/* Sunlit glass: soft yellow light behind translucent panels, with one saffron-to-marigold edge as the single motif. */
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

:root {
  --bg: #fffaf0;
  --ink: #2a1b0c;
  --muted: #76654c;
  --saffron: #e4600d;
  --deep: #b0460a;
  --marigold: #ffb020;
  --glass: rgba(255, 255, 255, .6);
  --glass-strong: rgba(255, 255, 255, .78);
  --hairline: rgba(168, 112, 28, .18);
  --tint: rgba(255, 176, 32, .13);
  --danger: #b3261e;
  --alert: rgba(255, 232, 214, .78);
  --edge: linear-gradient(135deg, rgba(228, 96, 13, .42), rgba(255, 176, 32, .2) 55%, rgba(168, 112, 28, .12));
  --fill: linear-gradient(135deg, #c94a06, #e8650f);
  --ring: conic-gradient(from var(--spin), #e4600d, #ffb020, #ffe39a, #e4600d);
  --blur: blur(18px) saturate(150%);
  --font-mark: 'Yatra One', Laila, serif;
  --font-head: Laila, Mukta, serif;
  --font-quote: 'Tiro Devanagari Hindi', Georgia, serif;
  --shadow: 0 1px 2px rgba(120, 78, 16, .05), 0 12px 32px -18px rgba(120, 78, 16, .28);
  --surface: #fff;
  --panel: rgba(255, 250, 240, .88);
  --panel-strong: rgba(255, 252, 245, .94);
  --panel-soft: rgba(255, 250, 240, .62);
  --bubble: linear-gradient(135deg, #ffefc4, #ffe2b0);
  --backdrop: rgba(60, 38, 8, .28);
  --glow-1: rgba(255, 196, 92, .5);
  --glow-2: rgba(255, 150, 92, .28);
  --glow-3: rgba(255, 226, 138, .42);
  color-scheme: light;
}
/* Dark: warm night, the same saffron light turned down. Auto follows the device unless a choice is saved. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16100a; --ink: #f6ead7; --muted: #b9a689; --saffron: #f2782c; --deep: #ffab6e; --marigold: #ffbd4a;
    --glass: rgba(255, 236, 205, .055); --glass-strong: rgba(255, 236, 205, .095); --hairline: rgba(255, 200, 130, .15); --tint: rgba(255, 176, 32, .1);
    --danger: #ff8f86; --alert: rgba(140, 62, 14, .34); --surface: #22190f; --panel: rgba(30, 22, 13, .92); --panel-strong: rgba(34, 25, 15, .97); --panel-soft: rgba(22, 16, 10, .72);
    --bubble: linear-gradient(135deg, #4d2e12, #3b230e); --backdrop: rgba(0, 0, 0, .55); --glow-1: rgba(255, 140, 40, .14); --glow-2: rgba(255, 100, 50, .08); --glow-3: rgba(255, 190, 90, .07);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -18px rgba(0, 0, 0, .7); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16100a; --ink: #f6ead7; --muted: #b9a689; --saffron: #f2782c; --deep: #ffab6e; --marigold: #ffbd4a;
  --glass: rgba(255, 236, 205, .055); --glass-strong: rgba(255, 236, 205, .095); --hairline: rgba(255, 200, 130, .15); --tint: rgba(255, 176, 32, .1);
  --danger: #ff8f86; --alert: rgba(140, 62, 14, .34); --surface: #22190f; --panel: rgba(30, 22, 13, .92); --panel-strong: rgba(34, 25, 15, .97); --panel-soft: rgba(22, 16, 10, .72);
  --bubble: linear-gradient(135deg, #4d2e12, #3b230e); --backdrop: rgba(0, 0, 0, .55); --glow-1: rgba(255, 140, 40, .14); --glow-2: rgba(255, 100, 50, .08); --glow-3: rgba(255, 190, 90, .07);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -18px rgba(0, 0, 0, .7); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  color: var(--ink);
  font: 400 17px/1.58 Mukta, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(60vw 50vh at 88% -8%, var(--glow-1), transparent 70%),
    radial-gradient(52vw 46vh at -6% 104%, var(--glow-2), transparent 70%),
    radial-gradient(44vw 40vh at 62% 108%, var(--glow-3), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, [role="button"]:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }
[hidden] { display: none !important; }

/* The gradient edge, drawn as a hollow ring so it sits on any glass surface. */
.composer::before, .wisdom::before, .watch-row::before {
  content: ''; position: absolute; inset: 0; padding: 1.5px; border-radius: inherit; pointer-events: none;
  background: var(--ring);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: .4; transition: opacity .25s;
}

.brand { font-family: var(--font-mark); font-weight: 400; font-size: 26px; letter-spacing: .005em; background: var(--fill); -webkit-background-clip: text; background-clip: text; color: transparent; text-decoration: none; padding: 0 6px; width: fit-content; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 8px; }
.auth-brand img { width: 96px; height: 96px; object-fit: contain; }
.brand.big { font-size: 38px; padding: 0; }
.side-brand { display: flex; align-items: center; gap: 6px; padding-left: 4px; }
.side-brand img { width: 36px; height: 36px; object-fit: contain; flex: none; }
.side-brand .brand { padding: 0; font-size: 24px; white-space: nowrap; }

.auth { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.auth-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 12px; padding: 28px; border-radius: 22px; background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--hairline); box-shadow: var(--shadow); }
.auth-box input, .modal input, .modal textarea, .modal select { width: 100%; padding: 11px 14px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--glass-strong); }
.primary { background: var(--fill); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 18px -10px rgba(201, 74, 6, .75); transition: transform .15s, box-shadow .15s; }
.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(201, 74, 6, .9); }
.primary.small { padding: 5px 14px; font-size: 15px; border-radius: 8px; }
.ghost { padding: 11px 18px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--glass-strong); }
.wide { width: 100%; margin-top: 12px; }
.link { color: var(--deep); padding: 4px; text-decoration: underline; text-underline-offset: 2px; }
.link.danger { color: var(--danger); }
.error { color: var(--danger); margin: 0; min-height: 1.2em; font-size: 15px; }
.wide-row { grid-column: 1 / -1; }

