/* ============================================================
   Out of Hiding — Inner Circle Portal
   Editorial · Warm · Feminine · Sanctuary
   ============================================================ */

:root {
  --cream: #FFF8F1;
  --cream-2: #FAF1E6;
  --cream-3: #F3E7D6;
  --white: #FFFFFF;
  --ink: #2A211B;
  --brown-dark: #5B4D43;
  --brown-mid: #A2672D;
  --brown-light: #6F5338;
  --gold: #E0BE9A;
  --gold-soft: #EBD3B5;
  --gold-deep: #C99A6B;
  --line: rgba(91, 77, 67, 0.18);
  --line-soft: rgba(91, 77, 67, 0.08);
  --shadow-sm: 0 1px 2px rgba(91, 77, 67, 0.06), 0 4px 14px rgba(91, 77, 67, 0.05);
  --shadow-md: 0 6px 24px rgba(91, 77, 67, 0.08), 0 2px 8px rgba(91, 77, 67, 0.04);
  --shadow-lg: 0 30px 80px rgba(91, 77, 67, 0.18), 0 10px 30px rgba(91, 77, 67, 0.08);

  --serif: "Cormorant Garamond", "Cormorant", "Times New Roman", serif;
  --display: "Italiana", "Cormorant Garamond", serif;
  --playfair: "Playfair Display", "Cormorant Garamond", serif;
  --sans: "Manrope", "Helvetica Neue", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--brown-dark);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* Typography ------------------------------------------------- */
.serif { font-family: var(--serif); }
.display { font-family: var(--display); letter-spacing: 0.02em; }
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brown-mid);
  font-weight: 500;
}
.italic-script { font-family: var(--serif); font-style: italic; font-weight: 400; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; color: var(--ink); letter-spacing: -0.01em; }
h1 { font-size: clamp(40px, 6vw, 72px); line-height: 1.02; }
h2 { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.08; }
h3 { font-size: clamp(20px, 2vw, 26px); line-height: 1.2; }
h4 { font-size: 18px; line-height: 1.3; }

/* Buttons ---------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  transition: all .25s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--cream);
  border: 1px solid var(--ink);
}
.btn-primary:hover { background: var(--brown-mid); border-color: var(--brown-mid); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--cream-2); border-color: var(--brown-light); }
.btn-gold {
  background: var(--gold);
  color: var(--ink);
  border: 1px solid var(--gold-deep);
}
.btn-gold:hover { background: var(--gold-deep); color: var(--cream); }
.btn-sm { padding: 9px 18px; font-size: 11px; }
.btn-lg { padding: 18px 34px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Cards ------------------------------------------------------ */
.card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}
.card-cream { background: var(--cream-2); border: 1px solid var(--line-soft); border-radius: 18px; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--cream);
}
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-shell .login-art { display: none; }
}
.login-art {
  position: relative;
  overflow: hidden;
  background: var(--cream-3);
}
.login-art img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.login-art::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,248,241,0) 40%, rgba(91,77,67,0.35) 100%);
}
.login-art-overlay {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px;
  z-index: 2;
  color: var(--cream);
}
.login-art-overlay .mark {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.18em;
  color: var(--cream);
  text-shadow: 0 1px 16px rgba(0,0,0,0.3);
}
.login-art-overlay .quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.45;
  max-width: 420px;
  text-shadow: 0 1px 18px rgba(0,0,0,0.4);
}
.login-art-overlay .quote-attr {
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: .85;
  font-style: normal;
}

.login-form-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 60px 40px;
  position: relative;
}
.login-form {
  width: 100%; max-width: 420px;
}
.login-mark {
  font-family: var(--playfair);
  font-size: 18px;
  font-style: italic;
  letter-spacing: 0.12em;
  color: var(--brown-mid);
  margin-bottom: 80px;
  display: flex; align-items: center; gap: 12px;
}
.login-mark::before {
  content: ""; display: inline-block; width: 36px; height: 1px; background: var(--brown-mid);
}
.login-form h1 {
  font-size: 56px; line-height: 1; margin-bottom: 16px;
}
.login-form h1 em { font-style: italic; color: var(--brown-mid); }
.login-form .lede {
  font-family: var(--serif);
  font-size: 19px; font-style: italic;
  line-height: 1.5; color: var(--brown-light);
  margin-bottom: 44px;
}

