.board-page {
  min-height: 100vh;
  background:
    radial-gradient(1200px 420px at 8% -10%, rgba(47, 93, 80, 0.09), transparent 55%),
    var(--bg);
}

.board-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.75;
}

.board-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2.5rem;
  display: grid;
  gap: 1rem;
}

.board-projects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.board-tab {
  appearance: none;
  margin: 0;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.board-tab[aria-current="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.board-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.board-views {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-bottom: 0.15rem;
}

.board-view {
  appearance: none;
  margin: 0;
  padding: 0.28rem 0.7rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  border-radius: 0;
}

.board-view[aria-current="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 650;
}

.board-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.25rem;
  align-items: end;
  padding: 1.1rem 0 0.25rem;
}

.board-hero h2 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.board-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 42rem;
}

.board-meta {
  margin-top: 0.45rem !important;
  font-size: 0.8rem !important;
}

.board-score {
  text-align: right;
}

.board-pct {
  font-size: 2.4rem;
  font-weight: 650;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.board-pct-label {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.board-stack-bar {
  display: flex;
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #e7e2dc;
}

.board-stack-bar span {
  display: block;
  height: 100%;
  transition: width 0.45s ease;
}

.board-stack-bar .s-done { background: var(--accent); }
.board-stack-bar .s-doing { background: #c4a35a; }
.board-stack-bar .s-blocked { background: var(--bad); }
.board-stack-bar .s-todo { background: #d8d2cb; }

.board-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
  margin-top: 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.board-legend i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 99px;
  margin-right: 0.3rem;
  vertical-align: 0.05rem;
}

.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.board-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.board-filters button {
  margin: 0;
  padding: 0.32rem 0.65rem;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.78rem;
}

.board-filters button[aria-pressed="true"] {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.board-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.board-toggle input { margin: 0; }

.board-err {
  color: var(--bad);
  font-size: 0.9rem;
}

.board-group {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.board-group + .board-group { margin-top: 0.7rem; }

.board-group-h {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  background: #fff;
  color: inherit;
  border: 0;
  border-radius: 0;
  text-align: left;
  cursor: pointer;
}

.board-group-h:hover { background: #faf8f5; }

.board-group-h h3 {
  margin: 0;
  font-size: 0.98rem;
}

.board-group-h .win {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}

.board-mini {
  width: 88px;
  height: 6px;
  border-radius: 99px;
  background: #ece8e3;
  overflow: hidden;
}

.board-mini b {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}

.board-frac {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 4.5rem;
  text-align: right;
}

.board-body { padding: 0 0.4rem 0.55rem; }

.board-row {
  display: grid;
  grid-template-columns: 5.6rem 1fr 4.6rem 6.4rem 5.5rem;
  gap: 0.5rem;
  align-items: center;
  padding: 0.48rem 0.6rem;
  border-top: 1px solid #f0ece7;
  font-size: 0.84rem;
}

.board-row .tid {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

.board-row .note {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.pill {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
}

.pill-done { background: var(--accent-light); color: var(--accent); }
.pill-doing { background: #f4ead3; color: #7a5a16; }
.pill-todo { background: #f1eee9; color: #6b6b6b; }
.pill-blocked { background: #f6e4e4; color: var(--bad); }
.pill-na { background: #eee; color: #888; }

.board-date, .board-owner {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.board-empty {
  padding: 0.8rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.board-schema-search {
  padding: 0.15rem 0 0.35rem;
}

.board-schema-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.board-schema-toolbar .board-schema-input {
  flex: 1 1 16rem;
  max-width: none;
}

.board-schema-toggle {
  flex: 0 0 auto;
  white-space: nowrap;
}

.board-schema-input {
  width: 100%;
  max-width: 28rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.88rem;
  background: #fff;
}

.board-schema-input:focus {
  outline: 2px solid rgba(47, 93, 80, 0.25);
  border-color: var(--accent);
}

.board-schema-mod-h {
  grid-template-columns: auto 1fr auto;
}

.board-schema-mod-h::before,
.board-schema-table-h::before {
  content: "▸";
  display: inline-block;
  width: 0.9rem;
  color: var(--muted);
  transition: transform 0.12s ease;
  flex-shrink: 0;
}

.board-schema-mod-h[aria-expanded="true"]::before,
.board-schema-table-h[aria-expanded="true"]::before {
  transform: rotate(90deg);
}

.board-schema-mod-b {
  padding: 0.35rem 0.55rem 0.65rem;
  display: grid;
  gap: 0.55rem;
}

.board-schema-mod-b.is-collapsed,
.board-schema-table-b.is-collapsed,
.board-schema-mod-b[hidden],
.board-schema-table-b[hidden] {
  display: none !important;
}

.board-group-h .sch-mod-title {
  display: block;
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
}

.board-schema-table {
  border: 1px solid #ece8e3;
  border-radius: 8px;
  overflow: hidden;
  background: #faf9f7;
}

.board-schema-table.is-patch {
  border-style: dashed;
  background: #fff;
}

.board-schema-table-h {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.75rem;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.board-schema-table-h > div:first-of-type {
  flex: 1;
  min-width: 0;
}

.board-schema-table-h .sch-colcount {
  margin-left: auto;
}

.board-schema-table-h:hover {
  background: #f3f0eb;
}

.sch-tname {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--accent);
}

.sch-tcomment {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.76rem;
  color: var(--muted);
}

.sch-colcount {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.board-schema-table-b {
  border-top: 1px solid #ece8e3;
  background: #fff;
}

.sch-scroll {
  overflow-x: auto;
}

.sch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.sch-table th,
.sch-table td {
  padding: 0.42rem 0.65rem;
  border-bottom: 1px solid #f0ece7;
  text-align: left;
  vertical-align: top;
}

.sch-table th {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--muted);
  background: #faf8f5;
  white-space: nowrap;
}

.sch-table tbody tr:last-child td {
  border-bottom: 0;
}

.sch-col-name {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.76rem;
  white-space: nowrap;
}

.sch-col-type {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.74rem;
  white-space: nowrap;
}

.sch-col-size,
.sch-col-null,
.sch-col-def {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--muted);
}

.sch-col-comment {
  min-width: 10rem;
  max-width: 28rem;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .board-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .board-score { text-align: left; }
  .board-row {
    grid-template-columns: 4.8rem 1fr auto;
    grid-template-areas:
      "id title status"
      "id note note"
      "id date owner";
  }
  .board-row .tid { grid-area: id; }
  .board-row .ttl { grid-area: title; }
  .board-row .pill { grid-area: status; }
  .board-row .note { grid-area: note; }
  .board-row .board-date { grid-area: date; }
  .board-row .board-owner { grid-area: owner; }
}
