:root {
  --bg: #f3efff;
  --panel: #ffffff;
  --ink: #1d1633;
  --muted: #6c6090;
  --primary: #7a56ff;
  --danger: #c83f73;
  --line: #dcd2ff;
  --accent-soft: #efe7ff;
  --accent-strong: #5f3de2;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 16% 0%, #ffffff 0%, #f3efff 46%, #e8deff 100%),
    linear-gradient(145deg, #efe7ff 0%, #f8f5ff 45%, #efe9ff 100%);
  color: var(--ink);
}

body { min-height: 100vh; }

input, button, textarea, select { font: inherit; }
button, input, select, textarea { min-height: 44px; }

.screen { display: none; min-height: 100vh; padding: 12px 14px 180px; }
.screen.active { display: block; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 10px 30px rgba(91, 62, 198, 0.12);
}

.auth-card { max-width: 520px; margin: 24px auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in oklab, var(--bg), white 52%);
  backdrop-filter: blur(8px);
  padding: 8px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quick-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 8px 0 12px; }

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

.column {
  background: linear-gradient(180deg, #f8f3ff 0%, #f2ebff 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.column h3 { margin: 0 0 10px; font-size: 1rem; }

.task-card, .idea-card {
  background: linear-gradient(180deg, #ffffff 0%, #fcfaff 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
}

.task-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.stack > * + * { margin-top: 10px; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap { gap: 8px; }

.btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf7ff;
  color: var(--ink);
  padding: 8px 12px;
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(93, 64, 211, 0.25);
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: #ece4ff;
  color: var(--accent-strong);
  font-size: 0.8rem;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in oklab, white, var(--bg) 24%);
  border-top: 1px solid var(--line);
  z-index: 12;
}

.tab-btn { min-height: 46px; border-radius: 12px; }
.tab-btn.active {
  background: var(--accent-soft);
  border-color: #bca9ff;
  color: var(--accent-strong);
}

.action-bar {
  position: fixed;
  right: 12px;
  bottom: calc(74px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  z-index: 14;
}

#fab-mic {
  width: 56px;
  min-height: 56px;
  border-radius: 999px;
  background: var(--accent-strong);
  color: #fff;
  border-color: var(--accent-strong);
  box-shadow: 0 10px 24px rgba(88, 62, 194, 0.3);
}

.drawer {
  position: fixed;
  inset: auto 0 0 0;
  transform: translateY(100%);
  transition: transform 0.2s ease;
  z-index: 20;
}

.drawer.open { transform: translateY(0); }

.drawer-content {
  background: linear-gradient(180deg, #ffffff 0%, #faf6ff 100%);
  border-radius: 16px 16px 0 0;
  border-top: 1px solid var(--line);
  max-height: 85vh;
  overflow-y: auto;
  padding: 16px;
}

.drawer-content h3 {
  margin: 0;
}

#task-detail-form label {
  display: grid;
  gap: 6px;
}

.drawer-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.drawer-section h4 {
  margin: 0 0 10px;
  color: var(--accent-strong);
  letter-spacing: 0.01em;
}

.detail-actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(250, 246, 255, 0.8) 0%, #faf6ff 38%);
  padding-top: 10px;
}

.tab { display: none; }
.tab.active { display: block; }

.error { color: var(--danger); min-height: 22px; }

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(86px + env(safe-area-inset-bottom));
  background: #2b1e52;
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

.toast.show { opacity: 1; }

@media (min-width: 900px) {
  .screen.active { max-width: 900px; margin: 0 auto; }
  .kanban { grid-template-columns: repeat(3, 1fr); }
}