.field {
  display: block;
  margin-bottom: 22px;
}
.field label {
  display: block;
  font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--brown-mid); margin-bottom: 8px; font-weight: 500;
}
.field input {
  width: 100%;
  padding: 14px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color .2s;
  font-family: var(--serif);
}
.field input:focus { border-bottom-color: var(--brown-mid); }
.field input::placeholder { color: rgba(91,77,67,0.35); font-style: italic; }

.login-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 30px 0 36px;
  font-size: 12px;
}
.login-row label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.login-row a { color: var(--brown-mid); border-bottom: 1px solid transparent; }
.login-row a:hover { border-color: var(--brown-mid); }

.login-cta { width: 100%; }
.login-foot {
  margin-top: 36px;
  text-align: center;
  font-size: 12px;
  color: var(--brown-light);
}
.login-foot a { color: var(--brown-mid); font-weight: 500; }

.login-divider {
  display: flex; align-items: center; gap: 16px;
  margin: 32px 0;
  color: var(--brown-light);
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
}
.login-divider::before, .login-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.invite-hint {
  background: var(--cream-2);
  border: 1px solid var(--line-soft);
  padding: 16px 18px;
  border-radius: 12px;
  font-size: 12px; line-height: 1.5;
  color: var(--brown-light);
  font-style: italic;
  font-family: var(--serif);
  font-size: 14px;
}
.invite-hint b { font-style: normal; color: var(--ink); font-family: var(--sans); font-weight: 500; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; display: block; margin-bottom: 6px; }

/* ============================================================
   PORTAL SHELL
   ============================================================ */
.portal {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}
@media (max-width: 980px) {
  .portal { grid-template-columns: 1fr; }
}

.sidebar {
  background: var(--cream-2);
  border-right: 1px solid var(--line-soft);
  padding: 28px 22px;
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-mark {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--ink);
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line-soft);
}
.sidebar-mark .sub {
  display: block;
  font-family: var(--playfair); font-style: italic;
  font-size: 13px; letter-spacing: 0.04em;
  color: var(--brown-mid);
  font-weight: 400;
  margin-top: 4px;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section {
  font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--brown-light);
  padding: 14px 12px 6px;
  font-weight: 500;
}
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--brown-dark);
  transition: background .15s, color .15s;
  font-weight: 500;
}
.nav a:hover { background: rgba(224, 190, 154, 0.18); color: var(--ink); }
.nav a.active { background: var(--ink); color: var(--cream); }
.nav a.active .nav-icon { color: var(--gold); }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: .85; }

.sidebar-foot {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
.member-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid var(--line-soft);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold-soft);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  color: var(--ink);
  font-size: 15px;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-card .meta { font-size: 12px; line-height: 1.3; }
.member-card .meta b { font-weight: 600; color: var(--ink); display: block; }
.member-card .meta span { color: var(--brown-light); font-size: 11px; }

/* Mobile top bar ---- */
.topbar {
  display: none;
  position: sticky; top: 0; z-index: 20;
  background: var(--cream);
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 20px;
  align-items: center; justify-content: space-between;
}
.topbar .mark { font-family: var(--display); font-size: 16px; letter-spacing: 0.2em; }
.topbar button { padding: 8px; }
@media (max-width: 980px) {
  .sidebar { display: none; }
  .topbar { display: flex; }
  .sidebar.open {
    display: flex;
    position: fixed; inset: 0;
    z-index: 50; height: 100vh; width: 100%;
  }
}

/* Main panel ---- */
.main {
  padding: 40px 56px 80px;
  max-width: 1280px;
  width: 100%;
}
@media (max-width: 700px) { .main { padding: 24px 20px 80px; } }

