:root {
  --bg: #101112;
  --panel: #181a1d;
  --panel2: #222529;
  --panel3: #121416;
  --text: #f4f1ea;
  --muted: #b7b0a4;
  --accent: #52c7b8;
  --danger: #ff6b6b;
  --warn: #e6b450;
  --ok: #7ccf8a;
  --border: rgba(244, 241, 234, 0.1);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f1ea;
    --panel: #fffdf8;
    --panel2: #ece7dc;
    --panel3: #ffffff;
    --text: #181714;
    --muted: #6b6258;
    --border: rgba(24, 23, 20, 0.13);
    --shadow: 0 18px 42px rgba(24, 23, 20, 0.11);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel2) 22%, transparent), transparent 280px),
    var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand__title {
  font-weight: 800;
  letter-spacing: 0;
}

.brand__subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.topbar__stats {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  border: 1px solid var(--border);
  font-size: 12px;
}

.pill code {
  font-family: var(--mono);
  font-size: 12px;
}

.container {
  padding: 22px 16px 56px;
  max-width: 900px;
  margin: 0 auto;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.card + .card {
  margin-top: 12px;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.h1 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.muted {
  color: var(--muted);
}

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

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
}

.tag--urgent {
  color: #fff;
  background: color-mix(in srgb, var(--danger) 25%, var(--panel2));
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}

.tag--type {
  background: var(--panel2);
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

button,
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 650;
  cursor: pointer;
  line-height: 1.15;
}

button:hover,
.btn:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
  color: #071210;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--accent) 18%, transparent);
}

.btn--danger {
  background: color-mix(in srgb, var(--danger) 18%, var(--panel2));
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}

.btn--ghost {
  background: transparent;
}

.btn--xl {
  min-height: 48px;
  padding: 14px 16px;
  font-size: 15px;
}

.homeShell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.practiceHero,
.emptyState {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: clamp(22px, 5vw, 42px);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel) 98%, var(--accent)), var(--panel3));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.displayTitle {
  max-width: 780px;
  font-size: clamp(32px, 7vw, 62px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0;
}

.lead {
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.focusLine,
.doneLine {
  display: grid;
  grid-template-columns: minmax(72px, 92px) 1fr;
  gap: 12px;
  align-items: start;
  max-width: 760px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--panel2) 76%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.focusLine span,
.doneLine span {
  color: var(--muted);
  font-size: 12px;
}

.focusLine strong,
.doneLine strong {
  font-size: 15px;
  line-height: 1.45;
}

.primaryRow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.homeHint {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 720px) {
  .homeHint {
    grid-template-columns: 1fr 1fr;
  }
}

.hintItem {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 84%, transparent);
}

.hintItem span {
  color: var(--muted);
  line-height: 1.5;
}

.homeNav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 4px 0;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 720px) {
  .grid2 {
    grid-template-columns: 1fr 1fr;
  }
}

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.formRow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 720px) {
  .formRow {
    grid-template-columns: 1fr 1fr;
  }
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.taskTitle {
  font-weight: 700;
  margin: 0;
}

.taskActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  max-width: min(720px, calc(100% - 24px));
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
  font-size: 14px;
}

.toast--show {
  opacity: 1;
}

.modal-root {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.45);
  z-index: 50;
}

.modal-root[aria-hidden="false"] {
  display: flex;
}

.modal {
  width: min(820px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.modalHeader {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.modalTitle {
  font-weight: 800;
  font-size: 16px;
}

.focus {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 56px;
}

.focusMode body {
  background: #000;
}

.focusMode .topbar {
  display: none;
}

.focusMode .container {
  max-width: 900px;
}

.timer {
  font-family: var(--mono);
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 900;
  letter-spacing: 1px;
}

.checklist {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.check input {
  width: auto;
  margin-top: 2px;
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
  }

  .displayTitle {
    font-size: 34px;
    line-height: 1.08;
  }

  .primaryRow .btn {
    width: 100%;
  }

  .focusLine,
  .doneLine {
    grid-template-columns: 1fr;
  }

  .row {
    align-items: flex-start;
    flex-direction: column;
  }

  .buttons {
    justify-content: flex-start;
  }
}
