:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --brand: #2563eb;
  --brand-ink: #1d4ed8;
  --brand-soft: #eff6ff;
  --done: #15803d;
  --done-bg: #dcfce7;
  --doing: #b45309;
  --doing-bg: #fef3c7;
  --todo: #b91c1c;
  --todo-bg: #fee2e2;
  --purple: #6d28d9;
  --purple-bg: #f3e8ff;
  --cyan: #0e7490;
  --cyan-bg: #cffafe;
  --radius: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.boot { padding: 48px; text-align: center; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Shell & Top Navigation */
.top {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.top-inner, .page {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding-inline: clamp(16px, 2vw, 32px);
}
.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  padding-bottom: 8px;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  min-width: 0;
  flex: 1;
}
.brand-row > div:not(.project-switcher),
.zm-top-brand,
.zm-top-brand > div {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.top h1 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.top .sub {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.project-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 3px 10px;
  max-width: 340px;
  flex-shrink: 0;
  min-width: 0;
  transition: border-color 0.15s, background-color 0.15s;
}
.project-switcher:hover {
  border-color: #cbd5e1;
  background: #fff;
}
.project-switcher > span {
  white-space: nowrap;
  flex-shrink: 0;
}
.project-switcher select {
  border: 0;
  background: transparent;
  padding: 2px 2px;
  height: 26px;
  line-height: 22px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 900px) {
  .top-inner { flex-wrap: wrap; }
  .brand-row { flex-wrap: wrap; }
  .top h1 { white-space: normal; flex-wrap: wrap; }
  .top .sub { white-space: normal; }
  .project-switcher { max-width: 100%; }
}
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding-inline: clamp(16px, 2vw, 32px);
  align-items: center;
  border-top: 1px solid #f1f5f9;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative;
  padding: 10px 13px;
  text-decoration: none;
  color: #475569;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: color .15s ease, background-color .15s ease;
}
.tabs a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background-color .15s ease;
}
.tabs a:first-child { margin-left: -13px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--brand-ink); font-weight: 650; }
.tabs a[aria-current="page"]::after { background: var(--brand); }
.tabs .tab-ai { color: #6d28d9; }
.tabs .tab-ai[aria-current="page"]::after { background: #7c3aed; }
.tabs .tab-screen { color: #0e7490; font-weight: 550; }
.tabs .tab-screen[aria-current="page"]::after { background: #0891b2; }
.page { padding-top: 18px; padding-bottom: 48px; }
.page.page-wide { max-width: none; }
.meta {
  color: #475569;
  font-size: 13px;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #d5dfeb;
  background: #fff;
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: #1e293b;
  white-space: nowrap;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease;
}
.btn:hover { border-color: #94a3b8; text-decoration: none; background: #f8fafc; color: #0f172a; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #1d4ed8;
  color: #fff;
  font-weight: 550;
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.22);
}
.btn.primary:hover {
  background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%);
  border-color: #1e40af;
  color: #fff;
  box-shadow: 0 3px 10px rgba(29, 78, 216, 0.25);
}
.btn.row-primary {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  font-weight: 600;
}
.btn.row-primary:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.btn.row-screen {
  background: #fff;
  border-color: #cbd5e1;
  color: #0f172a;
  font-weight: 550;
}
.btn.row-screen::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0ea5e9;
  flex: none;
}
.btn.row-screen:hover {
  background: #0f172a;
  border-color: #0f172a;
  color: #e0f2fe;
}
.btn.row-screen:hover::before { background: #38bdf8; }
.btn.screen-btn {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-color: #0f172a;
  color: #e0f2fe;
  font-weight: 550;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}
.btn.screen-btn::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 0 2.5px rgba(56, 189, 248, 0.22);
  flex: none;
}
.btn.screen-btn:hover {
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  border-color: #020617;
  color: #fff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.28);
}
.btn.ai-btn {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #6d28d9;
  font-weight: 550;
}
.btn.ai-btn:hover {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
}
.btn.danger { color: var(--todo); }
.btn.small { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.link { background: none; border: 0; color: var(--brand-ink); cursor: pointer; padding: 0; }

input[type=text], input[type=password], input[type=url], input[type=search], input[type=number], select, textarea {
  border: 1px solid #d5dfeb;
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  min-width: 0;
}
textarea { width: 100%; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > span { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; }
.hint { font-size: 12px; color: var(--muted); }
.error { color: var(--todo); font-size: 13px; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
}
.toolbar-card {
  background: #fff;
  border: 1px solid #dfe7f1;
  border-radius: 12px;
  padding: 11px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 4px 12px rgba(15, 23, 42, 0.02);
}
.toolbar-shortcuts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.grow,
.toolbar .grow { flex: 1 1 auto; min-width: 12px; }
.toolbar label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #334155; cursor: pointer; user-select: none; }
.toolbar input[type=search],
.toolbar select {
  height: 34px;
  padding: 0 11px;
  font-size: 13px;
  border-color: #d5dfeb;
  background-color: #f8fafc;
  color: #1e293b;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.toolbar input[type=search] {
  width: clamp(240px, 24vw, 380px);
  padding-left: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}
.toolbar input[type=search]:hover,
.toolbar select:hover {
  border-color: #b8c6d8;
  background-color: #fff;
}
.toolbar input[type=search]:focus,
.toolbar select:focus {
  background-color: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
  outline: none;
}
.toolbar .btn { height: 34px; padding: 0 12px; font-size: 12.5px; }
.toolbar .btn.small { height: 32px; padding: 0 11px; font-size: 12px; }
.seg-group {
  display: inline-flex;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  overflow: hidden;
  background: #f1f5f9;
  height: 34px;
  padding: 2px;
  gap: 2px;
}
.seg-group button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  color: #64748b;
  transition: background-color .14s, color .14s, box-shadow .14s;
}
.seg-group button:hover { color: var(--ink); }
.seg-group button.active {
  background: #fff;
  color: #1d4ed8;
  font-weight: 650;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.04);
}

/* Summary KPI Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.cards.cards-4,
.cards:has(> :nth-child(4):last-child) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.cards.cards-3,
.cards:has(> :nth-child(3):last-child) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cards.cards-5,
.cards:has(> :nth-child(5):last-child) {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (max-width: 1180px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards.cards-4,
  .cards:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards.cards-5,
  .cards:has(> :nth-child(5):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .cards,
  .cards.cards-4,
  .cards.cards-3,
  .cards.cards-5,
  .cards:has(> :nth-child(4):last-child),
  .cards:has(> :nth-child(3):last-child),
  .cards:has(> :nth-child(5):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 15px 18px 14px;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 4px 12px rgba(15, 23, 42, 0.02);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease;
}
.card:has(.zm-kpi-head) {
  flex-direction: column;
}
.card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, #94a3b8 0%, #cbd5e1 100%);
  opacity: 0.7;
  transition: opacity .15s ease;
}
.card.doing::before { background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%); }
.card.done::before { background: linear-gradient(90deg, #16a34a 0%, #4ade80 100%); }
.card.todo::before { background: linear-gradient(90deg, #ef4444 0%, #f87171 100%); }
.card.cyan::before { background: linear-gradient(90deg, #0891b2 0%, #38bdf8 100%); }
.card.purple::before { background: linear-gradient(90deg, #7c3aed 0%, #a78bfa 100%); }
.card.static { cursor: default; }
.card:not(.static):hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 20px -6px rgba(15, 23, 42, 0.09);
  transform: translateY(-1px);
}
.card:not(.static):hover::before { opacity: 1; }
.card b {
  display: block;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}
.card span {
  color: #64748b;
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.35;
}
.card[aria-pressed="true"] {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.14), 0 6px 16px -4px rgba(37, 99, 235, 0.12);
}
.card[aria-pressed="true"]::before {
  background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
  opacity: 1;
}
.card.done b { color: #15803d; }
.card.doing b { color: #b45309; }
.card.todo b { color: #b91c1c; }
.card.purple b { color: #6d28d9; }
.card.cyan b { color: #0e7490; }

/* Progress Bars & Module Grid */
.bar { display: flex; gap: 2px; height: 6px; border-radius: 999px; overflow: hidden; background: #e8eef6; }
.bar.bar-overall { height: 7px; margin: 0 0 14px; }
.bar i { display: block; border-radius: 999px; }
.bar .done { background: linear-gradient(90deg, #16a34a, #22c55e); }
.bar .doing { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar .todo { background: linear-gradient(90deg, #ef4444, #f87171); }
.modules {
  display: grid;
  grid-template-columns: repeat(var(--mod-cols, 5), minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
@media (max-width: 1280px) {
  .modules { grid-template-columns: repeat(var(--mod-cols-md, 4), minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .modules { grid-template-columns: repeat(var(--mod-cols-sm, 3), minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.module {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 15px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
  transition: border-color .14s, box-shadow .14s, transform .14s, background-color .14s;
}
.module:hover { border-color: #93c5fd; box-shadow: 0 4px 12px rgba(15, 23, 42, .06); transform: translateY(-1px); }
.module .name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 0;
  font-weight: 600;
  color: #1e293b;
  min-width: 0;
}
.module .name > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.module .name > .hint {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.module[aria-pressed="true"] { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14); background: #f8fbff; }

/* Tables, Groups & Badges */
.group {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 6px 18px rgba(15, 23, 42, 0.025);
}
.group h2 {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  padding: 13px 18px;
  border-bottom: 1px solid #e6edf5;
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.group-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.group h2 small { font-weight: 400; color: #94a3b8; font-size: 12px; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; border-bottom: 1px solid #eef2f7; text-align: left; vertical-align: middle; }
th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.025em;
  white-space: nowrap;
  border-bottom: 1px solid #e2e8f0;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color 0.12s ease, box-shadow 0.12s ease; }
tbody tr:hover td { background: #f8fbff; }
tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 #2563eb; }
tr.row { cursor: pointer; }
tr.row:hover td { background: #f4f8ff; }
tr.row[aria-expanded="true"] td { background: #eff6ff; }
td.code { width: 112px; font-family: ui-monospace, SFMono-Regular, Consolas, Monaco, monospace; font-size: 12px; font-weight: 600; color: #334155; white-space: nowrap; }
.code-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Consolas, Monaco, monospace;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
td.status { width: 112px; white-space: nowrap; }
td.count { width: 124px; color: var(--muted); font-size: 12px; white-space: nowrap; }

/* Fixed-column Fullscreen Data Tables */
.progress-table {
  table-layout: fixed;
  width: 100%;
  min-width: 920px;
}
.progress-table th.col-code,
.progress-table td.code { width: 108px; }
.progress-table th.col-title,
.progress-table td.item-title-cell { width: 31%; }
.progress-table th.col-status,
.progress-table td.status { width: 126px; }
.progress-table th.col-acceptance,
.progress-table td.acceptance-status { width: 124px; }
.progress-table th.col-note,
.progress-table td.item-note-cell { width: auto; }
.progress-table th.col-count,
.progress-table td.count { width: 132px; text-align: right; }
.item-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.item-title-text {
  font-weight: 550;
  color: #0f172a;
  line-height: 1.48;
  word-break: break-word;
}
.item-note-cell {
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}
.progress-table tr.detail-row > td {
  padding: 0;
  background: #fbfdff;
}
.progress-table tr.detail-row:hover > td {
  background: #fbfdff;
  box-shadow: none;
}

.feedback-table {
  table-layout: fixed;
  width: 100%;
  min-width: 860px;
}
.feedback-table th.col-idx,
.feedback-table td.col-idx { width: 64px; }
.feedback-table th.col-issue,
.feedback-table td.col-issue { width: 38%; }
.feedback-table th.col-items,
.feedback-table td.col-items { width: auto; }
.feedback-table th.col-status,
.feedback-table td.status { width: 128px; }
.feedback-table th.col-count,
.feedback-table td.count { width: 116px; text-align: right; }
.feedback-table tr.detail-row > td {
  padding: 0;
  background: #fbfdff;
}
.feedback-table tr.detail-row:hover > td {
  background: #fbfdff;
  box-shadow: none;
}
.feedback-title {
  font-weight: 600;
  color: #0f172a;
  line-height: 1.45;
}
.feedback-desc {
  margin-top: 3px;
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.5;
}

.users-table {
  table-layout: fixed;
  width: 100%;
  min-width: 980px;
}
.users-table th.col-member,
.users-table td.col-member { width: 22%; }
.users-table th.col-username,
.users-table td.col-username { width: 13%; }
.users-table th.col-role,
.users-table td.col-role { width: 120px; }
.users-table th.col-state,
.users-table td.col-state { width: 124px; }
.users-table th.col-devices,
.users-table td.col-devices { width: 102px; }
.users-table th.col-created,
.users-table td.col-created { width: 152px; }
.users-table th.col-actions,
.users-table td.col-actions { width: auto; }
.users-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 16px;
  align-items: stretch;
}
.users-bottom-grid > .group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}
@media (max-width: 1240px) {
  .users-bottom-grid { grid-template-columns: 1fr; }
}

.audit-table {
  table-layout: fixed;
  width: 100%;
  min-width: 720px;
}
.audit-table th.col-time,
.audit-table td.col-time { width: 148px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.audit-table th.col-proj,
.audit-table td.col-proj { width: 132px; }
.audit-table th.col-action,
.audit-table td.col-action { width: 18%; }
.audit-table th.col-actor,
.audit-table td.col-actor { width: 156px; }
.audit-table th.col-target,
.audit-table td.col-target { width: auto; word-break: break-word; }
.audit-table th.col-ip,
.audit-table td.col-ip { width: 132px; text-align: right; white-space: nowrap; }

.kanban-mod-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  margin: 0 0 14px;
  background: #fff;
  border: 1px solid #dfe7f1;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
}
.kanban-mod-bar .btn.small {
  height: 30px;
  padding: 0 11px;
}

.msg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: stretch;
}
.msg-grid > .group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}
.msg-grid > .group > .detail {
  flex: 1;
}
@media (max-width: 960px) {
  .msg-grid { grid-template-columns: 1fr; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 9px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
  font-weight: 550;
  border: 1px solid transparent;
}
.badge.done, .badge.pstatus-delivered, .badge.health-healthy {
  color: #15803d; background: #f0fdf4; border-color: #bbf7d0;
}
.badge.doing, .badge.pstatus-active, .badge.pstatus-testing, .badge.pstatus-accepting, .badge.health-warning {
  color: #b45309; background: #fffbeb; border-color: #fde68a;
}
.badge.todo, .badge.health-risk {
  color: #b91c1c; background: #fef2f2; border-color: #fecaca;
}
.badge.pstatus-planning {
  color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe;
}
.badge.pstatus-paused, .badge.pstatus-archived, .badge.plain {
  color: #475569; background: #f8fafc; border-color: #e2e8f0;
}
.badge.done::before, .badge.doing::before, .badge.todo::before,
.badge.pstatus-delivered::before, .badge.pstatus-active::before, .badge.pstatus-testing::before,
.badge.pstatus-accepting::before, .badge.pstatus-planning::before,
.badge.health-healthy::before, .badge.health-warning::before, .badge.health-risk::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.badge.ai-kind { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }
.badge.prio-high { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.badge.prio-medium { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.badge.prio-low { color: #475569; background: #f8fafc; border-color: #e2e8f0; }

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 5px;
  background: #f5f7ff;
  border: 1px solid #e0e7ff;
  color: #4338ca;
  margin-right: 4px;
}
.chip {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  margin: 0 4px 4px 0;
}
.chip i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; }
.chip.done i { background: var(--done); }
.chip.doing i { background: #f59e0b; }
.chip.todo i { background: #ef4444; }

.detail { padding: 14px 20px 18px; background: #fbfdff; }
.detail h3 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); font-weight: 600; }
.detail > :first-child { margin-top: 0; }
tr.detail-row .detail .pre,
tr.detail-row .detail .history,
tr.detail-row .detail .detail-progress-bar,
tr.detail-row .detail .status-history-list,
tr.detail-row .detail .thread,
tr.detail-row .detail .comment-form {
  max-width: 1060px;
}
.pre { white-space: pre-wrap; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0; font-size: 13px; }
.history { margin: 0; padding-left: 18px; font-size: 13px; }
.history li { margin-bottom: 4px; }
.empty { padding: 36px 24px; text-align: center; color: var(--muted); }

/* Multi-Project Table & Kanban Columns */
.proj-table td { vertical-align: middle; padding: 14px 16px; }
.proj-name-cell { min-width: 280px; }
.proj-name-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proj-name-link {
  font-weight: 650;
  font-size: 14.5px;
  color: #0f172a;
  line-height: 1.4;
  letter-spacing: -0.005em;
  transition: color .14s ease;
}
.proj-name-link:hover { color: #1d4ed8; text-decoration: none; }
.proj-sub { color: #64748b; font-size: 12.5px; line-height: 1.5; margin-top: 3px; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.proj-tags .tag { margin-right: 0; padding: 2px 7px; font-size: 11.5px; border-radius: 5px; }
.tag.tag-meta { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.proj-stage-cell { min-width: 124px; max-width: 200px; }
.proj-stage-note { color: #64748b; font-size: 12px; line-height: 1.45; margin-top: 5px; white-space: normal; }
.proj-progress-cell { min-width: 224px; width: 248px; }
.proj-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
  margin-bottom: 7px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.proj-progress-top strong { font-size: 13.5px; font-weight: 700; color: #0f172a; }
.proj-metric-cell { white-space: nowrap; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.proj-metric-main { font-weight: 600; color: #1e293b; }
.proj-time-cell { white-space: nowrap; font-size: 12.5px; color: #64748b; font-variant-numeric: tabular-nums; }
.proj-actions-cell { min-width: 256px; }
.proj-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.proj-actions .btn.small { padding: 4px 10px; font-size: 12px; font-weight: 550; border-radius: 7px; }

@media (max-width: 1580px) {
  .proj-table th,
  .proj-table td { padding: 12px 10px; }
  .proj-table td.code { width: 92px; }
  .proj-table td.status { width: 78px; }
  .proj-name-cell { min-width: 210px; }
  .proj-stage-cell { min-width: 108px; max-width: 162px; }
  .proj-progress-cell { min-width: 194px; width: auto; }
  .proj-progress-top { gap: 6px; font-size: 11.5px; }
  .proj-actions-cell { min-width: 184px; }
  .proj-actions { gap: 5px; }
  .proj-actions .btn.small { padding: 3.5px 8px; font-size: 11.5px; }
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(300px, 1fr));
  gap: 14px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-board.stage-board {
  grid-template-columns: repeat(5, minmax(240px, 1fr));
}
.kanban-col {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 11px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 8px;
  font-weight: 700;
  font-size: 13.5px;
  border-bottom: 2px solid #cbd5e1;
}
.kanban-col.col-todo .kanban-col-head { border-color: #ef4444; }
.kanban-col.col-doing .kanban-col-head { border-color: #f59e0b; }
.kanban-col.col-done .kanban-col-head { border-color: #16a34a; }
.kanban-cards { display: flex; flex-direction: column; gap: 8px; max-height: 74vh; overflow-y: auto; padding-right: 2px; }
.kcard {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 13px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.kcard:hover { border-color: #93c5fd; box-shadow: 0 6px 16px -4px rgba(37, 99, 235, 0.12); transform: translateY(-1px); }
.kcard-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12px; }
.kcard-title { font-weight: 650; font-size: 13.5px; line-height: 1.45; margin-bottom: 5px; color: #0f172a; }
.kcard-note { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; line-height: 1.5; }
.kcard-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); padding-top: 8px; border-top: 1px solid #f1f5f9; }

/* Guides, Accounts & Panels */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols, 3), minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.grid[data-cols="1"] {
  max-width: 840px;
}
.grid > .empty {
  grid-column: 1 / -1;
}
@media (max-width: 1480px) {
  .grid { grid-template-columns: repeat(var(--grid-cols-lg, 3), minmax(0, 1fr)); }
}
@media (max-width: 1120px) {
  .grid { grid-template-columns: repeat(var(--grid-cols-md, 2), minmax(0, 1fr)); }
}
.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.panel > details { margin-top: auto; padding-top: 8px; }
.panel h2 { font-size: 15px; font-weight: 650; margin: 0 0 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #0f172a; }
.panel ol { margin: 8px 0; padding-left: 20px; }
.panel ol li { margin-bottom: 5px; line-height: 1.6; }
.kv { display: grid; grid-template-columns: 76px 1fr; gap: 6px 10px; font-size: 13px; margin: 8px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; word-break: break-all; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, Monaco, monospace; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* AI Generated Page Viewer */
.ai-viewer-layout { display: grid; grid-template-columns: 296px 1fr; gap: 16px; align-items: start; }
.ai-page-list { display: flex; flex-direction: column; gap: 8px; }
.ai-page-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
  transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease;
}
.ai-page-item:hover { border-color: #c4b5fd; background: #fcfaff; }
.ai-page-item.active {
  border-color: #8b5cf6;
  background: #faf5ff;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.2), 0 4px 12px -4px rgba(109, 40, 217, 0.14);
}
.ai-frame-wrap {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 8px 24px -8px rgba(15, 23, 42, 0.06);
}
.ai-frame-bar {
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
  border-bottom: 1px solid #e6edf5;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.ai-iframe { width: 100%; height: calc(100vh - 176px); min-height: 620px; border: 0; background: #fff; display: block; }

/* Dark Command Center Big Screen (全局大屏 & 项目大屏) */
.big-screen {
  background: radial-gradient(circle at 15% 15%, #172554 0%, #090f1f 55%, #050811 100%);
  color: #e2e8f0;
  border-radius: 14px;
  padding: 20px 22px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.45);
}
.big-screen:fullscreen {
  border-radius: 0;
  border: 0;
  overflow-y: auto;
  padding: 24px 32px;
}
.bs-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
}
.bs-title { font-size: 22px; font-weight: 800; letter-spacing: .5px; color: #f8fafc; margin: 0; }
.bs-sub { font-size: 12.5px; color: #94a3b8; margin-top: 2px; }
.bs-clock { font-family: Consolas, monospace; font-size: 14px; color: #38bdf8; }
.bs-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.bs-kpi {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}
.bs-kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 3px;
  background: #38bdf8;
}
.bs-kpi.green::before { background: #22c55e; }
.bs-kpi.amber::before { background: #f59e0b; }
.bs-kpi.red::before { background: #ef4444; }
.bs-kpi.purple::before { background: #a855f7; }
.bs-kpi b { display: block; font-size: 28px; line-height: 1.15; color: #f8fafc; font-variant-numeric: tabular-nums; }
.bs-kpi span { font-size: 12px; color: #94a3b8; }

.bs-grid-3 { display: grid; grid-template-columns: 320px 1fr 340px; gap: 14px; margin-bottom: 14px; }
.bs-grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; }
.bs-card {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 12px;
  padding: 14px 16px;
}
.bs-card h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #7dd3fc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bs-rings { display: flex; justify-content: space-around; align-items: center; gap: 12px; padding: 6px 0; }
.bs-ring-box { text-align: center; }
.bs-ring-box .ring-caption { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.bs-bar-list { display: flex; flex-direction: column; gap: 10px; }
.bs-bar-row { display: flex; flex-direction: column; gap: 4px; }
.bs-bar-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: #cbd5e1; }
.bs-track { display: flex; height: 9px; border-radius: 5px; overflow: hidden; background: rgba(148, 163, 184, 0.18); }
.bs-track .done { background: linear-gradient(90deg, #16a34a, #4ade80); }
.bs-track .doing { background: #f59e0b; }
.bs-track .todo { background: rgba(148, 163, 184, 0.28); }
.bs-feed { display: flex; flex-direction: column; gap: 8px; max-height: 290px; overflow-y: auto; }
.bs-feed-item {
  background: rgba(30, 41, 59, 0.55);
  border-left: 3px solid #38bdf8;
  border-radius: 0 8px 8px 0;
  padding: 8px 10px;
  font-size: 12.5px;
}
.bs-feed-item.warn { border-left-color: #f59e0b; }
.bs-feed-item.danger { border-left-color: #ef4444; }
.bs-feed-meta { font-size: 11.5px; color: #94a3b8; margin-bottom: 2px; display: flex; justify-content: space-between; gap: 8px; }

/* Comments */
.thread { margin-top: 6px; }
.comment { border-left: 3px solid var(--line); padding: 6px 10px; margin: 8px 0; background: #fff; border-radius: 0 8px 8px 0; }
.comment.issue { border-color: #ef4444; }
.comment.question { border-color: #f59e0b; }
.comment.confirmed { border-color: var(--done); }
.comment.resolved { opacity: .65; }
.comment .head { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.comment .body { white-space: pre-wrap; margin: 2px 0; }
.replies { margin-left: 18px; }
.comment-form { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; align-items: start; margin-top: 8px; }

/* Login, Dialog, Toast */
.login { max-width: 440px; margin: 10vh auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: 0 10px 28px rgba(15, 23, 42, .06); }
.login h1 { font-size: 20px; margin: 0 0 6px; }
.login-tabs { display: flex; width: 100%; margin: 12px 0 16px; }
.login-tabs button { flex: 1; padding: 7px 10px; }
.inline-pass-row { display: flex; gap: 6px; align-items: center; }
.inline-pass-row input { flex: 1; }
.badge.user-role-admin { color: var(--purple); background: var(--purple-bg); }
.badge.user-role-member { color: var(--cyan); background: var(--cyan-bg); }
.badge.user-role-customer { color: var(--doing); background: var(--doing-bg); }
.tag.tag-member { background: #ecfeff; color: #0e7490; }
.rbac-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.rbac-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.rbac-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(780px, 94vw); }
dialog::backdrop { background: rgba(15, 23, 42, .45); }
dialog header { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
dialog .content { padding: 14px 18px; max-height: 76vh; overflow: auto; }
dialog footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
#toast { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
#toast div { background: #1f2937; color: #fff; padding: 9px 14px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
#toast div.error { background: #b91c1c; }

/* Customer acceptance */
.badge.acceptance-pending { color: var(--muted); background: var(--bg); border: 1px solid var(--line); }
.badge.acceptance-accepted { color: var(--done); background: var(--done-bg); }
.badge.acceptance-rejected { color: var(--todo); background: var(--todo-bg); }
.acceptance-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 11px 16px;
  background: #fff;
  border: 1px solid #dfe7f1;
  border-radius: 12px;
  margin: 0 0 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 4px 12px rgba(15, 23, 42, 0.02);
}
.acceptance-summary > strong {
  font-size: 13px;
  font-weight: 650;
  color: #0f172a;
  white-space: nowrap;
}
.acceptance-metrics {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.acceptance-metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #334155;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.acceptance-right {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 12px;
  margin-left: auto;
  min-width: 0;
}
.acceptance-baseline {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}
.acceptance-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.acceptance-status { white-space: nowrap; width: 116px; }
.acceptance-section { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 8px; }
.acceptance-editor { max-width: 720px; }

/* Updates Executive List (#p/:slug/updates) */
.upd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.upd-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.upd-count-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-ink);
  background: var(--brand-soft);
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}
.upd-baseline-text {
  font-size: 12.5px;
  color: var(--muted);
}
.upd-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.upd-search {
  width: 240px;
  max-width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-size: 13px;
}
.upd-search:focus {
  outline: none;
  border-color: #93c5fd;
  background: #fff;
}
.upd-list-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.upd-list-head {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr) 110px 76px;
  gap: 14px;
  padding: 10px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.upd-head-act { text-align: right; }
.upd-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.upd-row {
  border-bottom: 1px solid #eef2f7;
}
.upd-row:last-child { border-bottom: 0; }
.upd-row.is-latest > .upd-row-btn {
  box-shadow: inset 3px 0 0 var(--brand);
}
.upd-row.is-open {
  background: #fbfdff;
}
.upd-row-btn {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 13px 18px;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr) 110px 76px;
  align-items: center;
  gap: 14px;
  transition: background-color 0.14s ease;
}
.upd-row-btn:hover { background: #f4f8ff; }
.upd-col-time {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.upd-seq {
  font-family: Consolas, Monaco, monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  flex: none;
}
.upd-date-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.upd-date-stack strong { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.upd-date-stack small { font-size: 11.5px; color: var(--muted); font-family: Consolas, Monaco, monospace; }
.upd-col-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.upd-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.upd-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upd-latest-badge {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--brand-ink);
  background: var(--brand-soft);
  border: 1px solid #bfdbfe;
}
.upd-excerpt {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upd-col-author { min-width: 0; }
.upd-author-chip {
  display: inline-block;
  font-size: 12px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upd-col-toggle { text-align: right; }
.upd-toggle-label {
  font-size: 12px;
  font-weight: 550;
  color: var(--brand-ink);
  white-space: nowrap;
}
.upd-toggle-muted { font-size: 12px; color: var(--muted); }
.upd-row-detail {
  padding: 4px 24px 16px 196px;
  border-top: 1px dashed #e2e8f0;
  background: #f8fafc;
}
.upd-rich {
  font-size: 13px;
  line-height: 1.72;
  color: #334155;
  max-width: 88ch;
}
.upd-rich p { margin: 8px 0 0; }
.upd-points { margin: 6px 0 0; padding-left: 20px; }
.upd-points li { margin: 5px 0; }
.upd-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

@media (max-width: 1100px) {
  .bs-grid-3, .bs-grid-2 { grid-template-columns: 1fr; }
  .ai-viewer-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .top-inner { flex-direction: column; align-items: flex-start; }
  .comment-form { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  td.count { display: none; }
  .upd-list-head { display: none; }
  .upd-row-btn {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding: 12px 14px;
  }
  .upd-col-time { grid-column: 1; }
  .upd-col-author { display: none; }
  .upd-col-main { grid-column: 1 / -1; }
  .upd-title { white-space: normal; }
  .upd-col-toggle { grid-column: 2; grid-row: 1; }
  .upd-row-detail { padding: 6px 14px 14px 16px; }
  .upd-search { width: 100%; }
}


/* ===== Admin Key Management Center (#keys) ===== */
@media (max-width: 960px) {
  .cards.cards-4,
  .cards:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.key-warn-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 12px 16px;
  margin-bottom: 14px;
  border-radius: 11px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 13px;
}
.key-warn-banner strong { color: #b91c1c; font-weight: 700; }
.key-scope-banner {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 9px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 12.5px;
}
.key-scope-banner strong { font-size: 13px; color: #15803d; }
.key-receipt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #dbe3ee;
}
.key-receipt-code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, Monaco, monospace;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-all;
}
.keys-table { min-width: 1120px; }
.keys-table th { white-space: nowrap; }
.keys-table td { vertical-align: middle; padding: 13px 16px; }
.keys-table td.key-col-name { min-width: 168px; }
.keys-table td.key-col-role { width: 108px; white-space: nowrap; }
.keys-table td.key-col-scope { min-width: 220px; }
.keys-table td.key-col-secret { min-width: 208px; white-space: nowrap; }
.keys-table td.key-col-status { width: 128px; white-space: nowrap; }
.keys-table td.key-col-used { width: 128px; white-space: nowrap; }
.keys-table td.key-col-actions { min-width: 280px; }
.key-row-revoked td { opacity: 0.62; background: #fafbfd; }
.key-scope-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.key-proj-link {
  font-weight: 600;
  color: #0f172a;
  font-size: 13px;
}
.key-proj-link:hover { color: #1d4ed8; }
.key-secret-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.key-hint-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Consolas, Monaco, monospace;
  font-size: 12px;
  color: #334155;
  white-space: nowrap;
}
.key-hint-pill.is-revealed {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e3a8a;
  font-weight: 600;
  white-space: normal;
  word-break: break-all;
  max-width: 300px;
}
.keys-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.key-mini-btn {
  border: 1px solid #d5dfeb;
  background: #fff;
  color: #475569;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .14s, color .14s, background-color .14s;
}
.key-mini-btn:hover { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.btn.is-copied {
  border-color: #15803d !important;
  background: #f0fdf4 !important;
  color: #15803d !important;
}
.btn.key-share-btn {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}
.btn.key-share-btn:hover {
  border-color: #93c5fd;
  background: #dbeafe;
  color: #1e40af;
}
.key-pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.key-pick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.key-pick-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
.key-pick-meta strong {
  font-size: 13px;
  color: #0f172a;
}

/* ===== Project Home (#p/<slug>/home) ===== */
.ph-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ph-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 22px;
  flex-wrap: wrap;
  padding: 13px 20px;
  border-radius: 13px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.ph-strip-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ph-stage-text {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}
.ph-strip-center {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 340px;
  min-width: 240px;
}
.ph-bar-track {
  position: relative;
  display: flex;
  flex: 1 1 160px;
  min-width: 120px;
  max-width: 360px;
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}
.ph-bar-track .seg-done {
  display: block;
  height: 100%;
  background: #16a34a;
}
.ph-bar-track .seg-doing {
  display: block;
  height: 100%;
  background: #2563eb;
}
.ph-pct {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ph-counts {
  font-size: 12.5px;
  color: #64748b;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ph-strip-right {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  margin-left: auto;
}
.ph-meta-dim {
  font-size: 12.5px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.ph-strip-link {
  font-size: 13px;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
  white-space: nowrap;
}
.ph-strip-link:hover { text-decoration: underline; }
.ph-presale-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ph-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #64748b;
  font-weight: 500;
}
.ph-step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  display: inline-block;
}
.ph-step.is-done { color: #15803d; }
.ph-step.is-done .ph-step-dot { background: #16a34a; }
.ph-step.is-current { color: #1d4ed8; font-weight: 650; }
.ph-step.is-current .ph-step-dot {
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .16);
}
.ph-step-sep {
  width: 18px;
  height: 1px;
  background: #dbe3ee;
  margin: 0 2px;
}

.ph-portal-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ph-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}
.ph-section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -.01em;
}
.ph-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1120px) {
  .ph-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ph-grid { grid-template-columns: 1fr; }
}
.ph-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .03);
  text-decoration: none;
  text-align: left;
  font: inherit;
  color: inherit;
  min-height: 172px;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.ph-card.is-ready {
  cursor: pointer;
}
.ph-card.is-ready:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 10px 24px -12px rgba(15, 23, 42, .16);
}
.ph-card.tone-prod.is-ready:hover { border-color: #6ee7b7; }
.ph-card.tone-proto.is-ready:hover { border-color: #c4b5fd; }
.ph-card.tone-contract.is-ready:hover { border-color: #fcd34d; }
.ph-card.is-empty {
  background: #f8fafc;
  border-style: dashed;
  border-color: #cbd5e1;
}
.ph-card.is-configurable {
  cursor: pointer;
}
.ph-card.is-configurable:hover {
  background: #ffffff;
  border-color: #93c5fd;
  border-style: solid;
}
.ph-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ph-ico {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.ph-ico.tone-prod { background: #ecfdf5; color: #059669; }
.ph-ico.tone-test { background: #eff6ff; color: #2563eb; }
.ph-ico.tone-proto { background: #f5f3ff; color: #7c3aed; }
.ph-ico.tone-contract { background: #fffbeb; color: #d97706; }
.ph-card.is-empty .ph-ico {
  background: #eef2f7;
  color: #94a3b8;
}
.ph-state {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.ph-state.is-ready { background: #ecfdf5; color: #15803d; border: 1px solid #bbf7d0; }
.ph-state.is-builtin { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.ph-state.is-muted { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.ph-card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.ph-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -.01em;
}
.ph-card.is-empty .ph-card-title { color: #475569; }
.ph-card-sub {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-card-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ph-card.is-empty .ph-card-foot { border-top-color: #e2e8f0; }
.ph-action {
  font-size: 13px;
  font-weight: 650;
  color: #1d4ed8;
  white-space: nowrap;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
}
.ph-card-stretch {
  cursor: pointer;
}
.ph-card-stretch::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 14px;
}
.ph-card.tone-prod.is-ready .ph-action { color: #047857; }
.ph-card.tone-proto.is-ready .ph-action { color: #6d28d9; }
.ph-card.tone-contract.is-ready .ph-action { color: #b45309; }
.ph-action.is-muted { color: #94a3b8; font-weight: 550; }
.ph-sub-link {
  position: relative;
  z-index: 2;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  white-space: nowrap;
  transition: background-color .14s, color .14s;
}
.ph-sub-link:hover { background: #e2e8f0; color: #0f172a; }

.ph-quick-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-radius: 13px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}
.ph-quick-label {
  font-size: 12.5px;
  font-weight: 650;
  color: #64748b;
  white-space: nowrap;
}
.ph-quick-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ph-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 12.5px;
  font-weight: 550;
  color: #334155;
  text-decoration: none;
  transition: border-color .14s, color .14s, background-color .14s;
}
.ph-pill:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.ph-latest {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.ph-latest-tag {
  font-size: 11.5px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #334155;
  white-space: nowrap;
}
.ph-latest-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 550;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-latest-time {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ===== Manual Status Update Controls & Change History ===== */
.status-trigger,
.acceptance-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .13s ease, box-shadow .13s ease, border-color .13s ease, background-color .13s ease;
}
.status-trigger-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.status-edit-ico {
  opacity: 0.55;
  flex: none;
  transition: opacity .13s ease, transform .13s ease;
}
.status-trigger:hover .status-edit-ico,
.acceptance-trigger:hover .status-edit-ico {
  opacity: 1;
  transform: scale(1.06);
}
.status-trigger.done {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.status-trigger.done:hover {
  background: #dcfce7;
  border-color: #4ade80;
  box-shadow: 0 2px 8px rgba(21, 128, 61, 0.14);
  transform: translateY(-0.5px);
}
.status-trigger.doing {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}
.status-trigger.doing:hover {
  background: #fef3c7;
  border-color: #f59e0b;
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.14);
  transform: translateY(-0.5px);
}
.status-trigger.todo {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}
.status-trigger.todo:hover {
  background: #fee2e2;
  border-color: #f87171;
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.14);
  transform: translateY(-0.5px);
}
.acceptance-trigger.acceptance-pending {
  color: var(--muted);
  background: var(--bg);
  border-color: var(--line);
}
.acceptance-trigger.acceptance-pending:hover {
  color: #1e293b;
  background: #e2e8f0;
  border-color: #94a3b8;
}
.acceptance-trigger.acceptance-accepted {
  color: var(--done);
  background: var(--done-bg);
  border-color: #bbf7d0;
}
.acceptance-trigger.acceptance-accepted:hover {
  border-color: #4ade80;
}
.acceptance-trigger.acceptance-rejected {
  color: var(--todo);
  background: var(--todo-bg);
  border-color: #fecaca;
}
.acceptance-trigger.acceptance-rejected:hover {
  border-color: #f87171;
}

.status-modal {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.status-modal .field {
  margin-bottom: 0;
}
.status-modal-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.status-modal-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.status-modal-title {
  font-size: 14px;
  font-weight: 650;
  color: #0f172a;
  line-height: 1.4;
}
.status-transition-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.status-arrow {
  color: #94a3b8;
  font-weight: 700;
  font-size: 13px;
}
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 2px;
}
.req-mark {
  color: #dc2626;
  font-weight: 700;
}
.char-counter {
  font-size: 11.5px;
  font-weight: 500;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.status-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 600px) {
  .status-picker { grid-template-columns: 1fr; }
}
.status-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #dbe3ee;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease;
}
.status-opt:hover:not(:disabled) {
  border-color: #93c5fd;
  background: #f8fbff;
}
.status-opt.is-current {
  background: #f8fafc;
  border-style: dashed;
  border-color: #cbd5e1;
  opacity: 0.68;
  cursor: not-allowed;
}
.status-opt.is-selected.opt-done {
  border-color: #16a34a;
  background: #f0fdf4;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.14);
}
.status-opt.is-selected.opt-doing {
  border-color: #d97706;
  background: #fffbeb;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.15);
}
.status-opt.is-selected.opt-todo {
  border-color: #dc2626;
  background: #fef2f2;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.14);
}
.status-opt-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  font-size: 13.5px;
  color: #0f172a;
}
.status-opt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.status-opt-dot.done { background: #16a34a; }
.status-opt-dot.doing { background: #f59e0b; }
.status-opt-dot.todo { background: #ef4444; }
.status-opt-cur {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #e2e8f0;
  padding: 1px 6px;
  border-radius: 999px;
}
.status-opt-desc {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.4;
}
textarea.is-invalid,
input.is-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.sync-note-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: #334155;
  cursor: pointer;
  user-select: none;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.sync-note-check input {
  margin-top: 2px;
  flex: none;
}
.status-modal-history {
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}
.status-modal-history:empty {
  display: none;
}
.status-modal-history-title {
  font-size: 12px;
  font-weight: 650;
  color: #64748b;
  margin-bottom: 8px;
}

.detail-progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.detail-progress-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.detail-progress-note {
  margin: 4px 0 8px;
  color: #334155;
  font-size: 13.5px;
  line-height: 1.6;
}

.status-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 1060px;
}
.status-history-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.status-history-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}
.status-history-flow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status-history-actor {
  font-weight: 600;
  color: #334155;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 1px 7px;
}
.status-history-time {
  margin-left: auto;
  color: #94a3b8;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.status-history-reason {
  font-size: 12.5px;
  color: #334155;
  line-height: 1.55;
  background: #f8fafc;
  border-left: 3px solid #93c5fd;
  border-radius: 0 6px 6px 0;
  padding: 5px 9px;
  white-space: pre-wrap;
  word-break: break-word;
}
.status-history-reason strong {
  color: #1e3a8a;
  font-weight: 600;
}

.kcard-status-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  color: #1d4ed8;
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background-color .13s ease, border-color .13s ease, color .13s ease;
}
.kcard-status-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
}
.kcard-status-btn .status-edit-ico {
  opacity: 0.85;
}

/* ===== Project Stage Selector & Unified CRUD Modals ===== */
.stage-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .13s ease, box-shadow .13s ease, border-color .13s ease, background-color .13s ease;
}
.stage-trigger:hover .status-edit-ico { opacity: 1; transform: scale(1.06); }
.stage-trigger.pstatus-delivered { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.stage-trigger.pstatus-delivered:hover { background: #dcfce7; border-color: #4ade80; box-shadow: 0 2px 8px rgba(21, 128, 61, 0.14); }
.stage-trigger.pstatus-active,
.stage-trigger.pstatus-testing,
.stage-trigger.pstatus-accepting { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.stage-trigger.pstatus-active:hover,
.stage-trigger.pstatus-testing:hover,
.stage-trigger.pstatus-accepting:hover { background: #fef3c7; border-color: #f59e0b; box-shadow: 0 2px 8px rgba(180, 83, 9, 0.14); }
.stage-trigger.pstatus-planning { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.stage-trigger.pstatus-planning:hover { background: #dbeafe; border-color: #60a5fa; box-shadow: 0 2px 8px rgba(29, 78, 216, 0.14); }
.stage-trigger.pstatus-paused,
.stage-trigger.pstatus-archived { color: #475569; background: #f8fafc; border-color: #e2e8f0; }
.stage-trigger.pstatus-paused:hover,
.stage-trigger.pstatus-archived:hover { background: #f1f5f9; border-color: #94a3b8; }

.stage-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 680px) {
  .stage-picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stage-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1.5px solid #dbe3ee;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color .14s ease, background-color .14s ease, box-shadow .14s ease;
}
.stage-opt:hover { border-color: #93c5fd; background: #f8fbff; }
.stage-opt.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.stage-opt.is-selected.opt-delivered {
  border-color: #16a34a;
  background: #f0fdf4;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
}
.stage-opt.is-selected.opt-active,
.stage-opt.is-selected.opt-testing,
.stage-opt.is-selected.opt-accepting {
  border-color: #d97706;
  background: #fffbeb;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.15);
}
.stage-opt-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  font-size: 13px;
  color: #0f172a;
}
.stage-opt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: #64748b;
}
.stage-opt-dot.pstatus-planning { background: #2563eb; }
.stage-opt-dot.pstatus-active,
.stage-opt-dot.pstatus-testing,
.stage-opt-dot.pstatus-accepting { background: #f59e0b; }
.stage-opt-dot.pstatus-delivered { background: #16a34a; }

.stage-preset-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.stage-chip-btn {
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color .13s, background-color .13s, color .13s;
}
.stage-chip-btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.pill-choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.pill-choice-row.pill-choice-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1.5px solid #dbe3ee;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  transition: border-color .14s, background-color .14s, box-shadow .14s;
}
.choice-card:hover { border-color: #93c5fd; background: #f8fbff; }
.choice-card.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}
.choice-pill {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1.5px solid #dbe3ee;
  background: #fff;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: border-color .14s, background-color .14s, color .14s;
}
.choice-pill.tone-healthy.is-selected { border-color: #16a34a; background: #f0fdf4; color: #15803d; }
.choice-pill.tone-warning.is-selected { border-color: #d97706; background: #fffbeb; color: #b45309; }
.choice-pill.tone-risk.is-selected { border-color: #dc2626; background: #fef2f2; color: #b91c1c; }

.crud-form {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 640px) {
  .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
}

.btn.danger-solid {
  background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
  border-color: #b91c1c;
  color: #fff;
  font-weight: 600;
}
.btn.danger-solid:hover {
  background: linear-gradient(180deg, #b91c1c 0%, #991b1b 100%);
  border-color: #991b1b;
  color: #fff;
}
.link.danger { color: var(--todo); }
.row-act-btn.row-act-danger {
  color: #b91c1c;
  border-color: #fecaca;
}
.row-act-btn.row-act-danger:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #991b1b;
}

.confirm-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.confirm-msg {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: #0f172a;
}
.confirm-detail {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.55;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 9px 12px;
}

.group-head-actions,
.detail-progress-actions,
.card-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.upd-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #dbe3ee;
}