.page-head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: 36px;
  gap: 24px;
  flex-wrap: wrap;
}
.page-head .title { max-width: 720px; }
.page-head h1 { font-size: clamp(36px, 4.5vw, 60px); }
.page-head .lede {
  margin-top: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--brown-light);
  max-width: 560px;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.dash-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
}
@media (max-width: 980px) { .dash-grid { grid-template-columns: 1fr; } }

.hero-card {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: var(--ink);
  color: var(--cream);
  min-height: 380px;
  display: flex; flex-direction: column; justify-content: end;
  padding: 36px;
  box-shadow: var(--shadow-md);
}
.hero-card .bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: brightness(0.78) saturate(0.95);
}
.hero-card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(42,33,27,0.35) 0%, rgba(42,33,27,0.55) 50%, rgba(28,22,18,0.92) 100%);
  z-index: 1;
}
.hero-card::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 0% 100%, rgba(28,22,18,0.7) 0%, rgba(42,33,27,0) 65%);
  z-index: 1;
}
.hero-card > * { position: relative; z-index: 2; }
.hero-card .week-tag {
  font-family: var(--sans);
  font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.hero-card h2 {
  color: var(--cream);
  font-size: clamp(32px, 4vw, 50px);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 24px rgba(0,0,0,0.45), 0 1px 2px rgba(0,0,0,0.35);
}
.hero-card .meta, .hero-card .week-tag {
  text-shadow: 0 1px 14px rgba(0,0,0,0.5);
}
.hero-card .row {
  display: flex; gap: 12px; align-items: center;
  margin-top: 22px;
  flex-wrap: wrap;
}
.hero-card .meta {
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  opacity: .85;
}
.hero-card .btn-gold { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.hero-card .btn-gold:hover { background: var(--cream); border-color: var(--cream); }

.side-stack { display: flex; flex-direction: column; gap: 20px; }

.zoom-card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  padding: 26px;
  position: relative;
  overflow: hidden;
}
.zoom-card .stamp {
  position: absolute; top: 0; right: 0;
  width: 110px; height: 110px;
  background: radial-gradient(circle at 30% 30%, var(--gold-soft), transparent 70%);
  pointer-events: none;
}
.zoom-card .date-block {
  display: flex; align-items: baseline; gap: 14px;
  margin: 14px 0 16px;
}
.zoom-card .date-block .day {
  font-family: var(--serif);
  font-size: 64px;
  font-style: italic;
  line-height: 0.9;
  color: var(--ink);
}
.zoom-card .date-block .meta {
  font-size: 13px;
  color: var(--brown-light);
  line-height: 1.3;
}
.zoom-card .date-block .meta b { color: var(--ink); display: block; font-weight: 600; }
.countdown {
  display: flex; gap: 6px;
  margin: 12px 0 18px;
}
.countdown .seg {
  flex: 1;
  background: var(--cream-2);
  border-radius: 10px;
  padding: 10px 4px;
  text-align: center;
}
.countdown .seg b {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.countdown .seg span {
  font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--brown-light);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 28px;
}
.quick-tile {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 22px;
  text-align: left;
  display: flex; flex-direction: column; align-items: start; gap: 10px;
  transition: all .2s;
  cursor: pointer;
  min-height: 150px;
}
.quick-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.quick-tile .label {
  font-family: var(--serif); font-style: italic;
  font-size: 22px; color: var(--ink); line-height: 1.1;
}
.quick-tile .desc { font-size: 12px; color: var(--brown-light); line-height: 1.4; }
.quick-tile .icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--cream-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--brown-mid);
}
.quick-tile.gold { background: var(--gold-soft); border-color: var(--gold); }
.quick-tile.gold .icon { background: var(--white); }
.quick-tile.dark { background: var(--ink); border-color: var(--ink); }
.quick-tile.dark .label, .quick-tile.dark .desc { color: var(--cream); }
.quick-tile.dark .desc { opacity: 0.75; }
.quick-tile.dark .icon { background: rgba(255,255,255,0.1); color: var(--gold); }

@media (max-width: 600px) { .quick-grid { grid-template-columns: 1fr; } }

