:root {
  color-scheme: light;
  --ink: #102647;
  --muted: #4d617d;
  --blue: #0758a2;
  --navy: #113f75;
  --line: #d8e4f0;
  --surface: #fff;
  --wash: #f4f8fc;
  --tint: #ecf6ff;
  --shadow: 0 10px 34px #13365f0b;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body.qr-site { margin: 0; min-height: 100vh; color: var(--ink); background: var(--wash); }
.qr-site a { color: inherit; }
.qr-site button, .qr-site input, .qr-site select, .qr-site textarea { font: inherit; }
.qr-site button { cursor: pointer; }
.qr-site button:disabled { opacity: .55; cursor: not-allowed; }
.qr-site :focus-visible { outline: 3px solid #2993d7; outline-offset: 3px; }
.qr-site input[type="radio"] { width: 17px; height: 17px; accent-color: var(--blue); margin: 0; flex: none; }
.qr-site p { margin: 0; line-height: 1.55; }
.qr-site h1, .qr-site h2, .qr-site h3 { margin: 0; letter-spacing: -.035em; }
.shell { width: min(1140px, calc(100% - 48px)); margin-inline: auto; }
.qr-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 74px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.qr-brand { display: inline-flex; width: fit-content; align-items: center; gap: 9px; text-decoration: none; }
.qr-brand img { width: 40px; height: 40px; object-fit: contain; }
.qr-brand span { display: grid; gap: 1px; line-height: 1.2; }
.qr-brand strong { font-size: 1.31rem; letter-spacing: -.04em; }
.qr-brand small { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.qr-nav { display: flex; gap: 4px; align-items: center; }
.qr-nav a { padding: 9px 11px; font-size: .9rem; font-weight: 650; text-decoration: none; border-radius: 8px; white-space: nowrap; }
.qr-nav a:hover, .qr-nav a[aria-current="page"] { color: var(--blue); background: var(--tint); }
.qr-auth { min-width: 0; justify-self: end; display: flex; gap: 8px; align-items: center; }
.account-name { color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 160px; font-size: .84rem; font-weight: 650; }

.qr-button { min-height: 43px; padding: 9px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 9px; font-size: .9rem !important; font-weight: 700 !important; text-decoration: none; line-height: 1.3; text-align: center; white-space: nowrap; transition: background .16s, border-color .16s, box-shadow .16s, translate .16s; }
.qr-button:not(:disabled):active { translate: 0 1px; }
.qr-button.primary { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 4px 10px #0758a220; }
.qr-button.primary:hover { background: #064782; border-color: #064782; }
.qr-button.secondary { color: var(--navy); background: #fff; border-color: #cbdcec; }
.qr-button.secondary:hover { background: var(--tint); border-color: #9cbfdd; }
.qr-button.subtle { color: #164675; background: var(--tint); }
.qr-button.subtle:hover { background: #dcedfe; }
.link-button { width: fit-content; align-self: center; background: none; border: 0; color: var(--blue); font-weight: 690 !important; padding: 7px 3px; text-align: left; text-underline-offset: 3px; }
.link-button:hover { text-decoration: underline; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.main-shell { padding-block: 28px 54px; }
.qr-hero { min-height: 296px; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) minmax(255px, .59fr); align-items: center; gap: 20px; border: 1px solid #cde4f5; border-radius: 24px; overflow: hidden; background: radial-gradient(ellipse at 82% 43%, #b5edfa 0, transparent 45%), linear-gradient(125deg, #eef8ff 4%, #f8fcff 43%, #e1f2ff 100%); }
.hero-copy { padding: 34px 0 35px clamp(25px, 4.8vw, 56px); position: relative; z-index: 1; }
.hero-copy h1 { font-size: clamp(2.25rem, 5.75vw, 4.27rem); line-height: 1.01; font-weight: 810; letter-spacing: -.065em; }
.hero-copy p { max-width: 47ch; font-size: clamp(.97rem, 1.6vw, 1.08rem); color: var(--muted); margin: 16px 0 20px; }
.hero-link { font-size: .89rem; color: var(--blue) !important; font-weight: 730; text-underline-offset: 4px; display: inline-flex; gap: 7px; flex-wrap: wrap; }
.hero-link span { text-decoration: none; }
.hero-art { justify-self: center; width: 290px; height: 235px; position: relative; pointer-events: none; animation: art-appear .48s ease-out both; }
.hero-art::before { content: ''; position: absolute; inset: 8px -32px 7px; opacity: .44; background-image: linear-gradient(#79b9dc65 1px, transparent 1px), linear-gradient(90deg, #79b9dc65 1px, transparent 1px); background-size: 21px 21px; mask-image: radial-gradient(ellipse at center, #000 24%, transparent 72%); }
.art-back, .art-paper { border: 1px solid #bad6ed; border-radius: 14px; position: absolute; }
.art-back { top: 24px; left: 63px; width: 142px; height: 190px; background: #cce9fb; rotate: -13deg; }
.art-paper { top: 18px; left: 83px; width: 142px; height: 190px; background: linear-gradient(160deg, #fff, #f6fbff); rotate: 5deg; box-shadow: 0 13px 28px #1f5c852d; padding: 40px 20px; overflow: hidden; }
.art-fold { position: absolute; top: 0; right: 0; width: 29px; height: 29px; border-radius: 0 0 0 10px; background: #d7ecfa; }
.art-paper i { display: block; height: 5px; border-radius: 4px; background: #dcecf8; margin-bottom: 10px; }
.art-paper i:first-child { width: 61%; height: 8px; background: #5aafd9; margin-bottom: 14px; }
.art-paper i:nth-child(4) { width: 74%; }
.art-paper i:nth-child(5) { width: 48%; }
.art-qr { position: absolute; top: 104px; left: 150px; display: grid; place-items: center; width: 105px; height: 105px; border: 1px solid #aed3e8; border-radius: 14px; background: #fff; box-shadow: 0 10px 26px #0d42652b; rotate: -7deg; }
.art-qr img { width: 94%; height: 94%; }
.art-check { position: absolute; top: 89px; right: 17px; width: 31px; height: 31px; display: grid; place-items: center; color: #fff; border: 2px solid #fff; border-radius: 50%; background: #007c73; font-weight: 800; }
@keyframes art-appear { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
.panel { min-width: 0; margin-top: 22px; padding: clamp(17px, 3vw, 29px); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); scroll-margin-top: 18px; }
.panel h2 { font-size: clamp(1.42rem, 2.7vw, 1.79rem); line-height: 1.18; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.panel-heading p, .gate p { margin-top: 5px; color: var(--muted); font-size: .93rem; }
.gate-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.gate-symbol { display: grid; place-items: center; width: 52px; height: 52px; background: var(--tint); border: 1px solid #d7ebfa; border-radius: 14px; }
.gate-symbol img { object-fit: contain; }
.key-access { margin-top: 16px; color: var(--muted); }
.key-access summary { width: fit-content; color: var(--navy); cursor: pointer; font-size: .87rem; font-weight: 660; }
.key-form { margin-top: 12px; display: grid; width: min(100%, 560px); grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: end; }
.key-form p { grid-column: 1 / -1; }
.resume-legacy { border-top: 1px solid var(--line); padding-top: 13px; }
.workspace-status { margin-top: 16px !important; color: var(--muted); font-size: .9rem; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 14px; }
.details-grid .full { grid-column: 1 / -1; }
.field { display: block; min-width: 0; font-size: .86rem; font-weight: 710; line-height: 1.35; }
.field small { margin-left: 4px; color: var(--muted); font-weight: 520; }
.field :is(input:not([type="file"]), select, textarea), .page-picker select { display: block; width: 100%; margin-top: 6px; border: 1px solid #c8d9e9; background: #fdfefe; color: var(--ink); border-radius: 9px; padding: 10px 12px; min-height: 43px; font-size: 1rem; font-weight: 475; }
.field :is(input, textarea)::placeholder { color: #61738b; opacity: 1; }
.field textarea { resize: vertical; }
.mode-field, .placement-mode { margin: 23px 0 15px; min-width: 0; border: 0; padding: 0; }
.mode-field legend, .placement-mode legend { padding: 0; margin-bottom: 9px; font-weight: 760; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-option { cursor: pointer; display: flex; gap: 10px; align-items: flex-start; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.mode-option:hover { border-color: #a6cbe6; }
.mode-option:has(input:checked) { border-color: #79b5e3; background: #eff7ff; }
.mode-option input { margin-top: 2px !important; }
.mode-option strong, .mode-option small { display: block; }
.mode-option strong { line-height: 1.25; font-size: .96rem; }
.mode-option small { color: var(--muted); margin-top: 4px; line-height: 1.38; font-size: .83rem; }
.upload-field { display: grid; justify-items: start; gap: 6px; padding: 14px; border: 1px dashed #aac9e1; border-radius: 11px; background: #f7fbff; }
.upload-field span { color: var(--muted); font-size: .82rem; font-weight: 500; }
.upload-field input { width: 100%; color: var(--muted); font-size: .84rem; margin-top: 3px; overflow: hidden; }
.upload-field input::file-selector-button { cursor: pointer; border: 1px solid #c3d8ea; border-radius: 8px; background: #fff; color: var(--navy); font: inherit; font-weight: 700; padding: 8px 10px; margin-right: 8px; }
.form-footer { margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.form-footer p { font-size: .8rem; color: var(--muted); max-width: 57ch; }
.muted { color: var(--muted); font-size: .86rem; }
#previewStatus { margin-top: 9px; }
.inline-error { padding: 10px 12px; color: #a72d2d !important; background: #fdf0f0; border: 1px solid #f6d5d4; border-radius: 9px; font-size: .87rem !important; margin-top: 9px !important; }
.pdf-editor { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(215px, .72fr); gap: 13px; margin-top: 13px; align-items: start; }
.page-selection { grid-column: 1 / -1; min-width: 0; margin: 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 12px; }
.page-selection legend { padding-inline: 4px; font-weight: 740; font-size: .93rem; }
.page-scope-options { display: flex; flex-wrap: wrap; gap: 6px; }
.page-scope-options label { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: .85rem; cursor: pointer; }
.page-scope-options label:has(input:checked) { background: var(--tint); border-color: #9bc5e6; color: var(--navy); }
.page-selection p { margin-top: 8px; }
.page-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(43px, 1fr)); gap: 5px; max-height: 154px; overflow: auto; margin-top: 9px; padding: 3px; }
.page-choice { position: relative; display: grid; place-items: center; min-height: 41px; border: 1px solid var(--line); border-radius: 8px; background: #f7fbff; font-size: .84rem; font-weight: 660; }
.page-choice:has(input:checked) { color: #fff; border-color: var(--blue); background: var(--blue); }
.page-choice:has(input:focus-visible) { outline: 2px solid #2993d7; outline-offset: 1px; }
.page-choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.preview-panel, .placement-panel { min-width: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.preview-toolbar { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 7px; background: #fff; }
.icon-button { width: 36px; min-height: 36px; padding: 5px; font-size: 1.36rem !important; color: var(--blue); border-color: var(--line); background: #f7fbff; }
.icon-button:hover { background: var(--tint); }
.page-picker { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .83rem; }
.page-picker select { margin: 0; width: auto; min-height: 34px; padding: 4px 6px; font-size: .88rem; font-weight: 620; }
.preview-stage { display: grid; place-items: center; min-height: 130px; padding: clamp(11px, 2.2vw, 21px); background: #e8f0f8; background-image: radial-gradient(#c1d2e4 1px, transparent 1px); background-size: 14px 14px; }
.preview-stage[aria-busy="true"] .pdf-sheet { opacity: .56; }
.pdf-sheet { position: relative; width: min(100%, var(--preview-width, 420px)); background: #fff; box-shadow: 0 5px 15px #1232572c; }
.pdf-sheet canvas { width: 100%; height: 100%; display: block; }
.stamp-marker { position: absolute; display: grid; place-items: center; padding: 0; border: 0; outline: 1.5px solid #197aba; border-radius: 3px; box-shadow: 0 1px 8px #134e704d; background: white; touch-action: none; user-select: none; cursor: grab !important; }
.stamp-marker:active { cursor: grabbing !important; outline: 2px solid #2b90d2; }
.stamp-marker img { width: 100%; height: 100%; display: block; pointer-events: none; }
.placement-panel { padding: 14px; }
.placement-panel h3 { font-size: 1.14rem; }
.placement-panel p { color: var(--muted); font-size: .83rem; margin-top: 4px; }
.placement-mode { margin-block: 13px; display: grid; gap: 4px; }
.placement-mode legend { font-size: .86rem; margin-bottom: 5px; }
.placement-mode label { display: flex; gap: 7px; align-items: center; min-height: 31px; font-size: .84rem; cursor: pointer; }
.position-settings { display: flex; align-items: flex-start; gap: 11px; flex-wrap: wrap; }
.size-settings { min-width: 113px; flex: 1 1 113px; }
.size-override { display: flex; align-items: flex-start; gap: 6px; padding: 7px 0 2px; font-size: .8rem; color: var(--muted); cursor: pointer; }
.size-override input { width: 16px; height: 16px; margin: 2px 0 0; flex: none; accent-color: var(--blue); }
.custom-size { margin-top: 13px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #f7fbff; }
.custom-size-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 5px; font-size: .84rem; font-weight: 700; }
.size-value { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.size-value input { width: 3.5rem; min-height: 35px; padding: 4px 5px; border: 1px solid #c8d9e9; border-radius: 7px; color: var(--ink); background: #fff; }
.custom-size input[type="range"] { display: block; width: 100%; height: 28px; margin: 4px 0 0; accent-color: var(--blue); cursor: pointer; }
.size-bounds { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; }
.placement-panel .size-adjustment { margin-top: 7px; color: var(--navy); }
.field-label { display: block; margin-bottom: 6px; font-size: .85rem; }
.position-grid { display: grid; grid-template-columns: repeat(3, 34px); gap: 3px; }
.position-grid button { border: 1px solid #cbdcec; background: #f6faff; width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; }
.position-grid button::after { content: ''; width: 8px; height: 8px; background: #5685ae; border-radius: 2px; }
.position-grid button[aria-pressed="true"] { border-color: #559ad7; background: #e3f1ff; }
.position-grid button[aria-pressed="true"]::after { background: var(--blue); }
.page-note { display: grid; gap: 2px; margin-top: 11px; color: var(--muted); font-size: .79rem; }
.page-note .link-button { font-size: .8rem !important; min-height: 31px; }

.draft-grid { display: grid; grid-template-columns: minmax(0, .69fr) minmax(0, 1fr); align-items: stretch; gap: 15px; }
.qr-download { display: grid; min-width: 0; justify-items: center; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f6faff; text-align: center; }
.qr-download img { display: block; height: auto; border-radius: 8px; }
.qr-download code { color: var(--muted); overflow-wrap: anywhere; font-size: .77rem; }
.qr-download .button-row { justify-content: center; }
.finalize-form { display: grid; gap: 10px; align-content: start; justify-items: start; }
.finalize-form > p { font-size: .94rem; color: var(--muted); }
.finalize-form .upload-field { width: 100%; }
.success-panel { background: #f8fefa; border-color: #c7e5d8; }
.success-panel .panel-heading { justify-content: flex-start; align-items: center; }
.success-mark { width: 45px; height: 45px; flex: none; border-radius: 12px; background: #e1f4ea; color: #147853; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; }
#copyStatus { margin-top: 8px; }
.list-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, .35fr) auto; gap: 9px; align-items: end; }
#documentStatus { margin: 12px 0 4px; }
.doc-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.doc-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.doc-item:first-child { margin-top: 6px; }
.doc-meta { min-width: 0; display: grid; gap: 4px; overflow-wrap: anywhere; }
.doc-meta strong { font-size: .99rem; }
.doc-meta .muted { font-size: .79rem; }
.doc-meta p { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.status-pill { padding: 4px 7px; border-radius: 5px; background: #f4ebd7; color: #754e05; font-size: .72rem; font-weight: 750; line-height: 1; }
.status-pill[data-status="FINAL"] { background: #e1f4e9; color: #096a4b; }
.status-pill[data-status="REVOKED"] { background: #fbe6e5; color: #932f2b; }
.list-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 8px; font-size: .84rem; color: var(--muted); }
.qr-footer { color: var(--muted); background: #f1f6fb; border-top: 1px solid var(--line); font-size: .83rem; }
.qr-footer .shell { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-block: 20px; }
.qr-footer a { color: var(--blue); text-underline-offset: 3px; }

@media (max-width: 830px) {
  .header-inner { gap: 10px; grid-template-columns: auto 1fr auto; }
  .qr-nav { justify-self: center; }
  .account-name { max-width: 105px; }
  .pdf-editor { grid-template-columns: minmax(0, 1.4fr) minmax(190px, .7fr); }
}
@media (max-width: 690px) {
  .shell { width: calc(100% - 30px); }
  .header-inner { grid-template-columns: 1fr auto; grid-template-areas: "brand auth" "nav nav"; padding-top: 10px; gap: 4px 7px; min-height: 0; }
  .qr-brand { grid-area: brand; }
  .qr-nav { grid-area: nav; justify-self: stretch; flex-wrap: wrap; }
  .qr-auth { grid-area: auth; }
  .qr-nav a { padding-inline: 9px; }
  .main-shell { padding-top: 17px; }
  .qr-hero { grid-template-columns: minmax(0, 1fr) minmax(124px, .46fr); min-height: 214px; gap: 0; }
  .hero-copy { padding: 22px 0 24px 20px; }
  .hero-copy h1 { font-size: clamp(1.85rem, 6vw, 2.85rem); }
  .hero-copy p { margin-block: 10px 14px; font-size: .9rem; }
  .desktop-break { display: none; }
  .hero-art { width: 252px; height: 220px; scale: .66; margin: -36px; transform-origin: 53% center; }
  .gate-heading { grid-template-columns: auto minmax(0, 1fr); }
  .gate-heading .qr-button { grid-column: 1 / -1; justify-self: start; }
  .pdf-editor, .draft-grid { grid-template-columns: 1fr; }
  .placement-panel { overflow: visible; }
}
@media (max-width: 435px) {
  .shell { width: calc(100% - 22px); }
  .qr-brand img { width: 33px; height: 33px; }
  .qr-brand strong { font-size: 1.18rem; }
  .qr-auth .qr-button { padding-inline: 9px; min-height: 38px; font-size: .8rem !important; }
  .account-name { max-width: 92px; }
  .qr-hero { grid-template-columns: minmax(0, 1fr) 90px; }
  .hero-copy { padding-left: 15px; }
  .hero-art { scale: .4; translate: -25px 0; margin: -85px; transform-origin: 58% center; }
  .details-grid, .mode-grid { grid-template-columns: 1fr; }
  .gate-heading .qr-button { width: 100%; }
  .key-form, .form-footer { display: grid; grid-template-columns: 1fr; }
  .form-footer .qr-button { width: 100%; }
  .list-filters { grid-template-columns: minmax(0, 1fr) auto; }
  .list-filters .field:first-child { grid-column: 1 / -1; }
  .doc-item { grid-template-columns: 1fr; }
  .qr-download .qr-button { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-art, .qr-button { animation: none; transition: none; }
}
