/* Woodpecker firmware repository — same visual language as Codev CI Artifact (192.168.1.11) */

:root {
  --bg-app: #fafafa;
  --bg-card: #ffffff;
  --bg-subtle: #f4f4f5;
  --bg-hover: #f4f4f5;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-tertiary: #71717a;
  --text-muted: #a1a1aa;

  --sidebar-bg: #3b3b42;
  --sidebar-bg-hover: #52525b;
  --sidebar-active: #2f3a52;
  --sidebar-text: #f4f4f5;
  --sidebar-text-muted: #a1a1aa;

  --accent: #0066ff;
  --accent-hover: #0052cc;
  --accent-bg: #eff6ff;
  --accent-border: #bfdbfe;

  --success: #16a34a;
  --success-bg: #dcfce7;
  --success-border: #bbf7d0;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --info: #2563eb;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;

  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 21px;
  --radius-sm: 3px;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, .06);
  --shadow-ring: 0 0 0 3px rgba(0, 102, 255, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg-app); color: var(--text-primary);
  font-family: var(--font-base); font-size: var(--text-base); line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
h2, h3, h4 { margin: 0; }
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-tertiary); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
.sidebar ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); }

.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon-sm { width: 13px; height: 13px; vertical-align: -2px; }

/* ------------------------------------------------ layout */
.app { display: flex; gap: 12px; height: 100vh; padding: 12px; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.column { min-width: 0; min-height: 0; }
.column-list { width: 360px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }
.column-detail { flex: 1; overflow-y: auto; padding: 16px 18px 24px; }

/* ------------------------------------------------ column 1: sidebar */
.sidebar {
  width: 260px; flex-shrink: 0; background: var(--sidebar-bg); color: var(--sidebar-text);
  border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; overflow: hidden;
}
.sidebar > h2 {
  font-size: var(--text-lg); font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px;
  padding: 4px 4px 12px; border-bottom: 1px solid rgba(255, 255, 255, .12); margin-bottom: 6px;
}
.project-tree { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.group-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: none; border: 0; color: var(--sidebar-text); cursor: pointer; text-align: left;
  font-size: var(--text-sm); font-weight: 700; letter-spacing: .02em; padding: 10px 8px; border-radius: var(--radius);
}
.group-head:hover { background: rgba(255, 255, 255, .06); }
.group-head .caret { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--sidebar-text-muted); transition: transform .15s; }
.group.collapsed .caret { transform: rotate(-90deg); }
.group.collapsed .group-items { display: none; }
.group-items { display: grid; gap: 2px; padding-bottom: 6px; }
.project-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-radius: var(--radius);
  color: var(--sidebar-text); cursor: pointer; border: 0; background: none; width: 100%; text-align: left; font-size: var(--text-md);
}
.project-item:hover { background: var(--sidebar-bg-hover); text-decoration: none; }
.project-item .folder { color: var(--sidebar-text-muted); }
.project-item .p-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.project-item .p-badge { font-size: var(--text-xs); font-weight: 600; padding: 0 6px; border-radius: 9px; line-height: 17px; background: rgba(255, 255, 255, .1); color: var(--sidebar-text-muted); }
.project-item .p-badge.warn { background: rgba(217, 119, 6, .25); color: #fcd34d; }
.project-item.active { background: var(--sidebar-active); box-shadow: inset 3px 0 0 var(--accent); }
.project-item.active .folder { color: #fff; }
.sidebar-add {
  margin: 6px 0 4px; padding: 10px 8px 4px; border: 0; border-top: 1px solid rgba(255, 255, 255, .12); background: none;
  color: var(--sidebar-text-muted); font-size: var(--text-md); text-align: left; cursor: pointer;
}
.sidebar-add:hover { color: #fff; }
.sidebar-add-plain { border-top: 0; margin-top: 0; padding-top: 2px; }
.sidebar-empty { color: var(--sidebar-text-muted); font-size: var(--text-sm); padding: 12px 8px; line-height: 1.6; }

.sidebar-account { border-top: 1px solid rgba(255, 255, 255, .12); padding: 12px 4px 0; display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); }
.sidebar-account .who { flex: 1; min-width: 0; }
.sidebar-account .who b { display: block; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account .who span { color: var(--sidebar-text-muted); font-size: var(--text-xs); }
.sidebar .btn-dark { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: var(--sidebar-text); }
.sidebar .btn-dark:hover { background: rgba(255, 255, 255, .16); color: #fff; text-decoration: none; }
.sidebar-decor { color: var(--sidebar-text-muted); opacity: .75; padding: 18px 2px 2px; }
.sidebar-decor svg { width: 100%; height: auto; display: block; }

/* ------------------------------------------------ column 2: project card */
.project-card { padding: 16px 18px; }
.project-card h3 { font-size: var(--text-xl); font-weight: 700; letter-spacing: -.01em; }
.project-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.chip {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600; color: var(--text-secondary);
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1px 6px;
}
.project-desc { color: var(--text-secondary); font-size: var(--text-sm); }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.stat {
  border: 1px solid var(--border); background: var(--bg-subtle); border-radius: var(--radius); padding: 7px 4px 6px;
  text-align: center; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, background .15s;
}
.stat:hover { border-color: var(--border-strong); background: #fff; }
.stat.active { border-color: var(--accent); background: var(--accent-bg); box-shadow: var(--shadow-ring); }
.stat b { display: block; font-size: var(--text-xl); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--tone, var(--text-primary)); }
.stat span { font-size: 10.5px; color: var(--text-tertiary); white-space: nowrap; }

/* ------------------------------------------------ column 2: firmware list */
.list-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px 8px; }
.card-label { font-size: var(--text-sm); font-weight: 600; color: var(--text-secondary); }
.card-label .count { color: var(--text-muted); font-weight: 500; margin-left: 2px; }
.icon-btn {
  width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text-tertiary); cursor: pointer;
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { color: var(--accent); border-color: var(--accent-border); background: var(--accent-bg); }
.icon-btn .icon { width: 13px; height: 13px; }

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 16px 12px; border-bottom: 1px solid var(--border); }
.filters label { display: grid; gap: 3px; font-size: var(--text-xs); color: var(--text-tertiary); font-weight: 600; }
.filters .f-wide { grid-column: 1 / -1; }
.filters .link-btn { justify-self: start; }
input, select, textarea {
  font: inherit; font-size: var(--text-sm); color: var(--text-primary); background: var(--bg-card); width: 100%; min-width: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s;
}
input, select { height: 28px; padding: 0 8px; }
textarea { padding: 6px 8px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-ring); }
.active-filter { display: flex; align-items: center; gap: 6px; padding: 0 16px 8px; font-size: var(--text-xs); color: var(--text-tertiary); }
.active-filter .tag { display: inline-flex; align-items: center; gap: 4px; }
.active-filter button { border: 0; background: none; cursor: pointer; color: inherit; padding: 0; display: grid; }

.build-list { flex: 1; overflow-y: auto; padding: 0 16px 12px; }
.build-node {
  padding: 8px 10px; border-bottom: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
  display: grid; gap: 4px; transition: background-color .15s;
}
.build-node:last-child { border-bottom: 0; }
.build-node:hover { background: var(--bg-hover); }
.build-node.active { background: var(--accent-bg); box-shadow: inset 2px 0 0 var(--accent); }
.bn-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.build-number { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600; flex-shrink: 0; }
.build-node.active .build-number { color: var(--accent); }
.build-time { font-size: var(--text-xs); color: var(--text-tertiary); white-space: nowrap; }
.build-tag {
  margin-left: auto; background: var(--accent-bg); color: var(--accent-hover); border: 1px solid var(--accent-border);
  padding: 1px 7px; border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: 500; font-family: var(--font-mono);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; flex-shrink: 1;
}
.bn-sub { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--text-tertiary); min-width: 0; }
.bn-model { font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.bn-badges { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.bn-issues { color: var(--danger); font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.empty-state { display: grid; justify-items: center; gap: 6px; color: var(--text-muted); padding: 40px 12px; text-align: center; font-size: var(--text-sm); }
.empty-state .icon { width: 30px; height: 30px; color: var(--accent-border); stroke-width: 1.5; }

/* status badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: var(--radius-sm); font-size: var(--text-xs);
  font-weight: 600; line-height: 18px; border: 1px solid var(--border); background: var(--bg-subtle); color: var(--text-secondary); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.st-testing { color: var(--info); background: var(--info-bg); border-color: var(--info-border); }
.st-passed, .st-published, .st-fixed { color: var(--success); background: var(--success-bg); border-color: var(--success-border); }
.st-failed, .st-withdrawn, .st-critical, .st-open { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }
.st-pending_release, .st-major { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-border); }
.st-pending, .st-draft, .st-minor, .st-wontfix { color: var(--text-tertiary); }

/* ------------------------------------------------ column 3: firmware details */
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 8px; }
.section-label:first-child { margin-top: 0; }
.section-label > span { font-size: var(--text-sm); font-weight: 600; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 6px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.btn {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text-secondary);
  font-size: var(--text-sm); font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .15s;
}
.btn:hover { border-color: var(--text-muted); color: var(--text-primary); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-success { color: var(--success); border-color: var(--success-border); }
.btn-success:hover { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.btn-danger { color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger-hover); border-color: var(--danger); }
.btn-xs { height: 22px; padding: 0 7px; font-size: var(--text-xs); }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: var(--text-xs); font-weight: 600; padding: 0; }
.link-btn:hover { color: var(--accent-hover); text-decoration: underline; }

.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.title-row h3 { font-size: var(--text-2xl); font-weight: 700; font-family: var(--font-mono); letter-spacing: -.01em; }
.title-row .sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }

/* lifecycle */
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 12px 0 4px; padding: 9px 8px 7px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); }
.flow-step { position: relative; display: grid; justify-items: center; gap: 3px; text-align: center; min-width: 0; }
.flow-step::before { content: ""; position: absolute; top: 10px; right: calc(50% + 13px); left: calc(-50% + 13px); height: 2px; background: var(--border-strong); }
.flow-step:first-child::before { display: none; }
.flow-step.done::before, .flow-step.current::before, .flow-step.error::before { background: var(--success); }
.flow-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong); background: var(--bg-card); color: #fff; z-index: 1; }
.flow-dot .icon { width: 12px; height: 12px; stroke-width: 3; }
.flow-step.done .flow-dot { background: var(--success); border-color: var(--success); }
.flow-step.error .flow-dot { background: var(--danger); border-color: var(--danger); }
.flow-step.current .flow-dot { border-color: var(--accent); box-shadow: var(--shadow-ring); }
.flow-step.current .flow-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.flow-name { font-size: var(--text-xs); font-weight: 600; color: var(--text-tertiary); }
.flow-step.done .flow-name, .flow-step.current .flow-name { color: var(--text-primary); }
.flow-step.error .flow-name { color: var(--danger); }
.flow-sub { font-size: 10.5px; color: var(--text-muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.notice { margin-top: 10px; padding: 8px 12px; border-radius: var(--radius); font-size: var(--text-sm); display: flex; gap: 8px; align-items: flex-start; }
.notice-danger { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger-hover); }
.notice-info { background: var(--bg-subtle); border: 1px solid var(--border); color: var(--text-secondary); }

/* info tiles */
.meta-item { padding: 10px 12px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.meta-item.wide { grid-column: 1 / -1; }
.meta-item .label { font-weight: 600; color: var(--text-tertiary); font-size: var(--text-xs); letter-spacing: .04em; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.meta-item .value { color: var(--text-primary); font-size: var(--text-sm); word-break: break-all; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.meta-item .value.mono, .meta-item pre.value { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-secondary); }
.meta-item pre.value { margin: 0; white-space: pre-wrap; word-break: break-word; max-height: 200px; overflow-y: auto; display: block; }
.inline-edit { display: flex; gap: 6px; width: 100%; }

/* project issues link + view */
.issues-link {
  width: 100%; margin-top: 8px; display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); cursor: pointer;
  font: inherit; font-size: var(--text-sm); color: var(--text-secondary); text-align: left;
}
.issues-link:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.issues-link.active { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-hover); }
.issues-link span:first-of-type { flex: 1; font-weight: 600; }
.issues-link b { font-weight: 600; color: var(--text-tertiary); }
.issues-link b.has-open { color: var(--danger); }
.issues-link .arrow { color: var(--text-muted); font-size: 16px; line-height: 1; }
.title-plain { font-family: var(--font-base) !important; }
.sum-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.sum-chip {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 10px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-subtle); cursor: pointer; font: inherit; font-size: var(--text-sm); color: var(--text-secondary);
}
.sum-chip b { font-size: var(--text-md); color: var(--text-primary); }
.sum-chip.st-open b, .sum-chip.st-critical b { color: var(--danger); }
.sum-chip.st-fixed b { color: var(--success); }
.sum-chip.st-major b { color: var(--warning); }
.sum-chip:hover { border-color: var(--border-strong); }
.sum-chip.active { border-color: var(--accent); background: var(--accent-bg); box-shadow: var(--shadow-ring); }
.sum-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.sum-label { font-size: var(--text-xs); font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .04em; }
.vtable .num { text-align: right; font-variant-numeric: tabular-nums; }
.open-n { color: var(--danger); }
.issue-table td { vertical-align: top; }
.issue-table .issue-cell { max-width: 360px; }
.issue-table .issue-desc { color: var(--text-tertiary); font-size: var(--text-xs); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.issue-table select { width: auto; height: 24px; font-size: var(--text-xs); padding: 0 4px; }
.issue-versions tbody tr { cursor: pointer; }

/* issue table summaries */
.issue-table tbody tr { cursor: pointer; }
.issue-table .summary-cell { width: 150px; max-width: 150px; }
.issue-table td.mono { white-space: nowrap; }
.summary { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--text-secondary); min-width: 0; }
.summary-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-count { flex: none; min-width: 18px; text-align: center; font-weight: 600; color: var(--accent-hover); background: var(--accent-bg); border: 1px solid var(--accent-border); border-radius: 9px; line-height: 16px; padding: 0 5px; }