/* Activity ribbon */
.ribbon {
  margin-top: 36px;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 24px 28px;
}
.ribbon h3 { margin-bottom: 14px; }
.ribbon-feed { display: flex; flex-direction: column; }
.ribbon-item {
  display: flex; gap: 14px; align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.ribbon-item:last-child { border-bottom: none; }
.ribbon-item .who { font-weight: 600; color: var(--ink); }
.ribbon-item .when { font-size: 11px; color: var(--brown-light); margin-left: auto; letter-spacing: 0.05em; }
.ribbon-item .text { color: var(--brown-dark); font-family: var(--serif); font-style: italic; font-size: 15px; }

/* ============================================================
   JOURNEY (8 weeks)
   ============================================================ */
.journey {
  display: flex; flex-direction: column; gap: 16px;
}
.week-row {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  padding: 26px 28px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 24px;
  align-items: center;
  transition: all .2s;
  cursor: pointer;
  position: relative;
}
.week-row:hover { box-shadow: var(--shadow-md); transform: translateX(4px); }
.week-row.locked { opacity: .55; cursor: not-allowed; }
.week-row.current { background: var(--cream-2); border-color: var(--gold); }
.week-row.complete { background: var(--cream); }

.week-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 56px;
  line-height: 0.9;
  color: var(--brown-mid);
}
.week-row.complete .week-num { color: var(--brown-light); }
.week-row .titles .eyebrow { margin-bottom: 4px; }
.week-row .titles h3 {
  font-family: var(--serif);
  font-style: italic;
  font-size: 26px;
  color: var(--ink);
}
.week-row .titles .desc {
  font-size: 13px; color: var(--brown-light); margin-top: 6px;
  max-width: 540px;
}
.week-row .status {
  display: flex; flex-direction: column; align-items: end; gap: 8px;
}
.dot-progress {
  display: flex; gap: 4px;
}
.dot-progress span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--line);
}
.dot-progress span.on { background: var(--brown-mid); }

@media (max-width: 700px) {
  .week-row { grid-template-columns: 60px 1fr; padding: 20px 18px; }
  .week-row .status { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .week-num { font-size: 42px; }
}

/* ============================================================
   WEEK DETAIL
   ============================================================ */
.week-hero {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: var(--cream-3);
  margin-bottom: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 320px;
}
@media (max-width: 800px) { .week-hero { grid-template-columns: 1fr; } }
.week-hero .image {
  position: relative;
  background-size: cover;
  background-position: center;
  min-height: 260px;
}
.week-hero .copy {
  padding: 40px 44px;
  display: flex; flex-direction: column; justify-content: center;
}
.week-hero .copy .eyebrow { margin-bottom: 14px; }
.week-hero .copy h1 {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(32px, 4vw, 52px);
  margin-bottom: 16px;
}
.week-hero .copy p {
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  line-height: 1.5;
  color: var(--brown-light);
  max-width: 480px;
}

.week-tabs {
  display: flex; gap: 6px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 32px;
  overflow-x: auto;
  scrollbar-width: none;
}
.week-tabs::-webkit-scrollbar { display: none; }
.week-tab {
  padding: 14px 20px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brown-light);
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border .15s;
}
.week-tab:hover { color: var(--ink); }
.week-tab.active { color: var(--ink); border-color: var(--brown-mid); }

.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.reading-card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 36px 40px;
}
.reading-card .chap-tag {
  font-family: var(--serif); font-style: italic;
  color: var(--brown-mid);
  margin-bottom: 8px;
  font-size: 16px;
}
.reading-card h2 {
  font-style: italic;
  margin-bottom: 24px;
}
.reading-card p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  color: var(--brown-dark);
  margin-bottom: 16px;
}
.reading-card p:first-letter {
  font-family: var(--serif);
  font-size: 56px;
  line-height: 0.9;
  float: left;
  padding: 6px 8px 0 0;
  color: var(--brown-mid);
}
.reading-card .pull-quote {
  border-left: 2px solid var(--gold);
  padding: 16px 0 16px 22px;
  margin: 28px 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--ink);
  line-height: 1.4;
}

