/* 챙길 일: drawn with design-system tokens (design-system.css), so it follows light/dark. */
.wa-workspace { container: wa-page / inline-size; max-width: 1320px; margin: 0; overflow-wrap: anywhere; word-break: keep-all; color: var(--ds-ink); }
/* Wide monitors: the type steps up a notch (design-system.css), so the reading width grows with it but stays a reading width. */
@media (min-width: 1680px) { .wa-workspace { max-width: 1440px; } }

/* Header: the menu name, the date the lists count from, the 알림 toggle and 더보기. */
.wa-header { align-items: center; margin-bottom: var(--ds-space-5); }
.wa-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ds-space-1) var(--ds-space-3); min-width: 0; }
.wa-asof { color: var(--ds-ink-2); font-size: var(--ds-font-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The bell is a switch: the knob slides and the icon crossfades the moment it is pressed (ease-out), the save follows behind. */
.wa-switch { --wa-ease-out: cubic-bezier(0.2, 0.8, 0.2, 1); --wa-switch-ms: 220ms; display: inline-flex; align-items: center; gap: var(--ds-space-2);
  min-height: var(--ds-touch); padding: 0 var(--ds-space-2) 0 var(--ds-space-1); border: 0; border-radius: var(--ds-radius-md); color: var(--ds-ink);
  background: transparent; font: inherit; font-size: var(--ds-font-sm); font-weight: var(--ds-weight-medium); cursor: pointer; transition: background-color var(--wa-switch-ms) var(--wa-ease-out); }
.wa-switch:hover { background: color-mix(in srgb, var(--ds-sunken) 70%, transparent); }
.wa-switch:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }
.wa-switch__icon { position: relative; display: inline-grid; width: var(--ds-icon-sm); height: var(--ds-icon-sm); }
.wa-switch__icon .ds-icon { grid-area: 1 / 1; width: var(--ds-icon-sm); height: var(--ds-icon-sm); transition: opacity var(--wa-switch-ms) var(--wa-ease-out), transform var(--wa-switch-ms) var(--wa-ease-out); }
.wa-switch__bell { color: var(--ds-accent); }
.wa-switch__bell-off { color: var(--ds-ink-3); opacity: 0; transform: scale(.7); }
.wa-switch[aria-checked="false"] .wa-switch__bell { opacity: 0; transform: scale(.7) rotate(-12deg); }
.wa-switch[aria-checked="false"] .wa-switch__bell-off { opacity: 1; transform: none; }
.wa-switch[aria-checked="false"] .wa-switch__label { color: var(--ds-ink-2); }
.wa-switch__track { position: relative; flex: none; width: 36px; height: 20px; border-radius: 999px; background: var(--ds-accent); transition: background-color var(--wa-switch-ms) var(--wa-ease-out); }
.wa-switch__knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ds-surface);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ds-ink) 25%, transparent); transform: translateX(16px); transition: transform var(--wa-switch-ms) var(--wa-ease-out); }
.wa-switch[aria-checked="false"] .wa-switch__track { background: var(--ds-line-strong, var(--ds-ink-3)); }
.wa-switch[aria-checked="false"] .wa-switch__knob { transform: translateX(0); }
.wa-switch:active .wa-switch__knob { width: 19px; }
.wa-switch[aria-checked="true"]:active .wa-switch__knob { transform: translateX(13px); }
.wa-menu-count { margin-left: auto; padding-left: var(--ds-space-3); color: var(--ds-ink-2); font-variant-numeric: tabular-nums; }
.wa-more .ds-icon { width: var(--ds-icon-sm); height: var(--ds-icon-sm); }
.wa-blocked { max-width: 260px; line-height: var(--ds-leading); }
.wa-help { align-items: flex-start; }
.wa-help p { flex: 1 1 auto; margin: 0; line-height: var(--ds-leading-loose); }

/* The four kinds: light tabs on one underline, each carrying its count as the screen's big figure (summary first, then the list).
   No card around them: the numbers are the emphasis, the frame added none. */