.shell { display: grid; grid-template-columns: 272px 1fr; height: 100dvh; }
.sidebar { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-right: 1px solid var(--hairline); padding: 16px 12px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.new-chat { background: var(--fill); color: #fff; font-weight: 600; padding: 10px; border-radius: 12px; margin-top: 6px; box-shadow: 0 8px 18px -10px rgba(201, 74, 6, .75); transition: transform .15s; }
.new-chat:hover { transform: translateY(-1px); }
.nav-item { text-align: left; padding: 8px 10px; border-radius: 10px; font-weight: 500; transition: background .15s; }
.nav-item:hover, .chat-item:hover { background: var(--tint); }
.nav-item.on, .chat-item.on { background: var(--glass-strong); box-shadow: inset 0 0 0 1px var(--hairline); font-weight: 600; }
.side-label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 12px 10px 2px; }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; min-height: 60px; scrollbar-width: thin; }
.chat-item { display: flex; align-items: center; border-radius: 10px; transition: background .15s; }
.chat-item button:first-child { flex: 1; min-width: 0; text-align: left; padding: 7px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.chat-del { padding: 2px 10px; color: var(--muted); visibility: hidden; }
.chat-item:hover .chat-del, .chat-item:focus-within .chat-del { visibility: visible; }
.profile { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; text-align: left; transition: background .15s; }
.profile:hover { background: var(--tint); }
.initial { width: 32px; height: 32px; border-radius: 50%; background: var(--fill); color: #fff; display: grid; place-items: center; font-weight: 600; text-transform: uppercase; flex: none; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: none; align-items: center; gap: 8px; padding: 8px 12px; background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-bottom: 1px solid var(--hairline); }
.icon-btn { padding: 2px 8px; display: grid; place-items: center; }
.chat-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.scroll { flex: 1; overflow-y: auto; }
.thread { max-width: 760px; margin: 0 auto; padding: 28px 16px; display: flex; flex-direction: column; gap: 18px; }

/* Avatars carry the same edge as everything else. */
.guru-hero img, .card-guru img:not(.card-logo), .halo img {
  border-radius: 50%; object-fit: cover; flex: none; border: 2px solid transparent;
  background: var(--fill) border-box;
}

.welcome h1 { font-family: var(--font-head); font-weight: 600; font-size: 33px; line-height: 1.18; letter-spacing: -.01em; margin: 18px 0 18px; text-wrap: balance; }
.guru-hero { display: flex; align-items: center; gap: 14px; }
.guru-faces { display: flex; flex: none; }
.guru-hero img { width: 64px; height: 64px; }
.guru-face { position: relative; }
.guru-face + .guru-face { margin-left: -14px; }
.guru-face:hover, .guru-face:focus-within, .guru-face.on { z-index: 3; }
.guru-face-pick { display: block; border-radius: 50%; transition: transform .15s; }
.guru-face:hover .guru-face-pick { transform: translateY(-2px); }
.guru-hero .guru-face img { display: block; background: var(--surface); border: 3px solid var(--surface); transition: border-color .15s, box-shadow .15s; }
.guru-hero .guru-face.on img { border-color: var(--saffron); box-shadow: 0 0 0 2px var(--saffron); }
.guru-pop { display: none; position: absolute; top: 100%; left: 0; margin-top: 8px; z-index: 5; width: max-content; max-width: 280px; flex-direction: column; align-items: flex-start; gap: 9px; padding: 13px 15px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--shadow); }
.guru-pop::before { content: ''; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.guru-face:hover .guru-pop, .guru-face:focus-within .guru-pop { display: flex; }
.guru-pop button { white-space: normal; text-align: left; }
.guru-hero strong { font-family: var(--font-head); font-weight: 600; font-size: 19px; display: block; line-height: 1.25; }
.guru-hero span { color: var(--muted); font-size: 15px; }
.starters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.starter { text-align: left; background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--hairline); border-radius: 14px; padding: 13px 15px; transition: transform .15s, background .15s, border-color .15s; }
.starter:hover { background: var(--glass-strong); border-color: rgba(228, 96, 13, .4); transform: translateY(-1px); }

.wisdom { position: relative; background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-radius: 20px; padding: 18px 20px; margin-bottom: 24px; box-shadow: var(--shadow); }
.wisdom-label, .card-role { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--deep); }
.wisdom-quote { font-family: var(--font-quote); font-size: 23px; line-height: 1.36; font-weight: 400; font-style: italic; margin: 6px 0 4px; }
.wisdom-hi { color: var(--muted); font-size: 16px; }
.wisdom-actions { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; align-items: center; }