.aside-card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 26px;
}
.aside-card + .aside-card { margin-top: 20px; }
.aside-card h4 { margin-bottom: 14px; }
.aside-stack { display: flex; flex-direction: column; gap: 20px; }

/* Journal */
.prompt-card {
  background: var(--cream-2);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 14px;
  border: 1px solid var(--line-soft);
}
.prompt-card .num {
  font-family: var(--serif); font-style: italic;
  color: var(--gold-deep);
  font-size: 14px;
  margin-bottom: 6px;
}
.prompt-card .q {
  font-family: var(--serif); font-style: italic;
  font-size: 19px; color: var(--ink); line-height: 1.4;
}
.journal-entry textarea {
  width: 100%;
  min-height: 140px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  outline: none;
  resize: vertical;
  margin-top: 12px;
}
.journal-entry textarea:focus { border-color: var(--brown-mid); }
.journal-entry .save-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
  font-size: 11px; color: var(--brown-light); letter-spacing: 0.1em;
}

/* Homework checklist */
.homework {
  display: flex; flex-direction: column; gap: 10px;
}
.hw-item {
  display: flex; align-items: start; gap: 14px;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: background .15s;
}
.hw-item:hover { background: var(--cream-2); }
.hw-item.done { background: var(--cream-2); }
.hw-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--brown-light);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
  background: var(--white);
  transition: all .2s;
}
.hw-item.done .hw-check {
  background: var(--brown-mid);
  border-color: var(--brown-mid);
  color: var(--cream);
}
.hw-item.done .hw-text { text-decoration: line-through; color: var(--brown-light); }
.hw-text { font-family: var(--serif); font-size: 17px; color: var(--ink); line-height: 1.4; }
.hw-text small { display: block; font-family: var(--sans); font-size: 11px; color: var(--brown-light); letter-spacing: 0.06em; margin-top: 4px; font-style: normal; }

/* Song player */
.song-card {
  background: linear-gradient(160deg, var(--ink) 0%, #3D3128 100%);
  color: var(--cream);
  border-radius: 18px;
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.song-card::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224,190,154,0.3) 0%, transparent 60%);
}
.song-card h4 { color: var(--cream); margin-bottom: 6px; }
.song-card .eyebrow { color: var(--gold); }
.song-card .artist { font-size: 13px; opacity: .7; font-family: var(--sans); margin-bottom: 18px; }
.song-card .player {
  display: flex; align-items: center; gap: 14px;
  position: relative;
}
.play-btn {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
}
.play-btn:hover { background: var(--cream); transform: scale(1.05); }
.song-progress {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  overflow: hidden;
}
.song-progress .bar { height: 100%; background: var(--gold); width: 0%; transition: width .2s linear; }
.song-card .lyric {
  margin-top: 18px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.5;
  opacity: .8;
}

/* ============================================================
   SISTER CIRCLE (chat)
   ============================================================ */
.chat-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  height: calc(100vh - 160px);
  min-height: 600px;
}
@media (max-width: 900px) { .chat-shell { grid-template-columns: 1fr; height: auto; min-height: 0; } .chat-side { display: none; } }

.chat-side {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 22px;
  overflow-y: auto;
}
.chat-side h4 { margin-bottom: 6px; }
.chat-side .eyebrow { margin-bottom: 16px; }
.member-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}
.member-row:hover { background: var(--cream-2); }
.member-row .name { font-weight: 600; color: var(--ink); }
.member-row .role { font-size: 11px; color: var(--brown-light); }
.online-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold-deep);
  margin-left: auto;
}
.online-dot.off { background: var(--line); }

.chat-main {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 600px;
}
.chat-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.chat-head .title { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--ink); }
.chat-head .sub { font-size: 11px; color: var(--brown-light); letter-spacing: 0.1em; text-transform: uppercase; }

.chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px;
  display: flex; flex-direction: column; gap: 18px;
  background: var(--cream);
}
.msg { display: flex; gap: 12px; max-width: 80%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.system { align-self: center; max-width: 100%; }
.msg .bubble {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}
.msg.me .bubble { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.msg.maya .bubble { background: var(--cream-2); border-color: var(--gold); }
.msg .who {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--brown-light); margin-bottom: 4px; font-weight: 600;
}
.msg.me .who { text-align: right; }
.msg.maya .who { color: var(--brown-mid); }
.msg .when { font-size: 10px; color: var(--brown-light); margin-top: 4px; opacity: .7; }
.msg.system .bubble {
  background: transparent; border: none;
  font-family: var(--serif); font-style: italic;
  color: var(--brown-light); font-size: 13px;
  text-align: center;
}
.msg .avatar { width: 32px; height: 32px; }

.chat-input {
  display: flex; gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--line-soft);
  background: var(--white);
  align-items: end;
}
.chat-input textarea {
  flex: 1;
  padding: 12px 16px;
  background: var(--cream-2);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  font-family: var(--sans);
  font-size: 14px;
  resize: none;
  max-height: 120px;
  min-height: 44px;
  outline: none;
  line-height: 1.4;
}
.chat-input textarea:focus { border-color: var(--brown-mid); background: var(--white); }
.send-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
}
.send-btn:hover { background: var(--brown-mid); }
.send-btn:disabled { opacity: .4; }

.pinned-banner {
  background: var(--cream-2);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 0 24px 0 24px;
  margin-top: 16px;
  display: flex; gap: 12px; align-items: start;
  font-size: 13px;
}
.pinned-banner .pin-label { font-size: 10px; letter-spacing: 0.2em; color: var(--brown-mid); text-transform: uppercase; font-weight: 600; }
.pinned-banner .pin-text { font-family: var(--serif); font-style: italic; color: var(--ink); margin-top: 2px; }

/* ============================================================
   BREATHWORK
   ============================================================ */
.breath-shell {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 900px) { .breath-shell { grid-template-columns: 1fr; } }

.breath-stage {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  padding: 60px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 560px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.breath-stage::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 40%, var(--cream-2) 0%, transparent 60%);
  pointer-events: none;
}
.breath-stage > * { position: relative; z-index: 2; }

.breath-orb {
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold-soft) 0%, var(--gold) 60%, var(--gold-deep) 100%);
  box-shadow: 0 30px 80px rgba(162, 103, 45, 0.25), inset -20px -20px 40px rgba(162,103,45,0.2);
  margin: 30px auto 40px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-size: 32px;
  position: relative;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}
.breath-orb .count {
  font-family: var(--serif);
  font-size: 64px;
  font-style: italic;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.breath-orb .phase {
  position: absolute;
  bottom: -50px;
  font-size: 14px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brown-mid);
  font-style: normal;
  font-family: var(--sans);
  font-weight: 500;
  white-space: nowrap;
}

.breath-stage h2 { font-style: italic; margin-bottom: 8px; }
.breath-stage .lede { font-family: var(--serif); font-style: italic; color: var(--brown-light); font-size: 18px; max-width: 460px; margin: 0 auto 0; }

.breath-controls {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  margin-top: 60px;
}
.breath-techniques {
  display: flex; flex-direction: column; gap: 10px;
}
.tech-row {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  transition: all .15s;
}
.tech-row:hover { border-color: var(--brown-light); }
.tech-row.active { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.tech-row .name { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--ink); margin-bottom: 4px; }
.tech-row.active .name { color: var(--cream); }
.tech-row .desc { font-size: 12px; color: var(--brown-light); }
.tech-row.active .desc { color: rgba(255,248,241,0.7); }

/* ============================================================
   LIBRARY / RESOURCES / PROFILE
   ============================================================ */
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.lib-card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  overflow: hidden;
  transition: all .2s;
  cursor: pointer;
}
.lib-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.lib-card .thumb {
  height: 160px;
  background: var(--cream-3);
  background-size: cover; background-position: center;
  position: relative;
}
.lib-card .thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(42,33,27,0.2) 100%);
}
.lib-card .body { padding: 18px 20px; }
.lib-card .body .eyebrow { margin-bottom: 6px; }
.lib-card .body .title { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--ink); line-height: 1.2; }
.lib-card .body .meta { font-size: 12px; color: var(--brown-light); margin-top: 8px; }

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 800px) { .profile-grid { grid-template-columns: 1fr; } }

