:root {
  color-scheme: dark;
  --bg: #0c0f0d;
  --panel: #111612;
  --panel-deep: #0e120f;
  --line: #283129;
  --line-soft: #1b211c;
  --text: #e3e9e2;
  --muted: #798279;
  --muted-strong: #a1aaa1;
  --green: #8bae8b;
  --green-bright: #b4d6ae;
  --green-dim: #506a51;
  --danger: #bd8580;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(95, 135, 96, 0.09), transparent 33rem),
    var(--bg);
  color: var(--text);
}

button, input { font: inherit; }
button { cursor: pointer; }

.shell {
  width: min(760px, calc(100% - 40px));
  min-height: 490px;
  margin: 48px auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(20, 27, 21, 0.98), rgba(13, 17, 14, 0.99));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.32), inset 0 1px rgba(255, 255, 255, 0.025);
}

.topbar, .footer, .controls { border-color: var(--line-soft); }

.topbar {
  min-height: 115px;
  padding: 28px 30px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.identity { display: flex; gap: 13px; align-items: flex-start; }
.status-light { width: 9px; height: 9px; margin-top: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(139, 174, 139, 0.08), 0 0 13px rgba(139, 174, 139, 0.35); }
.eyebrow { margin: 0 0 7px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.11em; }
h1 { margin: 0; color: var(--text); font-size: 25px; line-height: 1; letter-spacing: -0.08em; font-weight: 700; }
h1 span { color: var(--green); }
.session { margin: 2px 0 0; color: var(--muted); font-size: 11px; white-space: nowrap; }
.session span { color: var(--green); font-size: 9px; vertical-align: 1px; }

.composer { margin: 25px 30px 19px; display: flex; align-items: center; min-height: 54px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-deep); transition: border-color 160ms ease, box-shadow 160ms ease; }
.composer:focus-within { border-color: var(--green-dim); box-shadow: 0 0 0 3px rgba(139, 174, 139, 0.07); }
.prompt { padding-left: 17px; color: var(--green); font-size: 18px; user-select: none; }
#task-input { width: 100%; min-width: 0; padding: 15px 13px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
#task-input::placeholder { color: #596258; opacity: 1; }
.add-button { align-self: stretch; min-width: 74px; padding: 0 14px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--green); font-size: 12px; font-weight: 700; transition: background 160ms ease, color 160ms ease; }
.add-button:hover, .add-button:focus-visible { background: rgba(139, 174, 139, 0.10); color: var(--green-bright); outline: 0; }

.controls { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 30px; border-bottom: 1px solid var(--line-soft); gap: 14px; }
.filters { display: flex; align-self: stretch; align-items: stretch; gap: 18px; }
.filter, .clear-button { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 11px; transition: color 160ms ease; }
.filter { position: relative; white-space: nowrap; }
.filter span { padding-left: 2px; color: #596258; }
.filter::after { content: ""; position: absolute; bottom: -1px; left: 0; width: 100%; height: 1px; background: transparent; }
.filter:hover, .filter:focus-visible { color: var(--muted-strong); outline: none; }
.filter.is-active { color: var(--green); }
.filter.is-active::after { background: var(--green); }
.clear-button { color: #8b817d; white-space: nowrap; }
.clear-button:hover, .clear-button:focus-visible { color: var(--danger); outline: none; }

.task-panel { position: relative; min-height: 220px; }
.task-list { margin: 0; padding: 6px 0; list-style: none; }
.task { display: grid; grid-template-columns: 24px minmax(0, 1fr) 31px; align-items: center; gap: 11px; min-height: 55px; padding: 9px 22px 9px 30px; border-bottom: 1px solid rgba(40, 49, 41, 0.52); animation: task-in 180ms ease-out; }
.task:last-child { border-bottom: 0; }
.task:hover { background: rgba(139, 174, 139, 0.025); }
.check-button { width: 18px; height: 18px; padding: 0; border: 1px solid #536054; border-radius: 3px; display: grid; place-items: center; background: transparent; color: #102113; font-size: 13px; line-height: 1; transition: background 140ms ease, border-color 140ms ease; }
.check-button:hover, .check-button:focus-visible { border-color: var(--green); outline: none; }
.task.is-complete .check-button { border-color: var(--green); background: var(--green); }
.task-text { overflow-wrap: anywhere; color: #d6ddd5; font-size: 14px; line-height: 1.45; transition: color 140ms ease; }
.task.is-complete .task-text { color: #647064; text-decoration: line-through; text-decoration-color: #4b554c; }
.delete-button { width: 28px; height: 28px; padding: 0; justify-self: end; border: 0; border-radius: 4px; background: transparent; color: #596258; font-size: 18px; line-height: 1; opacity: 0; transition: color 140ms ease, background 140ms ease, opacity 140ms ease; }
.task:hover .delete-button, .delete-button:focus-visible { opacity: 1; }
.delete-button:hover, .delete-button:focus-visible { color: var(--danger); background: rgba(189, 133, 128, 0.09); outline: none; }

.empty-state { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 8px; color: var(--muted); text-align: center; }
.empty-state[hidden] { display: none; }
.empty-mark { color: var(--green-dim); font-size: 29px; line-height: 1; }
.empty-state p { margin: 6px 0 0; color: var(--muted-strong); font-size: 13px; }
.empty-state span:last-child { font-size: 11px; }

.footer { min-height: 50px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line-soft); color: #697269; font-size: 10px; }
.footer p { margin: 0; }
kbd { padding: 1px 4px; border: 1px solid #3f493f; border-radius: 3px; color: #899388; font-family: inherit; font-size: 9px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes task-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

@media (max-width: 560px) {
  body { place-items: start center; }
  .shell { width: 100%; min-height: 100vh; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .topbar { min-height: 106px; padding: 27px 20px 22px; }
  .session { display: none; }
  .composer { margin: 20px 20px 15px; min-height: 52px; }
  .prompt { padding-left: 14px; }
  #task-input { padding: 14px 10px; font-size: 13px; }
  .add-button { min-width: 62px; padding: 0 10px; font-size: 11px; }
  .controls { padding: 0 20px; overflow-x: auto; }
  .filters { gap: 14px; }
  .task { grid-template-columns: 22px minmax(0, 1fr) 29px; gap: 9px; padding: 9px 12px 9px 20px; min-height: 57px; }
  .delete-button { opacity: 1; }
  .footer { min-height: 58px; padding: 0 20px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 5px; }
}
