:root {
  color-scheme: dark;
  --bg: #09110f;
  --panel: #13211b;
  --input: #0d1914;
  --line: #31463b;
  --ink: #eff7f0;
  --muted: #adbfb4;
  --accent: #c6ee75;
  --accent-ink: #16230c;
  --warn: #ffbcaa;
  font: 16px/1.55 Geist, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 70% 0, #132820 0, transparent 34rem), var(--bg); }
h1, h2, p { margin: 0; }
a { color: inherit; text-underline-offset: .25em; }
a:hover { color: var(--accent); }
button, select, input { font: inherit; }
button, select, input { min-height: 2.75rem; border: 1px solid var(--line); border-radius: .45rem; }
input, select { width: 100%; min-width: 0; color: var(--ink); background: var(--input); padding: .4rem .65rem; }
input::placeholder { color: #adbfb4; }
button { padding: .35rem .85rem; color: var(--ink); background: var(--panel); cursor: pointer; white-space: nowrap; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 700; }
.quiet { background: transparent; }
.danger { color: var(--warn); }
.danger-filled { color: #38201a; background: var(--warn); border-color: var(--warn); font-weight: 700; }
.shell { width: min(calc(100% - 2rem), 70rem); margin-inline: auto; }
.site-header { background: #0c1713; border-bottom: 1px solid var(--line); }
.header-content, .header-actions { display: flex; align-items: center; justify-content: space-between; }
.header-content { min-height: 4rem; gap: .8rem; }
.header-actions { gap: clamp(.5rem, 3vw, 1.25rem); color: var(--muted); font-size: .88rem; }
.wordmark { color: var(--accent); text-decoration: none; font-size: 1.45rem; font-weight: 700; }
main.shell { padding-block: clamp(1.35rem, 4vw, 3.25rem) 4rem; }
.page-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .35rem .8rem; margin-bottom: 1.15rem; }
.page-heading p, .muted, small { color: var(--muted); }
.page-heading strong { margin-inline-start: .2em; color: var(--ink); }
h1 { font-size: clamp(1.85rem, 5vw, 2.72rem); line-height: 1.25; }
h2 { font-size: 1.18rem; }
.panel { border: 1px solid var(--line); border-radius: .7rem; background: var(--panel); padding: clamp(.85rem, 3vw, 1.25rem); }
.sign-in { max-width: 29rem; }
.sign-in h2 { margin-bottom: .9rem; }
.field-grid { display: grid; gap: .85rem; }
.field-grid label, .filters label { display: grid; gap: .25rem; font-size: .90rem; color: var(--muted); }
.field-grid .primary { justify-self: start; }
.field-grid small { font-size: .79rem; }
.status { font-size: .9rem; color: var(--accent); margin-block: .75rem; overflow-wrap: anywhere; }
.status[data-error="true"] { color: var(--warn); }
.add-panel { margin-bottom: 1rem; }
summary { cursor: pointer; color: var(--accent); font-weight: 700; width: fit-content; min-height: 2.5rem; line-height: 2.5rem; }
.create-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; margin-top: .55rem; }
.list-heading { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; justify-content: space-between; }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(8rem, 13rem) auto; gap: .65rem; align-items: end; margin-block: .85rem 1rem; }
.table-wrap { border: 1px solid var(--line); border-radius: .55rem; overflow: hidden; }
table { width: 100%; border-spacing: 0; text-align: start; }
th, td { padding: .7rem .75rem; text-align: start; }
th { background: var(--input); color: var(--muted); font-weight: 600; font-size: .82rem; }
td { border-top: 1px solid var(--line); font-size: .9rem; }
td small { display: block; overflow-wrap: anywhere; }
.date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge { display: inline-block; color: var(--muted); white-space: nowrap; }
.badge.active { color: var(--accent); }
.row-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.row-actions button { padding-inline: .55rem; font-size: .82rem; }
.pages { margin-top: 1rem; display: flex; gap: .65rem; align-items: center; justify-content: center; font-size: .88rem; }
dialog {
  width: min(calc(100% - 2rem), 28rem); max-height: calc(100% - 2rem); overflow: auto;
  border: 1px solid var(--line); border-radius: .7rem; padding: 1.25rem; color: var(--ink); background: var(--panel);
}
dialog::backdrop { background: rgba(5, 12, 9, .72); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: .55rem; }
#access-description { overflow-wrap: anywhere; color: var(--muted); }
@media (max-width: 48rem) {
  .table-wrap { border: 0; border-radius: 0; overflow: visible; }
  table, tbody, tr { display: block; }
  thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody tr { border: 1px solid var(--line); border-radius: .5rem; padding: .65rem .75rem; }
  tbody tr + tr { margin-top: .55rem; }
  td { display: grid; grid-template-columns: minmax(6.7rem, 35%) minmax(0, 1fr); align-items: start; padding: .35rem 0; border: 0; white-space: normal !important; }
  td::before { content: attr(data-label); color: var(--muted); font-size: .79rem; padding-top: .1rem; }
}
@media (max-width: 30rem) {
  .create-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: minmax(0, 1fr) auto; }
  .filters label:first-child { grid-column: 1 / -1; }
  .header-actions { font-size: .78rem; }
  .header-actions button { padding-inline: .45rem; }
}

.pin-panel { margin-bottom: 1rem; }
.pin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; margin-top: .55rem; }
.pin-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
@media (max-width: 42rem) { .pin-grid { grid-template-columns: 1fr; } }
