:root {
  color-scheme: light;
  --ink: #241920;
  --muted: #756b72;
  --paper: #f8f3ed;
  --panel: #fffdf8;
  --line: rgba(36, 25, 32, 0.13);
  --wine: #4b1626;
  --wine-2: #6e2740;
  --sage: #6f8876;
  --sage-2: #425f4e;
  --brass: #c7a060;
  --rose: #d9959f;
  --blue: #526f91;
  --danger: #a64045;
  --shadow: 0 18px 50px rgba(64, 41, 48, 0.12);
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #31131f 0 310px, transparent 310px),
    linear-gradient(120deg, rgba(111, 136, 118, 0.16), transparent 34%),
    var(--paper);
  overflow-x: hidden;
}

body,
button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
strong,
span,
button,
a,
label,
textarea {
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 3px solid rgba(199, 160, 96, 0.42);
  outline-offset: 3px;
}

.ops-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.ops-sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 22px;
  align-content: start;
  height: 100vh;
  padding: 22px;
  color: #fffdf8;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.07), transparent 36%),
    var(--wine);
  border-right: 1px solid rgba(255, 253, 248, 0.12);
}

.ops-brand,
.ops-nav a,
.ghost-action {
  text-decoration: none;
}

.ops-brand {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  color: inherit;
}

.ops-brand span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  color: var(--wine);
  background: #fffdf8;
  font-weight: 950;
}

.ops-brand strong,
.ops-brand small {
  display: block;
  min-width: 0;
}

.ops-brand strong {
  font-size: 19px;
}

.ops-brand small {
  color: rgba(255, 253, 248, 0.64);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ops-nav {
  display: grid;
  gap: 8px;
}

.ops-nav a {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 253, 248, 0.1);
  border-radius: 8px;
  color: rgba(255, 253, 248, 0.76);
  font-weight: 900;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ops-nav a:hover,
.ops-nav a:focus-visible {
  transform: translateX(2px);
  color: var(--wine);
  background: #fffdf8;
}

.client-dock {
  align-self: end;
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: var(--brass);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.client-dock h2 {
  margin: 6px 0 14px;
  font-size: 22px;
}

.client-dock label,
.message-panel label,
.intake-form label {
  display: grid;
  gap: 7px;
  color: rgba(255, 253, 248, 0.72);
  font-size: 13px;
  font-weight: 900;
}

.client-dock select,
.message-panel select,
.intake-form input,
.intake-form select,
.message-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fffdf8;
}

.client-dock select,
.message-panel select,
.intake-form input,
.intake-form select {
  min-height: 42px;
  padding: 0 12px;
  font-weight: 850;
}

.client-dock figure {
  margin: 16px 0 0;
  overflow: hidden;
  border: 1px solid rgba(255, 253, 248, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.08);
}

.client-dock img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.client-dock figcaption {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.client-dock figcaption span {
  color: rgba(255, 253, 248, 0.68);
  font-size: 13px;
}

.ops-main {
  display: grid;
  gap: 20px;
  min-width: 0;
  align-content: start;
  padding: 28px clamp(18px, 3vw, 40px) 44px;
}

.ops-topbar {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #fffdf8;
}

.ops-topbar h1 {
  margin: 6px 0 0;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

.top-actions,
.panel-actions,
.message-actions,
.finance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.top-actions time,
.top-actions button,
.ghost-action,
.panel-actions button,
.intake-form button,
.message-actions button,
.finance-actions button,
.timeline-actions button,
.pipeline-card button,
.kit-item button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 950;
}

.top-actions time,
.ghost-action {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 253, 248, 0.14);
  color: rgba(255, 253, 248, 0.78);
  background: rgba(255, 253, 248, 0.08);
}

button {
  border: 1px solid transparent;
  color: var(--ink);
  background: #fffdf8;
}

.top-actions button,
.intake-form button,
.message-actions button:last-child,
.finance-actions button:first-child {
  border-color: var(--brass);
  background: var(--brass);
}

button:hover,
button:focus-visible,
.ghost-action:hover,
.ghost-action:focus-visible {
  transform: translateY(-1px);
}

.metric-strip,
.client-summary {
  display: grid;
  gap: 12px;
}

.metric-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-strip article,
.client-summary article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
}

