/* Wave — teal ocean theme, distinct from forge gold/ikigai gold/travel saffron */
:root {
  --bg: #0a1520; --panel: #12212f; --card: #172a3a; --border: #253a4e; --border-hi: #385a75;
  --text: #e6f0f5; --muted: #8ba7ba; --ink-faint: #6a8ca0;
  --teal: #4ecdc4; --teal-tint: rgba(78,205,196,0.15);
  --coral: #ff8c69;
  --sunrise: #ffb85c; --sunset: #f0755f;
  --green: #7cd3a5; --green-tint: rgba(124,211,165,0.15);
  --r-card: 14px; --r-btn: 10px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-ui: 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font-ui); font-size: 15px; line-height: 1.5; min-height: 100vh; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; color: var(--text); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.center { text-align: center; padding: 30px; }
button { font-family: var(--font-ui); cursor: pointer; }
input, textarea, select { font-family: var(--font-ui); }

/* buttons */
.btn-primary, .btn-secondary, .btn-ghost, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--r-btn); border: 1px solid transparent;
  padding: 9px 16px; font-size: 14px; font-weight: 500; transition: 150ms ease;
}
.btn-primary { background: var(--teal); color: #0a1520; border-color: var(--teal); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--panel); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-hi); }
.btn-danger { background: transparent; color: var(--coral); border: 1px solid transparent; padding: 4px 10px; }
.btn-danger:hover { background: rgba(255,140,105,0.1); }

input, textarea, select { background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: var(--r-btn); padding: 9px 12px; font-size: 14px; width: 100%; transition: 150ms ease; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 2px rgba(78,205,196,0.15); }

/* topbar */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--panel); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.topbar-top { display: flex; justify-content: space-between; align-items: center; height: 56px; }
.topbar-left { display: flex; align-items: center; gap: 14px; }
.wordmark { font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.desk-link { color: var(--muted); font-size: 13px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; }
.desk-link:hover { color: var(--teal); border-color: var(--teal); }
.logout-btn { background: none; border: none; color: var(--muted); font-size: 13px; padding: 6px 8px; border-radius: var(--r-btn); }
.logout-btn:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.tabs { display: flex; align-items: center; gap: 4px; height: 44px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 0 14px; height: 44px; display: flex; align-items: center; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--teal); }
.tab.active::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: var(--teal); border-radius: 2px; }

/* main */
.main { max-width: 1200px; margin: 0 auto; padding: 24px 20px 64px; }
.view { display: none; }
.view.active { display: block; }
.view-toolbar { display: flex; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 16px; }
.view-toolbar-heading h2 { font-size: 24px; margin-bottom: 4px; }
.view-subtitle { font-size: 13.5px; max-width: 640px; }

/* voice hero card */
.hero-voice {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, var(--card) 0%, var(--panel) 100%);
  border: 1px solid var(--border); border-radius: 16px; padding: 20px 24px;
  margin-bottom: 20px; position: relative;
}
.voice-emoji { font-size: 40px; flex-shrink: 0; }
.voice-body { flex: 1; }
.voice-quote { font-family: var(--font-display); font-size: 18px; font-weight: 500; color: var(--text); line-height: 1.5; font-style: italic; }
.voice-name { font-size: 12px; color: var(--teal); margin-top: 6px; letter-spacing: 0.05em; text-transform: uppercase; }
.voice-refresh { background: transparent; border: 1px solid var(--border); color: var(--muted); font-size: 16px; padding: 8px 12px; border-radius: 50%; }
.voice-refresh:hover { color: var(--teal); border-color: var(--teal); }