/* issue page */
.back-link { display: inline-block; margin-bottom: 8px; font-size: var(--text-sm); }
.issue-num { font-size: var(--text-md); font-weight: 500; }
.title-row .sub .muted { font-size: var(--text-xs); }
.issue-fw { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding: 8px 12px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); font-size: var(--text-sm); }
.issue-fw .label { font-size: var(--text-xs); font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .04em; }
.issue-fw .btn { margin-left: auto; }
.issue-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.issue-edit label { display: grid; gap: 4px; font-size: var(--text-xs); font-weight: 600; color: var(--text-tertiary); }
.issue-edit .field-full { grid-column: 1 / -1; }
.issue-edit input, .issue-edit select, .issue-edit textarea { font-weight: 400; font-size: var(--text-sm); color: var(--text-primary); }
.actions-left { display: flex; align-items: center; gap: 10px; }
.notes-list { display: grid; gap: 6px; }
.issue-open { font-size: inherit; font-weight: 600; color: var(--text-primary); text-align: left; }
.issue-open:hover { color: var(--accent); }
.note { padding: 6px 8px; border-left: 2px solid var(--border-strong); }
.note-meta { font-size: var(--text-xs); color: var(--text-tertiary); display: flex; align-items: center; gap: 6px; }
.note-meta b { color: var(--text-primary); }
.note-meta .link-btn { margin-left: auto; }
.note-body { font-size: var(--text-sm); color: var(--text-primary); white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.note-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 4px; }