.metric-strip article {
  min-height: 128px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 18px;
}

.metric-strip span,
.client-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.metric-strip strong {
  color: var(--wine);
  font-size: clamp(28px, 2.6vw, 36px);
  line-height: 1;
  white-space: nowrap;
}

.metric-strip small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ops-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 20px;
  align-items: start;
}

.ops-layout.wide-left {
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.55fr);
}

.finance-layout {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-head.compact {
  align-items: flex-start;
}

.panel-head h2 {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: clamp(24px, 2.5vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

.panel-actions button {
  border-color: var(--line);
  color: var(--ink);
  background: #fffaf2;
}

.panel-actions button.is-active,
.panel-actions button:hover,
.panel-actions button:focus-visible {
  border-color: var(--sage);
  color: #fffdf8;
  background: var(--sage);
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 10px;
  min-width: 0;
}

.pipeline-column {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(36, 25, 32, 0.1);
  border-radius: 8px;
  background: #f7efe7;
}

.pipeline-column h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  margin: 0 0 10px;
  color: var(--wine);
  font-size: 16px;
}

.pipeline-column h3 span {
  display: inline-flex;
  min-width: 28px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fffdf8;
  background: var(--wine);
  font-size: 12px;
}

.pipeline-stack {
  display: grid;
  gap: 8px;
}

.pipeline-card {
  display: grid;
  gap: 10px;
  min-height: 178px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pipeline-card.is-active {
  border-color: var(--wine-2);
  box-shadow: 0 12px 30px rgba(106, 35, 56, 0.15);
}

.pipeline-card:hover,
.pipeline-card:focus-within {
  transform: translateY(-2px);
}

.pipeline-card strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.pipeline-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.pipeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pipeline-tags span,
.risk-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--wine);
  background: rgba(199, 160, 96, 0.18);
  font-size: 12px;
  font-weight: 900;
}

.pipeline-card button {
  border-color: var(--sage);
  color: #fffdf8;
  background: var(--sage);
}

.intake-form {
  display: grid;
  gap: 12px;
}

.intake-form label {
  color: var(--muted);
}

.ops-feedback {
  min-height: 44px;
  display: flex;
  align-items: center;
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--sage-2);
  background: rgba(111, 136, 118, 0.12);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.45;
}

.client-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-summary article {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px 16px;
}

.client-summary strong {
  font-size: 18px;
}

.timeline-list,
.risk-list,
.kit-grid,
.style-checklist,
.addon-editor {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) minmax(120px, auto);
  gap: 14px;
  align-items: center;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
}

.timeline-item.is-done {
  opacity: 0.62;
}

.timeline-time {
  color: var(--wine);
  font-size: 20px;
  font-weight: 950;
}

.timeline-main strong {
  display: block;
  font-size: 17px;
}

.timeline-main span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.timeline-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.timeline-actions button {
  border-color: var(--line);
  background: #fffdf8;
}

.timeline-actions [data-task-action="done"] {
  border-color: var(--sage);
  color: #fffdf8;
  background: var(--sage);
}

.timeline-actions [data-task-action="delay"] {
  border-color: rgba(166, 64, 69, 0.36);
  color: var(--danger);
}

.risk-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
}

.risk-card strong {
  display: block;
  margin-bottom: 5px;
}

.risk-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.risk-card.is-danger {
  border-color: rgba(166, 64, 69, 0.34);
  background: rgba(166, 64, 69, 0.08);
}

.style-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.style-photo {
  min-height: 420px;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--wine);
}

.style-photo img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.style-photo figcaption {
  display: none;
}

.style-detail {
  display: grid;
  align-content: start;
  gap: 14px;
}

.style-detail h3 {
  margin: 0;
  color: var(--wine);
  font-size: 30px;
  line-height: 1.1;
}

