/* YourSpace: its own calm theme inside the Codewaala shell (SRS INT-4).
   Soft dawn colours, large touch targets, colour never used alone (FR-2, NFR-3). */
:root {
  --ys-bg: #f5f1ea; --ys-bg2: #ece6db; --ys-card: #fffdf9; --ys-ink: #1f2a37; --ys-mut: #556273; --ys-line: #ddd3c4;
  --ys-teal: #0f766e; --ys-teal2: #14b8a6; --ys-sun: #f2b84b; --ys-rose: #e8798b; --ys-lilac: #8b7bd8; --ys-sky: #5aa9e6;
  --ys-red: #b42318; --ys-redbg: #fff1f0; --ys-amber: #9a5b00; --ys-amberbg: #fff7e6;
  --ys-focus: #2563eb; --ys-shadow: 0 10px 30px -18px rgba(31, 42, 55, .45);
  --ys-radius: 20px; --ys-tap: 48px; --ys-fs: 17px;
}
:root:not([data-theme="light"]) body.ys.ys-dark,
:root[data-theme="dark"] body.ys {
  --ys-bg: #10201f; --ys-bg2: #152a28; --ys-card: #182f2d; --ys-ink: #eef5f3; --ys-mut: #a9bfbb; --ys-line: #2b4643;
  --ys-teal: #5eead4; --ys-teal2: #2dd4bf; --ys-red: #ffb4ab; --ys-redbg: #3b1714; --ys-amber: #ffd08a; --ys-amberbg: #3a2a10;
  --ys-focus: #93c5fd; --ys-shadow: 0 10px 30px -18px rgba(0, 0, 0, .8);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.ys {
    --ys-bg: #10201f; --ys-bg2: #152a28; --ys-card: #182f2d; --ys-ink: #eef5f3; --ys-mut: #a9bfbb; --ys-line: #2b4643;
    --ys-teal: #5eead4; --ys-teal2: #2dd4bf; --ys-red: #ffb4ab; --ys-redbg: #3b1714; --ys-amber: #ffd08a; --ys-amberbg: #3a2a10;
    --ys-focus: #93c5fd; --ys-shadow: 0 10px 30px -18px rgba(0, 0, 0, .8);
  }
}
body.ys { background: var(--ys-bg); color: var(--ys-ink); font-size: var(--ys-fs); line-height: 1.6; }
body.ys.ys-band-A { --ys-tap: 64px; --ys-fs: 19px; }
body.ys.ys-band-B { --ys-tap: 56px; --ys-fs: 18px; }
body.ys.ys-size-l { --ys-fs: 20px; }
body.ys.ys-size-xl { --ys-fs: 23px; }
body.ys.ys-dyslexia { font-family: 'Lexend', 'Inter', 'Noto Sans Devanagari', sans-serif; letter-spacing: .02em; word-spacing: .08em; }
body.ys.ys-dyslexia .ys-main { line-height: 1.8; }
body.ys.ys-contrast { --ys-bg: #ffffff; --ys-card: #ffffff; --ys-ink: #000000; --ys-mut: #1f2937; --ys-line: #000000; --ys-teal: #00524c; }
html[lang="hi"] body.ys { font-family: 'Noto Sans Devanagari', 'Inter', 'Mangal', sans-serif; }
body.ys a { color: inherit; }
body.ys a.ys-btn:not(.ys-btn-soft):not(.ys-btn-quiet) { color: #fff; }
body.ys :focus-visible { outline: 3px solid var(--ys-focus); outline-offset: 3px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { body.ys *, body.ys *::before, body.ys *::after { animation: none !important; transition: none !important; } }
body.ys.ys-still *, body.ys.ys-still *::before, body.ys.ys-still *::after { animation: none !important; transition: none !important; }

.ys-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- strip ---------- */
.ys-strip { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 8px 16px; background: var(--ys-bg2); border-bottom: 1px solid var(--ys-line); font-size: 14px; color: var(--ys-mut); }
.ys-strip__note { display: flex; gap: 6px; align-items: center; min-width: 0; }
.ys-strip__tools { display: flex; gap: 6px; flex-wrap: wrap; }
.ys-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--ys-line); background: var(--ys-card); color: var(--ys-ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.ys-chip[aria-pressed="true"] { background: var(--ys-teal); color: #fff; border-color: var(--ys-teal); }
:root[data-theme="dark"] .ys-chip[aria-pressed="true"] { color: #0b1f1d; }

/* ---------- layout ---------- */
.ys-main { max-width: 880px; margin: 0 auto; padding: 22px 16px 120px; min-height: 70vh; }
.ys-main:focus { outline: none; }
.ys-loading { text-align: center; padding: 80px 0; color: var(--ys-mut); }
.ys-diya-spin { font-size: 48px; animation: ys-glow 1.6s ease-in-out infinite; }
@keyframes ys-glow { 50% { transform: scale(1.08); filter: drop-shadow(0 0 12px #f2b84b); } }

.ys-card { background: var(--ys-card); border: 1px solid var(--ys-line); border-radius: var(--ys-radius); padding: 22px; box-shadow: var(--ys-shadow); margin: 0 0 16px; }
.ys-card h2, .ys-card h3 { margin: 0 0 8px; line-height: 1.3; }
.ys-h1 { font-family: 'Baloo 2', 'Inter', 'Noto Sans Devanagari', sans-serif; font-size: clamp(26px, 5vw, 36px); line-height: 1.2; margin: 0 0 6px; font-weight: 800; }
html[lang="hi"] .ys-h1 { font-family: 'Noto Sans Devanagari', sans-serif; }
.ys-sub { color: var(--ys-mut); margin: 0 0 18px; }
.ys-mut { color: var(--ys-mut); }
.ys-small { font-size: .86em; }
.ys-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ys-grow { flex: 1; min-width: 0; }
.ys-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.ys-grid-tight { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }

/* ---------- buttons ---------- */
.ys-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--ys-tap); padding: 10px 20px;
  border-radius: 16px; border: 0; background: var(--ys-teal); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform .12s, box-shadow .15s; }
:root[data-theme="dark"] body.ys .ys-btn:not(.ys-btn-soft):not(.ys-btn-quiet):not(.ys-btn-danger) { color: #0b1f1d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body.ys .ys-btn:not(.ys-btn-soft):not(.ys-btn-quiet):not(.ys-btn-danger) { color: #0b1f1d; } }
.ys-btn:hover { transform: translateY(-1px); box-shadow: var(--ys-shadow); }
.ys-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.ys-btn-soft { background: var(--ys-card); color: var(--ys-ink); border: 2px solid var(--ys-line); }
.ys-btn-quiet { background: transparent; color: var(--ys-mut); border: 0; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }
.ys-btn-big { min-height: 64px; font-size: 1.12em; padding: 14px 26px; border-radius: 20px; }
.ys-btn-danger { background: var(--ys-red); color: #fff; }
.ys-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.ys-actions .ys-right { margin-left: auto; }
.ys-icon-btn { min-width: 44px; min-height: 44px; border-radius: 12px; border: 1px solid var(--ys-line); background: var(--ys-card); color: var(--ys-ink); cursor: pointer; font-size: 18px; }

/* ---------- Diya the lamp ---------- */
.ys-diya { display: flex; gap: 14px; align-items: flex-start; }
.ys-diya__lamp { flex: 0 0 auto; width: 72px; height: 72px; }
.ys-diya__flame { transform-origin: 50% 90%; animation: ys-flicker 2.4s ease-in-out infinite; }
@keyframes ys-flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08, 1.12) rotate(2deg); } }
.ys-bubble { position: relative; background: var(--ys-card); border: 1px solid var(--ys-line); border-radius: 18px; padding: 14px 16px; box-shadow: var(--ys-shadow); }
.ys-say { display: inline-flex; vertical-align: middle; margin-left: 6px; }

/* ---------- choice tiles ---------- */
.ys-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); }
.ys-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; min-height: 120px;
  padding: 14px 10px; border-radius: 20px; border: 3px solid var(--ys-line); background: var(--ys-card); color: var(--ys-ink); cursor: pointer; font: inherit; font-weight: 600; }
.ys-tile:hover { border-color: var(--ys-teal2); }
.ys-tile[aria-pressed="true"], .ys-tile.on { border-color: var(--ys-teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ys-teal) 22%, transparent); }
.ys-tile__pic { font-size: 44px; line-height: 1; }
.ys-tile__swatch { width: 54px; height: 16px; border-radius: 99px; border: 1px solid rgba(0,0,0,.15); }
.ys-tile small { color: var(--ys-mut); font-weight: 500; }
.ys-door { min-height: 128px; }
.ys-answers { display: grid; gap: 10px; }
.ys-answer { display: flex; gap: 14px; align-items: center; text-align: left; min-height: var(--ys-tap); padding: 12px 16px; border-radius: 16px;
  border: 3px solid var(--ys-line); background: var(--ys-card); color: var(--ys-ink); font: inherit; font-weight: 600; cursor: pointer; }
.ys-answer:hover { border-color: var(--ys-teal2); }
.ys-answer .pic { font-size: 30px; flex: 0 0 auto; }
body.ys-band-A .ys-answers, body.ys-band-B .ys-answers { grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); }
body.ys-band-A .ys-answer, body.ys-band-B .ys-answer { flex-direction: column; text-align: center; min-height: 130px; }
body.ys-band-A .ys-answer .pic, body.ys-band-B .ys-answer .pic { font-size: 46px; }
.ys-skip { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.ys-progress { height: 8px; border-radius: 99px; background: var(--ys-bg2); overflow: hidden; margin: 0 0 18px; }
.ys-progress > i { display: block; height: 100%; background: var(--ys-teal2); border-radius: 99px; transition: width .3s; }
.ys-slider { width: 100%; accent-color: var(--ys-teal); min-height: 44px; }
.ys-input, .ys-textarea, .ys-select { width: 100%; font: inherit; color: var(--ys-ink); background: var(--ys-card); border: 2px solid var(--ys-line); border-radius: 14px; padding: 12px 14px; min-height: 48px; }
.ys-textarea { min-height: 120px; resize: vertical; }
.ys-label { display: block; font-weight: 700; margin: 12px 0 6px; }

/* ---------- story player ---------- */
.ys-scene { border-radius: 24px; overflow: hidden; border: 1px solid var(--ys-line); background: var(--ys-card); box-shadow: var(--ys-shadow); }
.ys-scene__art { display: grid; place-items: center; min-height: 190px; font-size: clamp(56px, 13vw, 92px); letter-spacing: .08em;
  background: linear-gradient(160deg, #fde7c3, #f7c6c7 45%, #c9d8f6); }
.ys-scene__art.alt1 { background: linear-gradient(160deg, #cdeee7, #bfe0f6 55%, #e8dcf9); }
.ys-scene__art.alt2 { background: linear-gradient(160deg, #fff1c1, #d9f1cf 50%, #bfe6e0); }
.ys-scene__art.alt3 { background: linear-gradient(160deg, #e2dcf8, #f6d6e6 55%, #ffe6c7); }
.ys-scene__art span { display: inline-block; animation: ys-bob 4s ease-in-out infinite; }
@keyframes ys-bob { 50% { transform: translateY(-6px); } }
.ys-scene__text { padding: 20px 22px; font-size: 1.08em; }
.ys-dots { display: flex; gap: 6px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.ys-dots i { width: 10px; height: 10px; border-radius: 99px; background: var(--ys-line); }
.ys-dots i.on { background: var(--ys-teal); }
.ys-value { border-left: 5px solid var(--ys-sun); padding: 10px 14px; background: color-mix(in srgb, var(--ys-sun) 14%, var(--ys-card)); border-radius: 12px; font-weight: 600; }

/* ---------- skill card ---------- */
.ys-skill__emoji { font-size: 54px; }
.ys-steps { padding-left: 1.3em; }
.ys-steps li { margin: 6px 0; }
.ys-breath { display: grid; place-items: center; margin: 18px auto; width: 220px; height: 220px; position: relative; }
.ys-breath__circle { width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #a7f3d0, #14b8a6); transition: transform linear; }
.ys-breath__label { position: absolute; bottom: -8px; left: 0; right: 0; text-align: center; font-weight: 800; font-size: 1.15em; }

/* ---------- garden ---------- */
.ys-garden { width: 100%; height: auto; border-radius: 22px; border: 1px solid var(--ys-line); background: linear-gradient(#cfe9f7, #eaf6e2 62%, #b7d99a 62%); display: block; }

/* ---------- hub ---------- */
.ys-hub-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; background: var(--ys-card); border: 1px solid var(--ys-line);
  border-radius: 20px; padding: 18px; min-height: 130px; box-shadow: var(--ys-shadow); cursor: pointer; text-align: left; font: inherit; }
.ys-hub-card:hover { border-color: var(--ys-teal2); transform: translateY(-2px); }
.ys-hub-card .pic { font-size: 34px; }
.ys-hub-card b { font-size: 1.05em; }
.ys-hub-card span { color: var(--ys-mut); font-size: .92em; }
.ys-hero { background: linear-gradient(135deg, color-mix(in srgb, var(--ys-teal) 16%, var(--ys-card)), var(--ys-card)); }

/* ---------- notes, banners ---------- */
.ys-banner { border-radius: 16px; padding: 14px 16px; margin: 0 0 16px; border: 1px solid var(--ys-line); background: var(--ys-card); }
.ys-banner.amber { background: var(--ys-amberbg); border-color: color-mix(in srgb, var(--ys-amber) 40%, transparent); }
.ys-banner.preview { background: #eef2ff; color: #312e81; border-color: #c7d2fe; }
.ys-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; border: 1px solid var(--ys-line); background: var(--ys-bg2); }
.ys-pill.red { background: #fde2e1; color: #8a1c13; border-color: #f5b5b0; }
.ys-pill.orange { background: #ffedd5; color: #8a4b08; border-color: #fbc58b; }
.ys-pill.request { background: #e0f2fe; color: #075985; border-color: #93c5fd; }
.ys-pill.done { background: #dcfce7; color: #14532d; border-color: #86efac; }
.ys-feedback { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 26px; color: var(--ys-mut); font-size: 14px; }
.ys-feedback button { min-width: 44px; min-height: 40px; border-radius: 12px; border: 1px solid var(--ys-line); background: var(--ys-card); cursor: pointer; font-size: 18px; }

/* ---------- Talk to a person (persistent, INT-5) ---------- */
.ys-talk { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; min-height: 56px; padding: 12px 20px;
  border-radius: 999px; border: 0; background: #7c2d12; color: #fff; font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 12px 30px -10px rgba(124, 45, 18, .7); }
.ys-talk:hover { background: #9a3412; }
@media (max-width: 520px) { .ys-talk { left: 16px; right: 16px; justify-content: center; } .ys-main { padding-bottom: 140px; } }

/* ---------- overlays ---------- */
.ys-overlay { position: fixed; inset: 0; z-index: 120; background: rgba(15, 23, 42, .55); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 24px 12px; }
.ys-dialog { width: min(680px, 100%); background: var(--ys-card); color: var(--ys-ink); border-radius: 24px; padding: 22px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); }
.ys-dialog h2 { margin-top: 0; }
.ys-red { position: fixed; inset: 0; z-index: 200; background: var(--ys-bg); overflow-y: auto; padding: 22px 16px 60px; }
.ys-red__inner { max-width: 720px; margin: 0 auto; }
.ys-red__title { font-family: 'Baloo 2', 'Inter', 'Noto Sans Devanagari', sans-serif; font-size: clamp(24px, 5vw, 32px); line-height: 1.25; margin: 8px 0 14px; }
.ys-help-line { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px; border-radius: 18px; border: 2px solid var(--ys-line); background: var(--ys-card); margin: 0 0 10px; }
.ys-help-line .num { font-size: 1.6em; font-weight: 800; letter-spacing: .04em; min-width: 92px; }
.ys-help-line .ys-grow { min-width: 170px; }
.ys-help-line .ys-btn { margin-left: auto; }
html[lang="hi"] .ys-red__title { font-family: 'Noto Sans Devanagari', sans-serif; font-weight: 800; line-height: 1.45; }
.ys-script { padding: 10px 14px; border-radius: 14px; background: var(--ys-bg2); margin: 6px 0; font-weight: 600; }
.ys-lock { position: fixed; inset: 0; z-index: 180; background: var(--ys-bg); display: grid; place-items: center; padding: 20px; text-align: center; }
.ys-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 210; background: #1f2937; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; max-width: 92vw; }

/* ---------- circle of trust ---------- */
.ys-circles { position: relative; width: min(100%, 420px); aspect-ratio: 1; margin: 10px auto; }
.ys-circles div { position: absolute; border-radius: 50%; border: 3px solid; display: flex; justify-content: center; padding-top: 6px; font-size: 13px; font-weight: 700; }

/* ---------- staff ---------- */
.ys-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ys-table th, .ys-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--ys-line); vertical-align: top; }
.ys-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.ys-tabs button { min-height: 42px; padding: 6px 14px; border-radius: 12px; border: 1px solid var(--ys-line); background: var(--ys-card); color: var(--ys-ink); font: inherit; font-weight: 600; cursor: pointer; }
.ys-tabs button.on { background: var(--ys-teal); color: #fff; border-color: var(--ys-teal); }
.ys-bar { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.ys-bar i { display: block; height: 14px; border-radius: 6px; background: var(--ys-teal2); min-width: 2px; }
.ys-bar span:first-child { width: 150px; flex: 0 0 150px; font-size: 14px; }
@media (max-width: 560px) { .ys-table thead { display: none; } .ys-table tr { display: block; border-bottom: 1px solid var(--ys-line); padding: 6px 0; } .ys-table td { display: block; border: 0; padding: 4px 0; } }