.wa-kinds { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0 var(--ds-space-8); margin-bottom: var(--ds-space-6); border-bottom: 1px solid var(--ds-line); }
.wa-kind { position: relative; display: grid; align-content: start; gap: 0; min-width: 0; min-height: var(--ds-touch); padding: 0 0 var(--ds-space-4); border: 0; color: var(--ds-ink); background: transparent; font: inherit; text-align: left; cursor: pointer; }
.wa-kind::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; transition: background-color var(--ds-duration) var(--ds-ease); }
.wa-kind:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; border-radius: var(--ds-radius-sm); }
.wa-kind[aria-selected="true"]::after { background: var(--ds-accent); }
.wa-kind__name { color: var(--ds-ink-2); font-size: var(--ds-font-md); font-weight: var(--ds-weight-medium); transition: color var(--ds-duration-fast) var(--ds-ease); }
.wa-kind[aria-selected="true"] .wa-kind__name { color: var(--ds-ink); font-weight: var(--ds-weight-bold); }
.wa-kind__count { margin-top: var(--ds-space-1); color: var(--ds-ink-2); font-size: var(--ds-font-md); font-variant-numeric: tabular-nums; }
.wa-kind__count b { margin-right: 3px; color: var(--ds-ink); font-size: var(--ds-font-3xl); font-weight: var(--ds-weight-bold); line-height: 1.1; letter-spacing: var(--ds-tracking-title); }
.wa-kind:not([aria-selected="true"]) .wa-kind__count b { font-weight: var(--ds-weight-strong); }
.wa-kind__note { margin-top: 2px; color: var(--ds-ink-2); font-size: var(--ds-font-sm); font-variant-numeric: tabular-nums; }
.wa-kind__note .wa-hot { color: var(--ds-danger); font-weight: var(--ds-weight-bold); }
/* 샘플·후불결제 hold nothing yet: their dash stays small so the empty kinds do not weigh like the real counts. */
.wa-kind--quiet .wa-kind__count b { color: var(--ds-ink-3); font-size: var(--ds-font-xl); font-weight: var(--ds-weight-regular); line-height: calc(var(--ds-font-3xl) * 1.1); }

/* One list per chosen kind, at every width. */
.wa-col { container: wa-list / inline-size; --wa-actions-width: 136px; min-width: 0; }
.wa-col--chat { --wa-actions-width: max-content; }
.wa-col__title { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Groups: the date heading stands on the page, outside any box, and only the rows sit on a surface (no shadow).
   Urgency is carried by the countdown's colour and weight next to the date, not by a tinted bar, a left stripe and a card at once. */
.wa-group, .wa-group.ds-group { margin: 0 0 var(--ds-space-6); border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
.wa-group:has(> .wa-group__heading [aria-expanded="false"]) { margin-bottom: var(--ds-space-2); }
.wa-group__heading { margin: 0; font: inherit; }
.wa-group__toggle { align-items: center; width: 100%; border: 0; color: var(--ds-ink); background: transparent; font: inherit; text-align: left; cursor: pointer; transition: color var(--ds-duration-fast) var(--ds-ease); }
.wa-group__toggle:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; border-radius: var(--ds-radius-sm); }
.wa-fold { flex: none; width: var(--ds-icon-sm); height: var(--ds-icon-sm); color: var(--ds-ink-2); transition: transform var(--ds-duration) var(--ds-ease); }
[aria-expanded="false"] > .wa-fold { transform: rotate(-90deg); }
.wa-group .wa-group__toggle { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ds-space-1) var(--ds-space-3); min-height: var(--ds-touch); margin: 0; padding: var(--ds-space-1) 0 var(--ds-space-2); border: 0; box-shadow: none; }
.wa-group__toggle .wa-day, .wa-group .ds-group__count { flex: none; }
.wa-group__toggle .wa-day { font-size: var(--ds-font-lg); font-weight: var(--ds-weight-bold); font-variant-numeric: tabular-nums; }
.wa-group__toggle .wa-stage { flex: 0 1 auto; min-width: 0; color: var(--ds-ink-2); font-size: var(--ds-font-md); font-weight: var(--ds-weight-medium); }
.wa-group__toggle .wa-fold { align-self: center; order: -1; margin-right: calc(var(--ds-space-1) * -1); }
.wa-group .ds-group__count { margin-left: 0; color: var(--ds-ink-2); font-size: var(--ds-font-sm); }
.wa-group.overdue .wa-stage { color: var(--ds-danger); font-weight: var(--ds-weight-bold); }
.wa-group.due_today .wa-stage { color: var(--ds-warn); font-weight: var(--ds-weight-bold); }
.wa-group.due_3 .wa-stage { color: var(--ds-warn); }
.wa-group .wa-list:not([hidden]) { border: 1px solid var(--ds-line); border-radius: var(--ds-radius-lg); background: var(--ds-surface); overflow: hidden; }
.wa-empty { margin: 0 0 var(--ds-space-4); }

/* Wide page: an agenda. The date and its countdown stand in a left rail beside their rows, so the width a wide monitor adds
   goes to the reading order (date → orders) instead of empty space at the right, and the headings stop stacking between boxes. */
