/* ==================================================================
   BREATHE (2.0.0.0)
   Two skins, light (dawn) and dark (night); "auto" follows the device.
   The widget carries its own background, so the dark skin works on a
   light page. The Hermitage edition uses the Hermitage's three themes
   (see the end of this file).
================================================================== */
.breathe, .brh {
    --bg: #f6f2ea; --panel: #fffdf8; --ink: #2b2a33; --muted: #686475; --line: #e0d9cb; --chip: #efe9dd;
    --accent: #2f7181; --accent-ink: #ffffff;
    --in: #3f93a8; --hold: #9a7fc9; --out: #c9773a; --rest: #a59f95; --free: #8fb3a0;
    --orb0: #f1fbfd; --orb1: #93cfdc; --orb2: #3d8aa0; --halo: rgba(110, 185, 205, .5); --track: #e8e2d6;
    --caution: #8a4b12;
}
.breathe[data-skin="dark"] {
    --bg: #10131b; --panel: #171b26; --ink: #e9e7f1; --muted: #a6a3b6; --line: #2b3142; --chip: #1f2434;
    --accent: #7cc6d6; --accent-ink: #0c1016;
    --in: #6cc0d4; --hold: #b9a3ee; --out: #f0a36b; --rest: #646a7b; --free: #8cc5a8;
    --orb0: #f4fcfe; --orb1: #86d0e1; --orb2: #2a6b82; --halo: rgba(100, 200, 228, .38); --track: #252b3b;
    --caution: #f2b27a;
}
@media (prefers-color-scheme: dark) {
    .breathe[data-skin="auto"] {
        --bg: #10131b; --panel: #171b26; --ink: #e9e7f1; --muted: #a6a3b6; --line: #2b3142; --chip: #1f2434;
        --accent: #7cc6d6; --accent-ink: #0c1016;
        --in: #6cc0d4; --hold: #b9a3ee; --out: #f0a36b; --rest: #646a7b; --free: #8cc5a8;
        --orb0: #f4fcfe; --orb1: #86d0e1; --orb2: #2a6b82; --halo: rgba(100, 200, 228, .38); --track: #252b3b;
        --caution: #f2b27a;
    }
}

.breathe {
    max-width: 560px; margin: 1.5rem auto; padding: 16px 16px 10px;
    background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 18px;
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    text-align: left;
}
.breathe *, .brh * { box-sizing: border-box; }
.breathe [hidden], .brh [hidden] { display: none !important; }
.breathe button { font: inherit; color: inherit; }
.breathe h3 { color: var(--ink); }

/* ---------- top bar ---------- */
.br-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.br-title { font-size: 1.35rem; font-weight: 600; letter-spacing: .02em; }
.br-top-r { display: flex; gap: 6px; flex-wrap: wrap; }
.br-pill {
    min-height: 34px; padding: 4px 12px; border-radius: 999px; cursor: pointer; font-size: .85rem !important;
    background: var(--chip); border: 1px solid var(--line); color: var(--muted) !important; text-transform: none;
}
.br-pill:hover { color: var(--ink) !important; }

