@charset "UTF-8";
      :root {
        --ink: #1b1533;
        --plum: #241a52;
        --plum-deep: #150e33;
        --accent: #3f6098;
        --accent-soft: #a6bad9;
        --accent-ink: #2c4770;
        --gold-tint: rgba(63, 96, 152, 0.12);
        --gold-line: rgba(63, 96, 152, 0.28);
        --ivory: #f2f3f6;
        --paper: #fdfdff;
        --paper-2: #eaecf1;
        --line: rgba(27, 21, 51, 0.13);
        --muted: #6b6678;
        --muted-2: #8b8797;
        --serif: "Spectral", "Spectral Fallback", Georgia, serif;
        --sans: "IBM Plex Sans", "IBM Plex Sans Fallback", system-ui, sans-serif;
        --mono: "IBM Plex Mono", "IBM Plex Mono Fallback", ui-monospace, monospace;
      }
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
      }
      body {
        font-family: var(--sans);
        color: var(--ink);
        background: #e4e6ec;
      }
      /* toolbar */
      .toolbar {
        position: sticky;
        top: 0;
        z-index: 20;
        background: var(--plum-deep);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 14px 24px;
        flex-wrap: wrap;
      }
      .toolbar .tb-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        color: #fff;
        font-family: var(--serif);
        font-weight: 600;
        font-size: 16px;
      }
      .toolbar .tb-brand b {
        color: var(--accent-soft);
      }
      .tb-actions {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
      }
      .btn {
        display: inline-flex;
        align-items: center;
        gap: 9px;
        font-family: var(--sans);
        font-weight: 600;
        font-size: 14px;
        padding: 11px 20px;
        border-radius: 10px;
        border: 1px solid transparent;
        cursor: pointer;
        text-decoration: none;
      }
      .btn svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
      }
      .btn-gold {
        background: var(--accent);
        color: #fff;
        border-color: var(--accent);
      }
      .btn-gold:hover {
        background: var(--accent-soft);
        color: var(--plum-deep);
      }
      .btn-gold svg {
        stroke: currentColor;
      }
      .btn-ghost {
        background: rgba(255, 255, 255, 0.06);
        color: #fff;
        border-color: rgba(255, 255, 255, 0.25);
      }
      .btn-ghost:hover {
        background: rgba(255, 255, 255, 0.14);
      }
      .btn-ghost svg {
        stroke: var(--accent-soft);
      }

      .stage {
        padding: 34px 16px 60px;
        display: flex;
        justify-content: center;
      }
      .sheet-wrap {
        width: 100%;
        max-width: 1123px;
        text-align: left;
        overflow: hidden;
      }
      /* A4 landscape @96dpi = 1123 × 794 px */
      .sheet {
        position: relative;
        width: 1123px;
        height: 794px;
        background: var(--paper);
        transform-origin: 0 0;
        box-shadow: 0 40px 80px -40px rgba(21, 14, 51, 0.5);
        display: inline-block;
        text-align: left;
        overflow: hidden;
      }
      /* decorative frame */
      .frame {
        position: absolute;
        inset: 26px;
        border: 2px solid var(--accent);
        border-radius: 4px;
      }
      .frame::after {
        content: "";
        position: absolute;
        inset: 6px;
        border: 1px solid var(--gold-line);
        border-radius: 2px;
      }
      .corner {
        position: absolute;
        width: 26px;
        height: 26px;
        border: 2px solid var(--accent-ink);
      }
      .corner.tl {
        top: 18px;
        left: 18px;
        border-right: none;
        border-bottom: none;
      }
      .corner.tr {
        top: 18px;
        right: 18px;
        border-left: none;
        border-bottom: none;
      }
      .corner.bl {
        bottom: 18px;
        left: 18px;
        border-right: none;
        border-top: none;
      }
      .corner.br {
        bottom: 18px;
        right: 18px;
        border-left: none;
        border-top: none;
      }
      .inner {
        position: absolute;
        inset: 52px 64px 42px;
        display: flex;
        flex-direction: column;
      }

      /* header */
      .c-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
      }
      .c-brand {
        display: flex;
        align-items: center;
        gap: 12px;
      }
      .c-seal {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--plum);
        border: 1.5px solid var(--accent);
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: inset 0 0 0 3px rgba(63, 96, 152, 0.22);
      }
      .c-seal span {
        font-family: var(--serif);
        font-weight: 600;
        font-size: 19px;
        color: var(--accent-soft);
      }
      .c-brand .bn {
        font-family: var(--serif);
        font-weight: 600;
        font-size: 20px;
        color: var(--ink);
        line-height: 1.1;
      }
      .c-brand .bn b {
        color: var(--accent-ink);
      }
      .c-brand .bs {
        font-family: var(--mono);
        font-size: 9px;
        letter-spacing: 2px;
        text-transform: uppercase;
        color: var(--muted-2);
      }
      .c-head-right {
        text-align: right;
      }
      .c-head-right .l {
        font-family: var(--mono);
        font-size: 9.5px;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        color: var(--muted-2);
      }
      .c-head-right .num {
        font-family: var(--mono);
        font-size: 13px;
        font-weight: 500;
        color: var(--accent-ink);
        margin-top: 3px;
      }

      /* title */
      .c-title {
        text-align: center;
        margin-top: 20px;
      }
      .c-title .over {
        font-family: var(--mono);
        font-size: 11px;
        letter-spacing: 3px;
        text-transform: uppercase;
        color: var(--accent-ink);
      }
      .c-title h1 {
        font-family: var(--serif);
        font-weight: 600;
        font-size: 52px;
        letter-spacing: 0.06em;
        color: var(--ink);
        margin: 6px 0 4px;
      }
      .c-title .sub {
        font-family: var(--serif);
        font-style: italic;
        font-size: 17px;
        color: var(--muted);
      }
      .c-rule {
        width: 120px;
        height: 2px;
        background: var(--accent);
        margin: 14px auto 0;
        position: relative;
      }
      .c-rule::before,
      .c-rule::after {
        content: "";
        position: absolute;
        top: 50%;
        width: 5px;
        height: 5px;
        background: var(--accent);
        border-radius: 50%;
        transform: translateY(-50%) rotate(45deg);
      }
      .c-rule::before {
        left: -12px;
      }
      .c-rule::after {
        right: -12px;
      }

      /* recipient */
      .c-recip {
        text-align: center;
        margin-top: 18px;
      }
      .c-recip .intro {
        font-size: 14.5px;
        color: var(--muted);
      }
      .c-name {
        font-family: var(--serif);
        font-weight: 600;
        font-size: 40px;
        color: var(--plum);
        margin: 8px 0 4px;
        line-height: 1.05;
      }
      .c-birth {
        font-family: var(--mono);
        font-size: 11.5px;
        letter-spacing: 0.5px;
        color: var(--muted-2);
        margin-bottom: 6px;
      }
      .c-line2 {
        font-size: 14.5px;
        color: var(--muted);
        max-width: 620px;
        margin: 4px auto 0;
        line-height: 1.55;
      }

      /* result band */
      .c-result {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 34px;
        margin-top: 18px;
      }
      .c-score {
        width: 132px;
        height: 132px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--plum), var(--plum-deep));
        border: 2px solid var(--accent);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-shadow: inset 0 0 0 5px rgba(63, 96, 152, 0.16);
        flex-shrink: 0;
      }
      .c-score .n {
        font-family: var(--serif);
        font-size: 52px;
        font-weight: 600;
        color: #fff;
        line-height: 1;
      }
      .c-score .l {
        font-family: var(--mono);
        font-size: 10px;
        letter-spacing: 2px;
        text-transform: uppercase;
        color: var(--accent-soft);
        margin-top: 2px;
      }
      .c-result-info .cat {
        font-family: var(--serif);
        font-size: 24px;
        font-weight: 600;
        color: var(--ink);
      }
      .c-result-info .pct {
        font-size: 13.5px;
        color: var(--accent-ink);
        font-weight: 600;
        margin-top: 2px;
      }
      .c-result-info .scale-note {
        font-family: var(--mono);
        font-size: 10px;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        color: var(--muted-2);
        margin-top: 6px;
      }
      .c-scales {
        display: flex;
        gap: 8px;
        margin-top: 12px;
      }
      .c-scale {
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 7px 11px;
        min-width: 70px;
      }
      .c-scale .sn {
        font-family: var(--mono);
        font-size: 8.5px;
        letter-spacing: 0.3px;
        text-transform: uppercase;
        color: var(--muted-2);
        white-space: nowrap;
      }
      .c-scale .sv {
        font-family: var(--serif);
        font-size: 18px;
        font-weight: 600;
        color: var(--accent-ink);
        line-height: 1.1;
      }

      /* footer band */
      .c-foot {
        margin-top: auto;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: end;
        gap: 20px;
      }
      .c-sign {
        text-align: center;
      }
      .c-sign svg.sig {
        width: 172px;
        height: 48px;
        display: block;
        margin: 0 auto -6px;
      }
      .c-sign .sline {
        border-top: 1px solid var(--line-2, rgba(27, 21, 51, 0.3));
        padding-top: 6px;
        font-size: 12px;
        color: var(--ink);
        font-weight: 600;
      }
      .c-sign .srole {
        font-family: var(--mono);
        font-size: 9px;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        color: var(--muted-2);
        margin-top: 2px;
      }
      .c-stamp {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        margin-top: -10px;
      }
      .c-verify {
        position: absolute;
        right: 0;
        bottom: 2px;
        text-align: center;
      }
      .qr-box {
        width: 96px;
        height: 96px;
        padding: 6px;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 8px;
        margin: 0 auto 7px;
      }
      .qr-box img,
      .qr-box canvas {
        display: block;
        width: 84px !important;
        height: 84px !important;
      }
      .c-verify .vl {
        font-family: var(--mono);
        font-size: 9px;
        letter-spacing: 1px;
        text-transform: uppercase;
        color: var(--muted-2);
      }
      .c-verify .vnum {
        font-family: var(--mono);
        font-size: 11px;
        font-weight: 500;
        color: var(--accent-ink);
        margin-top: 2px;
      }
      .c-verify .vurl {
        font-family: var(--mono);
        font-size: 10px;
        color: var(--muted);
      }

      .c-auth {
        margin-top: 10px;
        text-align: center;
        font-size: 9.5px;
        line-height: 1.45;
        color: var(--muted-2);
        max-width: 620px;
        margin-left: auto;
        margin-right: auto;
      }
      .c-auth b {
        color: var(--accent-ink);
      }
      .orig-badge {
        position: absolute;
        top: 356px;
        left: 50px;
        transform: rotate(-90deg);
        transform-origin: left center;
        background: var(--paper);
        border: 1.5px solid var(--accent);
        color: var(--accent-ink);
        font-family: var(--mono);
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 2px;
        padding: 5px 10px;
        border-radius: 5px;
        opacity: 0.85;
      }

      /* error */
      .err {
        max-width: 520px;
        margin: 80px auto;
        background: var(--paper);
        border: 1px solid var(--line);
        border-radius: 16px;
        padding: 44px;
        text-align: center;
      }
      .err h2 {
        font-family: var(--serif);
        font-size: 26px;
        color: var(--ink);
        margin-bottom: 10px;
      }
      .err p {
        color: var(--muted);
        margin-bottom: 22px;
      }

      @media (max-width: 700px) {
        .toolbar {
          padding: 12px 16px;
        }
        .btn {
          padding: 10px 14px;
          font-size: 13px;
        }
      }

      @media print {
        body {
          background: #fff;
        }
        .toolbar {
          display: none !important;
        }
        .save-note {
          display: none !important;
        }
        .stage {
          padding: 0;
        }
        .sheet {
          box-shadow: none;
          transform: none !important;
          width: 297mm;
          height: 210mm;
        }
        @page {
          size: 297mm 210mm;
          margin: 0;
        }
      }