:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #0f3460;
  --accent: #e94560;
  --accent-soft: rgba(233, 69, 96, 0.15);
  --text-primary: #eee;
  --text-secondary: #888;
  --radius: 16px;
  --radius-sm: 10px;
  --nav-height: 64px;
  --header-height: 56px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
}
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 500px;
  margin: 0 auto;
}

/* Header */
header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
header h1 { font-size: 18px; font-weight: 600; }
.header-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  padding: 6px;
}

/* Main content */
main {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

/* Nav */
nav {
  height: var(--nav-height);
  display: flex;
  background: var(--bg-secondary);
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  gap: 2px;
  transition: color 0.2s;
}
.nav-btn.active { color: var(--accent); }
.nav-icon { font-size: 22px; }

/* Messages page */
.msg-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 80px; }
.msg-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.msg-item.mine { flex-direction: row-reverse; }
.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.msg-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--bg-card);
  font-size: 15px;
  line-height: 1.5;
  word-break: break-word;
}
.msg-item.mine .msg-bubble { background: var(--accent); color: white; }
.msg-time {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Composer */
.composer {
  position: fixed;
  bottom: var(--nav-height);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-top: 1px solid rgba(255,255,255,0.05);
}
.composer input {
  flex: 1;
  padding: 10px 16px;
  border-radius: 20px;
  border: none;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
}
.composer button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Todos */
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}
.todo-item.done { opacity: 0.5; }
.todo-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 14px;
}
.todo-item.done .todo-check { background: var(--accent); color: white; }
.todo-text { flex: 1; font-size: 15px; }
.todo-creator { font-size: 18px; }
.todo-delete {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

/* Add bar (for todos) */
.add-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.add-bar input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
}
.add-bar button {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* Countdowns */
.countdown-list { display: flex; flex-direction: column; gap: 12px; }
.countdown-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.countdown-emoji { font-size: 32px; margin-bottom: 8px; }
.countdown-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.countdown-days { font-size: 36px; font-weight: 700; color: var(--accent); }
.countdown-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.countdown-delete {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  margin-top: 8px;
}

/* Settings */
.settings-list { display: flex; flex-direction: column; gap: 12px; }
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}
.settings-item label { font-size: 15px; }
.logout-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
}
