:root {
  --blue: #245eea;
  --blue-dark: #174bc7;
  --ink: #152238;
  --muted: #69778e;
  --line: #dce3ee;
  --soft: #f4f7fb;
  --green: #0c956b;
  --green-soft: #e8f8f2;
  --red: #bd3c3c;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-family: Inter, "Segoe UI", Arial, sans-serif; color: var(--ink); background: linear-gradient(180deg, #eef4ff 0, #f8fafc 42%, #eef2f7 100%); }
button, input, textarea { font: inherit; }
.mobile-shell { width: min(100% - 28px, 560px); margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 0 max(30px, env(safe-area-inset-bottom)); }
.mobile-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.mobile-brand > div:last-child { display: flex; flex-direction: column; }
.mobile-brand strong { font-size: 17px; }
.mobile-brand small { color: var(--muted); margin-top: 2px; }
.mobile-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: var(--blue); font-weight: 900; box-shadow: 0 8px 22px rgba(36,94,234,.24); }
.mobile-card { background: #fff; border: 1px solid rgba(205,215,230,.85); border-radius: 20px; padding: 20px; box-shadow: 0 12px 34px rgba(40,61,92,.09); margin-bottom: 14px; }
.session-card { display: flex; justify-content: space-between; align-items: center; gap: 14px; color: #fff; background: linear-gradient(135deg, var(--blue), #527ff3); border: 0; }
.eyebrow { display: block; font-size: 10px; letter-spacing: .13em; opacity: .8; font-weight: 800; }
.session-card h1 { margin: 4px 0 0; font-size: 30px; letter-spacing: .12em; }
.countdown-wrap { text-align: right; }
.countdown-wrap span { display: block; font-size: 10px; opacity: .8; }
.countdown-wrap strong { display: block; margin-top: 4px; font-size: 19px; }
h2 { margin: 0 0 7px; font-size: 19px; }
p { line-height: 1.55; }
.muted { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.field-label { display: grid; gap: 7px; margin-bottom: 15px; color: #4d5b71; font-size: 12px; font-weight: 700; }
input[type="text"], textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; color: var(--ink); background: #fff; outline: none; }
input[type="text"]:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,94,234,.11); }
.file-picker { min-height: 155px; border: 2px dashed #b8c7e4; border-radius: 16px; background: #f8faff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 18px; cursor: pointer; }
.file-picker input { display: none; }
.file-picker strong { margin-top: 9px; font-size: 15px; }
.file-picker small { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.picker-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; color: var(--blue); background: #e9efff; font-size: 27px; }
.mobile-file-list { display: grid; gap: 7px; margin: 13px 0 16px; }
.mobile-file-list.empty { color: var(--muted); text-align: center; font-size: 12px; }
.mobile-file-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 11px; background: var(--soft); border-radius: 10px; min-width: 0; }
.mobile-file-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.mobile-file-item small { flex: 0 0 auto; color: var(--muted); }
.mobile-primary { width: 100%; border: 0; border-radius: 13px; padding: 14px 16px; color: #fff; background: var(--blue); font-weight: 800; }
.mobile-primary:active { background: var(--blue-dark); }
.mobile-primary:disabled { background: #aab6ca; }
.hidden { display: none !important; }

.portal-shell { max-width: 760px; }
.portal-brand { align-items: center; }
.portal-hero h1 { margin: 8px 0 8px; font-size: clamp(25px, 6vw, 38px); }
.portal-hero > p { margin: 0; color: #5b6475; line-height: 1.65; }
.portal-start-card .section-title-row { margin-bottom: 14px; }
.portal-file-picker { min-height: 122px; }
.portal-file-picker + .mobile-file-list { margin-bottom: 14px; }
.portal-start-card .mobile-progress { margin: 0 0 14px; }
.portal-limit-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.portal-limit-row span { background: #eef4ff; color: #274b93; border-radius: 999px; padding: 7px 11px; font-size: 12px; }
.portal-capacity-note { margin: 15px 0 0; color: #667085; font-size: 12px; line-height: 1.55; text-align: center; }
.portal-privacy { margin-bottom: 28px; }
.order-number-box { margin: 20px 0; padding: 18px; border: 2px dashed #8fb0ff; border-radius: 16px; background: #f4f7ff; text-align: center; }
.order-number-box span, .order-number-box strong { display: block; }
.order-number-box span { color: #667085; font-size: 12px; }
.order-number-box strong { margin-top: 6px; color: #1746b2; font-size: 24px; letter-spacing: .04em; }
.mobile-progress { margin-top: 16px; padding: 14px; background: var(--soft); border-radius: 13px; text-align: center; }
.mobile-progress strong, .mobile-progress small { display: block; }
.mobile-progress small { color: var(--muted); margin-top: 4px; }
.progress-track { width: 100%; height: 8px; overflow: hidden; border-radius: 99px; background: #dce4f2; margin-bottom: 10px; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .15s ease; }
.mobile-result { margin-top: 15px; padding: 15px; border-radius: 13px; background: var(--green-soft); color: #12654f; }
.mobile-result.error { background: #fff0f0; color: var(--red); }
.mobile-result strong { display: block; margin-bottom: 4px; }
.privacy-card { padding: 15px 17px; border-radius: 15px; color: #536177; background: rgba(255,255,255,.72); border: 1px solid rgba(216,224,236,.9); }
.privacy-card strong { color: var(--ink); font-size: 12px; }
.privacy-card p { margin: 4px 0 0; font-size: 11px; }
.error-card { text-align: center; padding: 36px 22px; }
.error-card h1 { font-size: 24px; }
.error-card p { color: var(--red); }
.error-card small { color: var(--muted); }
.large-icon { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto; border-radius: 50%; color: #fff; background: var(--red); font-size: 28px; font-weight: 900; }

/* V0.5 mobile print setup */
.section-title-row { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 17px; }
.section-title-row h2 { margin-bottom: 3px; }
.muted.compact { margin: 0; }
.mobile-step { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--blue); font-weight: 900; font-size: 13px; }
input[type="number"], select { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; color: var(--ink); background: #fff; outline: none; }
input[type="number"]:focus, select:focus, .group-pages:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,94,234,.11); }
.group-pages { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; color: var(--ink); background: #fff; outline: none; }
.setup-files { display: grid; gap: 14px; margin-bottom: 17px; }
.setup-file-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fbfcff; }
.setup-file-heading { display: flex; gap: 10px; align-items: center; padding: 13px; background: #f0f4fb; border-bottom: 1px solid var(--line); }
.file-type-badge { flex: 0 0 auto; min-width: 42px; height: 38px; display: grid; place-items: center; padding: 0 7px; border-radius: 10px; color: var(--blue); background: #e2eaff; font-size: 10px; font-weight: 900; }
.setup-file-copy { min-width: 0; flex: 1; display: grid; gap: 3px; }
.setup-file-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.setup-file-copy small { color: var(--muted); font-size: 10px; }
.icon-danger { border: 0; width: 30px; height: 30px; border-radius: 9px; color: var(--red); background: #fff0f0; font-size: 18px; }
.print-groups { display: grid; gap: 10px; padding: 12px; }
.print-group { padding: 12px; border: 1px solid #dce3ef; border-radius: 13px; background: #fff; }
.group-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 11px; }
.group-title strong { font-size: 12px; }
.remove-group { border: 0; color: var(--red); background: transparent; font-size: 11px; }
.group-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.group-grid label { display: grid; gap: 5px; min-width: 0; color: #536177; font-size: 10px; font-weight: 800; }
.group-grid label:first-child { grid-column: 1 / -1; }
.group-grid .group-note-field { grid-column: 1 / -1; }
.group-grid label small { color: var(--muted); font-size: 9px; font-weight: 500; }
.group-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; }
.preview-button { border: 1px solid #b9c8e6; border-radius: 10px; padding: 9px 11px; color: var(--blue); background: #f5f8ff; font-size: 11px; font-weight: 800; }
.smart-warning { color: #a26213; font-size: 9px; text-align: right; }
.add-group-button { width: calc(100% - 24px); margin: 0 12px 12px; border: 1px dashed #a9bde1; border-radius: 11px; padding: 10px; color: var(--blue); background: #f6f9ff; font-size: 11px; font-weight: 800; }
.micro-note { margin: 11px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; text-align: center; }
.processing-visual { display: grid; place-items: center; margin-bottom: 12px; }
.spinner { width: 34px; height: 34px; display: inline-block; border: 4px solid #dce5f6; border-top-color: var(--blue); border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#processingSection { text-align: center; }
.resume-preparing { display: flex; align-items: center; gap: 14px; }
.resume-preparing .spinner { flex: 0 0 auto; }
.resume-preparing h2 { margin-bottom: 4px; }
.center-note { display: block; margin-top: 10px; color: var(--muted); font-size: 10px; }
.indeterminate span { width: 35%; animation: progressMove 1.2s ease-in-out infinite; }
@keyframes progressMove { 0% { transform: translateX(-120%); } 100% { transform: translateX(340%); } }
.success-badge { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; color: #fff; background: var(--green); font-size: 27px; font-weight: 900; }
#downloadSection { text-align: center; }
.link-button { display: block; text-decoration: none; }
.mobile-secondary { width: 100%; margin-top: 9px; border: 1px solid var(--line); border-radius: 13px; padding: 12px 15px; color: var(--ink); background: #fff; font-weight: 800; }
.fulfillment-choice { display: grid; gap: 10px; margin: 18px 0 10px; text-align: left; }
.fulfillment-card { width: 100%; display: grid; gap: 5px; border: 2px solid #dce4f2; border-radius: 15px; padding: 15px; color: var(--ink); background: #fff; text-align: left; }
.fulfillment-card:disabled { opacity: .58; }
.fulfillment-card strong { font-size: 13px; }
.fulfillment-card small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.fulfillment-card.self-service { border-color: #8fb0ff; background: #f5f8ff; }
.fulfillment-card.assisted-print { border-color: #a9dccd; background: #f2fbf8; }
.output-summary { display: grid; gap: 7px; margin-top: 14px; text-align: left; }
.output-summary > div { display: grid; gap: 3px; padding: 10px; border-radius: 10px; background: var(--soft); }
.output-summary strong { overflow-wrap: anywhere; font-size: 10px; }
.output-summary small { color: var(--muted); font-size: 9px; }
.preview-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(10,20,38,.72); }
.preview-dialog { width: min(100%, 720px); max-height: 92vh; overflow: auto; border-radius: 18px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.28); }
.preview-heading { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.preview-heading > div { display: grid; gap: 2px; }
.preview-heading small { color: var(--muted); font-size: 9px; }
.preview-heading button { border: 0; width: 34px; height: 34px; border-radius: 10px; background: var(--soft); font-size: 21px; }
.preview-loading { padding: 55px 20px; text-align: center; }
.preview-loading p { color: var(--muted); font-size: 11px; }
.preview-image { display: block; width: 100%; height: auto; background: #d5dbe5; }
.preview-dialog .mobile-result { margin: 14px; }

@media (max-width: 390px) {
  .group-grid { grid-template-columns: 1fr; }
  .group-grid label:first-child { grid-column: auto; }
  .group-grid .group-note-field { grid-column: auto; }
  .session-card h1 { font-size: 25px; }
}

/* V0.9 bilingual customer identity and paper orientation */
input[type="tel"] { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; color: var(--ink); background: #fff; outline: none; }
input[type="tel"]:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,94,234,.11); }
.customer-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.customer-details-card .field-label { font-size: 12px; }
.mobile-brand small { line-height: 1.35; }
.session-card > div:first-child { min-width: 0; }
.session-card > div:first-child small { display: block; max-width: 245px; line-height: 1.35; opacity: .86; }
@media (max-width: 520px) { .customer-fields { grid-template-columns: 1fr; gap: 0; } }

.password-unlock-list{margin-top:18px;display:grid;gap:12px}.password-unlock-heading{padding:16px 18px;border-radius:18px;background:#fff7e6;border:1px solid #f5c86b}.password-unlock-heading strong{display:block;font-size:1.05rem;color:#8a4b00}.password-unlock-heading small{display:block;margin-top:5px;line-height:1.45;color:#765b33}.password-unlock-card{display:grid;gap:12px;padding:16px;border-radius:18px;background:#fff;border:1px solid #f0c36a;box-shadow:0 10px 28px rgba(82,56,17,.08)}.password-unlock-card>div strong,.password-unlock-card>div small{display:block}.password-unlock-card>div small{margin-top:4px;color:#705c3b}.password-unlock-card label{display:grid;gap:7px;font-weight:700}.password-unlock-card input{min-height:52px;border:1px solid #cfd7e6;border-radius:14px;padding:0 14px;font-size:1rem}.unlock-message{margin:0;font-size:.92rem}.unlock-message.error{color:#b42318}.password-unlock-list.hidden{display:none}
