:root {
  color-scheme: light;
  --canvas: #f7f6f3;
  --paper: #fff;
  --ink: #302d31;
  --muted: #6d676c;
  --line: #e8e4de;
  --line-soft: #f0ece7;
  --accent: #c84123;
  --accent-deep: #a43c22;
  --accent-soft: #fcf0e9;
  --nav: #fff;
  --nav-text: #625c63;
  --nav-dim: #6d676c;
  --warning: #9d342b;
  --warning-pale: #fff0e7;
  --radius: 12px;
  --shadow: 0 1px 2px #362b2508;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --panel-yellow: #fff2c8;
  --panel-blue: #eaf3fd;
  --panel-purple: #f0e8fa;
  --panel-peach: #ffede3;
  --yellow-ink: #72521f;
  --blue-ink: #315d95;
  --purple-ink: #65448d;
  --peach-ink: #963e27;
  --neutral-control: #f6f3ef;
  --button-radius: 8px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--accent-deep); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #417ac8;
  outline-offset: 3px;
}
.sidebar :focus-visible { outline-color: #417ac8; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 700; line-height: 1.32; overflow-wrap: anywhere; }
h1 { font-size: clamp(28px, 3vw, 36px); letter-spacing: -.035em; font-weight: 700; }
h2 { font-size: 18px; letter-spacing: -.02em; }
h3 { font-size: 16px; }
[hidden] { display: none !important; }
::selection { color: var(--accent-deep); background: #ffe1cf; }

.shell { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: 20px;
  height: 100vh;
  height: 100dvh;
  min-height: 470px;
  overflow: auto;
  padding: 24px 14px 18px;
  color: var(--nav-text);
  background: var(--nav);
  border-right: 1px solid #e8e4de;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px;
  text-align: left;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: 0;
}
.brand-home { align-self: flex-start; min-height: 44px; border-radius: 8px; }
.brand-home:hover .brand-name { color: var(--accent-deep); }
.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 44px;
  place-items: center;
  border: 1px solid #ef704f;
  border-radius: 13px 13px 13px 4px;
  background: #ef704f;
  color: #32201d;
  font-size: 23px;
  font-weight: 750;
  line-height: 1;
  box-shadow: 3px 3px 0 #ffe1a0;
  transform: rotate(-4deg);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { display: block; color: var(--ink); font-size: 17px; font-weight: 700; letter-spacing: -.035em; white-space: nowrap; }
.brand-sub { display: block; margin-top: 1px; color: var(--nav-dim); font-size: 11px; letter-spacing: .035em; }
.nav { display: flex; flex-direction: column; gap: 5px; }
.nav-label { margin: 8px 10px 3px; color: var(--nav-dim); font-size: 12px; font-weight: 600; }
.nav-label:not(:first-child) { margin-top: 16px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--nav-text);
  text-align: left;
  text-decoration: none;
  font-weight: 560;
}
.nav-link:hover { background: #f6f4f1; }
.nav-link.active, .nav-link[aria-current="page"] {
  border-color: #dfb7a5;
  background: #f3dbcf;
  color: #71301f;
  font-weight: 700;
}
.nav-icon { display: grid; width: 21px; height: 21px; flex: 0 0 21px; place-items: center; border: 1px solid #e8e4de; border-radius: 4px; color: #6d676c; font-size: 11px; font-weight: 600; line-height: 1; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-text { min-width: 0; }
.side-foot {
  margin-top: auto;
  padding: 12px 13px 10px;
  border: 1px solid #ebe1c5;
  border-radius: 10px;
  background: #fffaed;
  color: #675a3e;
  font-size: 12px;
}

.workspace { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 9px clamp(18px, 3vw, 34px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.crumbs { color: var(--muted); font-size: 13px; font-weight: 600; }
.crumbs strong { color: var(--ink); }
.top-actions { display: flex; align-items: center; justify-content: end; gap: 12px; min-width: 0; }
.demo-pill, .tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 5px;
  background: #f3efeb;
  color: #635961;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
}
.demo-pill { border: 1px solid #e7e0ed; background: #f7f4f9; color: #685a72; }
.identity { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 13px; color: var(--muted); }
.content { width: min(100%, 1440px); margin-inline: auto; padding: 26px clamp(18px, 3vw, 34px) 48px; }
.content > * + * { margin-top: 20px; }
.page-head, .detail-head, .panel-head, .toolbar, .project-foot, .project-meta, .detail-actions, .head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-head, .detail-head, .panel-head, .toolbar, .project-foot { justify-content: space-between; }
.page-head { align-items: end; min-width: 0; }
.page-head > *, .detail-head > * { min-width: 0; }
.eyebrow { margin-bottom: 4px; color: var(--accent-deep); font-size: 13px; font-weight: 700; }
.lede { margin-top: 7px; color: var(--muted); max-width: 70ch; }
.head-actions, .detail-actions, .project-meta, .filters { flex-wrap: wrap; }
.detail-actions, .head-actions { justify-content: end; }
.detail-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.detail-top, .detail-title, .section-head, .stage-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.detail-title { align-items: end; }
.detail-title h1 { margin-top: 5px; }
.section-head + .project-grid { margin-top: 9px; }
.back { align-self: start; }
.btn, .filter, .link-button, .back, .icon-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover, .filter:hover, .icon-button:hover { background: #f7f5f2; border-color: #d6cdc5; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.small, .filter { min-height: 32px; padding: 5px 9px; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--accent-soft); }
.link-button, .back {
  min-height: 26px;
  padding: 2px 0;
  color: var(--accent-deep);
  background: transparent;
  border-color: transparent;
  text-align: left;
}
.link-button:hover, .back:hover { text-decoration: underline; text-underline-offset: 4px; }
.icon-button { min-width: 34px; min-height: 34px; padding: 3px; font-size: 20px; }
.btn svg, .link-button svg { width: 16px; height: 16px; }

/* Spring Workbench uses individual numeric tiles, with a featured yellow card. */
.today-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.today-band > * {
  display: grid; align-content: center; justify-items: start; gap: 5px;
  min-width: 0; min-height: 104px; padding: 13px 17px;
  border: 1px solid var(--tile-line,var(--line)); border-radius: var(--radius);
  background: var(--tile-bg,var(--paper)); color: var(--tile-ink,var(--ink));
  text-align: left;
}
.today-band .today-metric:hover {
  background: var(--tile-hover, var(--tile-bg));
  border-color: currentColor;
}
.today-metric:focus-visible {
  outline-color: var(--tile-ink);
  border-color: currentColor;
}
.today-date { --tile-bg: var(--panel-yellow); --tile-line: #ecdda9; --tile-ink: var(--yellow-ink); }
.today-metric[data-page="visits"] { --tile-bg: #efd0bf; --tile-hover: #e8beaa; --tile-line: #be826b; --tile-ink: #71301f; }
.today-metric[data-filter="waiting"] { --tile-bg: #cdddf1; --tile-hover: #bdd3eb; --tile-line: #7d9fc5; --tile-ink: #284e7b; }
.today-metric[data-filter="prep"] { --tile-bg: #dfd0ee; --tile-hover: #d4bfe8; --tile-line: #aa90c2; --tile-ink: #513570; }
.today-date span, .today-label { color: inherit; font-size: 13px; font-weight: 650; }
.today-date strong { font-size: clamp(16px, 2vw, 25px); font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.today-metric .today-label { font-weight: 750; }
.today-count { font-size: 34px; font-weight: 750; line-height: 1.06; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }

.dashboard-grid, .detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.dashboard-grid { align-items: stretch; }
.detail-grid { grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr); }
.stack { display: grid; min-width: 0; gap: 16px; }
.panel { min-width: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.panel-head { min-height: 33px; margin-bottom: 6px; }
.panel-head h2 { min-width: 0; }
.panel-head > :last-child { flex-shrink: 0; }
.panel-head > :only-child { flex-shrink: 1; }
.panel-head > div:first-child { min-width: 0; }
.panel-head p { margin-top: 4px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 52px;
  padding: 9px 0;
  text-align: left;
}
button.row, a.row { width: 100%; background: transparent; border: 0; color: inherit; text-decoration: none; }
button.row:hover .row-title, a.row:hover .row-title { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.row + .row, .panel-head + .row { border-top: 1px solid var(--line-soft); }
.row-main { display: grid; min-width: 0; gap: 2px; }
.row-title { color: var(--ink); font-weight: 680; overflow-wrap: anywhere; }
.visit-owner { margin-inline-start: 8px; vertical-align: middle; }
.demand-brief, .registration-text { padding-block: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.visit-count { margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.property-note { color: var(--muted); font-size: 13px; }
.property-no-link { color: var(--muted); font-size: 12px; }
.work-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.work-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.work-table th, .work-table td { padding: 9px 10px; border-top: 1px solid var(--line-soft); }
.work-table th, .work-table td:first-child, .work-table td:nth-child(3) { white-space: nowrap; }
.work-table th { color: var(--muted); font-weight: 650; }
.row-meta { white-space: pre-wrap; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.legacy-id { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.legacy-confirmation { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; }
.legacy-confirmation input { accent-color: var(--accent); }
.row-title .link-button { display: inline; padding: 0; color: var(--ink); font-size: inherit; white-space: normal; overflow-wrap: anywhere; }
.row-title .link-button:hover { color: var(--accent-deep); }
.row-end { display: flex; justify-content: end; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.tag.ok { color: var(--accent-deep); background: var(--accent-soft); }
.tag.warn { color: var(--warning); background: var(--warning-pale); }
.tag.quiet { color: #635961; background: #f3efeb; }
.empty { padding: 18px 0; color: var(--muted); font-size: 14px; }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.project-card {
  display: block;
  min-width: 0;
  width: 100%;
  padding: 16px 18px;
  text-align: left;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  background: var(--paper);
  box-shadow: var(--shadow);
}
button.project-card:hover, a.project-card:hover, .project-card:has(button:hover) { border-color: #d4c2e8; }
.project-card > * + * { margin-top: 9px; }
.project-meta { gap: 6px; color: var(--muted); font-size: 12px; }
.project-name { display: block; font-size: 19px; font-weight: 720; letter-spacing: -.018em; line-height: 1.4; overflow-wrap: anywhere; }
.project-card > .row-meta { display: block; }
.project-foot { padding-top: 9px; color: var(--muted); border-top: 1px solid var(--line-soft); font-size: 13px; }
.card-next { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.progress-mini { display: flex; align-items: center; gap: 4px; }
.progress-mini > * { display: block; width: 13px; height: 4px; border-radius: 4px; background: #e8e4de; }
.progress-mini .on { background: var(--accent-deep); }
.progress-mini .passed { background: #97b8df; }
.progress-mini .skipped { background: repeating-linear-gradient(90deg, #a198a1 0 2px, transparent 2px 4px); }
.filters { display: flex; gap: 6px; }
.filter.selected, .filter[aria-pressed="true"] { border-color: #ebcab9; background: var(--accent-soft); color: var(--accent-deep); }
input.search { width: min(100%, 245px); }

.stage-track { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 14px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.stage-step { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); grid-template-areas: "dot name" "dot status"; align-content: center; column-gap: 8px; min-width: 0; min-height: 54px; padding: 6px clamp(6px, 1.2vw, 15px); border-radius: var(--button-radius); }
.stage-step > div:has(.stage-name) { grid-area: 1 / 2 / 3 / 3; align-self: center; }
.stage-step + .stage-step { border-left: 1px solid var(--line-soft); }
.stage-step.current { color: var(--accent-deep); background: var(--accent-soft); }
.stage-dot { grid-area: dot; display: grid; width: 28px; height: 28px; align-self: center; place-items: center; border: 1px solid #dfd6ce; border-radius: 50%; background: #f7f5f2; color: var(--muted); font-size: 12px; font-weight: 700; }
.stage-name { grid-area: name; font-size: 14px; font-weight: 700; line-height: 1.3; }
.stage-status { grid-area: status; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.stage-step.current .stage-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.stage-step.done .stage-dot { background: var(--accent-soft); border-color: #c9d9ef; color: var(--accent-deep); }
.stage-step.skipped .stage-dot { border-style: dashed; }
.stage-step.skipped .stage-status { color: #6d676c; font-weight: 700; }
.stage-summary { margin-top: 13px; }
.stage-summary > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.stage-summary .detail-actions { flex-shrink: 0; }
.blocker-text { margin-top: 4px; color: var(--warning); }
.field-grid, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.field { display: grid; align-content: start; gap: 2px; min-width: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.field strong, .field b, .field dd { color: var(--ink); font-size: 14px; margin: 0; }
.project-brief { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line-soft); font-size: 14px; overflow-wrap: anywhere; }
.check-row { display: flex; align-items: center; gap: 9px; min-height: 39px; padding: 6px 0; overflow-wrap: anywhere; }
.row-title .check-row { min-height: 26px; padding: 0; }
.check-row + .check-row { border-top: 1px solid var(--line-soft); }
.check-row input, input[type="checkbox"] { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.check-row:has(input:checked) { color: var(--accent-deep); }
.log { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; margin: 0; padding: 7px 0; color: var(--ink); font-size: 13px; }
.log + .log { border-top: 1px solid var(--line-soft); }
.log > * { overflow-wrap: anywhere; }
.log :is(time, span) { color: var(--muted); font-variant-numeric: tabular-nums; }

input:not([type="checkbox"]), select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 37px;
  padding: 6px 9px;
  border: 1px solid #d2c8bf;
  border-radius: var(--button-radius);
  background: var(--paper);
}
input::placeholder, textarea::placeholder { color: #6d676c; }
textarea { min-height: 88px; resize: vertical; }
dialog#dialog {
  width: min(550px, calc(100% - 26px));
  max-height: min(720px, calc(100% - 24px));
  max-height: min(720px, calc(100dvh - 24px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 20px;
  border: 1px solid #e5d9d0;
  border-radius: 14px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 18px 60px #35292233;
}
dialog#dialog::backdrop { background: #30262c80; }
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-head { margin-bottom: 13px; }
.modal-foot { justify-content: end; margin-top: 16px; }
.modal-form { display: grid; gap: 11px; }
.modal-form .modal-foot { margin-top: 4px; }
.btn.danger-action { color: var(--warning); }
.modal-foot > .danger-action { margin-right: auto; }
.btn.danger-confirm { color: #fff; background: var(--warning); border-color: var(--warning); }
.btn.danger-confirm:hover { background: #7f251e; border-color: #7f251e; }
.form-field { display: grid; gap: 4px; min-width: 0; font-weight: 650; font-size: 13px; }
.form-field :is(input, select, textarea) { font-size: 14px; font-weight: 400; }
.form-field.full, .full-width, .wide { grid-column: 1 / -1; }
.toast {
  position: fixed;
  z-index: 10;
  right: 23px;
  bottom: 21px;
  max-width: min(420px, calc(100% - 46px));
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 3px 20px #35292226;
  font-size: 14px;
}
.toast:empty { display: none; }

@media (min-width: 1350px) {
  .project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
  .shell { grid-template-columns: 194px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .panel { padding: 13px 14px; }
  .stage-step { grid-template-columns: 24px minmax(0, 1fr); column-gap: 5px; }
  .stage-dot { width: 24px; height: 24px; }
}
@media (max-width: 850px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; min-height: auto; height: auto; padding: 13px 16px; gap: 11px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; }
  .nav { flex-flow: row wrap; gap: 5px; }
  .nav-link { width: auto; min-height: 35px; padding: 6px 8px; font-size: 13px; gap: 5px; }
  .nav-label { display: none; }
  .side-foot { padding: 4px 8px; margin: 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .topbar { min-height: 52px; }
  .content { padding-top: 20px; }
}
@media (max-width: 600px) {
  .dashboard-grid, .detail-grid, .project-grid { grid-template-columns: 1fr; gap: 11px; }
  .page-head { align-items: start; flex-direction: column; }
  .stage-summary { align-items: start; flex-direction: column; }
  .stage-summary .detail-actions { flex-shrink: 1; }
  .detail-actions, .head-actions { justify-content: start; }
  .toolbar { align-items: start; flex-direction: column; }
  .today-band { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .today-band > * { min-height: 82px; padding: 10px 13px; }
  .stage-track { padding: 5px; }
  .stage-step { grid-template-columns: 1fr; grid-template-areas: "dot" "name" "status"; justify-items: center; gap: 4px; padding: 6px 2px; text-align: center; }
  .stage-step > div:has(.stage-name) { grid-area: 2 / 1 / 4 / 2; }
  .stage-name { font-size: 12px; }
  .stage-status { margin: 0; font-size: 10px; }
}
@media (max-width: 390px) {
  .topbar { padding-inline: 10px; }
  .top-actions { gap: 5px; }
  .identity { gap: 3px; font-size: 12px; }
  .content { padding-inline: 11px; }
  .panel-head { flex-wrap: wrap; }
  .row { flex-wrap: wrap; }
  .detail-title { align-items: start; flex-direction: column; }
  .crumbs > span[aria-hidden] + .crumb-project, .crumbs > span[aria-hidden]:has(+ .crumb-project) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

.form-error { padding: 8px 10px; border-radius: var(--button-radius); background: var(--warning-pale); color: var(--warning); font-size: 13px; }
.local-label { font-size: 12px; }
.modal-head p { max-width: 52ch; margin-top: 4px; color: var(--muted); font-size: 13px; }
.modal-head .icon-button { flex: 0 0 auto; }
.modal-form .empty { grid-column: 1 / -1; }


/* Shared category colors from the Workbench palette, applied to labeled content. */
.tone-amber { --section-fill: var(--panel-yellow); --section-ink: var(--yellow-ink); --section-edge: #e9c764; }
.tone-coral { --section-fill: var(--panel-peach); --section-ink: var(--peach-ink); --section-edge: #eea28c; }
.tone-blue { --section-fill: var(--panel-blue); --section-ink: var(--blue-ink); --section-edge: #91b8e9; }
.tone-violet { --section-fill: var(--panel-purple); --section-ink: var(--purple-ink); --section-edge: #b79cd8; }
.brand-palette { display: flex; gap: 4px; margin-top: 6px; }
.brand-palette i { width: 13px; height: 4px; border-radius: 3px; background: #f08364; }
.brand-palette i:nth-child(2) { background: #f5c753; }
.brand-palette i:nth-child(3) { background: #8cbbef; }
.brand-palette i:nth-child(4) { background: #b699e4; }
.nav-link .nav-icon { background: var(--section-fill,var(--neutral-control)); color: var(--section-ink,var(--muted)); border: 0; }
.nav-link { gap: 11px; font-size: 14px; }
.page-head { gap: 20px; }
.panel-head { gap: 12px; }
.panel[class*="tone-"] { border-top: 3px solid var(--section-edge); }
.panel[class*="tone-"] > .panel-head {
  margin: -16px -18px 6px; padding: 14px 18px 11px;
  background: var(--section-fill); color: var(--section-ink);
  border-radius: 9px 9px 0 0;
}
.panel[class*="tone-"] > .panel-head p { color: var(--section-ink); }
.stage-panel { border-top: 3px solid #b79cd8; }
.stage-step.done .stage-dot, .tag.ok {
  color: var(--blue-ink); background: var(--panel-blue);
}
.stage-step.current { color: var(--purple-ink); background: var(--panel-purple); }
.stage-step.current .stage-dot { background: var(--purple-ink); border-color: var(--purple-ink); }
.tag.warn { color: var(--warning); background: var(--warning-pale); }
.tag.visit-owner { color: var(--purple-ink); background: var(--panel-purple); }
.project-card { border-top: 3px solid #b79cd8; }
.project-meta .tag { background: var(--panel-purple); color: var(--purple-ink); }
.progress-mini .on { background: var(--purple-ink); }
.property-note {
  border-left: 3px solid #91b8e9; border-radius: 0 8px 8px 0;
  padding: 9px 13px; background: var(--panel-blue); color: var(--blue-ink);
}
details.panel > summary { padding: 3px 0; cursor: pointer; color: var(--accent-deep); font-weight: 650; }
details.panel[open] > summary { margin-bottom: 14px; }
dialog#dialog { border-top: 4px solid #eea28c; padding: 20px 22px; }
.modal-head { padding-bottom: 11px; border-bottom: 1px solid var(--line-soft); }
.form-field { gap: 6px; }
.form-field :is(input,select,textarea) { min-height: 42px; }
.toast { background: var(--ink); }
.work-table thead { background: #fff9e9; }
.work-table th { color: var(--yellow-ink); }
.work-table tbody tr:nth-child(even) { background: #faf8f5; }
@media (max-width: 1020px) {
  .panel[class*="tone-"] > .panel-head { margin: -13px -14px 6px; padding: 11px 14px; }
}
@media (max-width: 850px) {
  .nav-link { min-height: 40px; }
  .brand-mark { flex-basis: 34px; width: 34px; height: 35px; font-size: 19px; }
}
@media (max-width: 600px) {
  .nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
  .nav-link { min-width: 0; width: 100%; padding: 5px 6px; gap: 5px; font-size: 12px; }
  .nav-icon { width: 17px; height: 17px; flex-basis: 17px; font-size: 10px; }
  .page-head { gap: 11px; }
  .topbar { flex-wrap: wrap; gap: 5px 10px; }
  .content > * + * { margin-top: 15px; }
  .panel-head { align-items: flex-start; }
  .row-end { justify-content: start; }
  .row:has(.row-end) { flex-wrap: wrap; }
}
@media (max-width: 430px) {
  .form-grid { grid-template-columns: minmax(0,1fr); }
  dialog#dialog { padding: 14px; }
  .stage-name { font-size: 11px; }
  .stage-step { min-height: 70px; }
}

/* Login uses the same mark, warm paper, and focus colors as the workspace. */
.login-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: clamp(20px, 5vw, 48px) 16px;
}
.login-card {
  width: min(100%, 440px);
  padding: clamp(20px, 5vw, 34px);
  border: 1px solid var(--line);
  border-top: 4px solid #eea28c;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 8px 30px #362b250b;
}
.login-card .brand { padding: 0 0 18px; border-bottom: 1px solid var(--line-soft); }
.login-card h1 { margin-top: 19px; font-size: 28px; }
.login-form { display: grid; gap: 14px; margin-top: 20px; }
.login-form input { min-height: 46px; font-size: 16px; }
.login-form .btn.primary, .google-login { min-height: 46px; width: 100%; }
.google-login { margin-top: 20px; text-decoration: none; }
.login-card .form-error { margin-top: 14px; overflow-wrap: anywhere; }
.app-error {
  margin: 12px clamp(18px, 3vw, 34px) 0;
  padding: 10px 13px;
  border: 1px solid #eed2bf;
  border-radius: var(--button-radius);
  background: var(--warning-pale);
  color: var(--warning);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.startup { padding: 22px 16px; color: var(--muted); text-align: center; }
.filter-group { min-width: 0; }
.check-row { cursor: pointer; }
.stage-status { overflow-wrap: anywhere; }
.form-grid fieldset {
  min-inline-size: 0;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
}
.form-grid legend { padding: 0 5px; color: var(--muted); font-size: 13px; font-weight: 650; }

@media (max-width: 850px) {
  .nav-link { min-height: 44px; }
}
@media (max-width: 600px) {
  .nav-text { line-height: 1.25; overflow-wrap: anywhere; }
  .topbar { padding-block: 7px; }
  .crumbs { min-width: 0; overflow-wrap: anywhere; }
  .top-actions { flex-wrap: wrap; gap: 4px 8px; }
  .panel-head { flex-wrap: wrap; }
  .panel-head > :last-child { flex-shrink: 1; min-width: 0; }
  .row:has(.row-end) { align-items: start; gap: 5px 10px; }
  .row:has(.row-end) .row-main { flex: 1 0 100%; }
  .row-end .btn, .row-end .link-button { justify-content: start; }
  .btn, .btn.small, .filter, .link-button, .back, .icon-button, .check-row, .row-title .check-row { min-height: 44px; }
  .row-title .link-button { display: inline-flex; align-items: center; text-align: left; }
  .icon-button { min-width: 44px; }
  .modal-foot { flex-wrap: wrap; }
  input:not([type="checkbox"]), select, .form-field :is(input,select,textarea) {
    min-height: 44px;
    font-size: 16px;
  }
  input.search { width: 100%; }
  .check-row input[type="checkbox"] { width: 20px; height: 20px; }
}