.stat-box {
  background: var(--white); border: 1px solid var(--line-soft);
  border-radius: 16px; padding: 22px;
  text-align: center;
}
.stat-box .num {
  font-family: var(--serif); font-style: italic;
  font-size: 48px; color: var(--ink); line-height: 1;
}
.stat-box .label {
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--brown-light); margin-top: 8px;
}

/* Stage entry animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .5s ease both; }

/* Toast ----- */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--cream);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.06em;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(42,33,27,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--cream);
  border-radius: 22px;
  max-width: 540px; width: 100%;
  padding: 40px;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.modal h2 { font-style: italic; margin-bottom: 12px; }
.modal .close {
  position: absolute; top: 18px; right: 18px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--cream-2);
  display: flex; align-items: center; justify-content: center;
}
.modal .close:hover { background: var(--gold-soft); }

/* Decorative gold rule */
.gold-rule {
  display: block; height: 1px; background: var(--gold);
  width: 60px; margin: 14px 0;
  position: relative;
}
.gold-rule::after {
  content: "❋";
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: var(--gold-deep);
  background: var(--cream); padding: 0 8px;
}

/* ---- Thread sidebar buttons ---- */
.thread-btn {
  display: block; width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  margin-bottom: 4px;
  transition: background 0.18s;
}
.thread-btn:hover { background: var(--cream-2); }
.thread-btn.active { background: var(--gold-soft); }
.thread-btn .thread-label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
}
.thread-btn .thread-desc {
  font-size: 11px;
  color: var(--brown-light);
  margin-top: 2px;
  letter-spacing: 0.04em;
}
.thread-btn.active .thread-label { color: var(--brown-mid); }

/* ---- Smooth message entrance ---- */
.msg {
  animation: msgIn 0.25s ease both;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Auth feedback ---- */
.auth-err {
  background: #fff0ee;
  border: 1px solid #f5c4be;
  color: #8b3a30;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.auth-info {
  background: #f0f7ee;
  border: 1px solid #b8ddb4;
  color: #2e6b28;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ---- Admin Panel ---- */
.admin-field { margin-bottom: 20px; }
.nav-section { 
  font-size: 10px; letter-spacing: 0.15em; 
  text-transform: uppercase; color: var(--gold-deep);
  padding: 14px 16px 4px; font-weight: 600;
}

/* ---- WELCOME SCREEN ---- */
.welcome-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  background: var(--cream);
}
.welcome-photo-col {
  position: relative;
  overflow: hidden;
}
.welcome-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.welcome-photo-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 40px 32px;
  background: linear-gradient(to top, rgba(91,77,67,0.85) 0%, transparent 100%);
  color: var(--cream);
}
.welcome-mark {
  font-size: 11px;
  letter-spacing: 0.2em;
  opacity: 0.8;
  margin-bottom: 6px;
}
.welcome-edition {
  font-family: var(--playfair);
  font-style: italic;
  font-size: 22px;
  font-weight: 500;
}
.welcome-letter-col {
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 48px;
  background: var(--cream);
}
.welcome-letter {
  max-width: 520px;
  width: 100%;
}
.letter-body p {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.85;
  color: var(--brown-dark);
  margin-bottom: 18px;
}
.letter-sign {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px !important;
  color: var(--brown-mid) !important;
  margin-top: 28px !important;
}
.letter-sign span {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}
.welcome-cta {
  width: 100%;
  margin-top: 36px;
  font-size: 16px;
  padding: 18px;
  letter-spacing: 0.05em;
}

/* Mobile welcome */
@media (max-width: 768px) {
  .welcome-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 45vh auto;
  }
  .welcome-photo-col {
    height: 45vh;
  }
  .welcome-letter-col {
    padding: 40px 24px;
  }
  .welcome-letter {
    max-width: 100%;
  }
  .letter-body p {
    font-size: 16px;
  }
}