/* scenario + log files on the issue page */
.scenario-text { font-size: var(--text-sm); white-space: pre-wrap; overflow-wrap: anywhere; padding: 6px 8px; background: var(--bg-subtle); border-radius: var(--radius-sm); }
.log-count { flex: none; display: inline-flex; align-items: center; gap: 2px; font-weight: 600; color: #7c3aed; }
.log-list { display: grid; gap: 4px; }
.log-item { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); padding: 4px 8px; background: var(--bg-subtle); border-radius: var(--radius-sm); min-width: 0; }
.log-item a { color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.log-item a:hover { color: var(--accent); }
.log-item .muted { font-size: var(--text-xs); white-space: nowrap; }
.log-item .link-btn { margin-left: auto; }
.log-upload { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--accent); font-size: var(--text-xs); font-weight: 600; padding: 2px 0; }
.log-upload:hover { color: var(--accent-hover); text-decoration: underline; }
.log-upload.busy { color: var(--text-tertiary); pointer-events: none; }

.note-form textarea { flex: 1; }

/* changelog page */
.cl-search { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; color: var(--text-muted); }
.cl-search input { max-width: 360px; }
.cl-entry { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); }
.cl-entry.latest { border-color: var(--accent-border); background: var(--accent-bg); box-shadow: var(--shadow-ring); }
.cl-entry .changes { max-height: none; }
.cl-entry.latest .changes li { border-bottom-color: var(--accent-border); }
.cl-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.cl-head .muted { font-size: var(--text-xs); }
.cl-version { font-size: var(--text-lg); font-weight: 700; color: var(--text-primary); }
.cl-models { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.cl-model { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-subtle); cursor: pointer; font: inherit; font-size: var(--text-xs); color: var(--text-secondary); }
.cl-model:hover { border-color: var(--accent); color: var(--accent); }
.issues-link + .issues-link { margin-top: 6px; }

