:root {
  color-scheme: light;
  --page: #f5f3ec;
  --paper: #fffefa;
  --ink: #23392f;
  --muted: #69776e;
  --green: #244e3e;
  --green-hover: #173e2f;
  --soft: #eef3ed;
  --line: #dce2d8;
  --warm: #856322;
  --warm-bg: #f9f0d9;
  --red: #a33938;
  --red-bg: #fff0ee;
  font-family: "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); font-size: 14px; line-height: 1.65; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, summary, label.file-button { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button, a, input, select, textarea, summary { outline-offset: 4px; }
:focus-visible { outline: 3px solid #85a88e; }
a { color: var(--green); text-underline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(25px, 3vw, 34px); line-height: 1.35; font-weight: 650; letter-spacing: -.7px; margin-bottom: 12px; }
h2 { font-size: 21px; line-height: 1.4; font-weight: 650; margin-bottom: 10px; }
h3 { font-size: 15px; margin-bottom: 8px; }
p { margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
[data-space="10"] { margin-top: 10px; }
[data-space="12"] { margin-top: 12px; }
[data-space="15"] { margin-top: 15px; }
[data-space="17"] { margin-top: 17px; }
[data-space="18"] { margin-top: 18px; }
[data-space="20"] { margin-top: 20px; }
[data-space="24"] { margin-top: 24px; }
[data-display="block"] { display: block; }
.loading-screen { min-height: 70vh; display: grid; align-content: center; justify-items: center; gap: 20px; padding: 24px; }
.brand-mark { display: grid; place-items: center; background: var(--green); color: var(--paper); height: 39px; width: 39px; border-radius: 12px 12px 12px 3px; font-family: "Microsoft JhengHei", sans-serif; font-size: 20px; font-weight: 500; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand strong { display: block; font-size: 18px; font-weight: 650; letter-spacing: 1px; line-height: 1.4; }
.brand small { color: var(--muted); font-size: 11px; }
.test-banner { background: #efe9d7; color: #6b592b; font-size: 12px; text-align: center; padding: 7px 16px; border-bottom: 1px solid #e0d7bd; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1140px; margin: auto; padding: 25px 30px; }
.site-header > .muted { font-size: 12px; }
.customer-layout { max-width: 1080px; margin: 30px auto 70px; padding: 0 30px; display: grid; grid-template-columns: minmax(230px, 1fr) minmax(400px, 530px); gap: 80px; align-items: start; }
.customer-intro { padding: 58px 0; position: sticky; top: 24px; }
.eyebrow { color: var(--green); font-size: 12px; letter-spacing: 2px; margin-bottom: 20px; }
.customer-intro h1 { font-size: 41px; line-height: 1.42; font-weight: 550; }
.customer-intro p { color: var(--muted); max-width: 300px; line-height: 1.9; }
.intro-rule { width: 46px; height: 2px; background: var(--green); margin: 32px 0 24px; }
.intro-note { font-size: 12px; }
.customer-card { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 12px 40px #23392f08; overflow: hidden; }
.card-body { padding: 30px; }
.steps { display: flex; justify-content: space-between; gap: 12px; padding: 21px 30px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.steps span { display: flex; align-items: center; gap: 7px; }
.steps b { display: grid; place-items: center; width: 21px; height: 21px; border: 1px solid var(--line); border-radius: 50%; font-size: 10px; }
.steps .current { color: var(--green); font-weight: 600; }
.steps .current b { background: var(--green); border-color: var(--green); color: white; }
.consent-intro { margin: 14px 0 24px; }
.notice { border: 1px solid var(--line); border-radius: 12px; margin: 24px 0; background: #fafbf6; }
summary { cursor: pointer; padding: 15px; font-size: 13px; }
.notice-body { border-top: 1px solid var(--line); padding: 15px; font-size: 12px; color: var(--muted); }
.notice-body p:last-child { margin-bottom: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 17px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 550; line-height: 1.4; }
.button:hover { background: #f3f5ee; }
.button.primary { background: var(--green); color: white; border-color: var(--green); }
.button.primary:hover { background: var(--green-hover); }
.button.soft { background: var(--soft); border-color: var(--soft); color: var(--green); }
.button.danger { color: var(--red); border-color: #e5c6c2; }
.button.compact { min-height: 36px; padding: 8px 12px; font-size: 12px; }
.button.wide { width: 100%; }
.text-button { border: 0; background: transparent; color: var(--green); padding: 8px 0; font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.icon-button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); color: var(--ink); background: var(--paper); display: inline-grid; place-items: center; font-size: 25px; flex-shrink: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions.right { justify-content: flex-end; }
.actions.spread { justify-content: space-between; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.field-grid.one { grid-template-columns: 1fr; }
.field { display: block; min-width: 0; }
.field > span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 6px; }
.field small { color: var(--muted); font-size: 10px; font-weight: 400; }
.field.wide { grid-column: 1 / -1; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { width: 100%; min-width: 0; background: var(--paper); border: 1px solid #ced8ce; border-radius: 8px; padding: 11px 12px; color: var(--ink); min-height: 44px; font-size: 14px; }
input::placeholder, textarea::placeholder { color: #96a098; opacity: 1; }
input[readonly], textarea[readonly] { background: #f4f6ef; }
textarea { resize: vertical; min-height: 90px; }
input[type=checkbox], input[type=radio] { accent-color: var(--green); width: 17px; height: 17px; flex-shrink: 0; }
.check { display: flex; align-items: start; gap: 9px; font-size: 13px; }
.check input { margin-top: 4px; }
.direction { border: 0; margin: 22px 0; padding: 0; }
.direction legend { font-size: 12px; margin-bottom: 8px; }
.direction-options { display: flex; gap: 8px; }
.direction-options label { flex: 1; display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); padding: 10px 14px; border-radius: 9px; cursor: pointer; }
.direction-options label:has(input:checked) { border-color: var(--green); background: var(--soft); }
.upload-list { display: grid; gap: 12px; margin: 22px 0; }
.upload-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fffefb; }
.upload-top { display: flex; gap: 13px; align-items: center; }
.upload-thumb { width: 55px; height: 55px; flex-shrink: 0; display: grid; place-items: center; border-radius: 8px; background: var(--soft); overflow: hidden; color: #7c9280; font-size: 24px; border: 0; padding: 0; }
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-info { flex: 1; min-width: 0; }
.upload-info h3 { font-size: 13px; margin-bottom: 3px; }
.upload-info p { font-size: 11px; color: var(--muted); margin: 0; }
.upload-actions { margin: 14px 0 0; display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap; }
.file-button { position: relative; display: flex; flex: 0 0 100%; width: 100%; min-width: 0; min-height: 64px; align-items: center; justify-content: center; padding: 16px 12px; border: 1px solid var(--green); border-radius: 9px; background: var(--green); color: #fff; cursor: pointer; font-size: 16px; font-weight: 700; line-height: 1.5; text-align: center; overflow-wrap: anywhere; }
.file-button > span { pointer-events: none; }
.file-button:hover { background: #193c2f; }
.file-input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; min-width: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer; font-size: 16px; }
.file-button:focus-within { outline: 3px solid #85a88e; outline-offset: 4px; }
.file-button:has(input:focus-visible) { outline: 3px solid #173d2c; outline-offset: 4px; }
.file-button:has(input:disabled) { opacity: .55; cursor: wait; }
.file-input:disabled { cursor: wait; }
.upload-picker-hint { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.upload-status { font-size: 11px; color: var(--green); margin: 9px 0 0; }
.details-prompt { margin: 26px 0 24px; padding: 22px 18px; border: 1px solid #d2dbc9; border-radius: 13px; background: #f2f5e9; scroll-margin-block: 22px; }
.details-recommended { display: inline-flex; padding: 4px 9px; border-radius: 6px; color: #a73919; background: #ffe3d3; font-size: 12px; font-weight: 700; }
.details-prompt h3 { margin: 12px 0 9px; font-size: 22px; line-height: 1.45; font-weight: 700; overflow-wrap: anywhere; }
.details-intro { margin: 0 0 19px; color: #526454; font-size: 14px; line-height: 1.8; }
.details-choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.details-choices .button { width: 100%; min-width: 0; min-height: 56px; padding: 14px 10px; font-size: 16px; font-weight: 700; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.details-choices .details-staff-button { border: 2px solid #71917b; color: var(--green); background: #fffefb; }
.details-choices .button[aria-pressed=true] { outline: 2px solid #365d44; outline-offset: 3px; }
.details-choices .button:focus-visible { outline: 3px solid #a34d28; outline-offset: 4px; }
.details-choice-status { margin: 17px 0 0; color: var(--green); font-size: 13px; line-height: 1.8; }
.details-fields { border-top: 1px solid #d2dbc9; margin-top: 18px; padding-top: 15px; }
.details-fields .field > span { font-size: 14px; }
.details-preference-badge { display: inline-flex; max-width: 100%; margin: 8px 0; padding: 6px 9px; border: 1px solid #cad9cc; border-radius: 6px; background: var(--soft); color: var(--green); font-size: 12px; font-weight: 600; line-height: 1.6; white-space: normal; }
.details-preference-badge.staff { border-color: #d89b7c; background: #ffeadb; color: #953c20; font-weight: 700; }
.feedback { font-size: 12px; line-height: 1.8; margin: 12px 0 0; color: var(--green); overflow-wrap: anywhere; }
.feedback:empty { display: none; }
.error { color: var(--red); }
.notice-strip { padding: 12px 15px; background: var(--soft); border-radius: 9px; font-size: 12px; margin-bottom: 18px; }
.notice-strip.warning { background: var(--warm-bg); color: var(--warm); }
.notice-strip.error { background: var(--red-bg); }
.receipt-code { border-radius: 12px; background: var(--soft); padding: 20px; margin: 25px 0; }
.receipt-code small { color: var(--muted); }
.receipt-code strong { display: block; font-size: 24px; letter-spacing: 1px; margin-top: 3px; overflow-wrap: anywhere; }
.success-symbol { display: grid; place-items: center; height: 58px; width: 58px; border-radius: 50%; background: var(--soft); color: var(--green); font-size: 28px; margin: 4px 0 22px; }
.receipt-copy { font-size: 13px; min-height: 94px; margin-bottom: 12px; }
.customer-footer { text-align: center; font-size: 11px; color: var(--muted); margin-top: 20px; }
.admin-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.admin-header-inner { max-width: 1420px; padding: 17px 32px; margin: auto; display: flex; align-items: center; gap: 35px; }
.admin-nav { display: flex; gap: 4px; flex: 1; }
.admin-nav a { font-size: 13px; text-decoration: none; color: var(--muted); padding: 9px 15px; border-radius: 8px; }
.admin-nav a.active { color: var(--green); background: var(--soft); font-weight: 600; }
.admin-user { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 11px; }
.admin-main { max-width: 1380px; padding: 32px; margin: auto; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 24px; }
.page-heading h1 { margin-bottom: 4px; font-size: 29px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 23px; margin-bottom: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-heading h2, .panel-heading h3 { margin: 0; }
.panel-heading h2 { font-size: 17px; }
.toolbar { display: flex; align-items: end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .field { flex: 1; min-width: 160px; }
.toolbar .field.search { flex: 2; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 12px; }
th { color: var(--muted); font-weight: 500; background: #f5f7f0; padding: 12px 14px; white-space: nowrap; }
td { border-bottom: 1px solid var(--line); padding: 15px 14px; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f9faf5; }
.case-link { font-size: 14px; font-weight: 600; text-decoration: none; }
.table-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 5px; background: var(--warm-bg); color: var(--warm); font-size: 10px; white-space: nowrap; }
.badge.success { background: #e4efe4; color: var(--green); }
.badge.danger { background: var(--red-bg); color: var(--red); }
.badge.neutral { background: var(--soft); color: var(--muted); }
.empty { padding: 54px 18px; text-align: center; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 18px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(290px, .8fr); gap: 22px; align-items: start; }
.detail-header { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.detail-header h1 { margin: 0; }
.back-link { display: inline-flex; margin-bottom: 13px; color: var(--muted); font-size: 12px; text-decoration: none; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.photo-item { min-width: 0; }
.photo-item button { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--soft); width: 100%; padding: 0; display: block; }
.photo-item img { width: 100%; aspect-ratio: 1.45; object-fit: contain; display: block; }
.photo-item p { font-size: 11px; margin: 7px 0 0; }
.photo-empty { aspect-ratio: 1.45; background: var(--soft); display: grid; place-items: center; border-radius: 8px; font-size: 11px; color: var(--muted); }
.check-list { display: grid; gap: 14px; margin-bottom: 19px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.meta-list { display: grid; gap: 8px; font-size: 12px; }
.meta-list > div { display: grid; grid-template-columns: 85px minmax(0, 1fr); gap: 12px; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; overflow-wrap: anywhere; }
.audit-list { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; }
.audit-list li { border-bottom: 1px solid var(--line); padding: 12px 0; font-size: 12px; overflow-wrap: anywhere; }
.audit-list li:first-child { padding-top: 0; }
.audit-list li:last-child { border-bottom: 0; }
.audit-list small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.link-panel { background: var(--soft); padding: 16px; border-radius: 10px; margin-top: 18px; }
.link-panel input { margin-bottom: 10px; font-size: 12px !important; }
.auth-wrap { max-width: 430px; margin: 55px auto 70px; padding: 0 20px; }
.auth-wrap .brand { justify-content: center; margin-bottom: 32px; }
.auth-wrap .panel { padding: 29px; }
.auth-wrap h1 { font-size: 25px; }
.form-stack { display: grid; gap: 18px; }
.settings-layout { max-width: 880px; margin: auto; }
.settings-layout .field-grid { margin-bottom: 20px; }
.ip-addresses { font-family: Consolas, "Microsoft JhengHei", monospace; line-height: 1.8; }
.security-local { padding: 11px 13px; background: var(--soft); border-radius: 8px; margin: 0; }
.security-local code { white-space: nowrap; }
.security-meta { display: grid; gap: 8px; font-size: 12px; margin: 0 0 12px; }
.security-meta > div { display: grid; grid-template-columns: 85px minmax(0, 1fr); gap: 12px; }
.security-meta dt { color: var(--muted); }
.security-meta dd { margin: 0; overflow-wrap: anywhere; }
.security-notifications td:first-child { white-space: nowrap; }
.risk-matches { border-left: 3px solid #b39755; padding: 12px 16px; background: #faf5e7; border-radius: 0 8px 8px 0; margin: 12px 0; }
.risk-matches p { font-size: 12px; margin: 4px 0; }
.image-dialog { width: min(900px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); padding: 23px; }
.image-dialog::backdrop { background: #13221cc9; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.dialog-heading h2 { font-size: 19px; margin: 0; }
.image-dialog > img { display: block; width: 100%; max-height: 65dvh; object-fit: contain; background: #edf0e7; border: 1px solid var(--line); border-radius: 8px; margin: 15px 0; }
.image-dialog > p { font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translateX(-50%); max-width: calc(100vw - 30px); padding: 12px 20px; border-radius: 10px; background: var(--green); color: white; box-shadow: 0 6px 24px #0002; font-size: 13px; z-index: 10; }
.noscript { padding: 30px; text-align: center; }
.busy { opacity: .6; pointer-events: none; }
@media (max-width: 1000px) {
  .customer-layout { gap: 35px; grid-template-columns: minmax(200px, 1fr) minmax(380px, 1.4fr); }
  .customer-intro h1 { font-size: 34px; }
  .detail-layout { grid-template-columns: 1fr; }
  .admin-header-inner { gap: 20px; }
  .admin-nav a { padding: 8px 10px; }
}
@media (max-width: 720px) {
  .site-header { padding: 20px; }
  .site-header > .muted { display: none; }
  .customer-layout { display: block; max-width: 540px; margin: 10px auto 35px; padding: 0 16px; }
  .customer-intro { display: none; }
  .customer-card { border-radius: 18px; }
  .card-body { padding: 24px 20px; }
  .steps { padding: 18px 20px; font-size: 10px; gap: 5px; }
  .steps span { gap: 5px; }
  .steps b { width: 19px; height: 19px; }
  input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { font-size: 16px; }
  .admin-header-inner { padding: 15px 18px 10px; flex-wrap: wrap; gap: 14px; }
  .admin-header-inner .brand { flex: 1; }
  .admin-nav { flex-basis: 100%; order: 3; overflow-x: auto; }
  .admin-nav a { white-space: nowrap; }
  .admin-user > span { display: none; }
  .admin-main { padding: 24px 16px; }
  .page-heading { align-items: start; }
  .page-heading h1 { font-size: 25px; }
  .panel { padding: 18px; border-radius: 11px; }
  .field-grid { grid-template-columns: 1fr; gap: 15px; }
  .photo-grid { gap: 7px; }
  .photo-item p { font-size: 10px; }
  .panel-heading { align-items: start; }
  .image-dialog { padding: 17px; }
  .image-dialog .actions { flex-direction: column; }
  .image-dialog .actions .button { width: 100%; min-height: 48px; }
  .toolbar .field { min-width: 130px; }
  .auth-wrap { margin-top: 35px; }
}
