:root {
  color-scheme: light;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #152a2b;
  background: #f3f5f3;
  --muted: #4d6463;
  --line: #d6dfdb;
  --accent: #075b51;
  --danger: #a42a30;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header { background: #133331; color: #fbfffc; }
.header-content, main { max-width: 1120px; margin: auto; padding: 20px 28px; }
.header-content, #account, .toolbar, form[role=search], nav, .pagination, .actions, .board-switch {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.header-content, .toolbar { justify-content: space-between; }
.brand { margin: 0; font-weight: 750; }
.brand span { color: #9ac1ac; padding-inline: 5px; }
#email { font-size: .85rem; }
main { padding-block: 34px; }
h1 { margin: 0 0 16px; font-size: 1.65rem; }
h2 { margin: 0 0 14px; font-size: 1.09rem; }
p { line-height: 1.6; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.login { max-width: 420px; margin: 7vh auto 0; }
.login p, .muted, caption { color: var(--muted); }
section + section { margin-block-start: 16px; }
.toolbar { margin-block-end: 24px; }
button, input, textarea { font: inherit; }
button, input { min-height: 44px; }
button {
  border: 1px solid transparent; border-radius: 7px; padding: 7px 15px;
  background: var(--accent); color: white; cursor: pointer; font-weight: 650;
}
.secondary { background: #fff; color: var(--accent); border-color: var(--line); }
.danger { background: var(--danger); }
dialog { max-width: min(440px, calc(100vw - 32px)); padding: 22px; border: 1px solid var(--line); border-radius: 12px; color: inherit; }
dialog::backdrop { background: #0d2526a8; }
button:disabled { opacity: .55; cursor: default; }
input, textarea { background: white; color: inherit; border: 1px solid #a5b5ad; border-radius: 7px; padding: 9px 12px; }
input { width: 152px; }
textarea { width: 100%; resize: vertical; margin-block: 8px 12px; }
a { color: var(--accent); text-underline-offset: 3px; }
nav a { padding: 10px 12px; border-radius: 7px; font-weight: 700; text-decoration: none; }
nav a[aria-current=page] { background: #d9eae1; }
:focus-visible { outline: 3px solid #168475; outline-offset: 3px; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .93rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { white-space: nowrap; background: #f4f7f5; color: var(--muted); }
td { overflow-wrap: anywhere; }
code { white-space: nowrap; font-size: .96em; }
.badge { display: inline-block; border-radius: 5px; color: #74450c; background: #f9edd7; padding: 3px 7px; white-space: nowrap; }
.pagination, .board-switch { margin-block: 14px; }
#status[data-error=true] { color: var(--danger); }
.board {
  display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px;
  max-width: 610px; margin-top: 14px; padding: 6px; background: #112b2a; border-radius: 8px;
}
.cell {
  display: grid; place-items: center; aspect-ratio: 1; min-width: 0;
  background: #1d3b3a; color: #f6fffa; border: 1px solid transparent; border-radius: 4px;
}
.cell.slot { border: 1px dashed #7c9e99; }
.piece {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  color: #fff; white-space: nowrap; line-height: 1; font-size: clamp(.68rem, 3vw, 1.45rem);
}
.piece small { font-size: .52em; }
.piece[data-color="1"] { color: #ff8e8c; }
.piece[data-color="2"] { color: #90ef9a; }
.piece[data-color="3"] { color: #ffda80; }
.piece[data-color="4"] { color: #9ac9ff; }
.piece[data-color="5"] { color: #ffb1ec; }
.piece[data-color="6"] { color: #9fece9; }
.tray { display: inline-flex; gap: 8px; align-items: center; color: white; background: #1d3b3a; padding: 8px; border-radius: 6px; }
.board-notes { font-size: .84rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 640px) {
  .header-content, main { padding-inline: 14px; }
  .panel { padding: 14px; }
  .board { gap: 2px; padding: 3px; }
}