/* try this week */
.try-this-week {
  background: linear-gradient(135deg, rgba(78,205,196,0.12) 0%, rgba(255,184,92,0.08) 100%);
  border: 1px solid var(--teal);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.try-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.try-label { font-size: 11px; letter-spacing: 0.15em; color: var(--teal); font-weight: 600; }
.try-week { font-size: 11px; color: var(--muted); font-style: italic; }
.try-practice { font-family: var(--font-display); font-size: 17px; color: var(--text); line-height: 1.5; font-style: italic; margin-bottom: 8px; }
.try-from { font-size: 12px; color: var(--muted); text-transform: capitalize; }

/* independence bar */
.independence-bar {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 20px;
}
.independence-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.independence-label span:first-child { color: var(--muted); }
.independence-label span:last-child { color: var(--teal); font-weight: 600; font-family: var(--font-display); }
.independence-track { height: 6px; background: var(--panel); border-radius: 3px; overflow: hidden; }
.independence-fill { height: 100%; background: linear-gradient(90deg, var(--sunrise) 0%, var(--teal) 100%); transition: width 0.5s ease; }
.independence-hint { font-size: 12px; color: var(--ink-faint); margin-top: 8px; font-style: italic; }
.rhythm-note { font-size: 11px; color: var(--teal); margin-top: 8px; padding: 8px 12px; background: rgba(78,205,196,0.08); border-left: 2px solid var(--teal); border-radius: 4px; }

/* ritual sections */
.ritual-section { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 20px; }
.ritual-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.ritual-header h2 { font-size: 20px; }
.ritual-progress { font-family: var(--font-display); color: var(--teal); font-size: 15px; }
.ritual-list { display: flex; flex-direction: column; gap: 10px; }
.ritual-item {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  transition: 150ms ease;
}
.ritual-item.done { background: var(--green-tint); border-color: var(--green); }
.check-btn {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border-hi); background: transparent; color: var(--text);
  font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.ritual-item.done .check-btn { background: var(--green); color: var(--bg); border-color: var(--green); }
.check-btn:hover { border-color: var(--teal); }
.ritual-text { flex: 1; }
.ritual-title { font-size: 15px; color: var(--text); font-weight: 500; }
.ritual-item.done .ritual-title { text-decoration: line-through; opacity: 0.7; }
.ritual-note { font-size: 12px; color: var(--muted); margin-top: 4px; font-style: italic; }

/* history strip */
.history-strip { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-top: 20px; }
.history-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }
.history-grid { display: grid; grid-template-columns: repeat(30, 1fr); gap: 4px; }
.day-cell { aspect-ratio: 1; border-radius: 4px; font-size: 8px; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.day-none { background: var(--panel); }
.day-light { background: rgba(78,205,196,0.15); color: var(--teal); }
.day-half { background: rgba(78,205,196,0.4); color: var(--teal); }
.day-full { background: var(--teal); color: var(--bg); font-weight: 600; }

/* design */
.design-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.design-col { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.design-col h3 { margin-bottom: 14px; }
.edit-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.edit-item { display: flex; gap: 6px; align-items: center; }
.edit-item input { padding: 7px 10px; font-size: 13px; }
.edit-item .edit-note { font-size: 12px; color: var(--muted); flex: 0 0 40%; }

/* voices */
.voices-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.voice-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px;
  cursor: pointer; text-align: center; transition: 150ms ease;
}
.voice-card:hover { border-color: var(--teal); }
.voice-card.active { background: var(--teal-tint); border-color: var(--teal); }
.voice-card-emoji { font-size: 36px; margin-bottom: 8px; }
.voice-card-name { font-family: var(--font-display); font-size: 15px; margin-bottom: 4px; }
.voice-card-count { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.voice-card-toggle { font-size: 12px; color: var(--muted); padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; display: inline-block; }
.voice-card.active .voice-card-toggle { background: var(--teal); color: var(--bg); border-color: var(--teal); font-weight: 500; }

/* login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--bg) 0%, var(--panel) 100%); }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 32px; width: 340px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.login-card h1 { text-align: center; margin: 0 0 4px; font-size: 28px; }
.login-hint { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.login-card input { background: var(--panel); border: 1px solid var(--border); color: var(--text); padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.login-card button { background: var(--teal); color: var(--bg); border: none; padding: 10px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.err { color: var(--coral); font-size: 12px; text-align: center; margin: 0; min-height: 16px; }

/* favorites */
.favorites-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.fav-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.fav-card:hover { border-color: var(--teal); }
.fav-header { display: flex; gap: 14px; align-items: flex-start; }
.fav-emoji { font-size: 42px; flex-shrink: 0; }
.fav-name { font-family: var(--font-display); font-size: 20px; margin: 0 0 4px; }
.fav-bio { font-size: 13px; line-height: 1.5; }
.fav-section { border-top: 1px solid var(--border); padding-top: 12px; }
.fav-section-label { font-family: var(--font-display); font-size: 14px; color: var(--teal); margin-bottom: 8px; font-weight: 500; }
.fav-row { font-size: 13px; margin-bottom: 4px; line-height: 1.5; }
.fav-row strong { color: var(--text); font-weight: 500; }
.fav-borrow { background: var(--teal-tint); border: 1px solid var(--teal); border-radius: 10px; padding: 12px 14px; }
.fav-borrow-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--teal); font-weight: 600; margin-bottom: 6px; }
.fav-borrow-text { font-size: 13px; line-height: 1.5; }
.fav-quotes { display: flex; flex-direction: column; gap: 6px; }
.fav-quote { font-style: italic; font-size: 12.5px; color: var(--muted); padding-left: 12px; border-left: 2px solid var(--border-hi); line-height: 1.5; }
.fav-links { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.fav-link { font-size: 12px; color: var(--teal); padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; }
.fav-link:hover { background: var(--teal-tint); border-color: var(--teal); }
.fav-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.7; color: var(--text); }
.fav-list li { margin-bottom: 3px; }

/* protocol library */
.protocol-section { margin-bottom: 32px; }
.protocol-section-title { font-family: var(--font-display); font-size: 20px; margin-bottom: 14px; color: var(--text); }
.protocol-list { display: flex; flex-direction: column; gap: 14px; }
.protocol-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px;
  transition: 150ms ease;
}
.protocol-card:hover { border-color: var(--border-hi); }
.protocol-card.active { border-color: var(--teal); background: linear-gradient(180deg, var(--teal-tint) 0%, var(--card) 40%); box-shadow: 0 0 0 1px var(--teal); }
.protocol-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.protocol-title-row { display: flex; gap: 14px; align-items: flex-start; }
.protocol-emoji { font-size: 32px; }
.protocol-name { font-family: var(--font-display); font-size: 18px; margin: 0; }
.protocol-creator { font-size: 12px; color: var(--muted); margin-top: 4px; }
.protocol-pick-btn { flex-shrink: 0; }
.protocol-stack { background: var(--panel); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 4px; }
.protocol-stack-item { font-size: 13px; line-height: 1.5; }
.protocol-stack-item strong { color: var(--teal); }
.protocol-details { display: flex; flex-direction: column; gap: 6px; }
.protocol-row { font-size: 13px; line-height: 1.5; }
.protocol-row strong { color: var(--text); font-weight: 500; }
.protocol-row.protocol-warn { color: var(--sunset); background: rgba(240,117,95,0.08); padding: 8px 12px; border-radius: 6px; border-left: 3px solid var(--sunset); }
