:root {
  color-scheme: dark;
  --bg: #0b111a;
  --surface: #121c28;
  --surface-2: #182534;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f7f9fc;
  --muted: #91a0b3;
  --accent: #24a1de;
  --accent-soft: rgba(36, 161, 222, 0.14);
  --success: #4fd29c;
  --warning: #f2b84b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% -10%, rgba(36, 161, 222, 0.16), transparent 38%),
    var(--tg-theme-bg-color, var(--bg));
  color: var(--tg-theme-text-color, var(--text));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button { font: inherit; }

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(104px + env(safe-area-inset-bottom));
}

.topbar, .section-heading, .section-title, .project-meta, .status-pill {
  display: flex;
  align-items: center;
}

.topbar { gap: 12px; margin-bottom: 22px; }
.topbar h1 { margin: 2px 0 0; font-size: 18px; letter-spacing: -0.02em; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, #29b6f6, #1677c8);
  color: white;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(36, 161, 222, 0.24);
}

.eyebrow { margin: 0; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 0.13em; }
.demo-badge { margin-left: auto; padding: 5px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 11px; }

.welcome-card { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; }
.welcome-card h2 { margin: 4px 0 0; font-size: clamp(22px, 6vw, 30px); letter-spacing: -0.045em; }
.muted { margin: 0; color: var(--muted); font-size: 14px; }
.status-pill { gap: 6px; flex: 0 0 auto; margin-left: 12px; color: var(--success); font-size: 11px; }
.status-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px var(--success); }

.project-card, .tasks-card {
  padding: 18px;
  margin-bottom: 24px;
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.section-heading, .section-title { justify-content: space-between; }
.section-heading h3 { margin: 5px 0 0; font-size: 20px; }
.text-button { padding: 6px 0; border: 0; background: none; color: var(--accent); font-weight: 650; cursor: pointer; }
.project-meta { gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.project-meta span { padding: 6px 9px; background: rgba(255,255,255,.055); border-radius: 8px; color: #c8d1dc; font-size: 12px; }
.project-note { display: flex; gap: 10px; padding: 12px; background: rgba(242,184,75,.09); border: 1px solid rgba(242,184,75,.16); border-radius: 12px; color: #e8c982; font-size: 12px; line-height: 1.45; }
.note-icon { display: grid; place-items: center; flex: 0 0 20px; height: 20px; border-radius: 50%; background: rgba(242,184,75,.2); font-weight: 800; }

.section-title { margin: 0 2px 12px; }
.section-title h2 { margin: 0; font-size: 18px; letter-spacing: -0.025em; }
.section-title > span { color: var(--muted); font-size: 11px; }
.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 24px; }
.action-card { min-height: 132px; padding: 16px; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; cursor: pointer; transition: transform .16s ease, border-color .16s ease; }
.action-card:active { transform: scale(.98); }
.action-card.primary { background: linear-gradient(145deg, rgba(36,161,222,.28), rgba(18,28,40,.95)); border-color: rgba(36,161,222,.3); }
.action-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 19px; border-radius: 11px; background: var(--accent-soft); color: #67c9f4; font-size: 19px; }
.action-card strong, .action-card small { display: block; }
.action-card strong { font-size: 14px; }
.action-card small { margin-top: 5px; color: var(--muted); font-size: 11px; }

.tasks-card { padding-bottom: 6px; }
.section-title.compact { margin-bottom: 8px; }
.task-row { display: flex; width: 100%; align-items: center; gap: 12px; padding: 13px 0; border: 0; border-top: 1px solid var(--line); color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.task-date { display: grid; place-items: center; flex: 0 0 45px; height: 45px; border-radius: 12px; background: rgba(36,161,222,.13); color: #75d2fb; font-size: 10px; text-transform: uppercase; }
.task-date.neutral { background: rgba(255,255,255,.06); color: #b8c3d0; }
.task-date b { font-size: 16px; line-height: 15px; }
.task-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.task-copy strong { font-size: 13px; }
.task-copy small { color: var(--muted); font-size: 11px; }
.chevron { color: var(--muted); font-size: 24px; }

.bottom-nav { position: fixed; left: 50%; bottom: 0; z-index: 5; display: grid; width: min(100%, 760px); grid-template-columns: repeat(4, 1fr); padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: rgba(11,17,26,.94); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
.bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px; border: 0; color: var(--muted); background: none; font-size: 10px; cursor: pointer; }
.bottom-nav button span { font-size: 20px; line-height: 20px; }
.bottom-nav button.active { color: var(--accent); }

.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 10; width: max-content; max-width: calc(100% - 32px); padding: 11px 14px; transform: translate(-50%, 18px); border: 1px solid var(--line); border-radius: 12px; background: #202c3a; color: white; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }

@media (min-width: 600px) {
  .app-shell { padding-inline: 24px; }
  .action-grid { grid-template-columns: repeat(4, 1fr); }
  .action-card { min-height: 150px; }
}
