:root,
html[data-theme="light"] {
  color-scheme: light;
  --ink: #0e4d5c;
  --accent: #c9782a;
  --bg: #f4f7f8;
  --card: #ffffff;
  --muted: #5a6878;
  --ok: #1b7a4a;
  --bad: #b42318;
  --line: #dce6ea;
  --text: #1a2330;
  --header: #0e4d5c;
  --header-text: #ffffff;
  --nav: #ffffff;
  --col: #eef3f5;
  --bar-track: #dce6ea;
  --code-bg: #eef3f5;
  --shadow: 0 8px 24px #0e4d5c14;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #8fd4e0;
  --accent: #e39a4a;
  --bg: #0c1216;
  --card: #161e24;
  --muted: #9aabba;
  --ok: #4ecf86;
  --bad: #ff7a6e;
  --line: #2a3842;
  --text: #e8eef2;
  --header: #0b1519;
  --header-text: #e8eef2;
  --nav: #11181e;
  --col: #121a20;
  --bar-track: #2a3842;
  --code-bg: #1c272e;
  --shadow: 0 8px 28px #00000066;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; min-height: 100%;
  font-family: "Noto Sans", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text);
}
#app { max-width: 1100px; margin: 0 auto; padding: 0 0 88px; }
header.top {
  background: var(--header); color: var(--header-text);
  padding: 14px 16px calc(12px + env(safe-area-inset-top));
  padding-top: calc(14px + env(safe-area-inset-top));
  display: flex; justify-content: space-between; align-items: center;
}
header.top { gap: 8px; flex-wrap: wrap; }
header.top .who { font-size: 11px; opacity: .8; margin-left: auto; }
.tap { cursor: pointer; }
textarea.doc { width: 100%; min-height: 240px; font-family: ui-monospace, monospace; }
.logout, .theme-toggle {
  background: transparent; border: 1px solid color-mix(in srgb, var(--header-text) 35%, transparent);
  color: var(--header-text); border-radius: 8px; padding: 6px 10px; cursor: pointer; font: inherit;
}
.theme-toggle {
  border-color: var(--line);
  color: var(--text);
  background: var(--card);
  font-size: 13px;
  font-weight: 700;
  width: auto;
  margin: 0;
  padding: 8px 12px;
}
.theme-bar {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px 0;
}
.view { padding: 14px 16px; }
h1 { font-size: 22px; margin: 0 0 8px; color: var(--ink); }
h2 { font-size: 15px; color: var(--ink); margin: 16px 0 8px; }
.lead { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  box-shadow: var(--shadow);
}
.card b { display: block; font-size: 22px; color: var(--ink); }
.card span { font-size: 12px; color: var(--muted); }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 10px; overflow-x: auto; }
.col { background: var(--col); border-radius: 12px; padding: 8px; min-height: 200px; }
.col h3 { margin: 4px 6px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); }
.task {
  background: var(--card); border-radius: 10px; padding: 8px 10px; margin: 0 0 8px;
  border-left: 4px solid var(--accent); font-size: 13px; cursor: pointer;
  color: var(--text);
}
.task small { display: block; color: var(--muted); margin-top: 4px; }
.task.p1 { border-left-color: var(--bad); }
nav.bottom {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--nav); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(6, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.bottom button {
  border: 0; background: none; padding: 10px 4px 8px; font-size: 10px; color: var(--muted);
}
nav.bottom button.on { color: var(--ink); font-weight: 700; }
form.login { max-width: 360px; margin: 24px auto; padding: 20px; }
form.login label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 4px; }
input, textarea, select, button.primary {
  width: 100%; padding: 12px 12px; margin: 0 0 10px; border-radius: 10px;
  border: 1px solid var(--line); font: inherit; font-size: 16px;
  -webkit-user-select: text; user-select: text;
  background: var(--card); color: var(--text);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--ink); outline-offset: 1px;
}
button.primary { background: var(--ink); color: var(--bg); border: 0; font-weight: 700; cursor: pointer; }
html[data-theme="light"] button.primary { color: #fff; }
.err { color: var(--bad); font-size: 13px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 0 0 8px; color: var(--text); }
.bar { height: 10px; background: var(--bar-track); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); }
.doc { white-space: pre-wrap; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 13px; line-height: 1.45; }
iframe.pdf { width: 100%; height: 70vh; border: 0; background: var(--card); border-radius: 12px; }
code { background: var(--code-bg); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
small { color: var(--muted); }
@media (max-width: 800px) {
  .kanban { grid-template-columns: repeat(4, 78vw); padding-bottom: 8px; }
  form.login { margin: 24px 16px; }
  nav.bottom button { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
