:root {
  --bg: #000000;
  --surface: rgba(14, 14, 18, 0.85);
  --panel: rgba(18, 18, 22, 0.9);
  --card: rgba(20, 20, 26, 0.9);
  --card-strong: rgba(26, 26, 34, 0.96);
  --text: #f2f5f9;
  --muted: #9aa3b2;
  --accent: #36ff88;
  --accent-strong: #36ff88;
  --neon-green: #36ff88;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  --radius: 22px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Sora", "Space Grotesk", sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

h1, h2, h3 { margin: 0; font-family: "Space Grotesk", "Manrope", sans-serif; }
h1 { font-size: 28px; letter-spacing: 0.3px; }
h2 { font-size: 20px; margin-bottom: 12px; }
h3 { font-size: 18px; }
p { margin: 0; }

.app {
  max-width: 980px;
  margin: 18px auto 28px;
  padding: 30px 18px calc(110px + env(safe-area-inset-bottom));
  background: transparent;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.brand {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.6px;
}
.brand-dot { color: var(--accent-strong); }
.user { color: var(--muted); font-size: 12px; }
.chat-indicator {
  margin-left: auto;
  color: var(--neon-green);
  font-size: 12px;
  letter-spacing: 0.4px;
  text-shadow:
    0 0 8px rgba(54, 255, 136, 0.6),
    0 0 16px rgba(54, 255, 136, 0.35);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.tabs-bottom {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom));
  background: rgba(20, 22, 30, 0.75);
  border-radius: 999px;
  padding: 8px 10px;
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.4);
  width: min(92vw, 560px);
  z-index: 5;
}
.tab {
  position: relative;
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.2s ease;
  font-size: 13px;
  display: grid;
  place-items: center;
  min-height: 62px;
}
.tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}
.tab.active::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  width: 22px;
  height: 5px;
  background: var(--neon-green);
  border-radius: 999px;
  transform: translateX(-50%);
  box-shadow: 0 0 12px rgba(54, 255, 136, 0.7);
}
.tab-icon {
  width: 48px;
  height: 48px;
  opacity: 0.9;
  filter: brightness(0) invert(1) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}
.tab.active .tab-icon {
  opacity: 1;
  filter: brightness(0) invert(1) drop-shadow(0 4px 10px rgba(54, 255, 136, 0.6));
}
.tab-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.view {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: fadeUp 0.35s ease both;
}
.view.animating {
  animation: fadeUp 0.3s ease both;
}
.hidden { display: none; }
.content { display: grid; gap: 16px; }

.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 11px;
  color: var(--accent-strong);
  margin-bottom: 6px;
}
.muted { color: var(--muted); }
.chip {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  margin-top: 10px;
  font-size: 12px;
}

.stats {
  display: grid;
  gap: 10px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}
.stat-title { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 600; color: var(--accent-strong); }
.stat-sub { font-size: 12px; color: var(--muted); }

.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row-wrap { flex-wrap: wrap; }
.section-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.list { margin-top: 12px; display: grid; gap: 12px; }
#today-list { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  animation: fadeUp 0.4s ease both;
}
.item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.item-title { font-weight: 600; }
.item-time { color: var(--accent-strong); font-size: 13px; }
.item-meta { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}
.item small { color: var(--muted); }
.item.clickable { cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease; }
.item.clickable:hover { transform: translateY(-2px); border-color: rgba(110, 231, 255, 0.35); }
.item.active { border-color: rgba(110, 231, 255, 0.6); }

.btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 16px;
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.2s ease;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.25); color: var(--accent-strong); }
.btn-primary {
  background: linear-gradient(135deg, rgba(54, 255, 136, 0.25), rgba(54, 255, 136, 0.12));
  border-color: rgba(54, 255, 136, 0.6);
  color: var(--text);
}

.link { background: none; border: none; color: var(--muted); cursor: pointer; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.hidden { display: none; }
.modal-content {
  background: rgba(22, 24, 34, 0.95);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
input, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  height: 42px;
}
input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.fab-wrap {
  position: fixed;
  right: 22px;
  bottom: calc(120px + env(safe-area-inset-bottom));
  z-index: 6;
  display: grid;
  gap: 10px;
  justify-items: end;
}
.fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--neon-green);
  color: var(--text);
  font-size: 0;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.fab img {
  width: 40px;
  height: 40px;
  display: block;
  margin: 0 auto;
  filter: brightness(0) invert(1);
}
.fab:hover { transform: translateY(-2px); background: #2fe37a; }
.fab-menu {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(20, 22, 30, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 26px rgba(0, 0, 0, 0.3);
}
.fab-menu.hidden { display: none; }
.fab-option {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}
.fab-option:hover {
  border-color: rgba(79, 192, 255, 0.4);
  color: var(--accent-strong);
}

.setting {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.setting-title { font-weight: 600; }

.debug {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 170, 77, 0.35);
  background: rgba(255, 170, 77, 0.12);
  color: #ffddb1;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #1b2334; border: 1px solid var(--border);
  border-radius: 999px; transition: 0.2s;
}
.slider:before {
  position: absolute; content: "";
  height: 20px; width: 20px; left: 3px; top: 2px;
  background: #fff; border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .slider {
  background: rgba(110, 231, 255, 0.35);
  border-color: rgba(110, 231, 255, 0.6);
}
.switch input:checked + .slider:before { transform: translateX(20px); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tabs-bottom { width: calc(100% - 32px); }
  .fab-wrap { right: 16px; }
}
