:root {
  --bg: #f4f1e8;
  --surface: #fffdf6;
  --ink: #111111;
  --muted: #69645b;
  --line: rgba(17, 17, 17, 0.13);
  --accent: #111111;
  --ready: #174d33;
  --running: #3454d1;
  --blocked: #8f1d1d;
  --scheduled: #8a5a00;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  background:
    radial-gradient(circle at 18% -8%, rgba(17,17,17,0.10), transparent 19rem),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button, input { font: inherit; }

.app-shell {
  width: min(100% - 24px, 720px);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 0 max(34px, env(safe-area-inset-bottom));
}

.hero {
  min-height: 44dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 34px 0 24px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 7.5ch;
  margin-bottom: 18px;
  font-size: clamp(4.2rem, 21vw, 7.2rem);
  line-height: 0.82;
  letter-spacing: -0.095em;
}

.lead {
  max-width: 34ch;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.hero-actions, .section-title, .task-footer, .task-topline, .task-id-box, .chips {
  display: flex;
  gap: 10px;
  align-items: center;
}

.hero-actions { flex-wrap: wrap; }

button {
  min-height: 46px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.primary { background: var(--ink); color: #fffdf6; }
.secondary, .ghost { background: transparent; color: var(--ink); }
.ghost { min-height: 38px; font-size: 0.86rem; }

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.summary article {
  min-height: 96px;
  padding: 14px;
  background: rgba(255,253,246,0.82);
}

.summary strong {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(1.35rem, 8vw, 2.4rem);
  line-height: 1;
  letter-spacing: -0.07em;
}

.summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.toolbar {
  margin: 22px 0 28px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255,253,246,0.72);
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

input[type="search"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

input[type="search"]:focus { border-color: var(--ink); }

.chips { flex-wrap: wrap; margin-top: 14px; }

.chip {
  min-height: 34px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
}

.chip.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.task-section { padding-bottom: 24px; }
.section-title { justify-content: space-between; margin-bottom: 14px; }
h2 { margin-bottom: 0; font-size: 1.15rem; letter-spacing: -0.04em; }

.task-list { display: grid; gap: 12px; }

.task-card {
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255,253,246,0.9);
  box-shadow: 0 16px 36px rgba(17,17,17,0.06);
}

.task-topline { justify-content: flex-start; margin-bottom: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(23,77,51,0.1);
  color: var(--ready);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.badge.running { color: var(--running); background: rgba(52,84,209,0.1); }
.badge.blocked { color: var(--blocked); background: rgba(143,29,29,0.1); }
.badge.scheduled { color: var(--scheduled); background: rgba(138,90,0,0.12); }

.task-id-box {
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px dashed rgba(17,17,17,0.28);
  border-radius: 18px;
  background: rgba(17,17,17,0.035);
}

.task-id-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.task-id {
  display: block;
  width: 100%;
  color: var(--ink);
  font-family: "SF Mono", "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: clamp(1.55rem, 8vw, 2.2rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.045em;
  user-select: all;
  -webkit-user-select: all;
  overflow-wrap: anywhere;
  cursor: text;
}

.task-id:focus {
  outline: 3px solid rgba(17,17,17,0.18);
  outline-offset: 4px;
  border-radius: 8px;
}

.copy-id {
  width: 100%;
  min-height: 46px;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
  font-size: 0.86rem;
}

.task-card.copied .task-id-box {
  border-color: rgba(23,77,51,0.55);
  background: rgba(23,77,51,0.08);
}

.task-card h3 {
  margin-bottom: 10px;
  font-size: 1.35rem;
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.task-card p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

.task-footer { justify-content: space-between; }
.priority { color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.copy-task { min-height: 36px; font-size: 0.82rem; }
.empty { color: var(--muted); line-height: 1.6; }

@media (min-width: 720px) {
  .app-shell { padding-top: 38px; }
  h1 { max-width: none; }
  .task-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