.msg-user { align-self: flex-end; background: var(--bubble); padding: 9px 16px; border-radius: 18px 18px 5px 18px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 6px 16px -12px rgba(120, 78, 16, .5); }
.answer { display: flex; flex-direction: column; gap: 14px; }
.overview { font-size: 19px; line-height: 1.52; margin: 2px 0 4px; max-width: 68ch; }
.closest-note { font-size: 15px; color: var(--muted); }
.ai-note, .ref { font-size: 13px; color: var(--muted); }

/* Projects, archive and chat options */
.side-head { display: flex; align-items: center; justify-content: space-between; padding-right: 4px; }
.side-add { width: 24px; height: 24px; margin-top: 10px; border-radius: 8px; color: var(--deep); font-size: 19px; line-height: 1; font-weight: 600; }
.side-add:hover { background: var(--tint); }
.project-list { display: flex; flex-direction: column; gap: 2px; max-height: 26%; overflow-y: auto; flex: none; scrollbar-width: thin; }
.project-item { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 10px; text-align: left; font-size: 16px; min-width: 0; }
.project-item:hover { background: var(--tint); }
.project-item.on { background: var(--glass-strong); box-shadow: inset 0 0 0 1px var(--hairline); font-weight: 600; }
.project-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.color-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.color-dot.big { width: 14px; height: 14px; margin-right: 10px; vertical-align: 2px; }
.c-saffron { background: #e4600d; } .c-marigold { background: #f5a800; } .c-rose { background: #d6456b; } .c-lotus { background: #9a5cc6; } .c-tulsi { background: #3f9a5d; } .c-sky { background: #2f8fd0; }
.color-label { font-weight: 500; margin-bottom: 6px; }
.color-row { display: flex; gap: 10px; margin-bottom: 14px; }
.color-pick { width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 2px transparent; transition: box-shadow .15s; }
.color-pick.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.project-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.project-head h1, .archive-title { font-family: var(--font-head); font-weight: 600; font-size: 30px; line-height: 1.2; margin: 6px 0 0; }
.project-note { margin: 0; color: var(--muted); max-width: 66ch; }
.project-chats { display: flex; flex-direction: column; gap: 4px; }
.project-chats .chat-item { background: var(--glass); border: 1px solid var(--hairline); border-radius: 12px; padding: 3px 2px; }
.project-chats .chat-del { visibility: visible; }
.archive-row { display: flex; align-items: center; gap: 14px; padding: 8px 14px; background: var(--glass); border: 1px solid var(--hairline); border-radius: 12px; }
.archive-open { flex: 1; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more.danger { color: var(--danger); }
.more.quiet { display: block; margin-top: 12px; color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-item.quiet { font-weight: 500; color: var(--muted); font-size: 15.5px; }
.chat-menu { position: fixed; z-index: 40; width: 220px; max-height: 70dvh; overflow-y: auto; padding: 6px; border-radius: 14px; background: var(--panel-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--hairline); box-shadow: 0 20px 44px -22px rgba(70, 40, 0, .6); display: flex; flex-direction: column; }
.chat-menu button { text-align: left; padding: 6px 10px; border-radius: 8px; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.chat-menu button:hover { background: var(--tint); }
.chat-menu .danger { color: var(--danger); }
.menu-label { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 2px; }
.menu-line { height: 1px; background: var(--hairline); margin: 5px 4px; flex: none; }

/* Choosing a saint */
.saint-bar { display: flex; overflow-x: auto; max-width: 728px; width: calc(100% - 32px); margin: 4px auto -2px; scrollbar-width: none; flex: none; }
.saint-bar::-webkit-scrollbar { display: none; }
.saint-chip { flex: none; display: flex; align-items: center; gap: 6px; padding: 3px 1px 5px; margin-right: 14px; font-size: 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; }
.saint-chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.saint-chip:hover { color: var(--ink); }
.saint-chip.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--saffron); }

/* One group per saint in an answer */
.saint-section { display: flex; flex-direction: column; gap: 12px; }
.saint-section + .saint-section { margin-top: 14px; padding-top: 18px; border-top: 1px solid var(--hairline); }
.saint-heading { display: flex; align-items: center; gap: 12px; }
.saint-heading img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid transparent; background: var(--fill) border-box; flex: none; }
.saint-heading h3 { font-family: var(--font-head); font-weight: 600; font-size: 21px; margin: 0; }
.waiting-quote cite { display: block; margin-top: 2px; font-family: Mukta, sans-serif; font-style: normal; font-size: 12.5px; color: var(--muted); }

/* Gurus */
.guru-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.guru-tile { display: flex; align-items: center; gap: 14px; padding: 14px; text-align: left; border-radius: 18px; background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--hairline); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; min-width: 0; }
.guru-tile:hover { transform: translateY(-2px); border-color: rgba(228, 96, 13, .45); }
.guru-tile img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid transparent; background: var(--fill) border-box; flex: none; }
.guru-tile-text { display: flex; flex-direction: column; min-width: 0; }
.guru-tile strong { font-family: var(--font-head); font-weight: 600; font-size: 18px; line-height: 1.25; }
.guru-tile-text span { font-size: 14px; color: var(--muted); }
.guru-profile { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.guru-profile > img { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; border: 3px solid transparent; background: var(--fill) border-box; flex: none; }
.guru-info { flex: 1; min-width: 220px; }
.guru-info h1 { font-family: var(--font-head); font-weight: 600; font-size: 28px; line-height: 1.2; margin: 0; }
.guru-info p { margin: 2px 0 0; color: var(--muted); }
.guru-tabs { padding: 0; margin: 0; max-width: none; border-bottom: 1px solid var(--hairline); }
.guru-body { display: flex; flex-direction: column; gap: 14px; }
.video-list { display: flex; flex-direction: column; gap: 8px; }
.video-row { display: flex; align-items: center; gap: 12px; padding: 7px; border-radius: 14px; background: var(--glass); border: 1px solid var(--hairline); color: inherit; text-decoration: none; transition: background .15s; min-width: 0; }
.video-row:hover { background: var(--glass-strong); }
.video-row .watch-thumb { width: 120px; }
.video-row .watch-text strong { font-weight: 500; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#thread > .more { align-self: flex-start; }

.guru-section-title { font-family: var(--font-head); font-weight: 600; font-size: 20px; margin: 10px 0 0; }
.latest-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.latest-tile { flex: none; width: 210px; display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; font-size: 14.5px; line-height: 1.3; }
.latest-tile img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; display: block; transition: transform .2s; }
.latest-tile:hover img { transform: scale(1.02); }
.latest-tile span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.question-group { display: flex; flex-direction: column; gap: 6px; }
.question-group h3 { font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--deep); margin: 8px 0 2px; }
.question-row { text-align: left; padding: 9px 14px; border-radius: 12px; background: var(--glass); border: 1px solid var(--hairline); font-weight: 500; transition: background .15s, border-color .15s; }
.question-row:hover, .question-row[aria-expanded="true"] { background: var(--glass-strong); border-color: rgba(228, 96, 13, .4); }
.topic-row { display: flex; border-bottom: 1px solid var(--hairline); overflow-x: auto; scrollbar-width: none; flex: none; }
.topic-row::-webkit-scrollbar { display: none; }
.guru-cards { display: flex; flex-direction: column; gap: 12px; }
.card-question { font-weight: 500; color: var(--muted); margin: 0 0 2px; }