@container wa-page (min-width: 1100px) {
  .wa-group.due, .wa-group.review, .wa-group.skipped { display: grid; grid-template-columns: 160px minmax(0, 1fr); column-gap: var(--ds-space-6); align-items: start; }
  .wa-group:is(.due, .review, .skipped) .wa-group__toggle { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 2px; padding: var(--ds-space-3) var(--ds-space-6) 0 0; }
  .wa-group__heading { position: relative; }
  .wa-group:is(.due, .review, .skipped) .wa-group__toggle .wa-fold { position: absolute; right: 0; top: calc(var(--ds-space-3) + 6px); margin: 0; }
  .wa-group.due .wa-group__toggle .wa-day { font-size: var(--ds-font-xl); line-height: var(--ds-leading-tight); }
  .wa-group:has(> .wa-group__heading [aria-expanded="false"]) { margin-bottom: var(--ds-space-4); }
}

/* Rows. Narrow (default): the name line, then the state with the actions beside it (full-size targets on touch). The whole row opens the item.
   Sizes by role: the organisation is the row's protagonist (--ds-font-name, bold); the order code and the state are secondary. */
.wa-list { margin: 0; padding: 0; list-style: none; }
.wa-list[hidden] { display: none; }
.wa-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; grid-template-areas: "main main chev" "aside actions actions"; align-items: center; gap: var(--ds-space-1) var(--ds-space-3); min-height: 60px; padding: var(--ds-space-3) var(--ds-space-4); }
.wa-row--chat { grid-template-columns: minmax(0, 1fr) auto 16px; grid-template-areas: "main actions chev" "aside actions chev"; }
.wa-main { grid-area: main; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--ds-space-3); min-width: 0; }
.wa-open { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--ds-space-3); min-width: 0; max-width: 100%; padding: 0; border: 0; color: var(--ds-ink); background: none; font: inherit; font-size: var(--ds-font-name); text-align: left; cursor: pointer; }
.wa-open::after { content: ""; position: absolute; inset: 0; }
.wa-open:focus-visible { outline: none; }
.wa-open:focus-visible::after { outline: 2px solid var(--ds-focus); outline-offset: -2px; }
.wa-code { flex: none; min-width: 3.4em; color: var(--ds-ink-2); font-size: var(--ds-font-sm); font-weight: var(--ds-weight-medium); font-variant-numeric: tabular-nums; }
.wa-organization { min-width: 0; font-size: var(--ds-font-name); font-weight: var(--ds-weight-bold); letter-spacing: -.015em; }
.wa-named { margin-left: 6px; color: var(--ds-ink-2); font-size: var(--ds-font-sm); font-weight: var(--ds-weight-medium); }
.wa-order { color: var(--ds-ink-2); font-size: var(--ds-font-md); }
/* 로젠 등록에서 빠진 수령인: which roster rows and why, after the order; it may be cut on a wide line (the full list is its title). */
.wa-skipped-rows { min-width: 0; color: var(--ds-warn); font-size: var(--ds-font-sm); font-weight: var(--ds-weight-medium); }
.wa-row--chat .wa-open { flex-direction: column; align-items: flex-start; gap: 2px; }
.wa-row--chat .wa-order { font-size: var(--ds-font-sm); }
/* A narrow order name flows like text, so a long name wraps right after its code. */
.wa-row--due .wa-open { display: block; }
.wa-row--due .wa-code { display: inline-block; margin-right: var(--ds-space-3); }
.wa-aside { grid-area: aside; display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-1) var(--ds-space-3); min-width: 0; color: var(--ds-ink-2); font-size: var(--ds-font-sm); font-variant-numeric: tabular-nums; }
.wa-moved, .wa-date { white-space: nowrap; }
.wa-actions { grid-area: actions; position: relative; z-index: 1; display: flex; justify-content: flex-end; align-items: center; gap: var(--ds-space-1); }
.wa-actions:empty { display: none; }
/* The row's actions repeat on every line, so they are quiet: 배송 등록 reads as an accent text button (still a 32px/44px target),
   ⋯ holds only 그만 알림, and the whole line already opens the order, so the › mark is dropped on a pointer screen. */
