:root{--primary:#fff;--background-soft:#f6f9fc;--surface:#fff;--surface-blue:#eaf4ff;--action-blue:#0057a8;--action-blue-dark:#003f7d;--navy:#0f172a;--accent-green:#15803d;--border:#e5edf5;--muted:#64748b;--danger:#991b1b;--warning:#92400e;--success:#166534;--shadow-soft:0 18px 45px #0f172a14;--font-thai:Prompt, "Noto Sans Thai", Inter, ui-sans-serif, system-ui, sans-serif;font-family:var(--font-thai);color:var(--navy);background:var(--background-soft);font-synthesis:none;text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*{box-sizing:border-box}body{min-width:320px;min-height:100vh;margin:0}button,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.65}#root{min-height:100vh}.app-shell{background:radial-gradient(circle at 10% 0,#eaf4ffe6,#0000 28%),linear-gradient(#fff 0%,#f6f9fc 100%);min-height:100vh;padding:clamp(12px,2vw,28px)}.patient-app{border:1px solid var(--border);width:min(100%,1120px);min-height:calc(100vh - 56px);box-shadow:var(--shadow-soft);background:#fffffff0;border-radius:clamp(24px,4vw,34px);margin:0 auto;overflow:hidden}.patient-header{z-index:20;border-bottom:1px solid var(--border);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);background:#ffffffeb;grid-template-columns:1fr auto;align-items:center;gap:12px;padding:14px clamp(16px,3vw,28px);display:grid;position:sticky;top:0}.brand-lockup{align-items:center;gap:14px;min-width:0;display:flex}.brand-lockup>div{flex-direction:column;gap:6px;min-width:0;display:flex}.brand-logo{object-fit:contain;object-position:left center;flex:none;width:clamp(118px,18vw,154px);height:auto;max-height:52px;display:block}.patient-header h1,.section-header h2,.hero-panel h2,.ticket-card h2,.queue-number{letter-spacing:-.03em;margin:0}.patient-header h1{font-size:clamp(1rem,2vw,1.2rem);line-height:1.2}.eyebrow{color:var(--action-blue);letter-spacing:.06em;text-transform:uppercase;margin:0 0 4px;font-size:.74rem;font-weight:850}.step-pill,.status-dot,.ui-badge{white-space:nowrap;border-radius:999px;align-items:center;width:fit-content;padding:8px 11px;font-size:.78rem;font-weight:800;line-height:1;display:inline-flex}.step-pill{background:var(--background-soft);color:var(--muted)}.screen-stack{flex-direction:column;gap:clamp(14px,2vw,20px);padding:clamp(16px,3vw,28px);display:flex}.two-column-content,.profile-gate-layout,.registration-layout,.review-layout,.ticket-layout,.queue-layout{grid-template-columns:minmax(0,1fr);align-items:start;display:grid}.two-column-content{gap:clamp(16px,3vw,24px)}.ui-card,.hero-panel,.ticket-card,.queue-card{border:1px solid var(--border);background:var(--surface);color:var(--navy);border-radius:28px;padding:clamp(18px,3vw,26px)}.ui-card--interactive,.choice-card,.reason-chip{transition:border-color .16s,background-color .16s,transform .16s,box-shadow .16s}.ui-card--interactive:hover,.choice-card:hover,.reason-chip:hover{transform:translateY(-1px)}.ui-card--selected,.choice-card.is-selected,.reason-chip.is-selected,.time-slot-card[data-state=checked]{background:var(--surface-blue);border-color:#0057a86b;box-shadow:0 10px 24px #0057a814}.hero-panel{background:radial-gradient(circle at 88% 22%,#eaf4fff2,#0000 32%),#fff;flex-direction:column;justify-content:flex-end;min-height:320px;display:flex;position:relative;overflow:hidden}.hero-panel:after{content:"+";background:var(--surface-blue);width:96px;height:96px;color:var(--accent-green);border-radius:30px;place-items:center;font-size:4rem;font-weight:400;display:grid;position:absolute;top:24px;right:28px}.hero-panel h2{max-width:560px;margin-top:16px;font-size:clamp(2rem,6vw,4rem);line-height:1.02}.hero-panel p,.section-header p,.choice-card span,.choice-card small,.form-field small,.info-note-card p,.active-ticket-card p,.queue-status,.detail-list dd,.queue-card small{color:var(--muted);line-height:1.58}.hero-panel p{max-width:520px;margin:16px 0 0;font-size:1.02rem}.status-dot{color:var(--success);background:#dcfce7}.action-panel,.profile-session-card,.form-card,.side-stack{flex-direction:column;gap:16px;display:flex}.side-stack{position:static}.section-header{margin-bottom:16px}.section-header h2{font-size:clamp(1.45rem,4vw,2.2rem);line-height:1.14}.section-header p{margin:8px 0 0}.profile-session-card{background:linear-gradient(#fff 0%,#fbfdff 100%)}.line-profile-row{grid-template-columns:auto 1fr;align-items:center;gap:16px;display:grid}.line-profile-row img{object-fit:cover;border:1px solid var(--border);border-radius:20px;width:56px;height:56px}.line-profile-row h2{letter-spacing:-.03em;margin:10px 0 4px;font-size:clamp(1.45rem,4vw,2.2rem)}.line-profile-row p,.formal-note{color:var(--muted);margin:0;line-height:1.58}.formal-note{border:1px solid var(--border);background:var(--background-soft);border-radius:20px;padding:14px}.line-prefill-note{color:#0f172a;background:#eff6ff;border:1px solid #bfdbfe;border-radius:18px;grid-template-columns:auto 1fr;align-items:center;gap:14px;padding:14px;display:grid}.line-prefill-note img,.line-prefill-note__avatar{object-fit:cover;color:#fff;background:#2563eb;border-radius:999px;place-items:center;width:44px;height:44px;font-size:.75rem;font-weight:800;display:grid}.line-prefill-note strong,.line-prefill-note span{display:block}.line-prefill-note span{color:var(--text-muted);margin-top:3px;line-height:1.55}.line-prefill-note--warning{background:#fffbeb;border-color:#fde68a}.line-prefill-note--warning .line-prefill-note__avatar{background:#f59e0b}.line-scope-panel{border:1px solid var(--border);background:var(--background-soft);border-radius:18px;gap:10px;padding:14px;display:grid}.line-scope-panel div{gap:3px;display:grid}.line-scope-panel strong{color:var(--navy);font-size:.94rem}.line-scope-panel span{color:var(--muted);font-size:.92rem;line-height:1.52}.input-with-action{grid-template-columns:1fr auto;align-items:center;gap:10px;display:grid}.input-with-action .ui-button{white-space:nowrap;min-height:44px}@media (width<=520px){.input-with-action{grid-template-columns:1fr}}.check-list{gap:10px;margin:0;padding:0;list-style:none;display:grid}.check-list li{background:var(--background-soft);color:var(--navy);border-radius:18px;padding:12px 14px;font-weight:650}.ui-button{border:1px solid #0000;border-radius:999px;min-height:48px;padding:0 18px;font-weight:850;transition:background-color .16s,border-color .16s,transform .16s}.ui-button:hover:not(:disabled){transform:translateY(-1px)}.ui-button--full{width:100%}.ui-button--primary{background:var(--action-blue);color:#fff}.ui-button--primary:hover:not(:disabled){background:var(--action-blue-dark)}.ui-button--secondary{border-color:var(--border);background:var(--surface);color:var(--navy)}.ui-button--ghost{background:var(--surface-blue);color:var(--action-blue)}.ui-button--danger{color:var(--danger);background:#fee2e2}.choice-list,.time-slot-list,.reason-chip-list{gap:12px;display:grid}.reason-chip-list{margin-top:14px}.choice-card,.time-slot-card,.reason-chip{border:1px solid var(--border);background:var(--surface);width:100%;min-height:72px;color:var(--navy);text-align:left;border-radius:24px;padding:16px}.choice-card__body,.time-slot-card span,.reason-chip{gap:4px;display:grid}.choice-card strong,.time-slot-card strong,.reason-chip strong{color:var(--navy);font-size:1rem}.reason-chip span{color:var(--muted);font-size:.92rem;line-height:1.5}.step-progress{flex-direction:column;gap:8px;margin-top:4px;display:flex}.step-progress__bar{background:var(--border);border-radius:999px;height:4px;overflow:hidden}.step-progress__fill{background:var(--action-blue);border-radius:999px;height:100%;transition:width .4s cubic-bezier(.4,0,.2,1)}.step-progress__steps{align-items:center;gap:0;display:flex}.step-progress__step{flex:1;align-items:center;gap:6px;display:flex}.step-progress__step--pending{opacity:.4}.step-progress__dot{border-radius:999px;flex:none;width:8px;height:8px}.step-progress__step--done .step-progress__dot{background:var(--action-blue)}.step-progress__step--active .step-progress__dot{background:var(--action-blue);box-shadow:0 0 0 3px #0057a82e}.step-progress__step--pending .step-progress__dot{background:var(--border)}.step-progress__label{color:var(--muted);white-space:nowrap;text-overflow:ellipsis;font-size:.72rem;font-weight:800;overflow:hidden}.step-progress__step--done .step-progress__label,.step-progress__step--active .step-progress__label{color:var(--action-blue)}.profile-choice{grid-template-columns:auto 1fr;align-items:center;gap:12px;display:grid}.avatar{background:var(--surface-blue);width:48px;height:48px;color:var(--action-blue);border-radius:18px;place-items:center;font-weight:900;display:grid}.ui-badge--blue{background:var(--surface-blue);color:var(--action-blue)}.ui-badge--green{color:var(--success);background:#dcfce7}.ui-badge--amber{color:var(--warning);background:#fef3c7}.ui-badge--red{color:var(--danger);background:#fee2e2}.ui-badge--muted{background:var(--background-soft);color:var(--muted)}.form-layout,.profile-gate-layout,.registration-layout,.review-layout,.ticket-layout,.queue-layout{max-width:860px;margin:0 auto}.form-field{gap:8px;margin-top:14px;display:grid}.form-field>span{font-size:.9rem;font-weight:800}.text-input,.radix-select-trigger{border:1px solid var(--border);background:var(--surface);width:100%;min-height:50px;color:var(--navy);font:inherit;border-radius:18px;outline:none;padding:12px 14px}.text-input:focus,.radix-select-trigger:focus{border-color:#0057a87a;box-shadow:0 0 0 4px #0057a814}.text-input--textarea{resize:vertical;min-height:116px}.radix-select-trigger{justify-content:space-between;align-items:center;display:flex}.radix-select-content{z-index:60;border:1px solid var(--border);background:var(--surface);min-width:220px;box-shadow:var(--shadow-soft);border-radius:18px;overflow:hidden}.radix-select-item{outline:none;padding:12px 14px}.radix-select-item[data-highlighted]{background:var(--surface-blue);color:var(--action-blue)}.summary-strip{grid-template-columns:auto 1fr;align-items:center;gap:14px;display:grid}.summary-strip div{gap:3px;display:grid}.warning-note,.info-note-card{color:var(--warning);background:#fffbeb;border:1px solid #f8d98b;border-radius:22px;padding:14px;line-height:1.55}.info-note-card{color:var(--navy)}.sticky-action{z-index:15;background:linear-gradient(#fff0,#fffffff5 30%);padding-top:6px;position:sticky;bottom:0}.button-row{grid-template-columns:1fr;gap:10px;display:grid}.detail-list{gap:12px;margin:0;display:grid}.detail-list div{border-bottom:1px solid var(--border);grid-template-columns:minmax(100px,.4fr) 1fr;gap:12px;padding:12px 0;display:grid}.detail-list div:last-child{border-bottom:0}.detail-list dt{color:var(--muted);font-weight:750}.detail-list dd{color:var(--navy);margin:0;font-weight:700}.ticket-card{background:linear-gradient(#fff,#fff),radial-gradient(circle at 50% 0,#eaf4ffe6,#0000 50%);gap:18px;display:grid}.ticket-card__top{gap:12px;display:grid}.ticket-card h2{color:var(--action-blue);font-size:clamp(2rem,8vw,4rem)}.qr-box{background:linear-gradient(90deg, #0057a80f 1px, transparent 1px), linear-gradient(#0057a80f 1px, transparent 1px), var(--surface-blue);min-height:230px;color:var(--action-blue);text-align:center;background-size:18px 18px;border:1px dashed #0057a859;border-radius:28px;place-items:center;display:grid}.qr-box strong{letter-spacing:-.08em;font-size:3.5rem}.qr-box__image{background:#fff;border-radius:16px;padding:14px;line-height:0}.ticket-cancel-btn{width:100%;min-height:44px;color:var(--danger);cursor:pointer;background:#fff1f2;border:1px solid #fca5a5;border-radius:999px;font-size:.94rem;font-weight:700;transition:background-color .16s}.ticket-cancel-btn:hover{background:#fee2e2}.dev-login-panel{background:#f9fafb;border:1px dashed #d1d5db;border-radius:18px;flex-direction:column;align-items:center;gap:10px;padding:14px 16px;display:flex}.dev-login-panel__label{color:#6b7280;text-align:center;font-size:.78rem;font-weight:600}.queue-card{text-align:center;justify-items:center;gap:12px;transition:background-color .3s,border-color .3s;display:grid}.queue-card--waiting{background:#eff6ff;border-color:#bfdbfe}.queue-card--called{background:#fff7ed;border-color:#fed7aa;animation:2s ease-in-out infinite queue-called-glow}.queue-card--serving{background:#f0fdf4;border-color:#bbf7d0}.queue-card--done{border-color:var(--border);background:var(--background-soft)}@keyframes queue-called-glow{0%{box-shadow:0 0 #d9770600}50%{box-shadow:0 0 0 10px #d977062e}to{box-shadow:0 0 #d9770600}}.queue-number--called{color:var(--warning);animation:1.1s ease-in-out infinite alternate queue-number-pulse}@keyframes queue-number-pulse{0%{transform:scale(1)}to{transform:scale(1.06)}}.queue-called-notice{color:var(--warning);background:#fef3c7;border:1px solid #fde68a;border-radius:18px;width:100%;margin:0;padding:12px 18px;font-size:1.08rem;font-weight:800}.queue-called-notice strong{color:var(--navy)}.queue-wait-estimate{color:var(--muted);margin:0;font-size:.94rem}.queue-number{color:var(--action-blue);font-size:clamp(4rem,24vw,9rem);line-height:.92}.queue-grid{grid-template-columns:1fr;gap:12px;width:100%;margin-top:8px;display:grid}.queue-grid div{border:1px solid var(--border);border-radius:22px;gap:4px;padding:16px;display:grid}.queue-grid strong{color:var(--navy);font-size:1.25rem}.queue-grid span{color:var(--muted)}.loading-state{min-height:420px;color:var(--muted);align-content:center;place-items:center;gap:16px;padding:28px;display:grid}.loading-pulse{background:var(--surface-blue);border-radius:50%;width:54px;height:54px;animation:1.35s infinite pulse;box-shadow:0 0 #0057a84d}@keyframes pulse{70%{box-shadow:0 0 0 22px #0057a800}to{box-shadow:0 0 #0057a800}}.app-error-fallback{text-align:center;align-content:center;place-items:center;gap:20px;min-height:420px;padding:28px;display:grid}.app-error-fallback__message{color:var(--muted);max-width:340px;line-height:1.58}@media (width>=760px){.two-column-content{grid-template-columns:minmax(0,1.08fr) minmax(320px,.72fr)}.registration-layout{max-width:860px}.ticket-layout,.review-layout,.queue-layout{max-width:900px}.button-row{grid-template-columns:auto 1fr}.reason-chip-list{grid-template-columns:repeat(2,minmax(0,1fr))}.ticket-card__top,.queue-grid{grid-template-columns:1fr auto;align-items:start}}@media (width<=520px){.app-shell{padding:0}.patient-app{border:0;border-radius:0;min-height:100vh}.patient-header{grid-template-columns:auto 1fr auto;align-items:center;gap:10px}.brand-lockup>div{gap:4px}.step-progress__label{display:none}.brand-logo{width:118px;max-height:42px}.step-pill{grid-column:auto}}.detail-list div{grid-template-columns:1fr;gap:4px}