/* Icons in the menu */
.nav-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item, .new-chat { display: flex; align-items: center; gap: 10px; }
.new-chat { justify-content: center; }
.side-label.with-icon { display: flex; align-items: center; gap: 8px; }
.side-label.with-icon .nav-icon { width: 14px; height: 14px; }

/* Life Lessons and Favourites */
.lesson-filter { width: 100%; padding: 11px 15px; border-radius: 14px; border: 1px solid var(--hairline); background: var(--glass-strong); box-shadow: var(--shadow); }
.lesson-filter:focus { outline: 2px solid var(--saffron); outline-offset: 1px; }
.lesson-topics { display: flex; flex-wrap: wrap; gap: 2px 20px; }
.lesson-topic { padding: 3px 0; font-weight: 500; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.lesson-topic:hover { color: var(--deep); border-bottom-color: var(--saffron); }
.more-from { align-self: flex-start; }
.more-from:disabled { color: var(--muted); cursor: default; }
.lesson-gurus, .lesson-themes { display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--hairline); flex: none; }
.lesson-gurus::-webkit-scrollbar, .lesson-themes::-webkit-scrollbar, .lesson-row::-webkit-scrollbar { display: none; }
.lesson-themes .lib-tab { flex: none; }
.lesson-shelf { display: flex; flex-direction: column; gap: 26px; }
.lesson-group { min-width: 0; }
.lesson-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.lesson-group h2 { font-family: var(--font-head); font-weight: 600; font-size: 20px; margin: 0; }
.lesson-arrows { display: flex; gap: 4px; flex: none; }
.lesson-arrows[hidden] { display: none; }
.lesson-arrow { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--deep); }
.lesson-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lesson-arrow:hover:not(:disabled) { background: var(--glass-strong); }
.lesson-arrow:disabled { opacity: .3; cursor: default; }
.lesson-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 2px 2px 8px; margin: 0 -2px; }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.lesson-card { flex: none; width: 200px; min-height: 128px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 15px; text-align: left; background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: 0 2px 10px rgba(168, 112, 28, .07); scroll-snap-align: start; transition: transform .15s, border-color .15s, box-shadow .15s; }
.lesson-grid .lesson-card { width: auto; }
.lesson-card:hover { transform: translateY(-1px); border-color: rgba(228, 96, 13, .4); box-shadow: 0 6px 18px rgba(168, 112, 28, .12); }
.lesson-card-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--deep); }
.lesson-card strong { font-family: var(--font-head); font-weight: 600; font-size: 17px; line-height: 1.28; text-wrap: balance; }
.lesson-faces { display: flex; margin-top: auto; padding-top: 6px; }
.lesson-faces img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--surface); margin-left: -6px; }
.lesson-faces img:first-child { margin-left: 0; }
#thread > .wisdom { margin-bottom: 0; }
.wisdom-by { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.wisdom-by img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.save-btn { display: inline-flex; align-items: center; gap: 5px; color: var(--deep); font-weight: 600; font-size: 15.5px; padding: 3px 0; }
.save-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.save-btn.on svg { fill: currentColor; }
.save-btn:hover { opacity: .72; }

/* Waiting */
.activity.live { display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.activity-now { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 400; color: var(--muted); }
.wait-faces { display: flex; flex: none; animation: breathe-soft 2.8s ease-in-out infinite; }
.wait-faces img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--bg); box-shadow: 0 0 0 1px rgba(228, 96, 13, .55); }
.wait-faces img + img { margin-left: -9px; }
.shimmer { color: var(--muted); }
.waiting-quote { margin: 0; padding: 0; border: 0; font-family: var(--font-quote); font-size: 16.5px; font-weight: 400; font-style: italic; line-height: 1.45; color: var(--muted); max-width: 56ch; animation: rise .7s ease-out; }
@keyframes turn { to { --spin: 360deg; } }
@keyframes breathe-soft { 50% { opacity: .65; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* Cards */
.card { border: 1px solid transparent; border-radius: 20px; overflow: hidden; background: linear-gradient(var(--glass-strong), var(--glass-strong)) padding-box, var(--edge) border-box; backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card-body { padding: 15px 18px 16px; }
.card h2 { font-family: var(--font-head); font-weight: 600; font-size: 20.5px; line-height: 1.28; letter-spacing: -.005em; margin: 2px 0 6px; text-wrap: balance; }
.card p { margin: 0 0 9px; }
.card-role { margin-bottom: 1px; }
.card-role:empty, .takeaway:empty { display: none; }
.takeaway { font-weight: 700; color: var(--deep); margin: 0 0 11px; }
.card-guru { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 15px; font-weight: 600; }
.card-guru strong { font-weight: 600; }
.card-guru img:not(.card-logo) { width: 38px; height: 38px; }
.card-guru img.card-logo { margin-left: auto; width: 30px; height: 30px; object-fit: contain; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 4px; }
.more { color: var(--deep); font-weight: 600; padding: 3px 0; font-size: 15.5px; text-decoration: none; transition: opacity .15s; }
.more:hover { opacity: .72; }
.detail { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.source { margin-top: 14px; }
.source-video { font-size: 14px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
blockquote { margin: 0 0 6px; padding: 1px 0 1px 13px; border-left: 2px solid rgba(228, 96, 13, .55); }
blockquote[lang="hi"] { color: var(--muted); }
.timestamp { display: inline-flex; gap: 7px; align-items: center; background: var(--tint); padding: 2px 8px; border-radius: 6px; font-weight: 600; font-size: 15px; color: var(--deep); transition: background .15s; }
.timestamp:hover { background: rgba(255, 176, 32, .26); }
.verse { background: var(--tint); padding: 8px 13px; border-radius: 12px; margin: 6px 0 10px; }
.verse-source { font-size: 12px; font-weight: 700; color: var(--deep); letter-spacing: .05em; text-transform: uppercase; }
.verse-line { font-weight: 500; line-height: 1.45; }
mark { background: linear-gradient(transparent 56%, rgba(255, 176, 32, .5) 56%); color: inherit; font-weight: 600; padding: 0 .08em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.story { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.story h3 { font-family: var(--font-head); font-weight: 600; font-size: 19px; margin: 0 0 6px; }
.story .card-role { margin-top: 10px; }

/* Video: a large image in the Library, a small line in chat */
.media { cursor: pointer; position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; background: #2b1d0e; padding: 0; overflow: hidden; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.card:hover .media img { transform: scale(1.025); }
.media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 8px; background: rgba(30, 18, 4, .62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; font-weight: 600; font-size: 14px; padding: 4px 10px 4px 9px; border-radius: 6px; }
.play-icon { width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 9px; border-color: transparent transparent transparent #fff; flex: none; }
.play-icon.dark { border-left-color: var(--deep); }
.card-body > .media { border-radius: 14px; margin: 2px 0 10px; }
.watch-row { position: relative; display: flex; align-items: center; gap: 12px; width: fit-content; max-width: 100%; padding: 6px 16px 6px 6px; margin: 2px 0 10px; border-radius: 14px; background: var(--glass); text-align: left; transition: background .15s; }
.watch-row:hover { background: var(--glass-strong); }
.watch-row:hover::before { opacity: .85; }
.watch-thumb { position: relative; width: 92px; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: #2b1d0e; flex: none; display: grid; place-items: center; }
.watch-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.watch-thumb .play-icon { position: relative; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7)); }
.watch-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.watch-text strong { font-size: 15px; font-weight: 600; }
.watch-text span { font-size: 14px; color: var(--deep); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Notices */
.notice { background: var(--alert); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid rgba(228, 96, 13, .22); border-radius: 16px; padding: 12px 16px; font-size: 15.5px; }
.notice.quiet { background: transparent; border-color: var(--hairline); color: var(--muted); backdrop-filter: none; -webkit-backdrop-filter: none; }
.notice.crisis { font-size: 17px; }
.notice a { color: var(--deep); font-weight: 700; }
.notice-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.notice-actions:empty { display: none; }
.support-title { font-weight: 700; margin-bottom: 2px; }
.support-line { font-weight: 500; }
.support-urgent { margin-top: 6px; font-weight: 500; }

.followups { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.followup { padding: 3px 0; font-size: 15.5px; font-weight: 500; color: var(--deep); text-align: left; border-bottom: 1px solid transparent; transition: border-color .15s; }
.followup:hover { border-bottom-color: var(--saffron); }

/* The ask box: its edge wakes on focus and travels while an answer is prepared. */
.composer { position: relative; max-width: 728px; width: calc(100% - 32px); margin: 8px auto calc(16px + env(safe-area-inset-bottom)); padding: 6px 6px 6px 8px; display: flex; gap: 8px; align-items: flex-end; border-radius: 16px; background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow); }
.composer:focus-within::before { opacity: .95; }
.composer.busy::before { opacity: 1; animation: turn 2.6s linear infinite; }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; padding: 8px 10px; max-height: 160px; min-width: 0; }
.composer textarea::placeholder { color: var(--muted); }
.send { width: 40px; height: 40px; flex: none; border-radius: 11px; background: var(--fill); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 14px -8px rgba(201, 74, 6, .9); transition: transform .15s; }
.send:hover { transform: scale(1.05); }
.send.stopping svg { display: none; }
.send.stopping::before { content: ''; width: 13px; height: 13px; background: #fff; border-radius: 3px; }

.modal { border: 1px solid var(--hairline); border-radius: 22px; padding: 24px; width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); background: var(--panel); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); color: var(--ink); box-shadow: 0 30px 70px -30px rgba(70, 40, 0, .55); }
.modal::backdrop { background: var(--backdrop); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal h2 { font-family: var(--font-head); font-weight: 600; margin: 0 0 12px; }
.modal label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-weight: 500; }
.row { display: flex; gap: 10px; margin-top: 4px; }
.row.split { justify-content: space-between; margin-top: 14px; }
#share-canvas { width: 100%; height: auto; border-radius: 12px; display: block; box-shadow: var(--shadow); }
.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.share-grid a, .share-grid button { background: var(--glass-strong); border: 1px solid var(--hairline); border-radius: 12px; padding: 8px; text-align: center; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.share-grid a:hover, .share-grid button:hover { border-color: rgba(228, 96, 13, .45); }

.share-page { padding: 24px 16px; }
.share-wrap { max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.primary-cta { display: block; text-align: center; background: var(--fill); color: #fff; padding: 13px; border-radius: 14px; font-weight: 700; text-decoration: none; box-shadow: 0 10px 22px -12px rgba(201, 74, 6, .9); }

/* Library */
.lib-head { position: sticky; top: 0; z-index: 5; background: var(--panel-soft); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-bottom: 1px solid var(--hairline); padding-top: 14px; }
.lib-composer { max-width: 1088px; margin: 0 auto 10px; }
.lib-tabs { display: flex; overflow-x: auto; max-width: 1120px; margin: 0 auto; padding: 0 16px; scrollbar-width: none; }
.lib-tabs::-webkit-scrollbar { display: none; }
.lib-tab { flex: none; padding: 5px 2px 7px; margin-right: 16px; font-weight: 500; font-size: 15.5px; color: var(--muted); border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.lib-tab:hover { color: var(--ink); border-bottom-color: var(--hairline); }
.lib-tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--saffron); }
.lib-body { max-width: 1120px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; align-items: start; }
.lib-grid .card { transition: transform .2s, box-shadow .2s; }
.lib-grid .card:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(120, 78, 16, .05), 0 20px 40px -20px rgba(120, 78, 16, .4); }
.lib-sentinel { min-height: 60px; color: var(--muted); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .wait-faces, .waiting-quote, .composer.busy::before { animation: none; }
  * { transition: none !important; }
  .card:hover .media img, .lib-grid .card:hover, .starter:hover, .primary:hover, .new-chat:hover { transform: none; }
}

.scrim { display: none; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 20; transform: translateX(-100%); transition: transform .2s; background: var(--panel-strong); }
  .sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: var(--backdrop); z-index: 10; }
  .topbar { display: flex; }
  .chat-del { visibility: visible; }
  .archive-row { flex-wrap: wrap; }
  .starters { grid-template-columns: 1fr; }
  .lib-grid { grid-template-columns: 1fr; }
  .welcome h1 { font-size: 27px; }
  .waiting-quote { margin-left: 0; font-size: 19px; }
  .watch-row { width: 100%; }
}

@media (max-width: 720px) {
  #thread > .wisdom { padding: 14px 16px; }
  #thread > .wisdom .wisdom-quote { font-size: 18px; }
  #thread > .wisdom .wisdom-hi { font-size: 14px; }
}

@media (max-width: 720px) {
  .guru-hero { position: relative; }
  .guru-face { position: static; }
  .guru-hero img { width: 52px; height: 52px; }
}

.saint-chip.on img { box-shadow: 0 0 0 2px var(--saffron); }
.lib-gurus { max-width: 1120px; margin: 0 auto 2px; padding: 0 16px; border-bottom: 0; }
.msg-user-wrap { align-self: flex-end; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 85%; width: fit-content; }
.msg-user-wrap .msg-user { max-width: 100%; align-self: auto; }
.msg-actions { display: flex; gap: 14px; opacity: 0; transition: opacity .15s; min-height: 20px; }
.msg-user-wrap:hover .msg-actions, .msg-user-wrap:focus-within .msg-actions { opacity: 1; }
.thread.pending .msg-actions { visibility: hidden; }
.msg-action { font-size: 13px; font-weight: 500; color: var(--muted); }
.msg-action:hover { color: var(--deep); }
.msg-edit { width: min(560px, 80vw); min-height: 76px; padding: 11px 14px; border: 1px solid var(--hairline); border-radius: 14px; background: var(--surface); font: inherit; resize: vertical; }
.msg-edit:focus { outline: 2px solid var(--saffron); outline-offset: 1px; }
.msg-edit-actions { display: flex; align-items: center; gap: 14px; }
.chat-item.pending::after { content: ''; flex: none; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--saffron); animation: pending-dot 1.4s ease-in-out infinite; }
@keyframes pending-dot { 50% { opacity: .3; } }
@media (hover: none) { .msg-actions { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .chat-item.pending::after { animation: none; } }

/* Settings */
.settings { max-width: 980px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-right, 0px)) 60px max(16px, env(safe-area-inset-left, 0px)); display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 8px 36px; align-items: start; }
.settings-heading { grid-column: 1 / -1; margin-bottom: 14px; }
.settings-nav { display: flex; flex-direction: column; position: sticky; top: 12px; }
.settings-tab { text-align: left; padding: 8px 12px; color: var(--muted); font-weight: 500; border-left: 2px solid var(--hairline); transition: color .15s, border-color .15s; }
.settings-tab:hover { color: var(--ink); }
.settings-tab.on { color: var(--ink); font-weight: 600; border-left-color: var(--saffron); }
.settings-body { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.set-group { background: var(--glass); border: 1px solid var(--hairline); border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.set-title { font-family: var(--font-head); font-weight: 600; font-size: 19px; margin: 0; }
.set-subtitle { font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--deep); margin: 8px 0 0; }
.set-note { color: var(--muted); font-size: 14.5px; margin: 0; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 4px 0; }
.set-row + .set-row { border-top: 1px solid var(--hairline); padding-top: 12px; }
.set-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 220px; }
.set-label { font-weight: 600; }
.set-value { color: var(--muted); }
.set-input { padding: 9px 12px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--glass-strong); min-width: 0; width: min(320px, 100%); }
.set-input:focus { outline: 2px solid var(--saffron); outline-offset: 1px; }
.set-text { width: 100%; resize: vertical; }
.set-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.set-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.set-field { display: flex; flex-direction: column; gap: 4px; }
.set-field .set-input { width: 100%; }
.set-flash { font-size: 14px; color: var(--deep); font-weight: 600; }
.set-flash.bad { color: var(--danger); }
.set-check { width: 20px; height: 20px; accent-color: var(--saffron); }
.set-inline { display: inline-flex; align-items: center; gap: 7px; font-size: 14.5px; }
.ghost.small { padding: 6px 14px; font-size: 15px; border-radius: 9px; text-decoration: none; display: inline-block; }
.set-photo-row { display: flex; align-items: center; gap: 18px; }
.set-avatar { width: 88px; height: 88px; border-radius: 50%; background: var(--fill); color: #fff; display: grid; place-items: center; font-size: 34px; font-weight: 600; overflow: hidden; flex: none; }
.set-avatar img, .initial img { width: 100%; height: 100%; object-fit: cover; }
.initial { overflow: hidden; }
.usage-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.usage-head strong { font-family: var(--font-head); font-size: 22px; }
.meter { height: 8px; border-radius: 8px; background: var(--tint); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--fill); border-radius: 8px; transition: width .3s; }
.theme-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.theme-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border: 1px solid var(--hairline); border-radius: 14px; background: var(--glass-strong); text-align: left; }
.theme-choice.on { border-color: var(--saffron); box-shadow: inset 0 0 0 1px var(--saffron); }
.theme-swatch { width: 100%; aspect-ratio: 16 / 9; border-radius: 9px; display: flex; flex-direction: column; justify-content: flex-end; gap: 5px; padding: 9px; border: 1px solid var(--hairline); }
.theme-swatch span { display: block; height: 7px; border-radius: 4px; width: 70%; }
.theme-swatch span + span { width: 45%; background: #e4600d !important; }
.theme-swatch.light { background: #fffaf0; } .theme-swatch.light span { background: #2a1b0c; }
.theme-swatch.dark { background: #16100a; } .theme-swatch.dark span { background: #f6ead7; }
.theme-swatch.auto { background: linear-gradient(135deg, #fffaf0 50%, #16100a 50%); } .theme-swatch.auto span { background: #b9a689; }
.plan-now { display: flex; align-items: baseline; gap: 12px; }
.plan-now strong { font-family: var(--font-head); font-size: 24px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.plan-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; border: 1px solid var(--hairline); border-radius: 16px; background: var(--surface); }
.plan-card.on { border-color: var(--saffron); box-shadow: inset 0 0 0 1px var(--saffron); }
.plan-name { font-family: var(--font-head); font-size: 19px; }
.plan-price { font-weight: 700; font-size: 17px; }
.plan-card .set-note { flex: 1; }
.plan-tag { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--deep); margin-left: 8px; }
.plan-card > .plan-tag { margin-left: 0; }
.tx-table { display: flex; flex-direction: column; }
.tx-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 9px 0; border-top: 1px solid var(--hairline); font-size: 15px; }
.tx-row:first-child { border-top: 0; }
.tx-date { color: var(--muted); }
.tx-amount { font-variant-numeric: tabular-nums; }
.danger-zone { border-color: rgba(179, 38, 30, .25); }
.danger-button { background: var(--danger); box-shadow: none; }
.cancel-plan { align-self: flex-start; }
.test-banner { display: flex; flex-direction: column; gap: 6px; }
.reason-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
.reason { display: flex; align-items: center; gap: 9px; }
.reason input { width: 18px; height: 18px; accent-color: var(--saffron); }
.cancel-flow p { margin: 0 0 12px; }
.farewell-gurus { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 16px; }
.farewell-guru { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.farewell-guru:hover { color: var(--deep); }
.farewell-guru img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
@media (max-width: 720px) {
  .settings { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; position: static; border-bottom: 1px solid var(--hairline); }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-tab { flex: none; border-left: 0; border-bottom: 2px solid transparent; padding: 6px 2px 8px; margin-right: 18px; }
  .settings-tab.on { border-bottom-color: var(--saffron); }
  .set-grid, .theme-choices, .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .tx-row { grid-template-columns: minmax(0, 1fr) auto; }
  .tx-date { grid-column: 1 / -1; }
}

/* Public front page and sign-in */
.landing { position: fixed; inset: 0; overflow-y: auto; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
.land-top { max-width: 1040px; margin: 0 auto; padding: 18px 0; }
.land-hero { max-width: 1040px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 48px; align-items: center; padding: 28px 0 44px; }
.land-title { font-family: var(--font-head); font-weight: 600; font-size: clamp(34px, 5vw, 52px); line-height: 1.12; letter-spacing: -.01em; margin: 0 0 14px; text-wrap: balance; }
.land-sub { font-size: 19px; color: var(--muted); margin: 0 0 22px; max-width: 34em; }
.land-faces { display: flex; }
.land-faces img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 3px solid var(--surface); }
.land-faces img + img { margin-left: -12px; }
.auth-box { width: 100%; max-width: none; background: var(--surface); }
.auth-title { font-family: var(--font-head); font-weight: 600; font-size: 24px; margin: 0; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input:not([type="checkbox"]), .modal input:not([type="checkbox"]) { width: 100%; padding: 11px 14px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--glass-strong); }
.auth-check { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 9px; font-size: 14.5px; font-weight: 400 !important; }
.auth-check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--saffron); flex: none; }
.auth-check.quiet { color: var(--muted); }
.auth-check a { color: var(--deep); }
.auth-links { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.social { text-align: center; text-decoration: none; color: var(--ink); font-weight: 500; }
.land-more { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 38px; }
.land-h2 { font-family: var(--font-head); font-weight: 600; font-size: 26px; margin: 0 0 14px; }
.land-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.land-step { background: var(--glass); border: 1px solid var(--hairline); border-radius: 16px; padding: 16px; }
.land-step strong { font-family: var(--font-head); font-size: 18px; }
.land-foot { max-width: 1040px; margin: 44px auto 0; padding-top: 18px; border-top: 1px solid var(--hairline); display: flex; flex-direction: column; gap: 10px; }
.land-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.land-links a { color: var(--deep); text-decoration: none; font-weight: 500; }
.tf-qr { width: 180px; height: 180px; background: #fff; border-radius: 10px; padding: 8px; }
.tf-key { word-break: break-all; font-size: 13px; }
.tf-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; font-size: 15px; }
.welcome-note { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 18px; }
@media (max-width: 820px) {
  .land-hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 10px; }
  .land-steps { grid-template-columns: minmax(0, 1fr); }
}
.land-top .auth-brand { flex-direction: row; justify-content: flex-start; gap: 10px; margin: 0; }
.land-top .auth-brand img { width: 38px; height: 38px; }
.land-top .brand { font-size: 24px; }
.lesson-locked { font-size: 13px; color: var(--muted); }
