@font-face {
  font-family: "CountWD Numbers";
  src: url("./fonts/RobotoCondensed-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0024-003A, U+00A5, U+2212;
}

:root {
  --ink: #0b1f33;
  --muted: #5c6f82;
  --line: #cfe5f8;
  --paper: #f6fbff;
  --panel: #ffffff;
  --sky: #2ea7ff;
  --sky-soft: #dff3ff;
  --deep: #0c5794;
  --navy: #123c69;
  --cyan: #18b7c8;
  --mint: #1c9f75;
  --amber: #b36a00;
  --rose: #c23855;
  --shadow: 0 14px 34px rgba(16, 78, 122, .11);
  --radius: 8px;
  --z-modal: 40;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100dvh;
  padding-bottom: calc(82px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, #fbfeff 0%, #eefaff 390px, #f8fcff 100%);
  color: var(--ink);
  font-family: "Microsoft JhengHei UI", "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  letter-spacing: 0;
  line-height: 1.5;
}

body.public-page,
body.public-page * {
  font-family: "CountWD Numbers", "Microsoft JhengHei UI", "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
}

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

button, a {
  min-height: 44px;
  border: 1px solid var(--deep);
  border-radius: 6px;
  background: var(--deep);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
  touch-action: manipulation;
}

button { padding: 8px 12px; }
button:hover, a:hover { background: var(--navy); }
button:active, a:active { transform: translateY(1px); }
button:disabled { cursor: wait; opacity: .55; transform: none; }
button.danger { border-color: var(--rose); background: var(--rose); }

input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

textarea { resize: vertical; }

input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, .sale-card:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(46, 167, 255, .35);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: var(--z-modal);
  transform: translateY(-160%);
  padding: 8px 12px;
}

.skip-link:focus { transform: none; }

.hero, .admin-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 28px max(14px, calc((100vw - 1240px) / 2)) 24px;
  border-bottom: 1px solid rgba(12, 87, 148, .12);
  background: rgba(255, 255, 255, .74);
  backdrop-filter: blur(14px);
}

.hero { grid-template-columns: 1fr; }

.public-page .hero {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-block: 22px 20px;
  border-bottom: 0;
  background:
    linear-gradient(135deg, #f7fdff 0%, #dff6ff 46%, #bcecff 100%);
  box-shadow: 0 14px 34px rgba(46, 167, 255, .12);
}

.hero-copy, .admin-head div { min-width: 0; }

.eyebrow, .card-kicker, .empty, label span, .event-item span, .mini-grid small, .money-focus small, .status-line, .metric-card small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(32px, 5vw, 62px);
  line-height: .95;
  font-weight: 900;
}

.hero-copy .eyebrow {
  display: inline-block;
  border: 1px solid rgba(12, 87, 148, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  padding: 4px 10px;
  color: var(--deep);
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

.hero-copy h1 {
  position: relative;
  margin-top: 6px;
  padding-left: 14px;
  color: #073f70;
  font-size: clamp(36px, 4.2vw, 58px);
  letter-spacing: .01em;
}

.hero-copy h1::before {
  content: "";
  position: absolute;
  left: 0;
  top: .08em;
  bottom: .08em;
  width: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--sky), var(--cyan));
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: 8px;
}

.hero-meta small, .hero-meta span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(12, 87, 148, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .74);
  color: var(--navy);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.hero-meta span {
  border-color: rgba(46, 167, 255, .3);
  background: rgba(255, 255, 255, .48);
  color: var(--deep);
}

.hero-meta i {
  color: var(--deep);
  font-style: normal;
}

.hero-meta .pwa-action {
  min-height: 28px;
  border: 1px solid #9fd8c5;
  border-radius: 999px;
  background: #eef9f5;
  color: #0b7558;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
}

.hero-meta .pwa-action[aria-pressed="true"] {
  border-color: #7bc6ae;
  background: #dff5ec;
}


main {
  width: min(1240px, 100% - 28px);
  margin: 14px auto 32px;
}

.overview-panel {
  margin-bottom: 12px;
  border: 1px solid rgba(46, 167, 255, .22);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(247, 252, 255, .88)),
    #fff;
  box-shadow: 0 18px 46px rgba(16, 78, 122, .11);
  padding: 12px;
}

.dashboard-strip {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr .9fr .8fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid #d9ecfb;
  border-radius: 11px;
  background: #d9ecfb;
  margin-bottom: 10px;
}

.metric-card, .sale-card, .panel, .product-dialog {
  border: 1px solid rgba(46, 167, 255, .23);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 108px;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, .96);
  box-shadow: none;
  padding: 16px 18px;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 14px auto 14px 0;
  width: 4px;
  height: auto;
  border-radius: 999px;
  background: var(--sky);
}

.metric-card.has-rise::before, .metric-hot::before, .metric-money::before { background: var(--amber); }

.metric-money .metric-value { color: var(--amber); }

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-value {
  display: block;
  margin-top: 6px;
  color: var(--navy);
  font-size: clamp(25px, 3vw, 40px);
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.overview-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 8px;
  align-items: stretch;
  border-radius: 12px;
  background: linear-gradient(90deg, #ccefff, #e8f9ff);
  padding: 6px;
}

.summary-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 54px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .94);
  padding: 8px 10px 8px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 8px 18px rgba(8, 58, 101, .1);
}

.summary-card b, .selection-actions b {
  display: block;
  color: var(--deep);
  font-size: 15px;
  font-weight: 900;
}

.summary-card small, .selection-actions small {
  display: block;
  color: #607c92;
  font-size: 11px;
  font-weight: 700;
}

.period-summary {
  display: flex;
  min-width: 0;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.period-summary span {
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: auto auto auto;
  align-items: baseline;
  gap: 5px;
  border: 1px solid #c8eafa;
  border-radius: 999px;
  background: #f4fcff;
  padding: 4px 8px;
}

.period-summary i, .period-summary em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.period-summary b {
  color: var(--mint);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.period-summary em { color: var(--amber); }

.summary-card button {
  min-height: 36px;
  border-color: transparent;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #e4f7ff);
  color: var(--deep);
  padding: 5px 10px;
  font-weight: 900;
  box-shadow: 0 3px 0 #b9e6fb;
  white-space: nowrap;
}

.summary-details {
  min-width: 0;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .94);
  padding: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 8px 18px rgba(8, 58, 101, .1);
}

.summary-details[open] {
  display: flex;
  flex-direction: column;
  max-height: min(56vh, 430px);
  overflow: hidden;
}

.summary-details summary {
  min-height: 50px;
  color: var(--deep);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 0 14px;
  font-size: 14px;
  font-weight: 800;
}

.summary-details summary::-webkit-details-marker { display: none; }

.summary-details summary::after {
  content: "展开";
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #dff6ff, #bdeeff);
  color: var(--deep);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 3px 0 #8fd8fb, inset 0 1px 0 rgba(255, 255, 255, .9);
}

.summary-details[open] summary::after { content: "收起"; }

.summary-details summary span, .selection-actions b {
  display: block;
  color: var(--deep);
  font-size: 15px;
  font-weight: 900;
}

.summary-details summary small, .selection-actions small {
  display: block;
  color: #607c92;
  font-size: 11px;
  font-weight: 700;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.summary-details[open] .detail-list {
  max-height: min(40vh, 300px);
  overflow: auto;
  margin-top: 0;
  padding: 0 12px 12px;
}

.history-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px 84px;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 12px 8px;
}

.history-tools label {
  min-width: 0;
}

.history-tools button {
  width: 100%;
  min-height: 44px;
  border-color: #a9def9;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #e8f8ff);
  color: var(--deep);
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 3px 0 #b9e6fb;
}

.period-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: #f6fbff;
}

.period-row b, .period-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.period-row > span {
  color: var(--deep);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-weight: 800;
}

.period-row small {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.period-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcff;
  padding: 9px;
}

.period-card > div {
  display: grid;
  gap: 7px;
}

.day-heatmap {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 5px;
  margin: 8px 0 10px;
}

.heat-cell {
  display: grid;
  min-width: 0;
  border: 1px solid #d9ecfb;
  border-radius: 6px;
  background: #fff;
  padding: 4px 3px;
  text-align: center;
}

.heat-cell i {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.1;
}

