/* The hub's look: plain and tidy, Lagoon colours, light and dark. */
:root {
  --bg: #edf6f7;
  --surface: #ffffff;
  --muted-bg: #e1eff1;
  --line: #d1e5e8;
  --text: #0e2a33;
  --muted: #587680;
  --primary: #0d7480;
  --primary-text: #ffffff;
  --accent: #ff8a66;
  --violet: #6d5bd0;
  --good: #178f5f;
  --good-bg: #dbf4e8;
  --bad: #dc4343;
  --bad-bg: #fde6e6;
  --warn: #b86a00;
  --warn-bg: #fff0d9;
  --info: #2a6fd0;
  --info-bg: #e3edfb;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1a1f;
    --surface: #112730;
    --muted-bg: #17323c;
    --line: #23434e;
    --text: #e6f3f5;
    --muted: #8fb0b8;
    --primary: #3fb6c2;
    --primary-text: #062126;
    --good-bg: #123d2c;
    --bad-bg: #4a1d1d;
    --warn-bg: #45320d;
    --info-bg: #182f52;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.2; }
h2 { font-size: 24px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; margin-top: 14px; }
a { color: var(--primary); }
code { background: var(--muted-bg); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
button { background: var(--primary); color: var(--primary-text); border: 0; border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; }
button:disabled { opacity: 0.5; cursor: default; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.ghost:hover { background: var(--muted-bg); }
button.danger { background: var(--bad); color: #fff; }
button.danger.ghost { background: transparent; color: var(--bad); border-color: var(--bad); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
textarea { width: 100%; resize: vertical; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
label.row { flex-direction: row; align-items: center; font-weight: 500; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); }
td input { width: 100%; padding: 4px 6px; }

.shell { display: flex; height: 100%; }
.menu { width: 230px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand { font-weight: 800; font-size: 18px; padding: 0 10px 14px; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
.menu a:hover { background: var(--muted-bg); }
.menu a.on { background: var(--primary); color: var(--primary-text); font-weight: 700; }
.menu .icon { width: 20px; text-align: center; }
.menu .count { background: var(--bad); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; font-weight: 700; }
.content { flex: 1; overflow-y: auto; padding: 24px 32px 60px; display: flex; flex-direction: column; gap: 16px; }
.content > * { max-width: 1200px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.tile-value { font-size: 26px; font-weight: 800; }
.tile-label { color: var(--muted); font-weight: 600; font-size: 13px; }
.tile.good .tile-value { color: var(--good); }
.tile.bad .tile-value { color: var(--bad); }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--muted-bg); color: var(--muted); white-space: nowrap; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--info); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.muted { color: var(--muted); }
.small { color: var(--muted); font-size: 13px; }
.pre { white-space: pre-wrap; margin: 4px 0; }
.error { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.item.new { border-left: 4px solid var(--primary); }
.item.done { opacity: 0.6; }
.item.clickable { cursor: pointer; }
.item.picked { outline: 2px solid var(--primary); }
.item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search { min-width: 260px; flex: 1; }
.scroll { max-height: 320px; overflow: auto; }
.scroll.tall { max-height: 560px; }
.form { display: flex; flex-direction: column; gap: 8px; }
.bars-axis { display: flex; justify-content: space-between; }
.banner { padding: 10px 14px; border-radius: 12px; font-weight: 600; }
.banner.info { background: var(--info-bg); color: var(--info); }
.banner.warning { background: var(--warn-bg); color: var(--warn); }
.banner.success { background: var(--good-bg); color: var(--good); }
.login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 420px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.qr { width: 200px; height: 200px; background: #fff; border-radius: 8px; align-self: center; }
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.todo:hover { border-color: var(--primary); }
.todo.done .todo-title { text-decoration: line-through; color: var(--muted); }
.todo-title { font-weight: 700; font-size: 16px; margin: 4px 0 6px; }
.todo-title-input { width: 100%; font-weight: 700; font-size: 16px; }
.prompt-box { width: 100%; background: var(--muted-bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 6px; font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; line-height: 1.5; }
textarea.prompt-box { resize: vertical; }
.todo-num { min-width: 30px; height: 30px; border-radius: 15px; background: var(--muted-bg); color: var(--primary); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.todo input[type='checkbox'] { width: 18px; height: 18px; margin-top: 6px; cursor: pointer; }
.todo-text { margin: 4px 0 2px; }
.todo-actions { flex-shrink: 0; }
.todo-actions button { padding: 6px 12px; }
.icon-btn { padding: 6px 10px !important; }
.rec { color: var(--bad); font-weight: 600; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }
@media (max-width: 800px) {
  .shell { flex-direction: column; }
  .menu { width: 100%; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .menu .spacer, .menu .small { display: none; }
  .content { padding: 16px; }
}
