:root { color-scheme: light; --pine: #183a30; --pine-dark: #102a23; --paper: #f5f7f6; --ink: #192b25; --muted: #58675f; --rule: #d6dfda; --accent: #23694c; --danger: #a52d32; --focus: #b46a0d; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 3vw, 2.35rem); line-height: 1.2; letter-spacing: -0.025em; margin-bottom: 12px; text-wrap: balance; }
h2 { font-size: 1.1rem; line-height: 1.3; margin-bottom: 12px; }
p { max-width: 72ch; }
.app-shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--pine); color: #d1e0d7; padding: 32px 18px 22px; display: flex; flex-direction: column; min-height: 100vh; }
.brand { display: block; padding: 0 12px 32px; color: #fff; font-size: 1.35rem; font-weight: 650; text-decoration: none; letter-spacing: -0.02em; }
.brand span { display: block; color: #bfcec5; font-size: 0.85rem; font-weight: 400; letter-spacing: 0; margin-top: 5px; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 10px 12px; color: #e1eae5; text-decoration: none; border-radius: 4px; min-height: 44px; }
.sidebar nav a:hover { background: var(--pine-dark); }
.sidebar nav a[aria-current] { background: #dceadd; color: #153326; font-weight: 650; }
.nav-count { font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.sidebar-footer { margin-top: auto; padding: 36px 12px 0; font-size: 0.8rem; }
.signout { color: #e1eae5; background: transparent; border: 0; padding: 10px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.workspace { min-width: 0; padding: 46px clamp(22px, 4vw, 64px); }
.page-heading { margin-bottom: 34px; }
.page-heading p { color: var(--muted); margin-bottom: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 26px 0 12px; }
.section-heading h2 { margin: 0; }
.muted, .footnote { color: var(--muted); }
.footnote { font-size: 0.85rem; margin-top: 18px; }
.table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--rule); background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { padding: 15px 18px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; }
thead th { font-weight: 550; font-size: 0.8rem; color: var(--muted); background: #edf2ef; white-space: nowrap; }
thead th a { color: inherit; text-decoration: none; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover { background: #f3f7f4; }
tbody th { min-width: 195px; font-weight: 600; }
tbody th a { text-decoration: none; }
small { display: block; margin-top: 4px; font-size: 0.75rem; font-weight: 400; color: var(--muted); }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.row-action { display: inline-flex; align-items: center; gap: 12px; min-height: 30px; white-space: nowrap; font-weight: 600; text-decoration: none; }
.identifier { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; }
.state { white-space: nowrap; }
.search-toolbar { display: flex; align-items: end; gap: 10px; }
.search-field { max-width: 520px; flex: 1; }
label { display: block; font-weight: 550; font-size: 0.9rem; margin-bottom: 7px; }
input:not([type=hidden]) { width: 100%; min-height: 44px; border: 1px solid #889c90; border-radius: 4px; background: #fff; color: var(--ink); padding: 10px 12px; }
input::placeholder { color: #68756d; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 10px 17px; border: 1px solid #96a89c; border-radius: 4px; color: var(--ink); background: #fff; text-decoration: none; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.button:hover { background: #e8efea; }
.button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.button.primary:hover { background: var(--pine); }
.button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button.danger:hover { background: #862126; }
.button.danger-outline { color: var(--danger); border-color: #b88e8d; }
.button.disabled { opacity: 0.48; cursor: default; }
.full-width { width: 100%; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; font-size: 0.85rem; }
.empty-state { padding: 48px 24px; border-block: 1px solid var(--rule); }
.empty-state p { color: var(--muted); }
.notice { background: #e8eee9; padding: 16px 20px; border-radius: 4px; margin: 0 0 24px; max-width: 90ch; }
.notice.error { background: #f8e6e5; color: #80282c; }
.notice.success { background: #deeddf; color: #244d31; }
.back-link { display: inline-block; margin-bottom: 25px; font-size: 0.9rem; }
.detail-heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.record-id { font-family: ui-monospace, Consolas, monospace; font-size: 0.88rem; overflow-wrap: anywhere; }
.record-fields { margin: 0; background: #fff; border: 1px solid var(--rule); }
.record-field { display: grid; grid-template-columns: 185px minmax(0, 1fr); padding: 18px 22px; gap: 24px; border-bottom: 1px solid var(--rule); }
.record-field:last-child { border: 0; }
dt { color: var(--muted); font-size: 0.9rem; }
dd { margin: 0; overflow-wrap: anywhere; }
pre { font: 0.82rem/1.65 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 560px; overflow: auto; padding: 18px; margin: 0; background: #f1f4f2; }
.related-section { margin-top: 32px; max-width: 620px; }
.related-list { list-style: none; padding: 0; margin: 0 0 24px; }
.related-list li { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--rule); padding: 12px 0; }
.deletion-review { max-width: 760px; }
.deletion-target { display: flex; flex-direction: column; gap: 8px; padding: 20px 0; border-block: 1px solid var(--rule); margin-bottom: 30px; }
.delete-form { margin-top: 32px; }
.delete-form input:not([type=hidden]) { max-width: 320px; }
.form-actions { display: flex; gap: 12px; margin-top: 26px; }
.auth-workspace { padding: 24px; display: grid; min-height: 100vh; place-items: center; }
.auth-form { width: 100%; max-width: 420px; }
.auth-brand { display: inline-block; font-weight: 650; font-size: 1.05rem; text-decoration: none; margin-bottom: 40px; }
.auth-form form { margin-top: 28px; }
.auth-form form > input:not([type=hidden]) { margin-bottom: 22px; }
.auth-form .button { margin-top: 4px; }
.message-page { max-width: 640px; }
.boards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 0 0 36px; }
.board-card { margin: 0; min-width: 0; border: 1px solid var(--rule); background: #fff; }
.board-card figcaption { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; font-weight: 600; }
.board-svg { display: block; width: 100%; height: 280px; background: #fafcfb; }
.board-empty, .board-summary { margin: 0; padding: 12px 16px; font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--rule); }
.board-empty { min-height: 280px; display: grid; align-items: center; border-top: 0; }
.board-grid-line { stroke: #e4eae6; stroke-width: 1; }
.board-body { fill: #dbe8de; stroke: #6c937d; stroke-width: 1; }
.kind-space .board-body { fill: #e4e7e5; stroke: #c0c9c3; }
.kind-item .board-body { fill: #f3dfaf; stroke: #967322; }
.kind-unknown .board-body { fill: #f1e6e4; stroke: var(--danger); stroke-dasharray: 4 3; }
.board-item-symbol { fill: #886518; }
.board-unknown-label { fill: var(--danger); font-weight: 700; }
.board-unit-art { image-rendering: pixelated; }
.skip-link { position: fixed; top: -70px; left: 16px; z-index: 5; background: #fff; padding: 12px 18px; }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 1000px) { .boards { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 195px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .workspace { padding: 32px 22px; }
  .record-field { grid-template-columns: 135px minmax(0, 1fr); padding-inline: 16px; gap: 16px; }
  .detail-heading { flex-direction: column; }
}
@media (max-width: 640px) {
  .app-shell { display: block; }
  .sidebar { min-height: auto; padding: 20px 16px 12px; }
  .brand { font-size: 1.2rem; padding: 0 0 18px; }
  .brand span { display: inline; margin-left: 14px; }
  .sidebar nav { display: flex; overflow-x: auto; gap: 5px; padding: 3px 3px 8px; }
  .sidebar nav a { flex-shrink: 0; gap: 14px; font-size: 0.85rem; }
  .sidebar-footer { display: flex; align-items: center; justify-content: space-between; padding: 8px 3px 0; }
  .signout { min-height: 44px; }
  .workspace { padding: 30px 16px; }
  .search-toolbar { flex-wrap: wrap; }
  .search-field { flex-basis: 100%; max-width: none; }
  .record-field { display: block; }
  dt { margin-bottom: 8px; }
  th, td { padding: 13px 14px; }
  .overview-table tr > :nth-child(2), .overview-table tr > :nth-child(4) { display: none; }
  .pagination { gap: 8px; }
}
