/* Smash List — Smashboard-inspired warm surfaces + BTC orange */

:root {
  color-scheme: light dark;
  --background: 35 18% 96%;
  --foreground: 30 12% 12%;
  --border: 35 12% 86%;
  --card: 0 0% 100%;
  --card-foreground: 30 12% 12%;
  --muted: 35 14% 92%;
  --muted-foreground: 30 6% 42%;
  --primary: 32 95% 49%;
  --primary-foreground: 0 0% 100%;
  --destructive: 0 70% 45%;
  --destructive-foreground: 0 0% 98%;
  --input: 35 12% 80%;
  --radius: 0.5rem;
  --shadow-sm: 0 1px 2px hsl(30 30% 5% / 0.05);
  --font-sans: "Satoshi", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --prio-1: 32 95% 49%;
  --prio-2: 32 95% 49%;
  --prio-3: 32 95% 49%;
  --prio-4: 32 95% 49%;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: 30 8% 7%;
    --foreground: 35 12% 92%;
    --border: 30 6% 18%;
    --card: 30 8% 10%;
    --card-foreground: 35 12% 92%;
    --muted: 30 6% 14%;
    --muted-foreground: 35 8% 65%;
    --primary: 32 95% 55%;
    --primary-foreground: 30 8% 7%;
    --destructive: 0 65% 50%;
    --input: 30 6% 22%;
    --shadow-sm: 0 1px 2px hsl(0 0% 0% / 0.3);
    --prio-1: 32 95% 55%;
    --prio-2: 32 95% 55%;
    --prio-3: 32 95% 55%;
    --prio-4: 32 95% 55%;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

.app {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem 0.85rem calc(1.25rem + var(--safe-bottom));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.header-actions {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}

.btn {
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border-radius: calc(var(--radius) - 2px);
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
  line-height: 1.2;
}

.btn:hover { background: hsl(var(--muted)); }
.btn:active { transform: translateY(1px); }

.btn.primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: transparent;
}

.btn.primary:hover { filter: brightness(1.06); }

.btn.ghost {
  background: transparent;
  box-shadow: none;
}

.btn.small {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.btn.danger { color: hsl(var(--destructive)); }

.btn.icon {
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.btn.icon svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn.icon.danger:hover {
  background: color-mix(in srgb, hsl(var(--destructive)) 14%, transparent);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.lists-bar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.list-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.list-tab {
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.8rem;
}

.list-tab[aria-selected="true"] {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: transparent;
}

.list-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.4rem;
  align-items: center;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.4rem;
  box-shadow: var(--shadow-sm);
}

.prio-select {
  border: 1px solid hsl(var(--input));
  border-radius: 6px;
  background: transparent;
  padding: 0.3rem 0.3rem;
  font-size: 0.8rem;
}

.new-text {
  border: none;
  background: transparent;
  outline: none;
  min-width: 0;
  padding: 0.3rem 0.2rem;
}

.main { flex: 1; }

.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.todo-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 0.45rem;
  align-items: start;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.45rem 0.5rem;
  box-shadow: var(--shadow-sm);
}

.todo-item.done .todo-text {
  text-decoration: line-through;
  opacity: 0.55;
}

.todo-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin-top: 0.2rem;
  accent-color: hsl(var(--primary));
}

.prio-badge {
  font-size: 0.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  margin-top: 0.15rem;
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
  cursor: pointer;
}

.prio-badge.p1 { background: hsl(var(--prio-1)); }
.prio-badge.p2 { background: hsl(var(--prio-2)); }
.prio-badge.p3 { background: hsl(var(--prio-3)); }
.prio-badge.p4 { background: hsl(var(--prio-4)); }

.todo-body { min-width: 0; }

.todo-note-row {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.25rem;
  align-items: start;
  margin-top: 0.35rem;
}

.note-toggle {
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
}

.note-toggle:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
}

.note-toggle svg {
  width: 0.85rem;
  height: 0.85rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.todo-note {
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: hsl(var(--muted-foreground));
  white-space: pre-wrap;
  word-break: break-word;
  outline: none;
  border-radius: 4px;
  padding: 0.1rem 0.2rem;
}

.todo-note.collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  white-space: normal;
}

.todo-note[contenteditable="true"] {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  white-space: pre-wrap;
}

.todo-text {
  outline: none;
  word-break: break-word;
}

.todo-text[contenteditable="true"] {
  background: hsl(var(--muted));
  border-radius: 4px;
  padding: 0.1rem 0.25rem;
}

.todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.25rem;
}

.todo-actions {
  display: flex;
  gap: 0.15rem;
  flex-shrink: 0;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.todo-actions .btn.small {
  padding: 0.2rem 0.4rem;
  font-size: 0.72rem;
}

.stats {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.show-done {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.empty {
  padding: 1.25rem 0.5rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .composer { grid-template-columns: auto 1fr; }
  .composer .btn.primary { grid-column: 1 / -1; }
}
