:root {
  color-scheme: light dark;
  --canvas: light-dark(#f4f6f2, #151a18);
  --surface: light-dark(#fff, #1e2622);
  --ink: light-dark(#1d2822, #edf3ef);
  --muted: light-dark(#536159, #b0c0b6);
  --line: light-dark(#d8dfd8, #3c4a43);
  --soft: light-dark(#ebefeb, #28332e);
  --accent: light-dark(#205b41, #a7dfbe);
  --accent-soft: light-dark(#e5f2e9, #243e31);
  --button-text: light-dark(#fff, #16231b);
  --error: light-dark(#a12936, #ffb6bf);
  --blue: light-dark(#3a6799, #a9cef8);
  --orange: light-dark(#925217, #f0bd83);
  font: 15px/1.55 system-ui, "Yu Gothic UI", "Hiragino Sans", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.55rem, 3.2vw, 2.15rem); letter-spacing: .018em; line-height: 1.3; }
h2 { font-size: 1.35rem; line-height: 1.4; }
button, input, select, textarea { font: inherit; color: inherit; }
button, input, select, textarea {
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: var(--surface);
  padding: .48rem .7rem;
}
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
button:disabled { opacity: .6; cursor: wait; }
a { color: var(--accent); text-underline-offset: .16em; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
textarea { resize: vertical; }
.primary { background: var(--accent); color: var(--button-text); border-color: var(--accent); font-weight: 650; }
.primary:hover { filter: brightness(.91); }
.quiet { background: transparent; }
.muted { color: var(--muted); }
.eyebrow { color: var(--muted); font-size: .83rem; margin-bottom: .28rem; }
.error { color: var(--error); white-space: pre-wrap; margin: .6rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner, main { max-width: 1320px; margin: 0 auto; padding: .8rem clamp(.85rem, 3vw, 2rem); }
.header-inner, .header-links, .brand, .board-header, .board-actions, .board-tools, .search-tools, .dialog-header {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
}
.header-inner, .board-header, .board-tools, .dialog-header { justify-content: space-between; }
.brand { gap: .55rem; font-weight: 720; letter-spacing: .018em; }
.board-mark { display: grid; grid-template-columns: repeat(3, 4px); gap: 3px; padding: 5px; color: var(--accent); background: var(--accent-soft); border-radius: 5px; }
.board-mark i { width: 4px; height: 12px; border-radius: 1px; background: currentColor; }
.board-mark i:nth-child(2) { height: 8px; }
.header-links { gap: .65rem; font-size: .85rem; }
.header-links button { padding: .28rem .52rem; }
main { padding-top: 1.6rem; }
.status-message { color: var(--muted); }
.login-panel { max-width: 400px; margin: 4vh auto; padding: clamp(1rem, 5vw, 1.6rem); background: var(--surface); border: 1px solid var(--line); border-radius: .8rem; }
.login-panel h1 { font-size: 1.55rem; margin-bottom: .4rem; }
#login-form, #post-form { display: grid; gap: .8rem; margin-top: .9rem; }
#login-form button { justify-self: start; }
form label { display: grid; gap: .25rem; min-width: 0; }
.board-header { margin-bottom: 1.15rem; }
.board-tools { padding: .55rem 0 .7rem; border-bottom: 1px solid var(--line); }
.board-tools nav, .detail-tabs, .detail-actions, .form-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.board-tools nav button, .detail-tabs button { background: transparent; border-color: transparent; }
button[aria-pressed="true"] { background: var(--accent-soft) !important; border-color: var(--line) !important; color: var(--accent); }
.search-tools { gap: .4rem; }
.search-tools input { width: min(100%, 13rem); }
.notice { margin-top: .9rem; border-radius: .5rem; padding: .55rem .75rem; background: var(--accent-soft); color: var(--accent); }
.notice button { margin-left: .3rem; font-size: .85rem; background: var(--surface); }
.columns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; gap: .8rem; margin-top: 1.1rem; }
.column { min-width: 0; padding: .65rem; min-height: 12rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--soft); }
.column h2 { display: flex; justify-content: space-between; align-items: center; gap: .35rem; padding: 0 .12rem .62rem; font-size: .95rem; }
.column h2 span:first-child::before { content: ""; display: inline-block; width: .52rem; height: .52rem; border-radius: 50%; background: var(--status-color, var(--muted)); margin-right: .38rem; }
.column[data-status="in_progress"] { --status-color: var(--blue); }
.column[data-status="awaiting_verification"] { --status-color: var(--orange); }
.column[data-status="done"] { --status-color: var(--accent); }
.count { font-size: .82rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.column-body, .archive-list { display: grid; align-content: start; gap: .55rem; }
.archive-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); margin-top: 1rem; }
.post-card { display: grid; gap: .28rem; min-height: 5.8rem; background: var(--surface); width: 100%; text-align: left; overflow-wrap: anywhere; }
.post-card strong { line-height: 1.35; }
.post-card .meta { font-size: .78rem; color: var(--muted); }
.empty { color: var(--muted); font-size: .85rem; margin: .25rem .1rem; }
dialog { color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 1.25rem; max-width: calc(100% - 1rem); }
dialog::backdrop { background: #101a16a3; }
.drawer { width: min(100%, 43rem); max-width: 100%; max-height: 100%; height: 100%; inset: 0 0 0 auto; margin: 0; overflow-y: auto; }
.editor { width: 39rem; border-radius: .8rem; }
.dialog-header { align-items: flex-start; flex-wrap: nowrap; padding-bottom: .55rem; }
.dialog-header button { flex-shrink: 0; }
.detail-actions { margin: .35rem 0 .65rem; }
.detail-actions select { max-width: 100%; }
.detail-tabs { border-bottom: 1px solid var(--line); padding-bottom: .45rem; margin: .8rem 0; }
.thread-post { padding: .7rem 0; min-width: 0; }
.thread-post + .thread-post { border-top: 1px solid var(--line); }
.thread-post header { display: flex; align-items: start; justify-content: space-between; gap: .5rem; }
.thread-post h3 { font-size: 1.05rem; }
.thread-post .meta { color: var(--muted); font-size: .8rem; }
.markdown { margin-top: .45rem; overflow-wrap: anywhere; }
.markdown > * { margin: .45rem 0; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 { font-size: revert; line-height: 1.35; }
.markdown ul, .markdown ol { padding-left: 1.55rem; }
.markdown pre, .history-json { background: var(--soft); border-radius: .4rem; padding: .55rem; overflow-x: auto; }
.markdown table { border-collapse: collapse; display: block; max-width: 100%; overflow-x: auto; }
.markdown th, .markdown td { padding: .35rem .5rem; border: 1px solid var(--line); }
.markdown blockquote { border-left: 3px solid var(--line); padding-left: .7rem; color: var(--muted); }
.post-links { margin: .45rem 0 0; padding-left: 1.25rem; }
.history-entry { border-bottom: 1px solid var(--line); padding: .6rem 0; }
.history-entry summary { cursor: pointer; }
.history-entry button { margin-left: .3rem; }
.history-json { max-height: 16rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.form-row, .link-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.link-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: end; margin-bottom: .45rem; }
fieldset { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: .5rem; padding: .5rem .65rem; }
.form-actions { justify-content: flex-end; }
@media (max-width: 780px) { .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px) { .columns { grid-template-columns: 1fr; } .link-row { grid-template-columns: 1fr; } }
@media (pointer: coarse) { button, select, input { min-height: 44px; } }
