/* Luke's App: placeholder look. Dark, calm, legible from a phone to a TV across the room.
   All colours are tokens on :root, so the ported Canvas design can replace them wholesale. */

:root {
  --bg: #0e1416;
  --bg-2: #141c1f;
  --card: #172124;
  --card-2: #1d292d;
  --line: #2a383c;
  --ink: #e6ece9;
  --ink-2: #9aaaa5;
  --ink-3: #6f7f7a;
  --accent: #6cc9b4;
  --accent-ink: #062019;
  --good: #6cc98a;
  --warn: #e9b765;
  --bad: #f08a7e;
  --radius: 14px;
  --radius-s: 9px;
  --gap: clamp(12px, 1.2vw, 28px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
  color-scheme: dark;
}

/* One rem grows with the screen: ~16px on a phone, ~21px on a 1080p TV, capped for 4K. */
html { font-size: clamp(16px, 0.55vw + 10.5px, 30px); -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.45 var(--font);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .92em; background: var(--card-2); padding: .1em .35em; border-radius: 5px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.muted { color: var(--ink-2); }
.small { font-size: .88rem; }
.lede { font-size: 1.25rem; font-weight: 600; }

/* ---------- controls ---------- */
.btn {
  min-height: 2.75rem; padding: .55rem 1rem; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: transparent; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.solid { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.quiet { font-weight: 500; color: var(--ink-2); min-height: 2.4rem; padding: .4rem .8rem; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.field {
  width: 100%; min-width: 0; min-height: 2.75rem; padding: .6rem .85rem; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--bg-2); font-size: 1.05rem;
}
.field::placeholder { color: var(--ink-3); }
.field:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

/* ---------- centred screens: loading, not connected, login ---------- */
.center { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; text-align: center; }
.panel { width: min(26rem, 100%); display: flex; flex-direction: column; gap: .9rem; align-items: center; }
.panel h1 { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; }
.panel .mark { width: 4.5rem; height: 4.5rem; border-radius: 1.1rem; }
.login-form { display: flex; gap: .5rem; width: 100%; }
.login-form .field.code { font-family: var(--mono); letter-spacing: .2em; text-align: center; }
.msg { min-height: 1.4em; color: var(--ink-2); font-size: .95rem; }
.msg.bad { color: var(--bad); }

/* ---------- signed-in frame ---------- */
.app { max-width: 2400px; margin: 0 auto; padding: 14px 16px 6rem; display: flex; flex-direction: column; gap: var(--gap); }
@media (min-width: 720px) { .app { padding: 20px clamp(20px, 2.5vw, 64px) 6rem; } }

.top { display: flex; align-items: center; gap: .75rem 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 750; font-size: 1.3rem; letter-spacing: -.01em; margin-right: auto; }
.brand img { width: 2rem; height: 2rem; border-radius: 8px; }
.status { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink-2); font-size: .9rem; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--ink-3); }
.status[data-s="live"] .dot { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.status[data-s="offline"] .dot { background: var(--bad); }
.status[data-s="connecting"] .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.capture { display: flex; gap: .5rem; }
.capture .field { font-size: 1.15rem; }

.label { font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-2); display: flex; gap: .5rem; align-items: baseline; }
.label .n { font-family: var(--mono); color: var(--ink-3); }

.body { display: flex; flex-direction: column; gap: calc(var(--gap) * 1.4); }

/* inbox */
.inbox { display: flex; flex-direction: column; gap: .5rem; }
.inbox ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.inbox li { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius-s); padding: .4rem .75rem; max-width: 100%; overflow-wrap: anywhere; }

/* ---------- areas as columns ---------- */
.columns {
  display: grid; gap: var(--gap); align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
}
.col { --h: 190; display: flex; flex-direction: column; gap: .7rem; min-width: 0; }
.band {
  border-radius: var(--radius); padding: .8rem 1rem;
  background: hsl(var(--h) 32% 17%); color: hsl(var(--h) 70% 86%);
  border: 1px solid hsl(var(--h) 30% 24%);
}
.col.plain .band { background: transparent; color: var(--ink); border: 1px dashed var(--line); }
.band-row { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.band h2 { font-size: 1.35rem; font-weight: 750; letter-spacing: -.015em; }
.band p { font-size: .9rem; opacity: .8; margin-top: .15rem; }
.count { font: 600 .9rem/1 var(--mono); opacity: .75; }

.proj {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .75rem .9rem .5rem; display: flex; flex-direction: column; gap: .35rem; min-width: 0;
  border-left: 3px solid hsl(var(--h) 45% 50%);
}
.col.plain .proj { border-left-color: var(--line); }
.proj[data-state="parked"] { opacity: .6; }
.proj h3 { font-size: 1.05rem; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.nonext { font-size: .85rem; color: var(--warn); padding-bottom: .3rem; }
.empty { color: var(--ink-3); font-size: .9rem; padding: .3rem .2rem; }
.empty.big { font-size: 1.1rem; padding: 2rem 0; text-align: center; }

/* actions */
.acts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.act { display: flex; align-items: flex-start; gap: .65rem; padding: .45rem 0; border-top: 1px solid var(--line); min-width: 0; transition: opacity .3s; }
.proj .act:first-child { border-top: 0; }
.act-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .25rem; padding-top: .2rem; }
.act-title { overflow-wrap: anywhere; line-height: 1.35; }
.check {
  flex: none; width: 1.9rem; height: 1.9rem; margin-top: .05rem; border-radius: 50%; padding: 0;
  border: 2px solid var(--ink-3); background: transparent; color: transparent; cursor: pointer;
  display: grid; place-items: center; font-size: .95rem; font-weight: 800; line-height: 1;
}
.check:hover { border-color: var(--good); color: var(--good); }
.act.ticking .check { background: var(--good); border-color: var(--good); color: var(--accent-ink); }
.act.ticking .act-title { text-decoration: line-through; color: var(--ink-2); }
.act.ticking { opacity: .55; }
@media (pointer: coarse) { .check { width: 2.2rem; height: 2.2rem; } }

.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip {
  font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
  padding: .15rem .45rem; border-radius: 99px; border: 1px solid var(--line); color: var(--ink-2);
}
.chip[data-s="late"] { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.chip[data-s="today"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.chip[data-s="doing"] { color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, transparent); }
.chip[data-s="waiting"] { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }

/* loose actions */
.loose { display: flex; flex-direction: column; gap: .4rem; max-width: 46rem; }
.loose .acts { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .2rem .9rem; }
.loose .act:first-child { border-top: 0; }

/* toast */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: calc(100% - 32px); display: flex; align-items: center; gap: 1rem;
  background: var(--ink); color: var(--bg); padding: .7rem 1rem; border-radius: var(--radius-s);
  box-shadow: 0 10px 30px rgba(0,0,0,.45); z-index: 10;
}
.toast span { overflow-wrap: anywhere; }
.toast button { background: none; border: 1px solid currentColor; border-radius: 7px; padding: .3rem .7rem; cursor: pointer; font-weight: 650; flex: none; }

@media (prefers-reduced-motion: reduce) { .status[data-s="connecting"] .dot { animation: none; } .act { transition: none; } }