/* ---------- tabs ---------- */
.br-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--chip); border-radius: 12px; margin-bottom: 14px; }
.br-tabs button {
    min-height: 40px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font-size: .95rem !important;
    color: var(--muted) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px;
}
.br-tabs button[aria-selected="true"] { background: var(--panel); color: var(--ink) !important; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.br-kudos-tab { font-size: .75rem; color: var(--accent); }
.br-badge { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: .7rem; font-weight: 600; letter-spacing: .04em; background: var(--accent); color: var(--accent-ink); }

/* ---------- the locked editor (free edition) ---------- */
.br-locked { padding: 14px 16px; margin-bottom: 6px; border-radius: 14px; background: var(--panel); border: 1px dashed var(--accent); }
.br-locked p { margin: 0 0 8px; font-size: .92rem; color: var(--muted); }
.br-locked .br-locked-h { color: var(--ink); font-weight: 600; font-size: 1rem; }
.br-locked a.br-btn { display: inline-flex; align-items: center; text-decoration: none; }

/* ---------- help ---------- */
.br-help p { margin: 0 0 12px; font-size: .95rem; }
.br-h.is-first { margin-top: 0; }
.br-panel { min-height: 200px; }
.br-lead { margin: 0 0 12px; color: var(--muted); font-size: .95rem; }
.br-h { margin: 22px 0 8px; font-size: 1rem; font-weight: 600; }
.br-note { margin: 0 0 8px; color: var(--muted); font-size: .9rem; }
.br-empty { color: var(--muted); font-size: .9rem; list-style: none; padding: 6px 0; }
.br-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons, chips, fields ---------- */
.br-btn {
    min-height: 42px; padding: 6px 16px; border-radius: 999px; cursor: pointer; font-size: .95rem !important;
    background: var(--panel); border: 1px solid var(--line); color: var(--ink) !important;
}
.br-btn:hover:not(:disabled) { border-color: var(--accent); }
.br-btn.is-main { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) !important; }
.br-btn.is-wide { width: 100%; margin-top: 6px; }
.br-btn.is-small { min-height: 34px; padding: 3px 12px; font-size: .85rem !important; }
.br-btn.is-icon { min-width: 36px; min-height: 36px; padding: 0 8px; }
.br-btn:disabled { opacity: .45; cursor: default; }
.br-link { background: none; border: 0; padding: 6px 4px; min-height: 36px; cursor: pointer; color: var(--muted) !important; text-decoration: underline; font-size: .9rem !important; }
.breathe button:focus-visible, .breathe select:focus-visible, .breathe input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.br-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.br-row.is-centre { justify-content: center; }

.br-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.br-chips button {
    min-height: 34px; padding: 4px 12px; border-radius: 999px; cursor: pointer; font-size: .88rem !important;
    background: var(--chip); border: 1px solid var(--line); color: var(--ink) !important;
}
.br-chips.is-tight button { padding: 4px 10px; }
.br-chips button.is-locked { opacity: .55; cursor: not-allowed; }
.br-plan-who b { color: var(--ink); font-weight: 700; }
.br-chips button[aria-pressed="true"], .br-chips button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) !important; }
.br-field { display: block; margin: 10px 0; }
.br-label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.br-select, .br-input {
    width: 100%; min-height: 40px; padding: 6px 10px; border-radius: 10px; font: inherit; font-size: .95rem;
    background: var(--panel); color: var(--ink); border: 1px solid var(--line);
}

/* ---------- the practice list ---------- */
.br-list, .br-rows, .br-b-items, .br-explored, .br-plan-items { list-style: none; margin: 0; padding: 0; }
.br-item { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin-bottom: 8px; overflow: hidden; }
.br-item-head {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left;
    background: none; border: 0; cursor: pointer; min-height: 60px;
}
.br-item-txt { display: flex; flex-direction: column; min-width: 0; }
.br-item-name { font-weight: 600; }
.br-item-pat { font-size: .82rem; color: var(--muted); }
.br-item-body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.br-item-d { margin: 10px 0 6px; }
.br-item-how { margin: 0 0 10px; color: var(--muted); font-size: .92rem; }
.br-caution { margin: 0 0 10px; color: var(--caution); font-size: .88rem; }
.br-mins { margin: 8px 0 0; }

/* the small ring beside each practice */
.br-mini { flex: none; }
.br-mini .br-arc { fill: none; stroke-width: 4.5; stroke-linecap: round; }
.br-mini-dot { fill: var(--orb1); }