.style-detail p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatches span {
  display: inline-flex;
  min-width: 72px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(36, 25, 32, 0.1);
  border-radius: 8px;
  color: var(--ink);
  background: var(--swatch);
  font-size: 12px;
  font-weight: 950;
}

.style-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
}

.style-check input,
.addon-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--wine);
}

.message-panel {
  display: grid;
  gap: 12px;
}

.message-panel label {
  color: var(--muted);
}

.message-panel textarea {
  min-height: 240px;
  padding: 12px;
  resize: vertical;
  line-height: 1.65;
}

.message-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.kit-progress {
  display: grid;
  grid-template-columns: auto 128px;
  gap: 10px;
  align-items: center;
  color: var(--wine);
  font-weight: 950;
}

.kit-progress i,
.payment-meter {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(36, 25, 32, 0.12);
}

.kit-progress b,
.payment-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--brass), var(--rose));
  transition: width 0.25s ease;
}

.kit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kit-item {
  display: grid;
  gap: 10px;
  min-height: 142px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
}

.kit-item.is-packed {
  border-color: rgba(111, 136, 118, 0.36);
  background: rgba(111, 136, 118, 0.1);
}

.kit-item strong {
  display: block;
  color: var(--ink);
}

.kit-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.kit-item button {
  width: fit-content;
  border-color: var(--sage);
  color: #fffdf8;
  background: var(--sage);
}

.kit-item.is-low button {
  border-color: var(--danger);
  background: var(--danger);
}

.quote-box {
  display: grid;
  gap: 18px;
  padding: 16px;
  border-radius: 8px;
  color: #fffdf8;
  background:
    linear-gradient(135deg, rgba(199, 160, 96, 0.18), transparent 46%),
    var(--wine);
}

.quote-box dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.quote-box dl div {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
}

.quote-box dt {
  color: rgba(255, 253, 248, 0.58);
}

.quote-box dd {
  margin: 0;
  font-weight: 900;
}

.quote-box > strong {
  font-size: 36px;
  line-height: 1;
}

.payment-meter {
  background: rgba(255, 253, 248, 0.18);
}

.addon-editor {
  margin-top: 14px;
}

.addon-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
}

.addon-row strong {
  color: var(--sage-2);
  font-size: 14px;
}

.finance-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1220px) {
  .ops-shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .metric-strip,
  .client-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-layout,
  .ops-layout.wide-left,
  .finance-layout {
    grid-template-columns: 1fr;
  }

  .pipeline-board {
    overflow-x: auto;
    padding-bottom: 4px;
  }
}

@media (max-width: 900px) {
  body {
    background:
      linear-gradient(180deg, #31131f 0 430px, transparent 430px),
      var(--paper);
  }

  .ops-shell {
    display: block;
  }

  .ops-sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .ops-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ops-nav a {
    justify-content: center;
    text-align: center;
  }

  .client-dock {
    display: none;
  }

  .ops-main {
    padding: 18px 14px 36px;
  }

  .ops-topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ops-topbar {
    color: var(--ink);
  }

  .ops-topbar .eyebrow {
    color: var(--brass);
  }

  .top-actions time,
  .ghost-action {
    border-color: var(--line);
    color: var(--ink);
    background: #fffdf8;
  }

  .top-actions,
  .panel-actions {
    width: 100%;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .top-actions time,
  .top-actions button,
  .ghost-action {
    justify-content: center;
  }

  .style-workspace,
  .kit-grid {
    grid-template-columns: 1fr;
  }

  .style-photo,
  .style-photo img {
    min-height: 360px;
  }
}

@media (max-width: 620px) {
  .ops-nav,
  .metric-strip,
  .client-summary,
  .top-actions,
  .panel-actions,
  .message-actions,
  .finance-actions {
    grid-template-columns: 1fr;
  }

  .pipeline-board {
    grid-template-columns: repeat(4, 82vw);
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .timeline-actions {
    justify-content: stretch;
  }

  .timeline-actions button {
    flex: 1 1 0;
  }

  .quote-box dl div,
  .addon-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
