:root {
  color-scheme: light;
  font-family: "Instrument Sans", "PingFang TC", "Noto Sans TC", "Helvetica Neue", Arial, system-ui, sans-serif;
  color: var(--ink);
  background: var(--warm);
  font-size: 16px;
  --warm: #f8f7f2;
  --ink: #191915;
  --muted: #5d5e57;
  --line: #deded5;
  --accent: #ca341e;
  --accent-hover: #a82916;
  --surface: #fff;
  --error: #a32919;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid #2b5f88; outline-offset: 3px; }
.site-header-inner, .workspace { width: min(calc(100% - 80px), 1080px); margin-inline: auto; }
.site-header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  color: inherit;
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -.09em;
  text-decoration: none;
}
.identity .text-button { padding-inline: 12px 0; }
.workspace { padding-block: 41px 60px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 22px; font-weight: 650; line-height: 1.35; margin-bottom: 20px; }
.auth-card {
  width: min(100%, 420px);
  margin-inline: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 16px;
  padding: clamp(22px, 5vw, 36px);
  box-shadow: 0 10px 35px #1b180b06;
}
.stack { display: grid; gap: 16px; }
label { display: grid; gap: 8px; font-weight: 600; font-size: .9375rem; }
input, textarea {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #8492a6;
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 400;
}
.primary, .secondary, .text-button {
  min-height: 46px;
  padding: 9px 17px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.3;
}
.primary { background: var(--accent); color: white; }
.primary:not(:disabled):hover { background: var(--accent-hover); }
.primary:disabled { background: #e3e7ed; color: #566174; }
.secondary { background: transparent; color: var(--ink); border-color: #d1d1c8; }
.secondary:not(:disabled):hover, .text-button:not(:disabled):hover { background: #eeede5; }
.secondary:disabled, .text-button:disabled { color: var(--muted); }
.text-button { background: transparent; color: var(--ink); }
.form-error { color: var(--error); margin: 0; font-size: .9375rem; }
.empty-state { padding-block: 22px; border-block: 1px solid var(--line); color: var(--muted); }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section-heading h1 { font-size: 17px; margin: 0; }
.section-heading button { flex: none; }
.section-heading button span { margin-inline-end: 3px; }
.workspace-error { margin-bottom: 16px; }
.order-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px 184px;
  align-items: center;
  gap: 8px 14px;
  min-height: 73px;
  padding-block: 11px;
  border-top: 1px solid var(--line);
}
.order-card:last-child { border-bottom: 1px solid var(--line); }
.order-card h2 { font-size: 1rem; font-weight: 650; line-height: 1.32; margin-bottom: 3px; overflow-wrap: anywhere; }
.order-card time, .file-note { font-size: .875rem; color: var(--muted); }
.file-note { margin: 0; overflow-wrap: anywhere; }
.order-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  color: #4f5149;
  background: #edece4;
  font-size: .8125rem;
  font-weight: 650;
  white-space: nowrap;
}
.order-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.order-card[data-status="pending"] .order-status { background: #f8e8c9; color: #654218; }
.order-card[data-status="processing"] .order-status { background: #e2eaf5; color: #31476b; }
.order-card[data-status="delivered"] .order-status { background: #daefad; color: #304617; }
.order-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.order-actions:empty { display: none; }
.order-card .report-open:not(:disabled) { background: #1c1c19; }
.order-card .report-open:not(:disabled):hover { background: #373831; }
.order-actions .text-button:not(:disabled):hover { background: #ffffffa6; }
.order-error { grid-column: 1 / -1; }

.order-card[data-status="delivered"]:first-child {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "status date" "title actions";
  gap: 9px 20px;
  padding: 23px 26px;
  border: 1px solid #d5e1e8;
  border-radius: 19px;
  background: #e8f3fa;
}
.order-card[data-status="delivered"]:first-child:not(:last-child) { margin-bottom: 23px; }
.order-card[data-status="delivered"]:first-child .order-summary { display: contents; }
.order-card[data-status="delivered"]:first-child h2 {
  grid-area: title;
  margin: 0;
  font: 400 clamp(26px, 4.6vw, 48px) / 1.06 "Instrument Serif", Georgia, serif;
  letter-spacing: -.045em;
}
.order-card[data-status="delivered"]:first-child .order-status { grid-area: status; }
.order-card[data-status="delivered"]:first-child time { grid-area: date; justify-self: end; align-self: end; }
.order-card[data-status="delivered"]:first-child .order-actions { grid-area: actions; }
.flow-panel {
  max-width: 640px;
  margin-inline: auto;
  padding: clamp(20px, 5.2vw, 32px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 10px 35px #1b180b06;
}
.back-link { margin: -10px 0 4px -12px; padding-inline: 12px; color: var(--muted); }
.prompt-fields {
  min-width: 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 15px 0 0;
  display: grid;
  gap: 14px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}
.submission-field { display: grid; gap: 6px; }
.field-label { position: relative; display: flex; align-items: center; gap: 2px; }
.field-help summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  list-style: none;
  color: var(--muted);
  cursor: pointer;
}
.field-help summary::-webkit-details-marker { display: none; }
.field-help summary span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid #a2a196;
  border-radius: 50%;
  font: 700 12px / 1 Arial, sans-serif;
}
.help-bubble {
  display: none;
  position: absolute;
  z-index: 1;
  top: 100%;
  inset-inline-start: 0;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 5px 20px #14140f12;
  color: var(--ink);
  font-size: .8125rem;
  line-height: 1.5;
}
.field-help[open] + .help-bubble,
.field-help:not([data-dismissed]):has(summary:focus-visible) + .help-bubble { display: block; }
@media (hover: hover) {
  .field-help:not([data-dismissed]):hover + .help-bubble,
  .field-help:not([data-dismissed]) + .help-bubble:hover { display: block; }
}
textarea { min-height: 96px; resize: vertical; }
input[type=file] { padding: 9px 12px; font-size: .875rem; }
input:disabled, textarea:disabled { background: var(--warm); color: var(--muted); }
input::file-selector-button {
  cursor: pointer;
  min-height: 44px;
  padding-inline: 9px;
  margin-right: 8px;
  background: #eee9db;
  color: var(--ink);
  border: 0;
  border-radius: 5px;
}
input:disabled::file-selector-button { cursor: default; color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.form-actions > p { margin: 0; }
.checkout-panel { max-width: 440px; }
.checkout-panel a { display: grid; place-items: center; text-decoration: none; }
.checkout-panel button { width: 100%; }
.payment-summary {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 9px;
  background: #f3efe4;
  border-inline-start: 2px solid #bd8a62;
}
.payment-note { margin: 0; color: var(--muted); font-size: .875rem; }
.payment-order { margin: 0; font-weight: 650; line-height: 1.5; overflow-wrap: anywhere; }

html { scrollbar-gutter: stable; }
body:has(.report-reader[open]) { overflow: hidden; }
.report-reader {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  overflow: hidden;
}
.report-reader[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
}
.report-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px clamp(17px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: var(--warm);
}
.report-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.report-toolbar button { flex: none; }
.report-reader iframe { width: 100%; height: 100%; border: 0; }

@supports (backdrop-filter: blur(18px)) or (-webkit-backdrop-filter: blur(18px)) {
  .report-toolbar {
    background: #f8f7f2d9;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .report-toolbar {
    background: var(--warm);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (max-width: 700px) {
  .site-header-inner, .workspace { width: calc(100% - 34px); }
  .site-header-inner { min-height: 52px; }
  .workspace { padding-top: 27px; }
  .order-card { grid-template-columns: minmax(0, 1fr) auto; }
  .order-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .order-card[data-status="delivered"]:first-child {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "status" "title" "date" "actions";
    padding: 19px;
    border-radius: 17px;
  }
  .order-card[data-status="delivered"]:first-child time { justify-self: start; margin-top: 7px; }
}
