:root {
  --bg: #0a0e13;
  --panel: #111720;
  --panel-2: #151c26;
  --line: #263140;
  --line-soft: #1b2430;
  --text: #f7f9fc;
  --soft: #c9d3df;
  --muted: #8f9bad;
  --accent: #7fb2ff;
  --accent-soft: #b7d3ff;
  --type-do: #c1cad6;
  --type-go: #7fb2ff;
  --type-buy: #83d6a6;
  --type-pay: #f2c56e;
  --type-remember: #bd9cff;
  --type-waiting: #e6a96f;
  --type-ideas: #7ed7df;
  --danger: #ff7474;
  --ok: #83d6a6;
  --warning: #f2c56e;
  --focus: #b7d3ff;
  --nav-h: 68px;
  --radius: 16px;
  --touch: 44px;
  --ease: 150ms ease;
  --content-max: 820px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.45;
}

body {
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}

body.marketing {
  padding-bottom: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.app-header {
  padding: 20px 20px 4px;
  max-width: var(--content-max);
  margin: 0 auto;
}

.app-header h1,
.app-wordmark {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-wordmark img {
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.tagline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .tagline {
    display: none;
  }
}

.app-date {
  margin: 0 0 16px;
  color: var(--soft);
  font-size: 0.95rem;
  font-weight: 500;
}

#view {
  padding: 8px 16px 28px;
  max-width: var(--content-max);
  margin: 0 auto;
}

.app-screen {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.command {
  text-align: center;
  padding: 12px 8px 20px;
}

.command-title {
  margin: 10px 0 4px;
  font-size: 1.15rem;
  font-weight: 650;
}

.command-sub {
  margin: 0 auto;
  max-width: 28rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.pills span {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
}

.btn-mic {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #102033;
  margin: 0 auto;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(127, 178, 255, 0.22);
  position: relative;
  transition: transform var(--ease), box-shadow var(--ease);
}

.btn-mic .icon-mic {
  width: 32px;
  height: 32px;
}

.btn-mic.listening {
  box-shadow: 0 0 0 8px rgba(127, 178, 255, 0.18);
}

.btn-mic.listening::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(127, 178, 255, 0.45);
  animation: pulse-ring 1.2s ease-out infinite;
}

.btn-mic.processing {
  opacity: 0.88;
}

.btn-mic.processing::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  right: 6px;
  bottom: 6px;
  border: 2px solid #102033;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes pulse-ring {
  from {
    transform: scale(0.92);
    opacity: 0.8;
  }
  to {
    transform: scale(1.12);
    opacity: 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.sec {
  padding: 10px 0 6px;
  border-top: 1px solid var(--line-soft);
}

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.sec-head h2 {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.sec-count {
  color: var(--muted);
  font-size: 0.78rem;
}

.rec-row {
  display: grid;
  grid-template-columns: 1fr 36px;
  gap: 4px;
  align-items: stretch;
  border-radius: 12px;
  transition: background var(--ease);
}

.rec-row:hover,
.rec-row:focus-within {
  background: var(--panel);
}

.rec-open {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 8px 10px;
  align-items: start;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 6px;
  min-height: var(--touch);
  cursor: pointer;
  width: 100%;
}

.rec-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rec-title {
  font-size: 1.02rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.rec-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.rec-row.is-done .rec-title {
  text-decoration: line-through;
  color: var(--muted);
}

.type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding-top: 4px;
}

.type-do { color: var(--type-do); }
.type-go { color: var(--type-go); }
.type-buy { color: var(--type-buy); }
.type-pay { color: var(--type-pay); }
.type-remember { color: var(--type-remember); }
.type-waiting { color: var(--type-waiting); }
.type-ideas { color: var(--type-ideas); }

.prio {
  color: var(--warning);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  font-weight: 750;
  padding-top: 5px;
}

.rec-check {
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  min-width: 36px;
}

.rec-check-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
}

.rec-check-dot.on {
  background: var(--ok);
  border-color: var(--ok);
}

.card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 14px;
  margin: 10px 0;
  border: 1px solid var(--line);
}

.muted {
  color: var(--muted);
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-group {
  border-top: 1px solid var(--line-soft);
  padding: 16px 0;
}

.settings-group h2 {
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.btn {
  min-height: var(--touch);
  min-width: var(--touch);
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease);
}

.btn.primary {
  background: var(--accent);
  color: #102033;
  border-color: transparent;
  font-weight: 650;
}

.btn.danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.grow {
  flex: 1 1 140px;
}

.field label {
  color: var(--muted);
  font-size: 0.86rem;
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="date"],
input[type="time"],
textarea,
select {
  min-height: var(--touch);
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 10px 12px;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  height: var(--nav-h);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  background: rgba(10, 14, 19, 0.82);
  border: 1px solid var(--line);
  border-radius: 22px;
  backdrop-filter: blur(16px);
  z-index: 20;
  max-width: var(--content-max);
  margin: 0 auto;
}

.nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 56px;
  cursor: pointer;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.72rem;
}

.nav button svg {
  width: 20px;
  height: 20px;
}

.nav button[aria-current="page"] {
  color: var(--text);
  background: var(--panel-2);
  font-weight: 650;
}

.nav.hidden,
.header-app.hidden {
  display: none;
}

.locked {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  margin-right: 6px;
}

.status-dot.ok { background: var(--ok); }
.status-dot.warn { background: var(--warning); }
.status-dot.bad { background: var(--danger); }

.banner {
  background: var(--panel);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 8px 0;
}

.banner.error {
  border: 1px solid var(--danger);
}

.install-bar {
  margin: 8px 16px;
  max-width: var(--content-max);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.list {
  display: flex;
  flex-direction: column;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.filters input[type="search"] {
  grid-column: 1 / -1;
}

.empty {
  color: var(--muted);
  padding: 4px 0 10px;
  margin: 0;
  font-size: 0.92rem;
}

.review-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.about-powered {
  color: var(--muted);
  font-size: 0.85rem;
}

.local-summary {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.source-note {
  margin: 0;
  color: var(--soft);
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 10, 0.62);
  z-index: 40;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  max-height: min(88vh, 720px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  max-width: var(--content-max);
  margin: 0 auto;
}

.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  margin: 6px auto 12px;
}

.sheet h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.sheet-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (min-width: 900px) {
  :root {
    --content-max: 860px;
  }
}