/* compact build info */
.info-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0;
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.info-cell { padding: 7px 12px 8px; min-width: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.info-cell:nth-child(3n) { border-right: 0; }
.info-cell:nth-last-child(-n+3) { border-bottom: 0; }
.info-cell dt { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 600; color: var(--text-tertiary); letter-spacing: .04em; text-transform: uppercase; }
.info-cell dt .link-btn { text-transform: none; letter-spacing: 0; }
.info-cell dd { margin: 2px 0 0; font-size: var(--text-sm); color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-cell dd.mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-secondary); }
.title-row .sub .link-btn { margin-left: 4px; }
.info-cell dd.people-list { display: flex; flex-wrap: wrap; gap: 4px; white-space: normal; overflow: visible; }
.person-chip { display: inline-flex; align-items: center; gap: 3px; padding: 0 7px; border-radius: 10px; line-height: 20px; font-size: var(--text-xs); font-weight: 600; background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--text-primary); }
.person-chip button { border: 0; background: none; padding: 0 0 0 2px; cursor: pointer; color: var(--text-muted); font-size: 13px; line-height: 1; }
.person-chip button:hover { color: var(--danger); }
.people-edit { display: grid; gap: 6px; width: 100%; }
.people-edit .people-list { display: flex; flex-wrap: wrap; gap: 4px; }