.wa-actions .ds-button { border-color: transparent; color: var(--ds-accent-strong); background: transparent; font-size: var(--ds-font-sm); }
.wa-actions .ds-button:hover { color: var(--ds-accent-strong); background: var(--ds-accent-soft); }
.wa-actions .ds-icon-button { color: var(--ds-ink-3); }
.wa-actions .ds-icon-button:hover, .wa-actions .ds-icon-button[aria-expanded="true"] { color: var(--ds-ink); }
.wa-chev { grid-area: chev; width: var(--ds-icon-sm); height: var(--ds-icon-sm); color: var(--ds-ink-3); transition: transform var(--ds-duration-fast) var(--ds-ease), color var(--ds-duration-fast) var(--ds-ease); }
.wa-list > .wa-row + .wa-row { border-top: 1px solid var(--ds-line); }
.wa-list > .wa-row { border-bottom: 0; }
/* Hover only where there is a pointer, so a tapped tab or row does not stay filled on a phone. */
@media (hover: hover) {
  .wa-kind:hover .wa-kind__name { color: var(--ds-ink); }
  .wa-group__toggle:hover .wa-day { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
  .wa-row:hover { background: color-mix(in srgb, var(--ds-sunken) 60%, transparent); }
  .wa-row:hover .wa-organization { text-decoration: underline; text-underline-offset: 3px; }
  .wa-row:hover .wa-chev { color: var(--ds-ink); transform: translateX(2px); }
}
@media (hover: none) { .wa-row:hover { background: transparent; } }
.wa-row.is-dismissed .wa-organization, .wa-row.is-dismissed .wa-code { color: var(--ds-ink-2); }

/* Wide list: one line per item. What the order is and its state read as one phrase (code, organisation, product, state),
   so the state sits beside the name instead of a column away; the actions keep one place at the end of the line. */
@container wa-list (min-width: 640px) {
  .wa-row, .wa-row--chat { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--ds-space-4); padding: var(--ds-space-3) var(--ds-space-3) var(--ds-space-3) var(--ds-space-5); }
  .wa-row > .wa-main { flex: 0 1 auto; min-width: 0; }
  .wa-row > .wa-aside { flex: 0 1 auto; flex-wrap: nowrap; min-width: 0; }
  .wa-row > .wa-actions { flex: none; margin-left: auto; }
  .wa-row > .wa-chev { display: none; }
  .wa-actions:empty { display: flex; }
  .wa-row--due .wa-main { flex-wrap: nowrap; }
  .wa-row--due .wa-open { display: flex; flex-wrap: nowrap; align-items: baseline; flex: 0 1 auto; min-width: 0; }
  .wa-row--due .wa-code { margin-right: 0; }
  .wa-row--due .wa-organization { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .wa-row--due .wa-order { flex: none; white-space: nowrap; }
  .wa-row--skipped .wa-skipped-rows { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .wa-row--chat .wa-main { flex: 1 1 auto; }
}

/* 상담: one card per room. The room name leads; each item says what is owed (badge + one line), the words that raised it,
   and its two answers: 확인 (handled) and 그만보기 (hide this one). */
.wa-rooms { display: grid; gap: var(--ds-space-4); margin: 0 0 var(--ds-space-6); padding: 0; list-style: none; }
.wa-room { position: relative; padding: var(--ds-space-4) var(--ds-space-5); border: 1px solid var(--ds-line); border-radius: var(--ds-radius-lg); background: var(--ds-surface); }
.wa-room__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ds-space-1) var(--ds-space-3); margin-bottom: var(--ds-space-3); }
.wa-room__open::after { content: none; }
.wa-room__open:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; border-radius: var(--ds-radius-sm); }
.wa-room__meta { color: var(--ds-ink-2); font-size: var(--ds-font-sm); font-variant-numeric: tabular-nums; }
.wa-room__items { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.wa-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "line actions" "evidence actions"; gap: var(--ds-space-1) var(--ds-space-4); align-items: start; padding: var(--ds-space-3) 0; }
.wa-item + .wa-item { border-top: 1px solid var(--ds-line); }
.wa-item__line { grid-area: line; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ds-space-1) var(--ds-space-2); min-width: 0; }
.wa-item__kind { flex: none; }
.wa-item__reason { margin: 0; font-size: var(--ds-font-md); font-weight: var(--ds-weight-medium); }
.wa-item__evidence { grid-area: evidence; margin: 0; color: var(--ds-ink-2); font-size: var(--ds-font-sm); line-height: var(--ds-leading); }
.wa-item__who { color: var(--ds-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wa-item__evidence q { color: var(--ds-ink); }
.wa-item__unsure { margin-left: var(--ds-space-2); padding: 0 6px; border: 1px dashed var(--ds-line); border-radius: var(--ds-radius-sm); color: var(--ds-ink-2); font-size: var(--ds-font-xs, var(--ds-font-sm)); white-space: nowrap; cursor: help; }
/* What already happened in the room, in its own order, and whose move it is now. */
.wa-room__progress { margin: calc(var(--ds-space-2) * -1) 0 var(--ds-space-2); color: var(--ds-ink-2); font-size: var(--ds-font-sm); line-height: var(--ds-leading); font-variant-numeric: tabular-nums; }
.wa-room__progress-label { margin-right: var(--ds-space-1); color: var(--ds-ink); font-weight: var(--ds-weight-strong); }
.wa-turn { flex: none; padding: 1px 8px; border-radius: 999px; font-size: var(--ds-font-sm); font-weight: var(--ds-weight-strong); white-space: nowrap; }
.wa-turn--staff { color: var(--ds-accent-strong); background: var(--ds-accent-soft); }
.wa-turn--customer { color: var(--ds-ink-2); background: var(--ds-sunken); }
.wa-item__actions { grid-area: actions; display: flex; gap: var(--ds-space-1); align-self: center; }
.wa-item__actions .wa-handle { border-color: var(--ds-accent); color: var(--ds-accent-strong); }
@container wa-list (max-width: 559px) {
  .wa-room { padding: var(--ds-space-3) var(--ds-space-4); }
  .wa-item { grid-template-columns: minmax(0, 1fr); grid-template-areas: "line" "evidence" "actions"; }
  .wa-item__actions { justify-content: flex-end; }
}

/* A stopped collector or a signed-out model is said above the list, in one line. */
.wa-health { margin: 0 0 var(--ds-space-4); }
.wa-health small { color: var(--ds-ink-2); }

/* 정리된 항목: its own view from 더보기 (보류, 기다림, 끝난 상담, 확인, 그만보기), with the way back first. */
.wa-tidy { container: wa-list / inline-size; --wa-actions-width: 112px; margin: 0 0 var(--ds-space-4); }
.wa-tidy__bar { margin: 0 0 var(--ds-space-3); }
.wa-back { gap: var(--ds-space-1); padding-left: var(--ds-space-1); }
.wa-back .ds-icon { width: var(--ds-icon-sm); height: var(--ds-icon-sm); }
.wa-tidy__title { margin: 0 0 var(--ds-space-1); font-size: var(--ds-font-xl); font-weight: var(--ds-weight-bold); }
.wa-tidy__note { margin: 0 0 var(--ds-space-4); color: var(--ds-ink-2); font-size: var(--ds-font-md); }
.wa-tidy__count { color: var(--ds-ink-2); font-size: var(--ds-font-md); font-weight: var(--ds-weight-medium); font-variant-numeric: tabular-nums; }
.wa-tidy__body { border: 1px solid var(--ds-line); border-radius: var(--ds-radius-lg); background: var(--ds-surface); overflow: hidden; }
.wa-tidy__part + .wa-tidy__part { border-top: 1px solid var(--ds-line); }
.wa-tidy__part-title { margin: 0; padding: var(--ds-space-3) var(--ds-space-5) var(--ds-space-1); color: var(--ds-ink); font-size: var(--ds-font-sm); font-weight: var(--ds-weight-strong); }
.wa-tidy__part-title span { color: var(--ds-ink-2); font-weight: var(--ds-weight-medium); }

.order-workspace-sidebar nav .wa-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--ds-danger); color: var(--ds-surface); font-size: var(--ds-font-xs); font-weight: var(--ds-weight-bold); text-align: center; font-variant-numeric: tabular-nums; }

/* Narrow screens: the title and its date stack so the toolbar stays on the title line; the four kinds become a 2×2 grid
   with name and count on one line, each cell keeping its own underline. */
@container wa-page (max-width: 559px) {
  .wa-header { flex-wrap: nowrap; }
  .wa-title { flex-direction: column; align-items: flex-start; gap: 0; }
  .wa-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--ds-space-4); border-bottom: 0; }
  .wa-kind { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: var(--ds-space-2); padding: var(--ds-space-3) 0 var(--ds-space-2); border-bottom: 1px solid var(--ds-line); }
  .wa-kind__count { margin-top: 0; }
  .wa-kind__note { grid-column: 1 / -1; }
  .wa-kind__count b { font-size: var(--ds-font-xl); }
  .wa-kind--quiet .wa-kind__count b { font-size: var(--ds-font-md); line-height: inherit; }
}

/* Someone who asked for less motion gets the same states without the slide and fade. */
@media (prefers-reduced-motion: reduce) {
  .wa-switch, .wa-switch__icon .ds-icon, .wa-switch__track, .wa-switch__knob { transition: none; }
}