.heat-cell b {
  overflow: hidden;
  color: var(--deep);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heat-1 { background: #eef8ff; border-color: #bfe5ff; }
.heat-2 { background: #dbf2ff; border-color: #8fd2fb; }
.heat-3 { background: #e9f9f2; border-color: #8bd8bc; }
.heat-4 { background: #fff3db; border-color: #e7bd78; }
.heat-cell.down { background: #fff0f2; border-color: #eec2cd; }
.heat-cell.down b { color: var(--rose); }

.heat-3 b { color: var(--mint); }
.heat-4 b { color: var(--amber); }

.period-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.period-tab {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  min-width: 0;
  min-height: 58px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  padding: 7px 8px;
  text-align: left;
}

.period-tab.active {
  border-color: rgba(46, 167, 255, .7);
  background: #eef8ff;
  box-shadow: inset 0 0 0 1px rgba(46, 167, 255, .2);
}

.period-tab span, .period-tab strong, .period-tab b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.period-tab span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.period-tab strong, .period-tab b {
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.period-tab strong { color: var(--mint); font-size: 17px; }
.period-tab b { color: var(--amber); font-size: 13px; }

.period-card header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 8px;
}

.period-card header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.period-card header strong, .period-card header b {
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.period-card header strong { color: var(--mint); font-size: 18px; }
.period-card header b { color: var(--amber); font-size: 15px; }

.product-wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.selection-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 50px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .94);
  padding: 7px 8px 7px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 8px 18px rgba(8, 58, 101, .1);
  align-self: stretch;
  align-content: start;
}

.selection-actions span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.selection-actions button {
  min-height: 34px;
  border-color: transparent;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #e4f7ff);
  color: var(--deep);
  padding: 5px 10px;
  font-weight: 900;
  box-shadow: 0 3px 0 #b9e6fb;
}

.selection-actions button:hover {
  border-color: #98dcfb;
  background: linear-gradient(180deg, #f6fdff, #d8f3ff);
  color: var(--navy);
}

.sale-card {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-content: start;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.sale-card:hover {
  border-color: rgba(46, 167, 255, .7);
  box-shadow: 0 18px 42px rgba(16, 78, 122, .15);
  transform: translateY(-2px);
}

.sale-card.selected {
  border-color: rgba(46, 167, 255, .5);
}

.sale-card.ended {
  border-color: #aab9c8;
  background: #f7fafc;
}

.sale-card img {
  width: 88px;
  height: 88px;
  min-height: 88px;
  margin: 10px 0 0 10px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  color: transparent;
  font-size: 0;
  border: 1px solid #d9ecfb;
  border-radius: 7px;
  background: #eef7fd;
}

.sale-body {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 10px;
}

.card-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  line-height: 1.3;
  font-weight: 800;
}

.next-collect {
  color: #607c92;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.card-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.include-check {
  display: inline-grid;
  grid-template-columns: 16px auto;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  border: 1px solid #cfe5f8;
  border-radius: 999px;
  background: #f6fbff;
  padding: 4px 8px;
  cursor: pointer;
}

.include-check input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--sky);
}

.include-check span {
  color: var(--deep);
  font-size: 12px;
  font-weight: 800;
}

.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.ok { background: var(--mint); }
.status-dot.warn { background: var(--amber); }
.status-dot.error, .status-dot.ended { background: var(--rose); }

.sale-body h2 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ended-badge {
  justify-self: start;
  border: 1px solid #9fb3c6;
  border-radius: 6px;
  color: #354b61;
  background: #edf3f8;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 800;
}

.card-metrics {
  display: grid;
  grid-template-columns: minmax(90px, .85fr) minmax(132px, 1.15fr);
  gap: 7px;
  align-items: stretch;
}

.sale-number {
  display: grid;
  align-content: center;
  min-width: 0;
  border: 1px solid #d9ecfb;
  border-radius: 7px;
  background: #f7fbff;
  padding: 7px 8px;
  color: var(--deep);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.sale-number small {
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
}

.money-focus {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(179, 106, 0, .22);
  border-radius: 7px;
  background: #fffaf1;
  padding: 7px 8px;
}

.money-focus b {
  overflow: hidden;
  color: var(--amber);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: clamp(14px, 1.35vw, 18px);
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variable-rack {
  display: grid;
  gap: 6px;
}

.delta-chip {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f6fbff;
  padding: 5px 7px;
  color: var(--ink);
}

.delta-chip i {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
}

.delta-chip span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.delta-chip em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.delta-chip b, .delta-chip small {
  min-width: max-content;
  white-space: nowrap;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.delta-chip b {
  color: var(--deep);
}

.delta-chip small {
  color: var(--amber);
}

.delta-chip.up {
  border-color: rgba(28, 159, 117, .35);
  background: #eefbf6;
}

.milestone-panel {
  display: grid;
  gap: 6px;
  border: 1px solid #c8eafa;
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fdff, #edf9ff);
  padding: 6px 8px;
}

.milestone-panel > div:first-child, .milestone-panel p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.milestone-panel span, .milestone-panel small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.milestone-panel b {
  color: var(--deep);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.milestone-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 1px 5px;
  scrollbar-width: thin;
}

.milestone-dot {
  flex: 0 0 13px;
  width: 13px;
  height: 13px;
  border: 2px solid #acdff8;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 0 #d3effb;
}

.milestone-dot.done {
  border-color: #32bd91;
  background: #32bd91;
}

.milestone-dot.next {
  border-color: var(--sky);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(46, 167, 255, .14), 0 2px 0 #b9e6fb;
}

.milestone-panel p {
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
}

.milestone-label {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delta-chip.up b { color: var(--mint); }

.delta-chip.down {
  border-color: rgba(194, 56, 85, .35);
  background: #fff1f4;
}

.delta-chip.down b { color: var(--rose); }

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.mini-grid span {
  min-width: 0;
  border-top: 2px solid #dceefa;
  padding-top: 5px;
}

.mini-grid b, .mini-grid small {
  display: block;
  overflow-wrap: anywhere;
}

.mini-grid b {
  color: var(--ink);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.mini-grid .money-cell b { color: var(--amber); }

.meter {
  height: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eaf6ff;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sky), var(--mint));
}

.sku-live {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow: visible;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.sku-live div, .empty-inline {
  flex: 0 0 90px;
  min-width: 0;
  border: 1px solid #d9ecfb;
  border-radius: var(--radius);
  background: #f9fdff;
  padding: 6px 7px;
}

.sku-live span, .sku-live strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sku-live span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.sku-live strong {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--deep);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.sku-live strong small {
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
}

.record-list { margin-top: 10px; }

.record-row {
  display: grid;
  grid-template-columns: 98px 58px 94px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #d9ecfb;
  font-size: 12px;
}

.record-row.head {
  color: var(--muted);
  font-weight: 800;
}

.record-row strong {
  color: var(--mint);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
}

.record-row div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sku-change {
  display: inline-grid;
  grid-template-columns: minmax(52px, 1fr) auto auto;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border: 1px solid #d7ebfa;
  border-radius: 7px;
  background: #fff;
  padding: 3px 5px;
  line-height: 1.15;
}

.sku-change i, .sku-change b, .sku-change em {
  min-width: 0;
  font-style: normal;
  font-family: "Bahnschrift", "Microsoft JhengHei UI", "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}

.sku-change i {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.sku-change b {
  color: var(--mint);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.sku-change em {
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.empty-change {
  color: var(--muted);
  font-size: 12px;
}

.product-dialog {
  position: fixed;
  inset: 14px;
  z-index: var(--z-modal);
  width: min(860px, calc(100vw - 28px));
  max-height: min(780px, calc(100dvh - 28px));
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  padding: 16px;
}

.period-dialog {
  position: fixed;
  inset: 14px 14px 14px auto;
  z-index: var(--z-modal);
  width: min(560px, calc(100vw - 28px));
  height: calc(100dvh - 28px);
  max-height: none;
  margin: 0;
  border: 1px solid #aee4fb;
  border-radius: 18px;
  background: #f7fdff;
  color: var(--ink);
  padding: 16px;
  box-shadow: 0 24px 70px rgba(8, 58, 101, .24);
}

.product-dialog::backdrop, .period-dialog::backdrop { background: rgba(11, 31, 51, .52); }

.period-dialog-body {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: start;
  height: 100%;
  max-height: calc(100dvh - 60px);
  gap: 10px;
  overflow: hidden;
}

.period-dialog-body header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding-right: 48px;
}

.period-dialog-body .eyebrow {
  color: var(--deep);
  font-weight: 900;
}

.period-dialog-body h2 {
  margin: 0;
  color: var(--navy);
  font-size: 26px;
  line-height: 1.15;
}

.period-dialog .history-tools {
  margin: 0;
}

.period-dialog .detail-list {
  align-content: start;
  grid-auto-rows: max-content;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  padding: 0;
}

.dialog-head {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  padding-right: 48px;
}

.dialog-head img {
  width: 104px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  object-fit: contain;
  color: transparent;
  font-size: 0;
}

.dialog-head h2 {
  margin: 2px 0 8px;
  font-size: 22px;
  line-height: 1.25;
}

.detail-section {
  margin-top: 12px;
  border-top: 1px solid #d9ecfb;
  padding-top: 10px;
}

.detail-section h3 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 15px;
}

.rank-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: center;
  border: 1px solid #d9ecfb;
  border-radius: var(--radius);
  background: #f8fcff;
  padding: 7px 8px;
}

.rank-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row strong, .rank-row b,
.detail-periods strong, .detail-periods b {
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rank-row strong, .detail-periods strong { color: var(--mint); font-weight: 900; }
.rank-row b, .detail-periods b { color: var(--amber); font-weight: 900; }

.detail-periods {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.challenge-detail .detail-periods { gap: 12px; margin-bottom: 12px; }
.challenge-detail .milestone-list { gap: 10px; }

.detail-periods span {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 7px 8px;
}

.detail-periods i {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.detail-periods strong { font-size: 17px; }
.detail-periods b { font-size: 13px; }

.milestone-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.milestone-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border: 1px solid #d9ecfb;
  border-radius: var(--radius);
  background: #f8fcff;
  padding: 7px 8px;
}

.milestone-row span {
  color: var(--deep);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.milestone-row b {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.milestone-row em {
  color: var(--amber);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.milestone-row.done {
  border-color: rgba(28, 159, 117, .25);
  background: #eefbf6;
}

.milestone-row.done em { color: var(--mint); }

.view-tabs {
  position: fixed;
  right: max(16px, calc((100vw - 520px) / 2));
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(16px, calc((100vw - 520px) / 2));
  z-index: 38;
  display: flex;
  min-height: 64px;
  justify-content: center;
  gap: 10px;
  padding: 7px;
  border: 1px solid rgba(126, 202, 246, .72);
  border-radius: 22px;
  background: rgba(250, 254, 255, .92);
  box-shadow: 0 14px 36px rgba(35, 110, 163, .18), inset 0 1px 0 rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px);
}
.view-tabs a {
  display: grid;
  min-width: 0;
  min-height: 50px;
  flex: 1;
  place-items: center;
  gap: 2px;
  padding: 6px 14px 5px;
  border: 1px solid transparent;
  border-radius: 17px;
  background: transparent;
  color: #5a7891;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}
.view-tabs a::before {
  content: "";
  width: 22px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 7px;
  box-shadow: inset 6px -6px 0 rgba(88, 188, 242, .2);
}
.view-tabs a:nth-child(2)::before {
  border-radius: 50%;
  background:
    linear-gradient(currentColor, currentColor) 50% 50% / 2px 14px no-repeat,
    linear-gradient(currentColor, currentColor) 50% 50% / 14px 2px no-repeat;
  box-shadow: none;
}
.view-tabs a.active {
  color: #0b69a7;
  background: linear-gradient(180deg, #e8f8ff, #ffffff);
  border-color: rgba(85, 188, 244, .72);
  box-shadow: 0 6px 16px rgba(52, 169, 235, .16), inset 0 -3px 0 #c7efff;
}
.page-view[hidden] { display: none !important; }
.progress-view { min-height: 100vh; background: linear-gradient(180deg, #dff6ff 0, #f6fcff 360px, #f9fdff 100%); }
.progress-hero { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: end; padding: 34px max(24px, calc((100vw - 1440px) / 2)) 24px; border-bottom: 1px solid rgba(12, 87, 148, .12); background: rgba(255, 255, 255, .38); backdrop-filter: blur(14px); }
.progress-hero > p:last-child { max-width: 360px; margin: 0; padding: 13px 16px; border: 1px solid #b9e4fa; border-radius: 8px; background: rgba(255,255,255,.72); color: #587389; box-shadow: 0 8px 22px rgba(46,167,255,.12); }
.progress-main { max-width: 1440px; margin: auto; padding: 24px; }
.progress-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr)) minmax(280px, 2fr);
  gap: 10px;
  margin-bottom: 16px;
}
.progress-overview article, .progress-stage-strip {
  min-width: 0;
  border: 1px solid #c3e4f7;
  border-radius: 8px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 5px 0 #d8f1fc;
}
.progress-overview article { padding: 13px 15px; }
.progress-overview span { color: #587389; font-size: 12px; font-weight: 800; }
.progress-overview strong { display: block; margin-top: 3px; color: #0b5f99; font-size: 28px; line-height: 1; }
.progress-stage-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; }
.progress-stage-strip span { display: grid; align-content: center; gap: 2px; min-height: 48px; padding: 8px 10px; background: rgba(242,250,255,.82); }
.progress-stage-strip b { color: #0b5f99; font-size: 18px; line-height: 1; }
.progress-wall { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.progress-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; min-width: 0; padding: 12px; background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(241,250,255,.92)); border: 1px solid #b9ddf2; border-radius: 8px; box-shadow: 0 5px 0 #d8f1fc, 0 14px 30px rgba(16,78,122,.08); cursor: pointer; }
.progress-card:hover { transform: translateY(-2px); border-color: #70c7f2; }
.progress-card > img, .progress-placeholder { width: 96px; aspect-ratio: 1; object-fit: contain; border: 1px solid #c9eafa; border-radius: 7px; background: #e4f6ff; }
.progress-placeholder { display: grid; place-items: center; color: #1585c2; font-size: 34px; font-weight: 800; }
.progress-card-body { display: grid; min-width: 0; align-content: start; gap: 7px; }
.progress-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.progress-card-head small { color: #6d8294; white-space: nowrap; }
.stage-tag { display: inline-flex; padding: 3px 8px; color: #17648e; background: #e2f6ff; border: 1px solid #a9def6; border-radius: 999px; font-size: 12px; font-weight: 700; }
.progress-card h2 { margin: 0; overflow: hidden; color: #173f5d; font-size: 18px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.progress-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.progress-grid i { height: 10px; border: 1px solid #c7e5f6; border-radius: 999px; background: #f2f8fc; }
.progress-grid i.done { border-color: #38bce9; background: linear-gradient(180deg, #61d6ff, #22aee5); box-shadow: inset 0 -2px 0 rgba(7, 91, 150, .15); }
.progress-card p { display: -webkit-box; min-height: 38px; margin: 0; overflow: hidden; color: #4f6879; font-size: 13px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.progress-card small { color: #8799a5; font-size: 11px; }
.progress-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 4px; border-top: 1px solid #d9edf8; }
.progress-card-foot span { color: #6f8799; font-size: 12px; font-weight: 800; }
.progress-card-foot b { color: #0b6fa9; font-size: 12px; }
.progress-dialog { width: min(680px, calc(100% - 24px)); max-height: min(760px, calc(100dvh - 24px)); padding: 24px; border: 1px solid #9dd8f7; border-radius: 8px; }
.progress-dialog::backdrop { background: rgba(17, 56, 80, .52); }
.progress-detail-head { display: flex; align-items: center; gap: 16px; padding-right: 56px; }
.progress-detail-head img { width: 84px; aspect-ratio: 1; object-fit: contain; border-radius: 7px; }
.progress-detail-head h2 { margin: 7px 0 2px; color: #123f60; font-size: 25px; }
.progress-detail-head strong { color: #0872b5; font-size: 28px; }
#progress-dialog-body > .progress-grid { margin: 18px 0 24px; }
.progress-timeline { max-height: 430px; overflow: auto; border-top: 1px solid #d8ebf5; }
.progress-timeline h3 { position: sticky; top: 0; margin: 0; padding: 16px 0 10px; background: #fff; color: #244d68; }
.progress-timeline article { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px dashed #dbe9f0; }
.progress-timeline time { color: #708897; font-size: 12px; }
.progress-timeline b { color: #12689a; }
.progress-timeline p { margin: 4px 0 0; color: #405b6c; white-space: pre-wrap; }
.progress-admin-view { min-height: 100vh; background: #f4fbff; }
.progress-admin-shell { align-items: start; }
.progress-update-admin { margin-top: 14px; }
.progress-update-edit {
  display: grid;
  grid-template-columns: 150px minmax(110px, 150px) minmax(0, 1fr) 76px 76px;
  gap: 8px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid #dcecf6;
}
.progress-update-edit time { color: var(--muted); font-size: 12px; font-weight: 800; }
.progress-update-edit textarea { min-height: 58px; }

@media (max-width: 1100px) { .progress-wall { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .view-tabs {
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 10px;
    min-height: 62px;
    padding: 6px;
    border-radius: 20px;
  }
  .view-tabs a { min-height: 50px; padding: 5px 8px; font-size: 12px; }
  .view-tabs a::before { width: 20px; height: 20px; }
  .progress-hero { grid-template-columns: 1fr; padding: 22px 14px; }
  .progress-hero h1 { font-size: 32px; }
  .progress-main { padding: 10px; }
  .progress-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .progress-stage-strip { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .progress-overview article { padding: 9px 10px; }
  .progress-overview strong { font-size: 22px; }
  .progress-wall { gap: 9px; }
  .progress-card { grid-template-columns: 72px minmax(0, 1fr); padding: 9px; }
  .progress-card > img, .progress-placeholder { width: 72px; }
  .progress-placeholder { font-size: 22px; }
  .progress-card-head { min-height: 24px; }
  .progress-card h2 { font-size: 14px; }
  .progress-card p { min-height: 34px; font-size: 12px; }
  .progress-timeline article { grid-template-columns: 1fr; gap: 3px; }
  .progress-update-edit { grid-template-columns: 1fr 1fr; }
  .progress-update-edit textarea { grid-column: 1 / -1; }
}

.admin-page {
  background:
    linear-gradient(180deg, rgba(226, 244, 255, .76), rgba(247, 251, 255, 0) 320px),
    #f4f8fb;
}

.admin-head {
  align-items: center;
  border-bottom-color: rgba(12, 87, 148, .12);
}

.admin-head h1 {
  margin-bottom: 2px;
  color: #103d63;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: .02em;
}

.admin-head small {
  color: var(--muted);
  font-size: 14px;
}

.admin-public-link {
  display: inline-grid;
  min-height: 40px;
  place-items: center;
  border-color: #b9dbf4;
  background: #fff;
  color: var(--deep);
  padding: 0 14px;
  font-weight: 800;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  align-items: start;
  gap: 16px;
}

.panel { padding: 14px; }

.editor-panel, .list-panel {
  border-color: rgba(46, 167, 255, .2);
  background: rgba(255, 255, 255, .9);
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-title.compact {
  margin-bottom: 0;
}

.section-title h2 {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
  line-height: 1.2;
}

.section-title small {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.parse-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
  align-items: end;
}

.parse-url-field { display: grid; gap: 4px; }
.status-line { min-height: 20px; margin: 8px 0 0; }

.batch-box {
  margin-top: 10px;
  border: 1px solid #d9ecfb;
  border-radius: var(--radius);
  background: #fbfeff;
  padding: 8px 10px 10px;
}

.batch-box summary {
  color: var(--deep);
  cursor: pointer;
  font-weight: 800;
}

.batch-box label { margin-top: 8px; }
.batch-box textarea {
  min-height: 118px;
  background: #fff;
  line-height: 1.45;
}
.batch-box button { margin-top: 8px; min-height: 38px; }

.editor {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 14px;
}

.editor[hidden] { display: none; }

.draft-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.draft-wide {
  grid-column: 1 / -1;
}

.draft-wide textarea {
  min-height: 86px;
  line-height: 1.45;
}

label { display: grid; gap: 4px; }

.checkline {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  align-content: center;
  gap: 8px;
  padding-top: 18px;
}

.checkline input { width: 18px; height: 18px; min-height: 18px; }

.draft-skus {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sku-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fcff;
  padding: 9px;
}

.draft-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-title h2 { margin: 0; font-size: 18px; }
.panel-title small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.panel-title div { display: flex; gap: 6px; flex-wrap: wrap; justify-content: end; }
.panel-title > div:first-child { display: block; }
.panel-title button { min-height: 34px; padding-block: 5px; background: #fff; color: var(--ink); }

.batch-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.batch-actions button {
  min-height: 34px;
  padding: 5px 7px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.batch-actions .danger {
  border-color: rgba(194, 56, 85, .35);
  background: #fff3f6;
  color: var(--rose);
}

.event-list { display: grid; gap: 8px; }

.event-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid #d9ecfb;
  border-radius: var(--radius);
  background: #fff;
  padding: 8px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.event-item:hover {
  border-color: rgba(46, 167, 255, .48);
  box-shadow: 0 8px 18px rgba(16, 78, 122, .07);
}

.event-item.is-hidden {
  border-color: #d7e2ec;
  background: #f5f8fb;
  opacity: .76;
}

.event-item.is-hidden .event-copy b {
  color: var(--muted);
}

.event-item[draggable="true"] { cursor: grab; }
.event-item[draggable="true"]:active { cursor: grabbing; }

.event-pick {
  display: grid;
  min-height: 34px;
  place-items: center;
}

.event-pick input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--sky);
}

.event-copy {
  min-width: 0;
}

.event-copy b, .event-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-copy b {
  color: var(--navy);
  font-size: 14px;
  line-height: 1.35;
}

.progress-admin-view .event-copy b {
  display: -webkit-box;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.event-copy span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.event-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 38px 38px repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.progress-admin-view .event-actions {
  grid-template-columns: 44px 44px minmax(76px, 1fr) minmax(76px, 1fr);
}

.event-item button {
  min-height: 34px;
  border-color: #c5e1f6;
  background: #f7fbff;
  color: var(--deep);
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.event-item button:hover {
  border-color: var(--sky);
  background: #edf8ff;
}

.event-item button.danger {
  border-color: rgba(194, 56, 85, .35);
  background: #fff3f6;
  color: var(--rose);
}

.event-item button.danger:hover {
  border-color: var(--rose);
  background: #ffe8ee;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
}

.empty.small { margin: 0; }

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

@media (min-width: 1500px) {
  .product-wall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .dashboard-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-tools { grid-template-columns: 1fr; }
  .product-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-shell { grid-template-columns: 1fr; }
  .draft-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .hero, .admin-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .summary-card { grid-template-columns: minmax(0, 1fr) auto; }
  .period-summary { grid-column: 1 / -1; }
  .period-dialog {
    inset: auto 8px 8px;
    width: calc(100vw - 16px);
    height: auto;
    max-height: min(78dvh, 720px);
    border-radius: 18px 18px 12px 12px;
    padding: 12px;
  }
  .period-dialog-body { max-height: calc(78dvh - 24px); }
  .period-dialog .detail-list { max-height: none; }
  .parse-line, .draft-skus, .sku-edit { grid-template-columns: 1fr; }
  .detail-list, .product-wall { grid-template-columns: 1fr; }
  .sale-card { grid-template-columns: 96px minmax(0, 1fr); min-height: 0; }
  .sale-card img { width: 76px; height: 76px; min-height: 76px; }
  .card-metrics { grid-template-columns: minmax(0, .85fr) minmax(128px, 1fr); }
  .sale-number { font-size: 30px; }
  .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sku-live {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .sku-live div { flex-basis: 92px; }
  .record-row { grid-template-columns: 82px 48px 76px minmax(0, 1fr); }
  .dialog-head { grid-template-columns: 74px minmax(0, 1fr); }
  .dialog-head img { width: 74px; }
  .rank-list, .detail-periods, .milestone-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Notification preferences reuse the compact project-card rhythm. */
.push-dialog {
  width: min(520px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  border: 1px solid #9dd8f7;
  border-radius: 10px;
  padding: 22px;
}

.push-dialog::backdrop { background: rgba(17, 56, 80, .52); }
.push-dialog form { display: grid; gap: 12px; }
.push-dialog header { padding-right: 48px; }
.push-dialog h2 { margin: 3px 0; color: #0f4773; font-size: 24px; }
.push-dialog header small { color: #688095; }
.push-all,
.push-projects label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  border: 1px solid #d6e6ef;
  border-radius: 8px;
  padding: 8px 10px;
  color: #294b60;
  font-weight: 800;
}

.push-projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 42dvh; overflow-y: auto; }
.push-projects label:has(input:checked), .push-all:has(input:checked) { border-color: #73c4e5; background: #eef9fd; }
.push-projects input:disabled + span { color: #91a2ae; }
.push-all input,
.push-projects input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  padding: 0;
  accent-color: #0872b5;
}
.push-actions { display: flex; justify-content: flex-end; gap: 8px; }
.progress-follow { margin-left: auto; white-space: nowrap; }

.admin-health {
  width: min(1180px, calc(100% - 28px));
  margin: 12px auto 0;
  border: 1px solid #b9dfd2;
  border-radius: 10px;
  background: #f2fbf7;
  padding: 10px 12px;
}

.admin-health.has-issues { border-color: #efd097; background: #fff9e9; }
.admin-health-head,
.admin-health-issues article { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-health-head span,
.admin-health-issues span { display: grid; min-width: 0; gap: 2px; }
.admin-health small { color: #688095; }
.admin-health-detail { margin-top: 7px; border-top: 1px solid #eadfbe; padding-top: 6px; }
.admin-health-detail summary { width: fit-content; color: #176f99; font-size: 12px; font-weight: 800; cursor: pointer; }
.admin-health-issues { display: grid; gap: 6px; margin-top: 6px; }
.admin-health-issues article { min-height: 38px; }

.progress-update-new .checkline { min-height: 38px; margin: 0; }

@media (max-width: 600px) {
  .push-projects { grid-template-columns: 1fr; }
  .progress-detail-head { flex-wrap: wrap; }
  .progress-follow { margin-left: 0; }
  .admin-health-head, .admin-health-issues article { align-items: flex-start; }
}

.progress-admin-view .event-item {
  grid-template-columns: minmax(0, 1fr);
}

.progress-admin-view .event-copy b {
  overflow-wrap: anywhere;
  text-overflow: clip;
  -webkit-line-clamp: unset;
}

.progress-update-new {
  border-color: #a9d9ee;
  background: #f2fbff;
}

.progress-node-row {
  grid-template-columns: minmax(100px, 1fr) 120px;
}

.progress-node-row strong {
  color: var(--navy);
  font-size: 14px;
}

.progress-update-new {
  grid-template-columns: 110px minmax(0, 1fr) 72px;
}

.progress-update-edit:not(.progress-update-new) {
  grid-template-columns: 140px minmax(0, 1fr) 72px 72px;
}

.progress-grid i.active {
  background: #f0bd57;
}

.stage-tag.project-active-tag {
  border-color: #add8ec;
  background: #eef9fd;
  color: #187ca5;
}

.progress-stage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.progress-stage-filter {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: none;
}

.progress-stage-filter::-webkit-scrollbar { display: none; }

.progress-stage-filter button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid #c5dfed;
  border-radius: 7px;
  background: #fff;
  color: #527187;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.progress-stage-filter button.active {
  border-color: #65bce4;
  background: #e8f6fc;
  color: #08689f;
}

@media (max-width: 520px) {
  main { width: min(100% - 16px, 1240px); }
  .hero { gap: 10px; padding-block: 18px 16px; }
  .hero-copy h1 { font-size: 34px; }
  .hero-meta { gap: 5px; margin-top: 7px; }
  .hero-meta small, .hero-meta span { min-height: 26px; font-size: 11px; }
  .overview-panel { border-radius: 12px; padding: 8px; }
  .admin-head { gap: 10px; padding-block: 16px; }
  .admin-head h1 { font-size: 30px; }
  .admin-public-link { min-height: 38px; }
  .admin-shell { gap: 10px; }
  .editor-panel, .list-panel { padding: 10px; }
  .section-title { align-items: start; margin-bottom: 8px; }
  .section-title small { text-align: left; }
  .parse-line { gap: 7px; }
  .parse-line button { min-height: 40px; }
  .batch-box { margin-top: 8px; padding: 7px 9px; }
  .dashboard-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-bottom: 8px; }
  .product-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric-card { min-height: 86px; padding: 11px 12px; }
  .metric-value { font-size: 23px; }
  .summary-card { gap: 7px; min-height: 48px; padding: 7px 8px 8px 10px; }
  .summary-card b, .selection-actions b { font-size: 14px; }
  .summary-card small, .selection-actions small { font-size: 10px; }
  .period-summary span { padding: 3px 7px; }
  .period-summary b { font-size: 13px; }
  .summary-details summary { min-height: 44px; padding: 6px 8px 6px 10px; }
  .summary-details summary span, .selection-actions b { font-size: 14px; }
  .summary-details summary small, .selection-actions small { font-size: 10px; }
  .summary-details summary::after { padding: 2px 7px; font-size: 11px; }
  .selection-actions { min-height: 44px; padding: 6px 7px 6px 10px; }
  .selection-actions button { min-height: 34px; padding: 4px 9px; }
  .sale-card { grid-template-columns: 1fr; }
  .sale-card img { width: 58px; height: 58px; min-height: 58px; margin: 8px 0 0 8px; }
  .sale-body { gap: 6px; padding: 7px 8px 8px; }
  .card-topline { position: absolute; top: 8px; right: 8px; left: 74px; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
  .card-kicker { font-size: 11px; }
  .include-check { min-height: 30px; padding: 3px 6px; }
  .include-check span { font-size: 11px; }
  .sale-body h2 {
    min-height: 36px;
    margin-top: -2px;
    font-size: 13px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .card-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .sale-number { padding: 6px 7px; font-size: 22px; }
  .variable-rack { grid-template-columns: 1fr; }
  .mini-grid { grid-template-columns: 1fr; gap: 4px; }
  .mini-grid span { padding-top: 4px; }
  .delta-chip { grid-template-columns: 46px minmax(0, 1fr) minmax(0, 1fr); gap: 4px; padding: 5px; }
  .delta-chip i, .delta-chip em { font-size: 10px; }
  .delta-chip b, .delta-chip small { font-size: 12px; }
  .money-focus { display: grid; gap: 2px; }
  .money-focus { padding: 6px 7px; }
  .money-focus b { font-size: 13px; }
  .milestone-panel { gap: 4px; padding: 5px 6px; }
  .milestone-panel > div:first-child {
    display: grid;
    grid-template-columns: auto auto;
    gap: 2px 6px;
  }
  .milestone-panel > div:first-child > span { display: none; }
  .milestone-panel b { font-size: 12px; }
  .milestone-panel small { font-size: 10px; }
  .milestone-panel p { font-size: 11px; }
  .milestone-dots { gap: 5px; padding-bottom: 3px; }
  .milestone-dot { flex-basis: 11px; width: 11px; height: 11px; }
  .sku-live {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .sku-live div { flex: 0 0 74px; padding: 5px 6px; }
  .sku-live span { font-size: 10px; }
  .sku-live strong { gap: 3px; font-size: 15px; }
  .sku-live strong small { font-size: 10px; }
  .day-heatmap { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .period-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-tools label { grid-column: 1 / -1; }
  .selection-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .selection-actions span { grid-column: 1 / -1; }
  .selection-actions button { min-width: 0; }
  .period-card header { grid-template-columns: 1fr auto; }
  .period-card header b { grid-column: 2; }
  .rank-list { grid-template-columns: 1fr; }
  .record-row {
    grid-template-columns: 1fr 48px 70px;
    font-size: 11px;
  }
  .record-row.head span:last-child, .record-row div { grid-column: 1 / -1; }
  .draft-grid { grid-template-columns: 1fr; }
  .panel-title { display: grid; grid-template-columns: 1fr; }
  .panel-title div { justify-content: start; }
  .event-item { grid-template-columns: 22px minmax(0, 1fr); gap: 6px; padding: 7px; }
  .event-pick { min-height: 28px; }
  .event-copy b { font-size: 13px; }
  .event-actions {
    grid-column: 2;
    grid-template-columns: 32px 32px 46px 54px;
    justify-content: start;
    gap: 5px;
  }
  .event-item button {
    min-height: 32px;
    padding: 4px 6px;
    font-size: 12px;
  }
}

/* Period dashboard: 4 radial gauges, relative to the strongest time window. */
.period-summary {
  display: grid;
  grid-template-columns: repeat(4, 74px);
  justify-content: start;
  gap: 8px;
  overflow: visible;
}

.period-summary .period-orb {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  gap: 1px;
  width: 74px;
  height: 74px;
  isolation: isolate;
  border: 0;
  border-radius: 50%;
  background: conic-gradient(#42b8d9 calc(var(--p) * 1%), #e4eff5 0);
  padding: 8px;
  text-align: center;
}

.period-summary .period-orb::before {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: -1;
  border-radius: 50%;
  background: #fff;
}

.period-summary .period-orb i,
.period-summary .period-orb b,
.period-summary .period-orb em {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.period-summary .period-orb i {
  color: #526f83;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.05;
}

.period-summary .period-orb b {
  color: #16936f;
  font-size: 14px;
  line-height: 1;
}

.period-summary .period-orb em {
  color: #a86700;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

@media (max-width: 760px) {
  .period-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px;
  }
  .period-summary .period-orb {
    width: 100%;
    max-width: 70px;
    height: auto;
    aspect-ratio: 1;
    justify-self: center;
    padding: 7px;
  }
  .period-summary .period-orb i,
  .period-summary .period-orb em {
    font-size: 9px;
  }
  .period-summary .period-orb b {
    font-size: 13px;
  }
}

/* Flat UI correction: no raised buttons, no horizontal progress lanes. */
:root {
  --ink: #12263a;
  --muted: #64788b;
  --line: #d5e6f0;
  --paper: #f7fbfd;
  --panel: #ffffff;
  --sky: #4aaed8;
  --sky-soft: #edf8fc;
  --deep: #246f96;
  --navy: #183b56;
  --cyan: #58bfd0;
  --mint: #1f9d7a;
  --amber: #a86700;
  --rose: #c94b62;
  --shadow: 0 10px 28px rgba(31, 91, 128, .08);
  --radius: 12px;
}

body {
  background: linear-gradient(180deg, #f2fbff 0, #f8fbfd 340px, #f7fafc 100%);
  font-family: "Inter", "Noto Sans SC", "HarmonyOS Sans SC", "Microsoft JhengHei UI", "Microsoft YaHei UI", "Segoe UI", sans-serif;
}

button, a {
  border-color: #bfd9e8;
  border-radius: 10px;
  background: #fff;
  color: var(--deep);
  box-shadow: none;
}

button:hover, a:hover {
  border-color: #8fc7df;
  background: #f1f9fc;
  color: #164e70;
}

button:active, a:active { transform: none; }

button.danger {
  border-color: #efb7c3;
  background: #fff7f8;
  color: var(--rose);
}

input, select, textarea {
  border-radius: 10px;
  background: #fff;
}

.public-page .hero, .admin-head, .progress-hero {
  background: linear-gradient(180deg, #eefaff, #f8fcfe);
  box-shadow: none;
}

.hero-copy .eyebrow, .progress-hero .eyebrow, .admin-head .eyebrow,
.hero-meta small, .hero-meta span {
  border-color: #cfe5f2;
  background: #fff;
  box-shadow: none;
}

.overview-panel, .panel, .period-dialog, .product-dialog, .progress-dialog,
.metric-card, .summary-card, .selection-actions, .progress-overview-copy, .progress-overview article, .progress-stage-strip,
.event-item, .progress-card {
  border-color: var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.dashboard-strip, .overview-tools {
  background: transparent;
  gap: 10px;
  padding: 0;
}

.metric-card {
  min-height: 98px;
}

.metric-card::before {
  left: 12px;
  background: var(--sky);
}

.summary-card button, .selection-actions button, .history-tools button,
.event-item button, .batch-actions button, .panel-title button {
  border-color: #c8dfec;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.view-tabs {
  min-height: 58px;
  border-color: #d2e4ee;
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 24px rgba(31, 91, 128, .12);
}

.view-tabs a {
  min-height: 44px;
  border-radius: 12px;
}

.view-tabs a::before {
  display: none;
}

.view-tabs a.active {
  border-color: #a7d4e8;
  background: #eaf7fc;
  box-shadow: none;
}

.progress-view {
  background: linear-gradient(180deg, #f2fbff 0, #f8fbfd 340px, #f7fafc 100%);
}

.progress-main {
  max-width: 1240px;
}

.progress-overview {
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(120px, .5fr)) minmax(0, 1.5fr);
}

.progress-stage-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px;
}

.progress-stage-strip button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border-color: #cde5f1;
  border-radius: 999px;
  background: #f8fcfe;
  color: #496b80;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
}

.progress-stage-strip button.active {
  border-color: #8fc7df;
  background: #e7f6fb;
  color: #165b7f;
}

.progress-stage-strip i {
  font-style: normal;
}

.progress-stage-strip b {
  color: inherit;
  font-size: 13px;
}

.progress-wall {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  overflow: visible;
  padding: 0;
}

.progress-lane {
  display: contents;
}

.progress-card {
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  cursor: pointer;
}

.progress-card:hover {
  border-color: #a7d4e8;
  transform: none;
  box-shadow: var(--shadow);
}

.progress-card > img, .progress-placeholder {
  width: 70px;
  border-color: #d7e8f1;
  border-radius: 10px;
  background: #f3f9fc;
}

.progress-card h2 {
  font-size: 15px;
  line-height: 1.35;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.progress-card p {
  min-height: 36px;
}

.stage-tag {
  border-color: #c7e1ee;
  border-radius: 999px;
  background: #eef8fb;
  color: #226f91;
}

.progress-grid {
  gap: 4px;
}

.progress-grid i {
  height: 7px;
  border: 0;
  border-radius: 999px;
  background: #e3edf3;
}

.progress-grid i.done {
  background: #48afd5;
  box-shadow: none;
}

.admin-shell {
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
}

.list-panel {
  max-height: calc(100dvh - 118px);
}

.event-item {
  background: #fff;
  box-shadow: none;
}

.event-item.active {
  border-color: #7fc1dc;
  background: #eef8fc;
  box-shadow: inset 3px 0 0 #4aaed8;
}

.progress-update-edit {
  border-color: var(--line);
  border-radius: 12px;
  background: #fff;
}

@media (max-width: 1180px) {
  .progress-wall {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .progress-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .progress-overview-copy, .progress-stage-strip {
    grid-column: 1 / -1;
  }
  .progress-stage-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .progress-stage-strip button {
    justify-content: center;
    min-width: 0;
    padding: 5px 6px;
  }
  .progress-wall {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    scroll-snap-type: none;
  }
  .progress-card {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 8px;
  }
  .progress-card > img, .progress-placeholder {
    width: 58px;
  }
  .progress-card-head {
    align-items: start;
  }
  .progress-card-head small {
    display: none;
  }
  .progress-card h2 {
    min-height: 38px;
    font-size: 13px;
  }
  .progress-card p {
    min-height: 34px;
    font-size: 12px;
  }
  .progress-card-foot {
    font-size: 11px;
  }
}

@media (max-width: 520px) {
  .progress-overview {
    gap: 8px;
  }
  .progress-stage-strip {
    gap: 6px;
    padding: 8px;
  }
  .progress-stage-strip button {
    font-size: 11px;
  }
  .admin-shell {
    width: min(100% - 16px, 1240px);
  }
}

/* Unified shell refresh: light mini-app style, kept after legacy rules by design. */
:root {
  --ink: #102842;
  --muted: #638197;
  --line: #cfe9fb;
  --paper: #f2fbff;
  --panel: #ffffff;
  --sky: #62c7ff;
  --sky-soft: #eaf8ff;
  --deep: #1474ae;
  --navy: #113f67;
  --cyan: #41c6d8;
  --mint: #20aa82;
  --amber: #b86f00;
  --rose: #d44868;
  --shadow: 0 14px 34px rgba(43, 132, 183, .12);
}

body {
  background:
    radial-gradient(circle at 12% 0, rgba(139, 219, 255, .42), transparent 260px),
    linear-gradient(180deg, #ecfaff 0, #f8fdff 460px, #f7fbff 100%);
  font-family: "Noto Sans SC", "HarmonyOS Sans SC", "Microsoft JhengHei UI", "Microsoft YaHei UI", "Segoe UI", sans-serif;
}

button, a, input, select, textarea { border-radius: 14px; }

button {
  border-color: #98d7f8;
  background: linear-gradient(180deg, #ffffff, #e6f7ff);
  color: var(--deep);
  font-weight: 900;
  box-shadow: 0 4px 0 #bfeaff;
}

button:hover, a:hover {
  border-color: #70c9f7;
  background: linear-gradient(180deg, #f8fdff, #dff4ff);
  color: var(--navy);
}

button.danger {
  border-color: #f0a9ba;
  background: linear-gradient(180deg, #fff7f9, #ffe8ef);
  color: var(--rose);
}

input, select, textarea {
  border-color: #c8e8fa;
  background: #fbfeff;
}

.public-page .hero, .admin-head, .progress-hero {
  border-bottom: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(224,247,255,.84)),
    linear-gradient(90deg, rgba(98,199,255,.18), rgba(65,198,216,.12));
  box-shadow: 0 18px 42px rgba(58, 153, 207, .14);
}

.hero-copy .eyebrow, .progress-hero .eyebrow, .admin-head .eyebrow {
  border-color: #b9e7fb;
  background: #fff;
  color: #1681bd;
  box-shadow: 0 4px 0 #d8f3ff;
}

.hero-copy h1, .progress-hero h1, .admin-head h1 {
  color: #0f4773;
  letter-spacing: 0;
}

.hero-copy h1::before {
  background: linear-gradient(180deg, #48c4ff, #27b7cb);
}

.overview-panel, .panel, .period-dialog, .product-dialog, .progress-dialog {
  border-color: #bde6fb;
  border-radius: 22px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 14px 34px rgba(43, 132, 183, .12), inset 0 1px 0 rgba(255,255,255,.95);
}

.dashboard-strip {
  border: 0;
  border-radius: 18px;
  background: transparent;
  gap: 10px;
  overflow: visible;
}

.metric-card {
  min-height: 104px;
  border: 1px solid #d2edfb;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f4fbff);
  box-shadow: 0 8px 0 #dff4ff;
}

.metric-card::before {
  inset: 12px auto 12px 12px;
  width: 5px;
  background: linear-gradient(180deg, #62c7ff, #3ac5d5);
}

.overview-tools {
  border-radius: 20px;
  background: linear-gradient(135deg, #dff5ff, #f4fcff);
  gap: 10px;
  padding: 8px;
}

.summary-card, .selection-actions {
  border: 1px solid #d3edfb;
  border-radius: 18px;
  box-shadow: 0 6px 0 #e0f5ff;
}

.summary-card button, .selection-actions button, .history-tools button {
  border-radius: 14px;
}

.view-tabs {
  border-radius: 26px;
  background: rgba(255,255,255,.94);
}

.view-tabs a {
  border-radius: 20px;
}

.view-tabs a.active {
  color: #0b6fa9;
  background: linear-gradient(180deg, #def5ff, #ffffff);
  box-shadow: 0 7px 18px rgba(83, 181, 236, .18), inset 0 -4px 0 #bdeaff;
}

.progress-view {
  background:
    radial-gradient(circle at 88% 12%, rgba(130, 220, 255, .35), transparent 230px),
    linear-gradient(180deg, #ecfaff 0, #f8fdff 460px, #f7fbff 100%);
}

.progress-hero {
  align-items: center;
  padding: 26px max(16px, calc((100vw - 1240px) / 2)) 22px;
}

.progress-hero .eyebrow {
  justify-self: start;
  width: fit-content;
}

.progress-hero > p:last-child {
  border-radius: 20px;
  border-color: #bde6fb;
  background: rgba(255,255,255,.86);
  color: #57788f;
  box-shadow: 0 8px 0 #dff4ff;
}

.progress-main {
  max-width: 1240px;
}

.progress-overview {
  grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(120px, .55fr)) minmax(320px, 1.5fr);
  gap: 10px;
}

.progress-overview-copy, .progress-overview article, .progress-stage-strip {
  min-width: 0;
  border: 1px solid #cceafb;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff, #f4fbff);
  box-shadow: 0 8px 0 #dff4ff;
}

.progress-overview-copy {
  padding: 15px 18px;
}

.progress-overview-copy span, .progress-overview article span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.progress-overview-copy small {
  color: var(--muted);
  font-weight: 800;
}

.progress-stage-strip {
  border-radius: 20px;
}

.progress-stage-strip span {
  background: rgba(246,252,255,.9);
}

.progress-wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  align-items: start;
  gap: 12px;
}

.progress-lane {
  min-width: 0;
  border: 1px solid #bfe7fb;
  border-radius: 22px;
  background: rgba(255,255,255,.78);
  padding: 10px;
  box-shadow: 0 10px 28px rgba(43, 132, 183, .1);
}

.progress-lane header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  padding: 4px 4px 8px;
  border-bottom: 1px dashed #cfeafb;
}

.progress-lane header span {
  color: #0f5f96;
  font-size: 15px;
  font-weight: 900;
}

.progress-lane header b {
  min-width: 28px;
  border: 1px solid #bfe7fb;
  border-radius: 999px;
  background: #eef9ff;
  color: #0f6fa8;
  text-align: center;
}

.progress-lane > div {
  display: grid;
  gap: 9px;
}

.progress-card {
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  border-color: #cceafb;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff, #f4fbff);
  box-shadow: 0 5px 0 #e0f5ff;
}

.progress-card > img, .progress-placeholder {
  width: 76px;
  border-radius: 16px;
}

.progress-card h2 {
  color: #143d5e;
  font-size: 16px;
}

.stage-tag {
  border-color: #b9e7fb;
  background: #eaf8ff;
  color: #1474ae;
}

.progress-grid i {
  border-color: #cae9fa;
  background: #f7fcff;
}

.progress-grid i.done {
  border-color: #51c5f5;
  background: linear-gradient(180deg, #83dcff, #40bff2);
}

.progress-dialog {
  border-radius: 24px;
}

.progress-timeline {
  border-top-color: #d4edfb;
}

.progress-timeline h3 {
  background: #fff;
  color: #13476e;
}

.admin-page {
  background:
    radial-gradient(circle at 8% 0, rgba(135, 220, 255, .38), transparent 260px),
    linear-gradient(180deg, #eefaff 0, #f7fcff 360px, #f7fbff 100%);
}

.admin-shell {
  grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
  max-width: 1240px;
}

.editor-panel {
  grid-column: 2;
  grid-row: 1;
}

.list-panel {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 14px;
  max-height: calc(100dvh - 112px);
  overflow: auto;
}

.progress-admin-shell .editor-panel {
  grid-column: 2;
}

.progress-admin-shell .list-panel {
  grid-column: 1;
}

.section-title h2, .panel-title h2 {
  color: #0f4773;
  font-size: 20px;
}

.list-search {
  margin: 0 0 10px;
}

.list-search input {
  min-height: 40px;
}

.event-item {
  border-color: #d2edfb;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f7fcff);
  box-shadow: 0 5px 0 #e7f7ff;
}

.event-item.active {
  border-color: #68c8f8;
  background: #eef9ff;
  box-shadow: 0 0 0 3px rgba(98, 199, 255, .18), 0 5px 0 #bfeaff;
}

.event-actions {
  grid-template-columns: 36px 36px repeat(3, minmax(58px, 1fr));
}

.progress-admin-view .event-actions {
  grid-template-columns: 36px 36px minmax(64px, 1fr) minmax(64px, 1fr);
}

.progress-update-edit {
  border: 1px solid #d2edfb;
  border-radius: 18px;
  background: #f8fdff;
  padding: 10px;
}

@media (max-width: 1180px) {
  .progress-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .progress-overview-copy, .progress-stage-strip {
    grid-column: 1 / -1;
  }
  .progress-wall {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 1080px) {
  .admin-shell, .progress-admin-shell {
    grid-template-columns: 1fr;
  }
  .editor-panel, .list-panel, .progress-admin-shell .editor-panel, .progress-admin-shell .list-panel {
    grid-column: 1;
    grid-row: auto;
  }
  .list-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .progress-hero {
    grid-template-columns: 1fr;
    padding: 20px 12px 16px;
  }
  .progress-main {
    padding: 10px;
  }
  .progress-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .progress-overview-copy, .progress-stage-strip {
    grid-column: 1 / -1;
  }
  .progress-wall {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
  }
  .progress-lane {
    flex: 0 0 min(82vw, 330px);
    scroll-snap-align: start;
  }
  .progress-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .progress-card > img, .progress-placeholder {
    width: 64px;
  }
  .progress-dialog {
    inset: auto 8px 8px;
    width: calc(100vw - 16px);
    max-height: min(82dvh, 720px);
    border-radius: 22px 22px 14px 14px;
    padding: 14px;
  }
  .progress-detail-head {
    gap: 10px;
    padding-right: 48px;
  }
  .progress-detail-head img {
    width: 64px;
  }
  .progress-timeline {
    max-height: 48dvh;
  }
  .admin-shell {
    width: min(100% - 16px, 1240px);
  }
  .panel {
    border-radius: 20px;
  }
}

@media (max-width: 520px) {
  .dashboard-strip {
    gap: 7px;
  }
  .metric-card {
    min-height: 84px;
    border-radius: 16px;
    box-shadow: 0 5px 0 #dff4ff;
  }
  .overview-tools {
    border-radius: 18px;
    padding: 7px;
  }
  .summary-card, .selection-actions {
    border-radius: 16px;
  }
  .progress-overview article, .progress-overview-copy {
    padding: 10px 11px;
  }
  .progress-overview-copy strong, .progress-overview strong {
    font-size: 24px;
  }
  .progress-stage-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .progress-stage-strip span {
    min-height: 44px;
    padding: 7px;
  }
  .progress-card h2 {
    font-size: 14px;
  }
  .progress-card p {
    min-height: 0;
    -webkit-line-clamp: 2;
  }
  .event-actions, .progress-admin-view .event-actions {
    grid-column: 1 / -1;
    grid-template-columns: 34px 34px repeat(3, minmax(48px, 1fr));
  }
  .progress-admin-view .event-actions {
    grid-template-columns: 34px 34px minmax(52px, 1fr) minmax(52px, 1fr);
  }
}

/* Final flat override: keep this at EOF so older style experiments cannot win. */
button, a, .summary-card button, .selection-actions button, .history-tools button,
.event-item button, .batch-actions button, .panel-title button {
  border-color: #bfd9e8;
  border-radius: 10px;
  background: #fff;
  color: #246f96;
  box-shadow: none;
}

button:hover, a:hover {
  border-color: #8fc7df;
  background: #f1f9fc;
  color: #164e70;
  transform: none;
}

.overview-panel, .panel, .period-dialog, .product-dialog, .progress-dialog,
.metric-card, .summary-card, .selection-actions, .progress-overview-copy, .progress-overview article,
.progress-stage-strip, .event-item, .progress-card {
  border-color: #d5e6f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}

.view-tabs {
  min-height: 58px;
  border-color: #d2e4ee;
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: none;
}

.view-tabs a {
  min-height: 44px;
  border-radius: 12px;
  box-shadow: none;
}

.view-tabs a::before { display: none; }

.view-tabs a.active {
  border-color: #a7d4e8;
  background: #eaf7fc;
  box-shadow: none;
}

.progress-stage-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px;
}

.progress-stage-strip button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border-color: #cde5f1;
  border-radius: 999px;
  background: #f8fcfe;
  color: #496b80;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
}

.progress-stage-strip button.active {
  border-color: #8fc7df;
  background: #e7f6fb;
  color: #165b7f;
}

.progress-stage-strip i { font-style: normal; }
.progress-stage-strip b { color: inherit; font-size: 13px; }

.progress-wall {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  overflow: visible;
  padding: 0;
  scroll-snap-type: none;
}

.progress-lane { display: contents; }

.progress-card {
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  box-shadow: none;
}

.progress-card:hover {
  border-color: #a7d4e8;
  transform: none;
  box-shadow: none;
}

.progress-card > img, .progress-placeholder {
  width: 70px;
  border-color: #d7e8f1;
  border-radius: 10px;
  background: #f3f9fc;
}

.progress-grid i { height: 7px; border: 0; background: #e3edf3; box-shadow: none; }
.progress-grid i.done { background: #48afd5; box-shadow: none; }

@media (max-width: 1180px) {
  .progress-wall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .progress-stage-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .progress-stage-strip button {
    justify-content: center;
    min-width: 0;
    padding: 5px 6px;
  }
  .progress-wall {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding: 0;
    scroll-snap-type: none;
  }
  .progress-card {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 8px;
  }
  .progress-card > img, .progress-placeholder { width: 58px; }
  .progress-card-head small { display: none; }
  .progress-card h2 {
    min-height: 38px;
    font-size: 13px;
    white-space: normal;
  }
.progress-card p {
    min-height: 34px;
    font-size: 12px;
  }
}

/* Targeted fixes from browser comments. */
.metric-card::before { display: none; }

.metric-card {
  padding-left: 14px;
  border-top: 3px solid #65bddf;
}

.metric-money {
  border-top-color: #e0ad64;
}

.metric-card.has-rise {
  border-top-color: #39b991;
}

.period-summary {
  display: grid;
  grid-template-columns: repeat(3, 58px);
  gap: 8px;
  overflow: visible;
}

.period-summary span {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  gap: 1px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  padding: 6px;
  text-align: center;
}

.period-summary i {
  max-width: 100%;
  overflow: hidden;
  color: #557286;
  font-size: 10px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.period-summary b {
  font-size: 13px;
  line-height: 1;
}

.period-summary em {
  max-width: 100%;
  overflow: hidden;
  color: #a86700;
  font-size: 10px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-hero.hero {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-block: 22px 20px;
}


.progress-card {
  align-items: start;
}

.progress-card:not(:has(> img)) {
  grid-template-columns: 1fr;
}

.progress-card > img {
  display: block;
}

.progress-note {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid #d9ebf3;
  border-radius: 10px;
  background: #f7fbfd;
  padding: 7px 8px;
}

.progress-note span {
  color: #247091;
  font-size: 11px;
  font-weight: 900;
}

.progress-note p {
  display: -webkit-box;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: #38586c;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.progress-timeline article {
  position: relative;
  grid-template-columns: 92px minmax(0, 1fr);
  border-top: 0;
  border-left: 3px solid #cfe5f2;
  margin-top: 10px;
  padding: 10px 0 10px 12px;
}

.progress-timeline article::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 16px;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #4aaed8;
}

.progress-timeline time {
  color: #577287;
  font-weight: 800;
}

.timeline-stage {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #cfe5f2;
  border-radius: 999px;
  background: #eef8fc;
  color: #1c688d;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 900;
}

.progress-timeline p {
  border: 1px solid #e1edf4;
  border-radius: 10px;
  background: #fbfdfe;
  padding: 8px 10px;
}

@media (max-width: 760px) {
  .period-summary {
    grid-template-columns: repeat(3, minmax(52px, 1fr));
  }
  .period-summary span {
    width: 100%;
    max-width: 62px;
    height: auto;
    aspect-ratio: 1;
  }
  .progress-card:not(:has(> img)) {
    grid-template-columns: 1fr;
  }
  .progress-card > img {
    width: 54px;
  }
  .progress-note {
    padding: 6px;
  }
  .progress-timeline article {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

/* Period dashboard v2: flat mini gauges, no ring/text collision. */
.period-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(66px, 1fr)) !important;
  gap: 8px;
  overflow: visible;
}

.period-summary .period-orb {
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 5px;
  width: auto;
  height: auto;
  min-height: 62px;
  border: 1px solid #d5e6f0;
  border-radius: 12px;
  background: #f8fcfe;
  padding: 8px;
  text-align: left;
}

.period-summary .period-orb::before { display: none; }

.period-summary .period-orb i,
.period-summary .period-orb b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.period-summary .period-orb i {
  color: #5f7586;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.period-summary .period-orb b {
  color: #12936d;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.period-summary .period-orb em {
  display: block;
  max-width: 100%;
  height: 5px;
  min-width: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4aaed8, #1f9d7a);
}

.period-summary .period-orb[style*="--p:0"] em {
  min-width: 0;
  background: #dfeaf0;
}

@media (max-width: 760px) {
  .period-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px;
  }
  .period-summary .period-orb {
    max-width: none;
    min-height: 58px;
    aspect-ratio: auto;
    padding: 7px 6px;
  }
  .period-summary .period-orb i { font-size: 10px; }
  .period-summary .period-orb b { font-size: 14px; }
}

/* Progress list final pass: one item per row, compact rich-text notes. */
.progress-wall {
  grid-template-columns: 1fr !important;
  gap: 10px;
}

.progress-card {
  grid-template-columns: 112px minmax(0, 1fr) 98px !important;
  align-items: center;
  gap: 14px;
  min-height: 128px;
  padding: 12px;
}

.progress-card:not(:has(> img)) {
  grid-template-columns: minmax(0, 1fr) 98px !important;
}

.progress-card > img {
  width: 112px;
}

.progress-card-body {
  display: contents;
}

.progress-card-head,
.progress-card h2,
.progress-grid,
.progress-note {
  grid-column: 2;
}

.progress-card:not(:has(> img)) .progress-card-head,
.progress-card:not(:has(> img)) h2,
.progress-card:not(:has(> img)) .progress-grid,
.progress-card:not(:has(> img)) .progress-note {
  grid-column: 1;
}

.progress-card-head {
  justify-content: flex-start;
}

.progress-card h2 {
  white-space: normal;
  -webkit-line-clamp: 2;
}

.progress-note {
  max-height: 76px;
  overflow: auto;
  scrollbar-width: thin;
}

.progress-note p,
.progress-timeline p {
  display: block;
  min-height: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-line-clamp: unset;
}

.progress-note a,
.progress-timeline a {
  color: #0a72a8;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.progress-card-foot {
  grid-column: 3;
  grid-row: 1 / span 4;
  align-self: stretch;
  display: grid;
  align-content: space-between;
  justify-items: end;
  min-width: 0;
  padding: 0 0 0 12px;
  border-top: 0;
  border-left: 1px solid #d5e6f0;
}

.progress-card:not(:has(> img)) .progress-card-foot {
  grid-column: 2;
}

@media (max-width: 760px) {
  .progress-card,
  .progress-card:not(:has(> img)) {
    grid-template-columns: 88px minmax(0, 1fr) !important;
    min-height: 112px;
    gap: 10px;
    padding: 10px;
  }

  .progress-card > img {
    width: 88px;
  }

  .progress-card-head,
  .progress-card h2,
  .progress-grid,
  .progress-note,
  .progress-card:not(:has(> img)) .progress-card-head,
  .progress-card:not(:has(> img)) h2,
  .progress-card:not(:has(> img)) .progress-grid,
  .progress-card:not(:has(> img)) .progress-note {
    grid-column: 2;
  }

  .progress-card:not(:has(> img)) {
    grid-template-columns: 1fr !important;
  }

  .progress-card:not(:has(> img)) .progress-card-head,
  .progress-card:not(:has(> img)) h2,
  .progress-card:not(:has(> img)) .progress-grid,
  .progress-card:not(:has(> img)) .progress-note,
  .progress-card:not(:has(> img)) .progress-card-foot {
    grid-column: 1;
  }

  .progress-note {
    max-height: 62px;
  }

  .progress-card-foot {
    grid-column: 1 / -1;
    grid-row: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 0;
    border-top: 1px solid #d5e6f0;
    border-left: 0;
  }
}

@media (max-width: 420px) {
  .progress-card {
    grid-template-columns: 78px minmax(0, 1fr) !important;
  }

  .progress-card > img {
    width: 78px;
  }
}

/* Progress detail + dense period pass. */
.period-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 6px;
}

.period-summary .period-orb {
  min-height: 50px;
  border-radius: 12px;
  padding: 6px 8px;
}

.period-summary .period-orb i {
  font-size: 10px;
}

.period-summary .period-orb b {
  font-size: 17px;
}

.progress-card {
  grid-template-columns: 104px minmax(0, 1fr) 82px !important;
  min-height: 112px;
  gap: 10px;
  padding: 10px;
}

.progress-card > img {
  width: 104px;
}

.progress-card h2 {
  min-height: 0;
  line-height: 1.3;
}

.progress-note {
  max-height: 58px;
  padding: 6px 8px;
}

.progress-card-foot {
  padding-left: 10px;
}

.progress-dialog {
  overflow-y: auto;
  overscroll-behavior: contain;
}

#progress-dialog-body {
  overflow: visible;
}

.progress-detail-head {
  align-items: center;
}

.progress-detail-card {
  margin: 12px 0;
  border: 1px solid #d8edf7;
  border-radius: 14px;
  background: #fbfdff;
  padding: 12px;
}

.progress-detail-card h3 {
  margin: 0 0 10px;
  color: #0f4773;
  font-size: 18px;
}

.progress-detail-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.progress-detail-fields div {
  min-width: 0;
  border-bottom: 1px solid #e1edf4;
  padding-bottom: 8px;
}

.progress-detail-fields span {
  display: block;
  color: #6d8294;
  font-size: 12px;
  font-weight: 800;
}

.progress-detail-fields p,
.progress-node-list p {
  margin: 4px 0 0;
  color: #263f50;
  font-weight: 800;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.progress-node-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.progress-node-track span {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  color: #718899;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.progress-node-track i {
  width: 16px;
  height: 16px;
  border: 2px solid #d8e6ee;
  border-radius: 50%;
  background: #fff;
}

.progress-node-track .node-done i {
  border-color: #43b6d9;
  background: #43b6d9;
}

.progress-node-track .node-active i {
  border-color: #f0c65e;
  background: #f0c65e;
}

.progress-node-list {
  display: grid;
  gap: 6px;
}

.progress-node-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: start;
  border-top: 1px solid #e1edf4;
  padding: 8px 0 0;
}

.progress-node-list span {
  color: #526b7b;
  font-weight: 800;
}

.progress-node-list b {
  color: #75899a;
}

.progress-node-list .node-active b { color: #a96e00; }
.progress-node-list .node-done b { color: #0d7e93; }
.progress-node-list p { grid-column: 1 / -1; font-weight: 700; }

.progress-timeline {
  padding-left: 8px;
}

.progress-timeline article {
  margin-left: 6px;
}

.progress-node-admin {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.progress-node-admin .section-title {
  align-items: center;
}

.progress-node-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) 110px minmax(140px, 1fr) 40px 40px 72px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  border: 1px solid #d8edf7;
  border-radius: 12px;
  background: #fbfdff;
  padding: 8px;
}

.progress-node-row input,
.progress-node-row select {
  min-height: 38px;
}

@media (max-width: 760px) {
  .period-summary .period-orb {
    min-height: 46px;
    padding: 6px;
  }

  .period-summary .period-orb b {
    font-size: 16px;
  }

  .progress-card,
  .progress-card:not(:has(> img)) {
    grid-template-columns: 84px minmax(0, 1fr) !important;
    min-height: 96px;
    padding: 8px;
  }

  .progress-card > img {
    width: 84px;
  }

  .progress-card-foot,
  .progress-card:not(:has(> img)) .progress-card-foot {
    grid-column: 2;
    border-top: 0;
    padding: 0;
  }

  .progress-note {
    max-height: 48px;
  }

  .progress-detail-fields {
    grid-template-columns: 1fr;
  }

  .progress-dialog {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .progress-node-row {
    grid-template-columns: 1fr 104px;
  }

  .progress-node-row [data-node-note],
  .progress-node-row [data-node-delete] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .progress-card,
  .progress-card:not(:has(> img)) {
    grid-template-columns: 74px minmax(0, 1fr) !important;
  }

  .progress-card > img {
    width: 74px;
  }
}

@media (max-width: 760px) {
  .progress-card:not(:has(> img)) {
    grid-template-columns: 1fr !important;
  }

  .progress-card:not(:has(> img)) .progress-card-head,
  .progress-card:not(:has(> img)) h2,
  .progress-card:not(:has(> img)) .progress-grid,
  .progress-card:not(:has(> img)) .progress-note,
  .progress-card:not(:has(> img)) .progress-card-foot {
    grid-column: 1;
  }
}

/* Completion-state split: five process stages, completion is a separate flag. */
.progress-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stage-tag.complete-tag {
  border-color: #9fdcc5;
  background: #edf9f4;
  color: #15855e;
}

.checkline.compact {
  min-height: 40px;
  padding: 8px 10px;
}

.progress-update-edit {
  grid-template-columns: 140px minmax(100px, 130px) 96px minmax(0, 1fr) 72px 72px;
}

.progress-update-edit textarea {
  grid-column: auto;
}

@media (max-width: 760px) {
  .progress-update-edit {
    grid-template-columns: 1fr 1fr;
  }

  .progress-update-edit textarea {
    grid-column: 1 / -1;
  }
}

/* Impeccable + ponytail pass: compact progress surface, no nested scrollers. */
.progress-main {
  max-width: 980px;
}

.progress-overview {
  gap: 8px;
  padding: 10px;
}

.progress-overview-copy,
.progress-overview article {
  padding: 10px 12px;
}

.progress-overview-copy strong,
.progress-overview strong {
  font-size: 24px;
}

.progress-stage-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow: visible;
}

.progress-stage-strip button {
  flex: 1 1 calc(25% - 6px);
  min-height: 38px;
  border-radius: 10px;
  padding: 6px 10px;
}

.progress-card,
.progress-card:not(:has(> img)) {
  grid-template-columns: 96px minmax(0, 1fr) !important;
  align-items: start;
  min-height: 0;
  padding: 10px;
}

.progress-card > img {
  width: 96px;
  color: transparent;
  font-size: 0;
}

.progress-card-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.progress-card-head,
.progress-card h2,
.progress-grid,
.progress-note,
.progress-card-foot,
.progress-card:not(:has(> img)) .progress-card-head,
.progress-card:not(:has(> img)) h2,
.progress-card:not(:has(> img)) .progress-grid,
.progress-card:not(:has(> img)) .progress-note,
.progress-card:not(:has(> img)) .progress-card-foot {
  grid-column: auto;
}

.progress-card-foot,
.progress-card:not(:has(> img)) .progress-card-foot {
  grid-row: auto;
  align-self: auto;
  display: flex;
  justify-content: space-between;
  padding: 6px 0 0;
  border-top: 1px solid #d5e6f0;
  border-left: 0;
}

.progress-note {
  max-height: none;
  overflow: hidden;
}

.progress-note p {
  display: -webkit-box;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (max-width: 760px) {
  .progress-main {
    padding: 8px 10px 96px;
  }

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

  .progress-overview-copy,
  .progress-stage-strip {
    grid-column: 1 / -1;
  }

  .progress-stage-strip button {
    flex-basis: calc(33.333% - 6px);
    min-height: 36px;
  }

  .progress-card,
  .progress-card:not(:has(> img)) {
    grid-template-columns: 76px minmax(0, 1fr) !important;
    gap: 9px;
    padding: 9px;
  }

  .progress-card > img {
    width: 76px;
  }

  .progress-card h2 {
    min-height: 0;
    font-size: 15px;
    line-height: 1.25;
  }

  .progress-note {
    max-height: none;
    padding: 6px 8px;
  }
}

/* Progress declutter pass: no stage filter strip, no duplicate node track. */
.progress-stage-strip {
  display: none !important;
}

.progress-grid.with-value {
  position: relative;
  align-items: center;
  padding-right: 52px;
}

.progress-grid.with-value::after {
  content: attr(data-progress);
  position: absolute;
  right: 0;
  top: 50%;
  color: #1373a8;
  font-size: 18px;
  font-weight: 900;
  transform: translateY(-50%);
}

.progress-detail-head strong {
  display: none;
}

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

.progress-detail-nodes {
  padding-block: 10px;
}

.progress-node-track {
  display: none;
}

.progress-node-list {
  gap: 0;
}

.progress-node-list article {
  min-height: 42px;
  border-top: 1px solid #dcebf3;
  padding: 8px 0;
}

@media (max-width: 760px) {
  .progress-detail-fields {
    grid-template-columns: 1fr;
  }

  .progress-grid.with-value {
    padding-right: 46px;
  }

  .progress-grid.with-value::after {
    font-size: 16px;
  }
}

/* Unified surface pass: reuse the sales-card rhythm across board, progress and admin. */
:root {
  --ui-gap: 10px;
  --ui-panel-radius: 14px;
  --ui-panel-shadow: 0 10px 24px rgba(16, 78, 122, .08);
}

.public-page main,
.progress-main,
.admin-shell {
  width: min(1240px, calc(100% - 28px));
  margin-inline: auto;
}

.progress-main {
  padding: 14px 0 96px;
}

.progress-overview {
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(116px, .55fr));
  gap: var(--ui-gap);
  margin-bottom: var(--ui-gap);
}

.progress-overview-copy,
.progress-overview article,
.progress-card,
.panel,
.metric-card,
.summary-card,
.selection-actions {
  border-radius: var(--ui-panel-radius);
  box-shadow: var(--ui-panel-shadow);
}

.progress-overview-copy,
.progress-overview article {
  min-height: 82px;
  padding: 12px 14px;
}

.progress-overview strong {
  font-size: 26px;
}

.progress-wall {
  gap: var(--ui-gap);
}

.progress-card {
  min-height: 104px;
  padding: 10px;
}

.progress-card > img,
.progress-placeholder {
  width: 96px;
}

.progress-card-body {
  gap: 5px;
}

.progress-note {
  padding: 5px 7px;
}

.admin-shell {
  gap: var(--ui-gap);
}

.admin-shell > .panel,
.progress-admin-shell > .panel {
  border-radius: var(--ui-panel-radius);
  box-shadow: var(--ui-panel-shadow);
}

.editor,
.draft-grid,
.event-list,
.progress-node-admin {
  gap: var(--ui-gap);
}

@media (max-width: 760px) {
  .public-page main,
  .progress-main,
  .admin-shell {
    width: min(100% - 20px, 620px);
  }

  .progress-main {
    padding-top: 10px;
  }

  .progress-overview {
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, .8fr)) !important;
  }

  .progress-overview-copy {
    grid-column: auto !important;
    min-height: 70px;
  }

  .progress-overview article {
    min-height: 70px;
  }

  .progress-card {
    grid-template-columns: 84px minmax(0, 1fr) !important;
  }

  .progress-card > img,
  .progress-placeholder {
    width: 84px;
  }
}

@media (max-width: 420px) {
  .progress-card {
    grid-template-columns: 74px minmax(0, 1fr) !important;
  }

  .progress-card > img,
  .progress-placeholder {
    width: 74px;
  }
}

/* Metric and detail hierarchy: one visual grammar across card and dialog. */
.card-metrics > .sale-number,
.card-metrics > .money-focus {
  min-height: 62px;
  padding: 7px 8px;
}

.money-focus {
  display: grid;
  align-content: center;
  gap: 2px;
}

.money-focus b {
  font-size: clamp(18px, 2.8vw, 30px);
  line-height: 1;
}

.period-summary {
  position: relative;
  align-items: end;
  gap: 0 !important;
  padding: 2px 0 0;
}

.period-summary::before {
  content: "";
  position: absolute;
  right: 6%;
  bottom: 15px;
  left: 6%;
  height: 2px;
  background: #d9e8ef;
}

.period-summary .period-orb {
  position: relative;
  z-index: 1;
  min-height: 58px;
  gap: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 5px 8px 0;
  text-align: center;
}

.period-summary .period-orb i,
.period-summary .period-orb b {
  overflow: visible;
  white-space: nowrap;
}

.period-summary .period-orb i { font-size: 10px; }
.period-summary .period-orb b { font-size: 16px; }

.period-summary .period-orb em {
  position: relative;
  display: block;
  width: 100% !important;
  height: 6px;
  min-width: 0;
  overflow: hidden;
  border-radius: 999px;
  background: #dfeaf0;
}

.period-summary .period-orb em::after {
  content: "";
  display: block;
  width: calc(var(--p) * 1%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4aaed8, #1f9d7a);
}

.period-summary .period-orb[style*="--p:0"] em::after { width: 0; }

.progress-detail-head > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.progress-detail-head h2 {
  flex-basis: 100%;
  margin-top: 2px;
}

.progress-detail-head .stage-tag,
.progress-card-head .stage-tag {
  margin: 0;
}

.progress-detail-nodes {
  padding: 10px 12px;
}

.progress-detail-nodes h3 {
  margin-bottom: 4px;
}

.progress-node-list {
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.progress-node-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  border-top: 1px solid #e1edf4;
  padding: 5px 0;
}

.progress-node-list li:first-child { border-top: 0; }

.progress-node-list .node-index {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: #eaf6fb;
  color: #6b8a9b;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.progress-node-list li > div { min-width: 0; }
.progress-node-list span { color: #36566c; font-size: 13px; }
.progress-node-list b { font-size: 12px; }
.progress-node-list p { margin: 2px 0 0; font-size: 11px; }
.progress-node-list .node-active .node-index { background: #fff4d5; color: #a96e00; }
.progress-node-list .node-active b { color: #a96e00; }
.progress-node-list .node-done .node-index { background: #e8f8f1; color: #0d7e63; }
.progress-node-list .node-done b { color: #0d7e63; }

@media (max-width: 520px) {
  .card-metrics > .sale-number,
  .card-metrics > .money-focus {
    min-height: 60px;
  }

  .money-focus b { font-size: 18px; }
  .period-summary .period-orb { padding-inline: 4px; }
  .progress-node-list li { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 6px; }
}

/* Compact overview and semantic progress states. */
.progress-overview {
  display: grid;
  grid-template-columns: minmax(128px, .34fr) minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid #c8e1ef;
  border-radius: var(--ui-panel-radius);
  background: #fff;
  box-shadow: var(--ui-panel-shadow);
}

.progress-overview-copy {
  display: grid;
  align-content: center;
  min-height: 74px;
  padding: 11px 15px;
  border: 0;
  border-right: 1px solid #dbeaf2;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.progress-overview-copy span { color: #57758a; font-size: 12px; font-weight: 800; }
.progress-overview-copy strong { margin-top: 2px; color: #075f98; font-size: 20px; line-height: 1.1; }
.progress-overview-copy strong i { font-size: 28px; font-style: normal; }

.progress-overview-meter {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
  padding: 11px 16px;
}

.progress-overview-meter > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #587389;
  font-size: 13px;
  font-weight: 800;
}

.progress-overview-meter b { color: #075f98; font-size: 16px; }
.progress-overview-track { display: block; height: 8px; overflow: hidden; border-radius: 4px; background: #e1edf3; }
.progress-overview-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: #21a47b; transition: width .25s ease; }

.stage-tag.stage-0,
.timeline-stage.stage-0 { color: #52697a; border-color: #cbd9e2; background: #edf3f6; }
.stage-tag.stage-1,
.timeline-stage.stage-1 { color: #76518f; border-color: #d9c8e6; background: #f5eff9; }
.stage-tag.stage-2,
.timeline-stage.stage-2 { color: #a15f08; border-color: #efd097; background: #fff4dc; }
.stage-tag.stage-3,
.timeline-stage.stage-3 { color: #08786f; border-color: #a9dfd7; background: #e8f7f4; }
.stage-tag.stage-4,
.timeline-stage.stage-4 { color: #17639d; border-color: #b9d9ee; background: #eaf5fb; }
.stage-tag.complete-tag,
.timeline-stage.complete-tag { color: #0b7558; border-color: #9fd8c5; background: #e9f8f1; }

.record-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.record-section-head h3 { margin: 0; }
.record-section-head small { color: #71889a; font-size: 11px; }
.record-section-head label { display: grid; grid-template-columns: auto minmax(128px, 150px); align-items: center; gap: 7px; color: #587389; font-size: 12px; font-weight: 800; }
.record-section-head input { width: 100%; min-height: 34px; padding: 5px 8px; border: 1px solid #bcdceb; border-radius: 7px; background: #fff; color: #174966; font: inherit; }

@media (max-width: 520px) {
  .progress-overview { grid-template-columns: 108px minmax(0, 1fr) !important; }
  .progress-overview-copy { min-height: 68px; padding-inline: 11px; }
  .progress-overview-copy strong { font-size: 16px; }
  .progress-overview-copy strong i { font-size: 24px; }
  .progress-overview-meter { padding-inline: 11px; }
  .record-section-head { align-items: center; }
  .record-section-head label { grid-template-columns: 1fr; gap: 2px; }
  .record-section-head label span { display: none; }
}

/* Node rail: compact enough for five stages on a phone. */
.progress-detail-nodes { padding: 10px 12px 12px; }
.progress-detail-nodes h3 { margin-bottom: 8px; }

.progress-node-list {
  display: grid;
  grid-template-columns: repeat(var(--node-count), minmax(0, 1fr));
  gap: 6px;
  overflow: visible;
}

.progress-node-list.is-scrollable {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(78px, 1fr);
  overflow-x: auto;
  padding-bottom: 4px;
}

.progress-node-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px;
  place-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 5px 3px;
  border: 1px solid #d6e6ef;
  border-radius: 8px;
  background: #f8fbfd;
  text-align: center;
}

.progress-node-list li:first-child { border-top: 1px solid #d6e6ef; }
.progress-node-list span { align-self: center; color: #284d65; font-size: 12px; font-weight: 800; line-height: 1.25; }
.progress-node-list b { align-self: center; font-size: 10px; line-height: 1.2; }
.progress-node-list span,
.progress-node-list b { white-space: nowrap; }
.progress-node-list .node-done { border-color: #b9dfd2; background: #f0faf6; }
.progress-node-list .node-active { border-color: #efd49b; background: #fff9e9; }

.period-summary::before { display: none; }

@media (max-width: 520px) {
  .progress-detail-nodes { padding-inline: 8px; }
  .progress-node-list { gap: 4px; }
  .progress-node-list li { min-height: 46px; padding-inline: 2px; }
  .progress-node-list span { font-size: 11px; }
}

.progress-timeline time { font-variant-numeric: tabular-nums; }

.progress-timeline p {
  margin: 0;
  color: #294b60;
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft JhengHei UI", "Microsoft YaHei UI", sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0;
  text-wrap: pretty;
}

/* The dialog is the only scroller; timeline content stays in normal flow on iOS and Android. */
.progress-dialog .progress-timeline {
  max-height: none;
  overflow: visible !important;
}

.progress-dialog .progress-timeline > h3 {
  position: relative !important;
  top: auto !important;
  z-index: 1;
}

/* One bundled data face keeps SKU and headline figures consistent on iOS. */
.metric-value,
.sale-number,
.money-focus b,
.sku-live strong {
  font-family: "CountWD Numbers", "Arial Narrow", sans-serif;
}

.progress-note a,
.progress-timeline a {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-block: 1px;
  border: 0;
  border-bottom: 1px solid #9bcddd;
  border-radius: 0;
  background: transparent;
  padding: 1px 0 0;
  color: #16789d;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
}

.progress-note a::after,
.progress-timeline a::after {
  content: "\2197";
  margin-left: 3px;
  font-size: 9px;
}

/* Independent project nodes and note-only timeline. */
.progress-node-row {
  grid-template-columns: minmax(100px, 1fr) 120px;
}

.progress-node-row strong {
  color: var(--navy);
  font-size: 14px;
}

.progress-update-new {
  grid-template-columns: 110px minmax(0, 1fr) 72px;
}

.progress-update-edit:not(.progress-update-new) {
  grid-template-columns: 140px minmax(0, 1fr) 72px 72px;
}

.progress-update-edit textarea {
  grid-column: auto;
}

.progress-grid i.active {
  background: #f0bd57;
}

.stage-tag.project-active-tag {
  border-color: #add8ec;
  background: #eef9fd;
  color: #187ca5;
}

@media (max-width: 760px) {
  .progress-update-new,
  .progress-update-edit:not(.progress-update-new) {
    grid-template-columns: 1fr 1fr;
  }

  .progress-update-new textarea,
  .progress-update-edit:not(.progress-update-new) textarea {
    grid-column: 1 / -1;
  }
}

/* Admin uses the same compact grammar as the public board and progress views. */
.admin-page {
  background: linear-gradient(180deg, #f2fbff 0, #f8fdff 360px, #f7fbff 100%);
}

.admin-head .hero-copy h1 {
  font-size: clamp(28px, 4vw, 42px);
}

.admin-page .section-title {
  display: grid;
  justify-content: start;
  gap: 2px;
}

.admin-page .section-title small { text-align: left; }

.progress-admin-view .draft-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-page input,
.admin-page select,
.admin-page textarea,
.admin-page .progress-update-edit {
  border-radius: 10px;
}

.progress-update-edit { gap: var(--ui-gap); }

.progress-update-new {
  grid-template-columns: 110px minmax(0, 1fr) auto 72px;
  align-items: center;
}

.progress-update-new .checkline {
  min-height: 44px;
  padding: 0;
}

.progress-admin-view .event-copy .progress-stage-tags { margin-bottom: 4px; }
.progress-admin-view .event-copy .stage-tag {
  display: inline-flex;
  padding: 2px 6px;
  font-size: 11px;
  font-style: normal;
}

.progress-node-row[data-node-state="已完成"] { border-color: #b9dfd2; background: #f0faf6; }
.progress-node-row[data-node-state="进行中"] { border-color: #efd49b; background: #fff9e9; }
.progress-node-row[data-node-state="未开始"] { border-color: #d6e6ef; background: #f8fbfd; }

.admin-health {
  width: min(1240px, calc(100% - 28px));
  border-color: #d5e6f0;
  border-radius: var(--ui-panel-radius);
  background: #fff;
}

.admin-page .event-actions button,
.admin-page .batch-actions button,
.admin-page .panel-title button {
  min-height: 44px;
}

@media (max-width: 1080px) {
  .progress-admin-shell .list-panel { order: -1; }
}

@media (max-width: 760px) {
  .progress-update-new,
  .progress-update-edit:not(.progress-update-new) {
    grid-template-columns: 1fr 1fr;
  }

  .progress-update-new textarea,
  .progress-update-edit:not(.progress-update-new) textarea {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .progress-admin-view .draft-grid { grid-template-columns: 1fr; }
  .admin-health { width: min(100% - 20px, 620px); }
}

/* Native share actions and selected-day totals reuse the compact metric grammar. */
.progress-share-actions {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.dialog-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dialog-title-row h2 { flex: 1; min-width: 0; }

.dialog-title-row button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 5px 9px;
  border-radius: 8px;
  background: #eef9fd;
  color: #0872b5;
  font-size: 11px;
}

.progress-share-actions button {
  min-height: 44px;
  padding: 6px 11px;
  border-radius: 8px;
  background: #eef9fd;
  color: #0872b5;
  font-size: 12px;
}

.record-day-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.record-day-summary span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid #d5e6ef;
  border-radius: 8px;
  background: #f7fbfd;
}

.record-day-summary small {
  color: #587389;
  font-size: 11px;
  font-weight: 750;
}

.record-day-summary strong {
  color: #0872b5;
  font-family: "CountWD Numbers", "Arial Narrow", sans-serif;
  font-size: 24px;
  line-height: 1;
}

.record-day-summary span:last-child strong { color: #b56b00; }

.comparison-metrics,
.linked-product-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.comparison-metrics span,
.linked-product-metrics span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d5e6ef;
  border-radius: 8px;
  background: #f7fbfd;
}

.comparison-metrics small,
.linked-product-metrics small,
.sku-contribution > small {
  color: #587389;
  font-size: 11px;
  font-weight: 750;
}

.comparison-metrics strong,
.linked-product-metrics strong {
  overflow: hidden;
  color: #0872b5;
  font-size: 20px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-metrics .up strong { color: var(--mint); }
.comparison-metrics .down strong { color: var(--rose); }

.sku-contribution {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.sku-contribution > b { color: #36566c; font-size: 12px; }

.sku-contribution span {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
  padding: 4px 7px;
  border: 1px solid #d5e6ef;
  border-radius: 7px;
  background: #f7fbfd;
}

.sku-contribution i {
  overflow: hidden;
  max-width: 180px;
  color: #587389;
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sku-contribution strong { color: var(--mint); font-size: 14px; }

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

.linked-product-head h3 { margin: 0; }

.linked-product-head button {
  min-height: 32px;
  padding: 4px 8px;
  border-color: #bcdceb;
  background: #eef9fd;
  color: #0872b5;
  font-size: 11px;
}

.linked-product-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.linked-product-metrics span:nth-child(3) strong { color: var(--amber); }
.linked-product-metrics span:last-child strong { font-size: 14px; }

.progress-sort-controls {
  display: flex;
  gap: 6px;
}

.progress-sort-controls select {
  width: auto;
  min-height: 34px;
  padding: 4px 8px;
  border-radius: 7px;
}

.progress-recent {
  padding: 10px 12px;
  border: 1px solid #cfe5f1;
  border-radius: 10px;
  background: #fff;
}

.progress-section-head {
  display: flex;
  gap: 7px;
  align-items: baseline;
  margin-bottom: 7px;
}

.progress-section-head h2 { margin: 0; color: var(--navy); font-size: 15px; }
.progress-section-head small { color: #71889a; font-size: 10px; }

.progress-recent-list {
  display: grid;
  grid-auto-columns: minmax(210px, 1fr);
  grid-auto-flow: column;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.progress-recent-list article {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #d8eaf3;
  border-radius: 8px;
  background: #f8fcfe;
  cursor: pointer;
}

.progress-recent-list article > div {
  display: flex;
  gap: 6px;
  align-items: center;
}

.progress-recent-list b {
  overflow: hidden;
  flex: 1;
  color: #174966;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-recent-list time { color: #71889a; font-size: 10px; white-space: nowrap; }
.progress-recent-list i { padding: 1px 4px; border-radius: 4px; background: #fff0ca; color: #986000; font-size: 9px; font-style: normal; }

.progress-recent-list p {
  display: -webkit-box;
  margin: 3px 0 0;
  overflow: hidden;
  color: #49677a;
  font-size: 11px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.progress-timeline article.is-pinned {
  border-color: #efd49b;
  background: #fffaf0;
}

.progress-update-new { grid-template-columns: 110px minmax(0, 1fr) auto auto 72px; }
.progress-update-edit:not(.progress-update-new) { grid-template-columns: 140px minmax(0, 1fr) auto 72px 72px; }

@media (max-width: 760px) {
  .progress-recent { padding-inline: 9px; }
  .progress-recent-list { grid-auto-columns: minmax(190px, 78vw); }
  .progress-update-new,
  .progress-update-edit:not(.progress-update-new) { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .comparison-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .comparison-metrics span, .linked-product-metrics span { padding: 7px; }
  .comparison-metrics strong, .linked-product-metrics strong { font-size: 16px; }
  .linked-product-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.selection-actions {
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
}

.selection-controls {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .selection-actions { grid-template-columns: minmax(0, 1fr) auto; }
  .selection-actions span { grid-column: auto; }
  .selection-controls button { padding-inline: 7px; font-size: 12px; }
}

.period-summary .period-orb.down b { color: var(--rose); }
.period-summary .period-orb.down em::after { background: var(--rose); }
.sku-change.down b,
.sku-change.down em { color: var(--rose); }