/* changelog */
.changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-height: 220px; overflow-y: auto; }
.changes li { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; font-size: var(--text-sm); border-bottom: 1px dashed var(--border); }
.changes li:last-child { border-bottom: 0; }
.changes .text { flex: 1; min-width: 0; color: var(--text-primary); }
.changes .by { color: var(--text-muted); font-size: var(--text-xs); }
.changes .hash { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-tertiary); }

/* report an issue */
.reported-box { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; margin-bottom: 8px; border: 1px solid var(--success-border); background: var(--success-bg); border-radius: var(--radius); font-size: var(--text-sm); color: var(--text-primary); }
.reported-box > .icon { color: var(--success); }
.reported-box .muted { font-size: var(--text-xs); }
.filter-note { font-weight: 500; }
.issue-form { display: grid; grid-template-columns: 1fr 96px auto; gap: 6px; margin-top: 8px; }
.issue-form textarea { grid-column: 1 / -1; }
.none { color: var(--text-muted); font-size: var(--text-sm); padding: 4px 0; }

/* files */
.file-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); transition: background .15s, border-color .15s; }
.file-item + .file-item { margin-top: 6px; }
.file-item:hover { background: var(--bg-card); border-color: var(--border-strong); }
.file-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-type { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; padding: 1px 4px; border-radius: var(--radius-sm); color: #7c3aed; background: #ede9fe; }
.file-item a { color: var(--text-primary); font-size: var(--text-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item a:hover { color: var(--accent); }
.file-item .locked { color: var(--text-muted); font-size: var(--text-md); }
.file-size { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-tertiary); white-space: nowrap; }

/* build record tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 18px 0 12px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 8px 10px; font-size: var(--text-sm); font-weight: 600; color: var(--text-tertiary); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { display: grid; grid-template-columns: 170px 84px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: var(--text-sm); }
.tl-item:last-child { border-bottom: 0; }
.tl-when { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-tertiary); padding-top: 1px; }
.tl-who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.tl-what { color: var(--text-secondary); overflow-wrap: anywhere; }
.tl-what b { color: var(--text-primary); font-weight: 600; }

.vtable { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.vtable th { text-align: left; font-size: var(--text-xs); font-weight: 600; color: var(--text-tertiary); padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.vtable td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.vtable tbody tr { cursor: pointer; }
.vtable tbody tr:hover td { background: var(--bg-hover); }
.vtable tr.current td { background: var(--accent-bg); }
.vtable .changes-preview { color: var(--text-tertiary); font-size: var(--text-xs); }

/* modal + toast */
.modal { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
.modal::backdrop { background: rgba(24, 24, 27, .45); }
.modal h3 { font-size: var(--text-lg); margin-bottom: 12px; }
.modal-field { display: grid; gap: 4px; font-size: var(--text-sm); color: var(--text-secondary); font-weight: 600; }
.modal-field small { font-weight: 400; color: var(--text-muted); font-size: var(--text-xs); }
.modal-field input:disabled { background: var(--bg-subtle); color: var(--text-tertiary); }
.modal-fields { display: grid; gap: 12px; }
.modal-wide { width: min(720px, calc(100vw - 32px)); }
.modal-note { margin: -4px 0 12px; color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.6; }
.members-table { margin-bottom: 12px; }
.members-table tbody tr { cursor: default; }
.members-table select { width: auto; }
.member-form { display: grid; grid-template-columns: 1fr 130px auto; gap: 8px; }
.member-form-projects { grid-column: 1 / -1; }
.proj-checks { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.proj-check { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-sm); white-space: nowrap; cursor: pointer; }
.proj-check input { width: auto; height: auto; margin: 0; }
.modal-wide { width: min(860px, calc(100vw - 32px)); }
.form-error { margin-top: 12px; padding: 6px 10px; border-radius: var(--radius); background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger-hover); font-size: var(--text-sm); }
.project-card .card-tools { float: right; display: flex; gap: 10px; margin-top: 4px; }
.link-btn.danger { color: var(--danger); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 20; background: var(--text-primary); color: #fff; padding: 8px 14px; border-radius: var(--radius); font-size: var(--text-sm); box-shadow: var(--shadow-md); max-width: calc(100vw - 32px); }
.toast.error { background: var(--danger); }

/* ------------------------------------------------ narrow screens */
@media (max-width: 1100px) {
  body { overflow: auto; }
  .app { flex-direction: column; height: auto; }
  .sidebar, .column-list { width: auto; }
  .sidebar .project-tree { max-height: 260px; }
  .sidebar-decor { display: none; }
  .list-card { max-height: 520px; }
  .column-detail { overflow: visible; }
}
@media (max-width: 600px) {
  .app { padding: 8px; gap: 8px; }
  .info-grid { grid-template-columns: 1fr; }
  .info-cell { border-right: 0 !important; border-bottom: 1px solid var(--border) !important; }
  .info-cell:last-child { border-bottom: 0 !important; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tl-item { grid-template-columns: 1fr; gap: 0; }
  .flow-sub { display: none; }
  .issue-form { grid-template-columns: 1fr; }
}

.log-hint { font-size: var(--text-xs); margin-top: 4px; }