/* ---- MOBILE MARGIN FIXES ---- */
@media (max-width: 768px) {
  .main {
    padding: 20px 16px;
    overflow-x: hidden;
  }
  .card {
    padding: 20px 16px !important;
  }
  .page-head {
    padding: 0 0 24px;
  }
  .week-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    flex-wrap: nowrap;
  }
  .week-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .chat-shell {
    flex-direction: column;
    height: auto;
  }
  .chat-side {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
    padding: 16px;
    max-height: 200px;
    overflow-y: auto;
  }
  .chat-main {
    height: 60vh;
  }
  .lib-grid {
    grid-template-columns: 1fr;
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .stat-box {
    padding: 16px;
  }
  h1 {
    font-size: clamp(28px, 8vw, 48px) !important;
  }
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }
  .login-shell {
    grid-template-columns: 1fr !important;
  }
  .login-art {
    display: none;
  }
  .login-form-wrap {
    padding: 40px 24px;
    min-height: 100vh;
  }
}

/* ---- INTENTION SCREEN ---- */
.intention-shell {
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.intention-card {
  max-width: 580px;
  width: 100%;
  background: var(--white);
  border-radius: 24px;
  padding: 52px 48px;
  box-shadow: var(--shadow-lg);
  text-align: left;
}
.intention-mark {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--brown-mid);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.intention-input {
  width: 100%;
  border: 1.5px solid var(--gold);
  border-radius: 12px;
  padding: 18px 20px;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--cream);
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.intention-input:focus {
  border-color: var(--brown-mid);
}
.intention-input::placeholder {
  color: var(--brown-light);
  font-style: italic;
}

@media (max-width: 600px) {
  .intention-card {
    padding: 36px 24px;
  }
}

/* ---- PORTAL TOUR ---- */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px;
}
.tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(91,77,67,0.5);
  backdrop-filter: blur(2px);
}
.tour-card {
  position: relative;
  background: var(--white);
  border-radius: 24px;
  padding: 40px 36px 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(91,77,67,0.25);
  z-index: 1;
  margin-bottom: 20px;
}
.tour-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}
.tour-dot {
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: var(--line-soft);
  transition: background 0.3s;
}
.tour-dot.active { background: var(--brown-mid); }
.tour-dot.done { background: var(--gold); }
.tour-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown-mid);
  margin-bottom: 16px;
}
.tour-step-label {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--brown-light);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.tour-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  color: var(--ink);
  margin-bottom: 12px;
  font-weight: 400;
}
.tour-body {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.75;
  color: var(--brown-dark);
  margin-bottom: 28px;
}
.tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 600px) {
  .tour-card {
    padding: 32px 24px 28px;
    margin-bottom: 0;
    border-radius: 24px 24px 16px 16px;
  }
}

/* ---- TOUR NAV HIGHLIGHT ---- */
.nav-item.tour-highlight {
  background: var(--gold-soft) !important;
  border: 2px solid var(--brown-mid) !important;
  border-radius: 10px;
  box-shadow: 0 0 0 4px rgba(162, 103, 45, 0.2);
  animation: tourPulse 1.5s ease infinite;
  position: relative;
}
.nav-item.tour-highlight::after {
  content: '←';
  position: absolute;
  right: 12px;
  color: var(--brown-mid);
  font-size: 16px;
  animation: tourArrow 1s ease infinite alternate;
}
@keyframes tourPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(162,103,45,0.2); }
  50% { box-shadow: 0 0 0 8px rgba(162,103,45,0.1); }
}
@keyframes tourArrow {
  from { transform: translateX(0); }
  to { transform: translateX(-4px); }
}

/* ---- AVATAR UPLOAD ---- */
.avatar-upload-hint {
  font-size: 11px;
  color: var(--brown-light);
  font-style: italic;
  font-family: var(--serif);
  margin-top: 8px;
  text-align: center;
}
