:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18231f;
  background: #f4f1eb;
  --ink: #18231f;
  --muted: #68736d;
  --line: #d8ddd7;
  --green: #174f3f;
  --mint: #dcebe4;
  --cream: #faf8f3;
  --amber: #b66c1c;
}

* { box-sizing: border-box; }

body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% 0%, #e2ece5, transparent 35%), #f4f1eb; }

button, input, textarea { font: inherit; }

.topbar {
  min-height: 104px;
  padding: 24px clamp(24px, 6vw, 88px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ink);
  color: white;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(24px, 3vw, 36px); font-weight: 520; letter-spacing: -.03em; }
h2 { max-width: 760px; margin-bottom: 12px; font-size: clamp(28px, 4vw, 48px); line-height: 1.08; letter-spacing: -.04em; }
h3 { margin-bottom: 0; font-size: 21px; letter-spacing: -.02em; }

.eyebrow, .step { margin-bottom: 8px; font-size: 11px; font-weight: 750; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow { color: #9eb8ac; }
.step { color: var(--green); }
.muted, .hint { color: var(--muted); }
.hint { margin: 12px 0 0; font-size: 12px; line-height: 1.5; }

.health { padding: 8px 12px; border: 1px solid #547268; border-radius: 999px; font-size: 12px; }
.health.ready { background: #244f42; color: #cce7d9; }

main { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 72px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.hero-actions button { min-height: 44px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
/* 队列占满两栏（PO 2026-09-01，CLD2CC-CONS-260901004）：建预约面板收进抽屉后，把最大空间让给客户列表。 */
.queue-panel { grid-column: 1 / -1; }

/*
 * 建预约抽屉。默认收起（translateX(-100%) + inert），只在需要时从左滑出；一块屏内完成，不跳页（终端前提 ①）。
 * 关闭途径三条：遮罩、抽屉内「关闭」按钮、Esc——不只靠再点一次入口。
 */
.drawer-backdrop { position: fixed; inset: 0; z-index: 19; background: rgba(24, 35, 31, .38); }
.drawer { position: fixed; inset: 0 auto 0 0; z-index: 20; width: min(460px, 100%); overflow-y: auto; padding: 18px; background: #f4f1eb; box-shadow: 18px 0 48px rgba(32, 48, 41, .22); transform: translateX(-100%); transition: transform .24s ease; }
.drawer.open { transform: none; }
.drawer-panel { min-height: 0; }
.drawer-heading-actions { display: flex; align-items: center; gap: 8px; }
.drawer-heading-actions button { min-height: 40px; padding: 8px 14px; }
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }

.panel {
  min-height: 310px;
  padding: 26px;
  border: 1px solid rgba(44, 63, 55, .12);
  border-radius: 18px;
  background: rgba(250, 248, 243, .92);
  box-shadow: 0 14px 38px rgba(32, 48, 41, .07);
}

.queue-panel { background: #eef3ef; }
.session-panel { background: var(--green); color: white; }
.session-panel .step, .session-panel .hint { color: #b8d1c5; }
.adapter-panel { min-height: 250px; background: #e9e5dc; }
.adapter-panel li { margin: 8px 0; color: #525d57; }

.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.pill, .count { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 0 11px; border-radius: 999px; background: var(--mint); color: var(--green); font-size: 12px; font-weight: 700; }
.pill.neutral { background: rgba(255,255,255,.14); color: white; }
.pill.disabled { background: #d8d1c5; color: #766654; }
.count { min-width: 30px; padding: 0; background: var(--green); color: white; }

label { display: grid; gap: 7px; margin: 15px 0; color: var(--muted); font-size: 12px; font-weight: 650; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); padding: 12px 13px; outline: none; }
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: #4c826f; box-shadow: 0 0 0 3px rgba(58, 116, 94, .12); }
.session-panel label { color: #c7d9d1; }

button { border: 0; border-radius: 10px; padding: 12px 16px; background: var(--green); color: white; font-weight: 720; cursor: pointer; }
button:hover { filter: brightness(1.08); }
button:disabled { cursor: wait; opacity: .6; }
button.secondary { border: 1px solid var(--line); background: var(--cream); color: var(--ink); }
.session-panel button { background: white; color: var(--green); }

.queue.empty, .empty-state { display: grid; min-height: 160px; place-items: center; color: var(--muted); text-align: center; }
.session-panel .empty-state { color: #b8c9c1; }
/*
 * 队列项三区布局（CLD2CC-CONS-260901004，修 PO 实机发现的「来意 15 字即挤成五六行」）：
 *   左上 .queue-head   名字 + 到店/确认状态标签 + 材料标签 + 预约时间（flex-wrap，短元素）
 *   左下 .queue-intake 科别 · 来意——独占一行、正文字号、可自由换行，不再和标签抢同一行
 *   右   .queue-actions 六个按钮垂直居中；宽度不够（<1000px）时整块落到下一行，而不是把信息区挤成窄条
 * 根因是半屏时按钮区吃掉了信息区的宽度；队列占满两栏后信息区约 700px，40 字来意一行放得下。
 * 手指点（终端前提 ②）：按钮 min-height 36px；无 hover 才显示的元素。
 */
.queue-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 18px; align-items: center; padding: 12px 0; border-bottom: 1px solid #d4ded8; }
.queue-item:last-child { border-bottom: 0; }
.queue-copy { display: grid; gap: 5px; min-width: 0; }
.queue-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--muted); font-size: 12px; }
.queue-head .tag { margin-right: 0; }
.queue-name { font-size: 17px; font-weight: 720; color: var(--ink); margin-right: 4px; }
.queue-time { white-space: nowrap; }
.queue-intake { font-size: 13.5px; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; }
.queue-intake .queue-department { color: var(--muted); }
.queue-intake.empty { color: var(--muted); font-style: italic; }
.queue-item.scheduled { background: linear-gradient(90deg, rgba(182, 108, 28, .06), transparent 60%); }
.queue-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 520px; }
.queue-actions button, .chip { min-height: 36px; padding: 8px 12px; font-size: 12px; }
.queue-actions select { min-height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; background: white; color: var(--ink); font-size: 12px; }
@media (max-width: 1000px) {
  .queue-item { grid-template-columns: 1fr; }
  .queue-actions { justify-content: flex-start; max-width: none; }
}
.queue-editor { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 6px 12px; align-items: end; }
.queue-editor label { margin: 4px 0; }
.queue-editor input, .queue-editor select { padding: 8px 10px; font-size: 12px; }
.queue-editor select { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); }
.queue-editor .queue-actions { grid-column: 1 / -1; }
.tag { display: inline-block; margin-right: 6px; padding: 2px 7px; border-radius: 999px; background: var(--mint); color: var(--green); font-size: 11px; font-weight: 700; }
.tag.pending { background: #f3e6d3; color: var(--amber); }
.tag.warn { background: #f6dcd8; color: #7d3028; }
.tag.ready { background: var(--green); color: white; }
.tag.muted { background: #e8e6df; color: var(--muted); }
/* 支持文档标记：长得像 tag、能点；覆盖全局 button 的大内边距与实心绿。30px 高，手指点得中（终端前提 ②）。 */
.queue-head .tag-button { margin-right: 0; min-height: 30px; padding: 4px 11px; border: 0; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 700; line-height: 1.4; cursor: pointer; }
.queue-head .tag-button:hover { filter: brightness(.96); }
.queue-preparation { grid-column: 1 / -1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); font-size: 13px; }
.queue-preparation .prep-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.queue-preparation .prep-head button { padding: 6px 10px; font-size: 12px; }
.queue-preparation .prep-kind { margin-top: 8px; color: var(--muted); font-size: 12px; }
.queue-preparation pre { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; font: inherit; line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 14px; }
.chip { border: 1px solid var(--line); background: var(--cream); color: var(--ink); font-weight: 650; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mono { overflow: hidden; color: #b8cfc5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; text-overflow: ellipsis; }

#toast { position: fixed; right: 24px; bottom: 24px; max-width: 400px; padding: 13px 16px; border-radius: 10px; background: var(--ink); color: white; opacity: 0; transform: translateY(10px); transition: .2s ease; pointer-events: none; }
#toast.visible { opacity: 1; transform: translateY(0); }
#toast.error { background: #7d3028; }

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .hero { align-items: flex-start; flex-direction: column; }
  .topbar { padding-inline: 22px; }
  main { width: min(100% - 24px, 1240px); padding-top: 26px; }
  .drawer { width: 100%; }
}
