/* Krang dashboard: one dark column, thumb-sized targets, no framework.
   Mobile first. The only wide-screen change is a max-width; the board stays
   one column on purpose (see the v1 non-goals).

   Colour contract: --dim is muted text (placeholders, counts, empty states)
   and --accent is interactive (links, active chips, group headings). They are
   never swapped, so nothing muted ever looks tappable. */

:root {
  --bg: #12141a;
  --panel: #1a1d26;
  --panel-2: #232733;
  --line: #2e3342;
  --text: #e6e8ee;
  --dim: #99a0b0;
  --accent: #7cc4ff;
  --warn: #ff8a7a;
  --ok: #7ddc9a;
  --amber: #f0c04a;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  padding: 0 12px 40px;
  max-width: 680px;
  margin: 0 auto;
}

.hidden { display: none !important; }

a { color: var(--accent); }

::placeholder { color: var(--dim); opacity: 1; }

/* ---------- sticky head: brand, capture, tabs ---------- */
.stickytop {
  background: var(--bg);
  padding-top: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  color: var(--accent);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 10px;
}

.status { align-items: center; display: flex; gap: 8px; }
.today { color: var(--dim); font-size: 15px; }

.health {
  border: 1px solid var(--line);
  border-radius: 50%;
  height: 14px;
  min-height: 0;
  padding: 0;
  width: 14px;
}

.health.green { background: var(--ok); }
.health.amber { background: var(--amber); }
.health.red { background: var(--warn); }

/* ---------- login ---------- */
#login { padding-top: 18vh; }

#login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

label { color: var(--dim); font-size: 14px; }

input[type="password"], input[type="text"], input[type="search"] {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  padding: 12px;
  width: 100%;
}

input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
  min-height: 44px;
  padding: 10px 14px;
}

button:active { background: var(--line); }
button:disabled { opacity: 0.45; cursor: default; }

#login-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #0d1017;
  font-weight: 600;
}

.error { color: var(--warn); min-height: 20px; margin: 4px 0 0; }

/* ---------- capture ---------- */
.capture { display: flex; gap: 8px; }
.capture input { flex: 1 1 auto; }
.capture button { flex: 0 0 auto; }

.ack {
  color: var(--dim);
  font-size: 14px;
  margin: 6px 2px 0;
  min-height: 18px;
  opacity: 1;
  transition: opacity 0.8s ease;
  white-space: pre-wrap;
}

.ack.fading { opacity: 0; }

/* ---------- tabs ---------- */
.tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 4px;
  margin-top: 10px;
}

.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--dim);
  flex: 0 0 auto;
  font-size: 15px;
  padding: 8px 14px;
}

.tab.active { border-bottom-color: var(--accent); color: var(--text); font-weight: 600; }

/* ---------- filter chips ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 4px;
}

.chip-btn {
  background: var(--panel);
  border-radius: 999px;
  font-size: 13px;
  min-height: 34px;
  padding: 4px 12px;
}

.chip-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0d1017;
  font-weight: 600;
}

.allclear { color: var(--dim); margin: 14px 2px; }

/* ---------- search ---------- */
.search { margin: 12px 0 0; }

/* ---------- sections ---------- */
.sec { margin-top: 18px; }

.sec h2 {
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
  letter-spacing: 0.1em;
  margin: 0 0 8px;
  padding-bottom: 5px;
  text-transform: uppercase;
}

.note { color: var(--dim); font-weight: 400; letter-spacing: 0; text-transform: none; }

.grphead { color: var(--accent); font-size: 13px; margin: 12px 0 4px; }

.empty { color: var(--dim); font-size: 14px; margin: 12px 2px; }

.items { list-style: none; margin: 0; padding: 0; }

.later { margin-top: 18px; }

.later > summary {
  color: var(--dim);
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.06em;
  min-height: 30px;
  padding: 4px 0;
  text-transform: uppercase;
}

/* ---------- one item row: compact by default, expanded on tap ---------- */
.item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 8px;
  padding: 10px 12px;
}

.row { align-items: baseline; display: flex; gap: 8px; }

.icon { flex: 0 0 auto; }

.summary {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.when { color: var(--dim); flex: 0 0 auto; font-size: 13px; text-align: right; }

/* The bucket chip is a nicety, not information: it only rides along in the
   compact row when there is room for it. No JS measures anything. */
.rowchip { display: none; }

.item.open .summary { overflow: visible; white-space: normal; }
.item .detail { display: none; }
.item.open .detail { display: block; }

.meta {
  align-items: center;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 6px;
  margin-top: 8px;
}

.chip { background: var(--panel-2); border-radius: 999px; padding: 2px 8px; }
.due { color: var(--dim); }
.due.overdue { color: var(--warn); }
.time { color: var(--text); }
.skipped { color: var(--dim); font-style: italic; }

.flag {
  background: var(--warn);
  border-radius: 4px;
  color: #1a0e0b;
  font-weight: 600;
  padding: 1px 6px;
}

.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.act { flex: 1 1 auto; font-size: 14px; min-width: 88px; }

/* overdue: colour AND the word, never colour alone */
.item.is-overdue { border-left-color: var(--warn); }
.item.is-overdue .when { color: var(--warn); }

/* Today carries the most weight on the page: bigger type, a lit edge, a
   header that is not whispering like the rest. */
.sec[data-sec="today"] h2 {
  border-bottom-color: var(--accent);
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0.06em;
}

.sec[data-sec="today"] .item {
  background: var(--panel-2);
  border-left-color: var(--accent);
  font-size: 17px;
  padding: 13px 14px;
}

.sec[data-sec="today"] .item.is-overdue { border-left-color: var(--warn); }

/* ---------- footers ---------- */
.foot { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 12px; }

.foot summary {
  color: var(--dim);
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.1em;
  min-height: 30px;
  text-transform: uppercase;
}

.appfoot { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 10px; }
.pending { color: var(--dim); font-size: 13px; }
.footlinks a { font-size: 13px; }

/* ---------- toast ---------- */
.toast {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  bottom: 16px;
  left: 50%;
  max-width: 90vw;
  opacity: 0;
  padding: 10px 16px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 12px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
}

.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 420px) {
  .rowchip { display: inline-block; }
}

@media (min-width: 900px) {
  body { padding: 0 20px 60px; }
  .item { padding: 12px 14px; }
}