/* ---------- guide ---------- */
.br-intents { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 8px; }
.br-intents button {
    display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: baseline; text-align: left;
    padding: 10px 12px; border-radius: 12px; cursor: pointer; background: var(--panel); border: 1px solid var(--line); min-height: 64px;
}
.br-intents button[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.br-int-ico { grid-row: span 2; font-size: 1.3rem; color: var(--accent); }
.br-int-name { font-weight: 600; }
.br-int-d { font-size: .8rem; color: var(--muted); line-height: 1.3; }
.br-plan { margin-top: 16px; padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.br-plan-who { margin: 0; font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.br-plan-name { margin: 2px 0 10px; font-size: 1.25rem; }
.br-plan-items li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.br-plan-items li.is-rest { padding-left: 44px; color: var(--muted); font-size: .85rem; font-style: italic; }
.br-plan-d { font-size: .85rem; color: var(--muted); }
.br-m { color: var(--accent); font-size: .9rem; }
.br-total { margin: 10px 0 0; color: var(--muted); font-size: .9rem; }

/* ---------- build ---------- */
.br-b-item {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; margin-bottom: 6px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.br-b-name { flex: 1 1 160px; font-weight: 600; }
.br-step, .br-b-move { display: inline-flex; align-items: center; gap: 4px; }
.br-b-min { min-width: 4.2em; text-align: center; font-variant-numeric: tabular-nums; }
.br-add { display: flex; gap: 8px; margin-top: 10px; }
.br-add .br-select { flex: 1; min-width: 0; }

/* ---------- saved and completed rows ---------- */
.br-rows li {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line);
}
.br-rows li.br-empty { border: 0; }
.br-r-name { flex: 1 1 140px; font-weight: 600; min-width: 0; }
.br-r-meta { color: var(--muted); font-size: .85rem; margin-right: auto; }

/* ---------- me ---------- */
.br-kudos { margin: 0 0 10px; font-size: 1.3rem; color: var(--accent); font-weight: 600; }
.br-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.br-badges span { padding: 4px 10px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); font-size: .85rem; }
.br-explored { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.br-explored li { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); padding: 4px 6px; border-radius: 8px; }
.br-explored li .br-mini { opacity: .35; }
.br-explored li.is-done { color: var(--ink); background: var(--chip); }
.br-explored li.is-done .br-mini { opacity: 1; }

/* ---------- shared link banner ---------- */
.br-shared { padding: 12px 14px; margin-bottom: 14px; border-radius: 14px; border: 1px solid var(--accent); background: var(--panel); }
.br-shared p { margin: 0; }
.br-shared-name { font-weight: 600; margin-top: 4px !important; }

/* ---------- the stage (shared with the Hermitage edition) ---------- */
.br-stage { width: min(78vw, 320px); margin: 6px auto 0; }
.br-stage-svg { display: block; width: 100%; height: auto; overflow: visible; }
.br-track { fill: none; stroke: var(--track); stroke-width: 10; }
.br-arc { fill: none; stroke-width: 10; stroke-linecap: round; opacity: .55; transition: opacity .6s ease; }
.br-arc.is-now { opacity: 1; }
.br-arc.is-in, .br-arc.is-top { stroke: var(--in); }
.br-arc.is-hold { stroke: var(--hold); }
.br-arc.is-out { stroke: var(--out); }
.br-arc.is-rest { stroke: var(--rest); }
.br-arc.is-free { stroke: var(--free); opacity: .5; }
.br-orb { fill: url(#br-orb-grad); }
.br-orb-s0 { stop-color: var(--orb0); }
.br-orb-s1 { stop-color: var(--orb1); }
.br-orb-s2 { stop-color: var(--orb2); }
.br-halo { fill: url(#br-halo-grad); }
.br-halo-s0 { stop-color: var(--halo); }
.br-halo-s1 { stop-color: var(--halo); stop-opacity: 0; }
.br-marker { fill: var(--ink); stroke: var(--bg); stroke-width: 3; }
.br-stage-svg[data-phase="in"] .br-marker, .br-stage-svg[data-phase="top"] .br-marker { fill: var(--in); }
.br-stage-svg[data-phase="hold"] .br-marker { fill: var(--hold); }
.br-stage-svg[data-phase="out"] .br-marker { fill: var(--out); }
.br-stage-svg[data-phase="rest"] .br-marker { fill: var(--rest); }
.br-stage-svg[data-phase="free"] .br-marker { fill: var(--free); }
.br-side { fill: var(--track); stroke: var(--line); stroke-width: 2; transition: fill .4s ease; }
.br-side.is-on { fill: var(--accent); stroke: var(--accent); }
.br-stage-svg.is-slow .br-num { display: none; }
.br-num { font: 600 34px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; fill: var(--orb2); font-variant-numeric: tabular-nums; }
.br-ripple { fill: none; stroke: var(--orb1); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.br-ripples.is-on .br-ripple { animation: br-ripple 2.7s ease-out infinite; }
@keyframes br-ripple { 0% { opacity: .55; transform: scale(1); } 100% { opacity: 0; transform: scale(2.1); } }
@media (prefers-reduced-motion: reduce) { .br-arc, .br-side { transition: none; } .br-ripples.is-on .br-ripple { animation: none; } }

/* ---------- the session ---------- */
.br-session, .br-done { text-align: center; padding: 4px 0 8px; }
.br-s-tag { display: inline-block; margin: 0 0 6px; padding: 2px 10px; border-radius: 999px; font-size: .75rem; letter-spacing: .06em; background: var(--chip); color: var(--accent); border: 1px solid var(--line); }
.br-s-teach { margin: 8px auto 0; max-width: 24em; font-size: 1.3rem; line-height: 1.45; min-height: 4.4em; white-space: pre-line; }
.br-s-nudge { margin: 10px auto 0; max-width: 26em; padding: 8px 14px; border-radius: 12px; background: var(--chip); border: 1px solid var(--line); color: var(--ink); font-size: .95rem; }
.br-s-name { margin: 0; font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.br-s-step { margin: 2px 0 0; font-weight: 600; font-size: 1.05rem; }
.br-s-phase { margin: 6px 0 0; font-size: 1.6rem; font-weight: 600; min-height: 1.4em; }
.br-s-way { margin: 0; color: var(--muted); min-height: 1.5em; }
.br-s-how { margin: 10px auto 0; max-width: 34em; font-size: .9rem; color: var(--muted); min-height: 1.5em; }
.br-s-next { margin: 6px 0 0; font-size: .88rem; color: var(--accent); min-height: 1.4em; }
.br-s-time { margin: 6px 0 0; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }
.br-safety { margin: 14px 0 0; font-size: .8rem; color: var(--muted); }

.br-done { padding: 26px 0 14px; }
.br-d-mark { font-size: 2.2rem; color: var(--accent); line-height: 1; }
.br-d-title { margin: 8px 0 4px; font-size: 1.4rem; }
.br-d-sum { margin: 0; color: var(--muted); }
.br-d-kudos { margin: 10px 0 0; color: var(--accent); font-weight: 600; }

.br-toast {
    position: sticky; bottom: 12px; margin: 10px auto 0; width: fit-content; max-width: 92%;
    padding: 8px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: .9rem; text-align: center;
}
.br-foot { margin: 14px 0 0; text-align: center; font-size: .78rem; color: var(--muted); }
.br-foot a { color: var(--muted); }
.breathe:not(.is-embed) .br-foot { display: none; }

@media (max-width: 420px) {
    .breathe { padding: 12px 10px 8px; border-radius: 14px; }
    .br-tabs button { font-size: .8rem !important; padding: 0 2px; }
    .br-s-phase { font-size: 1.4rem; }
}

/* ==================================================================
   HERMITAGE EDITION (.brh): transparent, the Hermitage's colours
================================================================== */
.brh {
    --ink: #2c2a26; --muted: #6f6a60; --line: #d4ccbd; --chip: #f1ede4; --track: #e3ddd1;
    --accent: #6d7f6a; --accent-ink: #fbfaf6; --bg: #f7f4ee;
    --in: #6d8fa0; --hold: #9a8ab5; --out: #b88454; --rest: #b9b1a1; --free: #8ea58a;
    --orb0: #fbfaf6; --orb1: #b9cdb5; --orb2: #6d7f6a; --halo: rgba(150, 175, 145, .45);
}
.brh[data-theme="buddhist"] { --accent: #8e3b2a; --accent-ink: #fff8ef; --chip: #f6ecdd; --orb1: #ecc28f; --orb2: #b2621c; --halo: rgba(220, 160, 90, .4); --out: #b2621c; }
.brh[data-theme="pagan"]    { --accent: #3f5a2f; --accent-ink: #f6f8ef; --chip: #edf0e3; --orb1: #b8cba1; --orb2: #4d6b3a; --halo: rgba(120, 160, 100, .4); }
/* The dark set. It applies when the Hermitage says its skin is dark (data-hscheme, put on <html> by
   hermitage-embed.js: the skin on screen, not the device), and, when nobody has said, when the device is
   dark. A light skin on a dark device stays light; ?scheme=dark or `scheme` in `load` forces it. */
html[data-hscheme="dark"] .brh {
    --ink: #ece7dd; --muted: #aaa293; --line: #403c33; --chip: #26241f; --track: #34312a;
    --accent: #a3b69f; --accent-ink: #1b1a17; --bg: #171612;
    --in: #8fb6c6; --hold: #b4a6d6; --out: #d9a273; --rest: #6c665a; --free: #9fbf9a;
    --orb0: #f6f8f2; --orb1: #a3b69f; --orb2: #4f6249; --halo: rgba(160, 190, 150, .3);
}
html[data-hscheme="dark"] .brh[data-theme="buddhist"] { --accent: #e59a4f; --accent-ink: #24140a; --chip: #2a2119; --orb1: #e59a4f; --orb2: #8a4a17; --halo: rgba(229, 154, 79, .3); --out: #e59a4f; }
html[data-hscheme="dark"] .brh[data-theme="pagan"]    { --accent: #9fbf86; --accent-ink: #141a0f; --chip: #222819; --orb1: #9fbf86; --orb2: #3f5a2f; --halo: rgba(159, 191, 134, .3); }
@media (prefers-color-scheme: dark) {
    html:not([data-hscheme]) .brh {
        --ink: #ece7dd; --muted: #aaa293; --line: #403c33; --chip: #26241f; --track: #34312a;
        --accent: #a3b69f; --accent-ink: #1b1a17; --bg: #171612;
        --in: #8fb6c6; --hold: #b4a6d6; --out: #d9a273; --rest: #6c665a; --free: #9fbf9a;
        --orb0: #f6f8f2; --orb1: #a3b69f; --orb2: #4f6249; --halo: rgba(160, 190, 150, .3);
    }
    html:not([data-hscheme]) .brh[data-theme="buddhist"] { --accent: #e59a4f; --accent-ink: #24140a; --chip: #2a2119; --orb1: #e59a4f; --orb2: #8a4a17; --halo: rgba(229, 154, 79, .3); --out: #e59a4f; }
    html:not([data-hscheme]) .brh[data-theme="pagan"]    { --accent: #9fbf86; --accent-ink: #141a0f; --chip: #222819; --orb1: #9fbf86; --orb2: #3f5a2f; --halo: rgba(159, 191, 134, .3); }
}
.brh { max-width: 440px; margin: 0 auto; text-align: center; color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.brh .br-stage { width: min(70vw, 280px); }
.brh-label { margin: 0 0 4px; font-size: .95rem; color: var(--muted); }
.brh-key {
    font: inherit; font-size: 1.05rem; min-width: 10rem; min-height: 44px; padding: 8px 20px; margin-top: 12px;
    border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer;
}
.brh-key.is-stop { background: transparent; color: var(--ink); border-color: var(--line); }
.brh-key:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.brh-plan { list-style: none; padding: 0; margin: 10px auto 0; max-width: 22em; text-align: left; font-size: .9rem; }
.brh-plan li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.brh-plan li.is-now { color: var(--ink); font-weight: 600; }
.brh-plan li.is-rest { font-style: italic; font-size: .82rem; }
