:root {
  --bg: #071018;
  --fg: #f2f7f5;
  --muted: #8fa3a0;
  --accent: #2dd4bf;
  --accent-deep: #0f766e;
  --card: #101a22;
  --font-display: "Unbounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}
.landing {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(45, 212, 191, 0.22), transparent 60%),
    radial-gradient(700px 480px at 100% 8%, rgba(15, 118, 110, 0.35), transparent 55%),
    linear-gradient(180deg, #071018 0%, #0a1620 55%, #071018 100%);
}
.landing .hero-plane {
  position: absolute;
  inset: 0 0 auto 0;
  height: min(92vh, 860px);
  background:
    linear-gradient(180deg, rgba(7, 16, 24, 0.15) 0%, rgba(7, 16, 24, 0.92) 78%, var(--bg) 100%),
    url("/web/static/og.png") center 30% / cover no-repeat;
  opacity: 0.28;
  pointer-events: none;
  animation: planeDrift 18s ease-in-out infinite alternate;
}
@keyframes planeDrift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(-1.5%, 1.5%, 0); }
}
.landing main {
  position: relative;
  z-index: 1;
  padding-bottom: 4rem;
}
.landing .hero {
  max-width: 44rem;
  margin: 0 auto;
  padding: min(18vh, 8rem) 1.5rem 2.75rem;
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.landing .brand {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--accent);
  line-height: 0.95;
}
.landing .brand::after {
  content: "";
  display: block;
  width: 3.2rem;
  height: 0.28rem;
  margin-top: 0.75rem;
  background: var(--accent);
  border-radius: 999px;
  transform-origin: left;
  animation: brandLine 1.1s ease 0.2s both;
}
@keyframes brandLine {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}
.landing h1 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4.4vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 1.1rem 0 0.85rem;
  max-width: 18ch;
}
.landing .lede {
  color: var(--muted);
  font-size: clamp(1.02rem, 2.2vw, 1.18rem);
  line-height: 1.45;
  margin: 0;
  max-width: 34rem;
}
.landing .local-fit {
  margin-top: 1rem;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--accent);
  background: rgba(45, 212, 191, 0.1);
  color: var(--fg);
  font-size: 0.95rem;
  line-height: 1.4;
}
.landing .cta {
  margin-top: 1.6rem;
  min-height: 3rem;
}
.landing .example {
  margin: 1.35rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.landing .example-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.landing .example-text {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  font-weight: 500;
  color: var(--fg);
}
.landing .foot {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.landing .foot a { color: var(--accent); text-decoration: none; }
.landing .foot a:hover { text-decoration: underline; }
.landing .story {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 1.5rem 2.75rem;
}
.landing .story h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 1rem;
}
.landing .loop-strip { padding-top: 0.5rem; }
.landing .loop-steps {
  list-style: none;
  margin: 0;
  padding: 1.25rem 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  border-top: 1px solid rgba(45, 212, 191, 0.25);
  border-bottom: 1px solid rgba(45, 212, 191, 0.25);
}
.landing .loop-steps li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.landing .loop-steps span {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.landing .loop-steps strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}
.landing .loop-steps em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.88rem;
}
.landing .faq details {
  border-top: 1px solid #1a2a32;
  padding: 0.9rem 0;
}
.landing .faq details:last-child { border-bottom: 1px solid #1a2a32; }
.landing .faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.02rem;
}
.landing .faq details p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}
/* opacity stays 1 — Safari can skip/fail animation-fill and leave opacity:0 forever */
.landing .reveal {
  opacity: 1;
  transform: translate3d(0, 18px, 0);
  animation: riseIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.landing .reveal.d1 { animation-delay: 0.08s; }
.landing .reveal.d2 { animation-delay: 0.16s; }
.landing .reveal.d3 { animation-delay: 0.26s; }
.landing .reveal.d4 { animation-delay: 0.34s; }
@keyframes riseIn {
  from { transform: translate3d(0, 18px, 0); }
  to { transform: translate3d(0, 0, 0); }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
@media (max-width: 720px) {
  .landing .loop-steps {
    grid-template-columns: 1fr 1fr;
    gap: 1rem 0.85rem;
  }
  .landing .hero { min-height: auto; padding-top: 22vh; }
}
@media (prefers-reduced-motion: reduce) {
  .landing .hero-plane,
  .landing .brand::after,
  .landing .reveal {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}
.brand { font-size: 2rem; letter-spacing: 0.04em; margin: 0; color: var(--accent); }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.2; margin: 0.6rem 0; }
.lede, .hint, .muted, .foot { color: var(--muted); }
.story-note {
  margin: 1.1rem 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}
.cta { margin-top: 1.5rem; min-height: 3rem; }

/* —— App shell (Baeza / same system as landing) —— */
body.app {
  font-family: var(--font-body);
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
.app-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(700px 420px at 8% -5%, rgba(45, 212, 191, 0.18), transparent 55%),
    radial-gradient(560px 380px at 100% 0%, rgba(15, 118, 110, 0.28), transparent 50%),
    linear-gradient(180deg, #071018 0%, #0a1620 50%, #071018 100%);
}
.app .top,
.app .app-shell,
.app .auth-gate {
  position: relative;
  z-index: 1;
}
.app .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid rgba(45, 212, 191, 0.18);
  background: rgba(7, 16, 24, 0.78);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.app .app-brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  text-decoration: none;
  line-height: 1;
}
.app .app-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}
.app .app-nav button[data-tab] {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
}
.app .app-nav button[data-tab].active {
  color: #042f2e;
  background: var(--accent);
}
.app .app-nav button[data-tab]:hover:not(.active) {
  color: var(--fg);
  background: rgba(45, 212, 191, 0.1);
}
.app .btn-logout,
.btn-logout {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  margin-left: 0.25rem;
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-body);
}
.app .btn-logout:hover,
.btn-logout:hover {
  color: var(--fg);
  border-color: var(--accent);
}
#panel-settings .btn-logout {
  display: block;
  margin: 1.25rem 0 0;
  width: fit-content;
}
.app-shell {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem 1.5rem;
  min-height: calc(100vh - 4rem);
}
.panel {
  display: none;
  padding: 1rem 0 1.5rem;
}
.panel.active { display: block; }
#panel-chat.panel.active {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 5.5rem);
}
.panel-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0.35rem 0 1rem;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.panel-head .panel-title { margin: 0; }
.btn-ghost {
  background: transparent !important;
  color: var(--accent) !important;
  border: 1px solid rgba(45, 212, 191, 0.35) !important;
  border-radius: 999px !important;
  padding: 0.4rem 0.85rem !important;
  font-weight: 600;
  cursor: pointer;
}
.chat-log {
  flex: 1;
  min-height: 42vh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 0 1rem;
  overflow-y: auto;
}
.bubble-wrap {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  gap: 0.4rem;
  animation: bubbleIn 0.35s ease both;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bubble-wrap { animation: none; }
}
.bubble-wrap.user { align-self: flex-end; align-items: flex-end; }
.bubble-wrap.bot { align-self: flex-start; }
.bubble {
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(16, 26, 34, 0.92);
  border: 1px solid rgba(45, 212, 191, 0.12);
  line-height: 1.45;
  white-space: pre-wrap;
}
.bubble.user {
  background: linear-gradient(145deg, #0f766e, #134e4a);
  border-color: transparent;
  border-bottom-right-radius: 0.35rem;
}
.bubble.bot { border-bottom-left-radius: 0.35rem; }
.bubble.md {
  white-space: normal;
  word-break: break-word;
}
.bubble.md a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.bubble.md a:hover { opacity: 0.9; }
.bubble.md strong { font-weight: 700; color: #ecfdf8; }
.bubble.md em { font-style: italic; }
.bubble.md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
  background: rgba(45, 212, 191, 0.12);
}
.action-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.action-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(45, 212, 191, 0.55);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: var(--font-body);
}
.action-btn:hover {
  background: rgba(45, 212, 191, 0.12);
}
.hint { font-size: 0.9rem; margin-top: 0.5rem; }
.chat-form {
  display: flex;
  gap: 0.55rem;
  margin-top: auto;
  padding: 0.75rem 0 0.25rem;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent, rgba(7, 16, 24, 0.92) 28%);
}
.chat-form input,
#tz-input,
.app .field input {
  flex: 1;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  background: rgba(10, 22, 32, 0.95);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
}
.chat-form input:focus,
#tz-input:focus,
.app .field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}
button,
.chat-form button {
  background: var(--accent);
  color: #042f2e;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.15rem;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-body);
}
.chat-form button:hover,
#save-tz:hover,
#enable-push:hover {
  filter: brightness(1.06);
}
.task-list { list-style: none; padding: 0; margin: 0; }
.task-list li {
  padding: 0.95rem 1rem;
  margin-bottom: 0.55rem;
  background: rgba(16, 26, 34, 0.9);
  border: 1px solid rgba(45, 212, 191, 0.14);
  border-radius: 0.9rem;
  line-height: 1.4;
}
.app .field {
  display: block;
  margin-bottom: 0.9rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.app .field input { margin-top: 0.4rem; border-radius: 0.75rem; }
.settings-block { margin: 0.85rem 0; line-height: 1.45; }
#save-tz,
#enable-push {
  display: inline-block;
  margin: 0.35rem 0.5rem 0.35rem 0;
}
.auth-gate {
  text-align: center;
  padding: min(18vh, 6rem) 1.25rem 3rem;
  max-width: 28rem;
  margin: 0 auto;
}
.auth-gate .auth-brand {
  display: inline-block;
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  margin-bottom: 0.65rem;
}
.auth-gate .auth-brand::after {
  content: "";
  display: block;
  width: 2.6rem;
  height: 0.24rem;
  margin: 0.65rem auto 0;
  background: var(--accent);
  border-radius: 999px;
}
.auth-lede {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 1.35rem;
  line-height: 1.25;
}
.auth-panel { margin-top: 0.5rem; }
.auth-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}
.auth-tg { min-height: 2.5rem; margin-bottom: 0.75rem; }
.auth-max-row { margin: 0.75rem 0; }
.auth-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin: 0.5rem 0 0.75rem;
}
.btn-tg, .btn-max, .btn-ya {
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-body);
}
.btn-tg { background: #229ed9; }
.btn-max { background: #2563eb; }
.btn-ya { background: #fc3f1d; }
.btn-tg:disabled, .btn-max:disabled, .btn-ya:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-google {
  display: flex;
  justify-content: center;
  margin: 0.35rem 0 0.75rem;
  min-height: 2.5rem;
}
.auth-code {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.btn-cancel {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  font-weight: 600;
}
.bot-links { margin-top: 1rem; font-size: 0.95rem; }
.bot-link { color: var(--accent); margin: 0 0.15rem; }
.cta-link {
  display: inline-block;
  background: var(--accent);
  color: #042f2e;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font-weight: 700;
}
.auth-blur { opacity: 0.25; pointer-events: none; }
.hidden { display: none !important; }
label { display: block; margin-bottom: 0.75rem; }
.app .foot a { color: var(--accent); }

.panel-sub {
  margin: -0.35rem 0 1.1rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}
.empty-state {
  margin: 1rem 0 0.5rem;
  padding: 1.25rem 1.15rem;
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: 1rem;
  background: rgba(45, 212, 191, 0.06);
}
.empty-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-display);
}
.empty-title {
  margin: 0.45rem 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.empty-copy {
  margin: 0 0 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}
.settings-card {
  padding: 1.15rem 1.1rem;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(45, 212, 191, 0.16);
  border-radius: 1rem;
  background: rgba(16, 26, 34, 0.72);
}
.settings-label {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.settings-copy {
  margin: 0.45rem 0 0.85rem;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.95rem;
}
.task-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.task-meta {
  color: var(--muted);
  font-size: 0.86rem;
}
.task-empty {
  color: var(--muted) !important;
  border-style: dashed !important;
  background: transparent !important;
}

@media (max-width: 640px) {
  .app .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }
  .app .app-nav { width: 100%; justify-content: flex-start; }
  .chat-form { flex-direction: column; }
  .chat-form button { width: 100%; }
}
