/*
 * Digital Mala: the tool's own components, styled in the site's design language (11 Nov 2026, on the UltraCompress Pro
 * template, after Unplug, whose shared block the first part of this file copies; it came from the Clock, Prana Breathing
 * Exercises and the Decision Maker). Base: /libs/site-pages.css (tokens, Inter and Space Grotesk, buttons, theme toggle,
 * focus rings) and /libs/shared-nav.css (the site's header and footer). The second part is the original's components (the
 * mantra heading, the stage with the mala and the count, the writing pad, the tally, the modes, the sankalpas, the day
 * strip and the lists of the sandhya times and lunar days, the mantra list, the journey's calendar and charts, the
 * settings, Focus) on the site's tokens; the mala's glow, the ink of the writing pad, the bead shadow and the calendar's
 * blues keep the original's colours as the tool's own tokens, which the drawings read. Mantras use the original's Tiro
 * Devanagari Sanskrit (SIL Open Font License, fonts/OFL.txt). Light is the default; dark applies when <html> has no
 * data-theme. Assembled once from Unplug's file and the original's style.css, then edited by hand: this file is the source.
 */

@font-face {
    font-family: "Tiro Devanagari Sanskrit";
    src: url("fonts/tiro-devanagari-sanskrit.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

/* ----- Tokens the tool adds ----- */
:root {
    --surface: #ffffff;
    --surface-2: #f3f4f8;
    --ring: rgba(139, 92, 246, 0.18);
    --app-max: 1600px;
    --radius-lg: 16px;
    --line: rgba(0, 0, 0, 0.1);
    --line-strong: rgba(0, 0, 0, 0.24);
    --ok: #166534;
    --ok-soft: rgba(22, 101, 52, 0.09);
    --bad: #b91c1c;
    --bad-soft: rgba(185, 28, 28, 0.08);
    --warn: #92400e;
    --warn-soft: rgba(217, 119, 6, 0.1);
}
:root:not([data-theme="light"]) {
    --surface: #14141f;
    --surface-2: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.26);
    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, 0.1);
    --bad: #f87171;
    --bad-soft: rgba(248, 113, 113, 0.1);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.1);
}

/* ----- Page: full width, the page provides the side space ----- */
.container.app-container { max-width: calc(var(--app-max) + 2 * var(--content-gutter)); margin-top: 16px; }
@media (min-width: 640px) { .container.app-container { margin-top: 24px; } }

/* ----- The site header is the first thing on the page and stays at the top ----- */
body { padding-top: 0; }
body > header { position: sticky; top: 0; z-index: 50; }
header .site-nav { position: relative; top: auto; }
.theme-toggle { top: 90px; }
@media (max-width: 639.98px) { .theme-toggle { top: 75px; } } /* the header is 81 px tall from 640 px, 65 px below */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ----- Hero ----- */
.app-hero { margin: 0 0 2rem; text-align: center; }
.app-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 1.25rem; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--text-strong); }
.app-brand img { width: 44px; height: 44px; border-radius: 12px; display: block; }
.app-hero h1 { margin-bottom: 0.75rem; }
.app-tagline { color: var(--text-2); font-size: 1.125rem; line-height: 1.6; max-width: 46rem; margin: 0 auto; }

/* ----- Small helpers ----- */
main [hidden], .dialog [hidden], .session [hidden] { display: none !important; } /* the script hides parts that carry their own display */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-2); }
.small { font-size: 0.9rem; }
.block { display: block; }
.hint { color: var(--text-3); font-size: 0.8rem; font-weight: 400; line-height: 1.45; }
.err { color: var(--bad); font-size: 0.85rem; font-weight: 600; }
.err:empty { display: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link:hover { color: var(--link-hover); }
code { font-size: 0.85em; padding: 1px 6px; border-radius: 6px; background: var(--code-bg); color: var(--code-text); }
kbd { font-family: inherit; font-size: 0.72rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 9999px; font-family: inherit; font-weight: 600; font-size: 0.95rem; line-height: 1.2; padding: 12px 24px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn .ico { width: 17px; height: 17px; }
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text-strong); border: 1px solid var(--surface-border); padding: 11px 23px; }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--link); transform: translateY(-2px); }
.btn-danger { background: var(--surface); color: var(--danger); border: 1px solid rgba(185, 28, 28, 0.35); padding: 11px 23px; }
.btn-danger:hover:not(:disabled) { background: var(--danger-strong); color: #fff; border-color: transparent; transform: translateY(-2px); }
.btn-sm { font-size: 0.85rem; padding: 9px 16px; }
.btn-secondary.btn-sm, .btn-danger.btn-sm { padding: 8px 15px; }
.btn-stack { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); flex-shrink: 0; padding: 0; font-family: inherit; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.icon-btn:hover { border-color: var(--brand); color: var(--link); background: var(--surface); }
.icon-btn.del:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn:focus-visible, .link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Toolbar ----- */
.app-shell { margin: 0 0 3rem; scroll-margin-top: 90px; }
.app-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 0 0 1.25rem; }
.toolbar-left, .toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 10px; border-radius: 9999px; border: 1px solid var(--tint-brand-border); background: var(--tint-brand); min-width: 220px; max-width: 100%; }
.status-icon { font-size: 1.3rem; line-height: 1; }
.status-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.status-main { font-weight: 700; font-size: 0.85rem; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-sub { font-size: 0.72rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--surface-2); max-width: 100%; }
.view-tab { padding: 8px 16px; border: 0; border-radius: 9999px; background: transparent; font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.view-tab:hover { color: var(--link); }
.view-tab.active { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.view-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.view[hidden] { display: none; }
.shell-hint { margin-top: 14px; }

/* ----- Fields ----- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.label { font-weight: 600; font-size: 0.85rem; color: var(--text-strong); }
.input, .select { width: 100%; min-width: 0; min-height: 44px; padding: 10px 14px; background: var(--field); border: 1px solid var(--field-border); border-radius: 12px; font-family: inherit; font-size: 0.95rem; color: var(--text); outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder { color: var(--placeholder); }
.input[aria-invalid="true"] { border-color: var(--bad); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
input[type="time"].input { color-scheme: light; width: 9em; }
:root:not([data-theme="light"]) input[type="time"].input { color-scheme: dark; }
.select { width: auto; max-width: 100%; appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; cursor: pointer; }
.select option { color: #0a0a14; background: #fff; }
.num-input { width: 7.5em; }
.num-input.wide { width: 10em; }
.check-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 0.925rem; color: var(--text); padding: 4px 0; }
.check-row input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex-shrink: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.seg button:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.seg button[aria-checked="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--chip); font-family: inherit; font-size: 0.8rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.chip .ico { width: 15px; height: 15px; color: var(--link); }
.chip:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Windows ----- */
.dialog { margin: auto; border: 1px solid var(--surface-border); border-radius: 20px; padding: 0; width: min(520px, calc(100vw - 16px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); }
.dialog--narrow { width: min(420px, calc(100vw - 16px)); }
.dialog--wide { width: min(680px, calc(100vw - 16px)); }
.dialog::backdrop { background: rgba(10, 10, 20, 0.6); backdrop-filter: blur(6px); }
.dialog[open] { animation: pop 0.2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } }
.dialog-head { padding: 18px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-title { margin: 0; font-size: 1.15rem; }
.dialog-close { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: border-color 0.2s ease, color 0.2s ease; }
.dialog-close:hover { border-color: var(--brand); color: var(--link); }
.dialog-body { padding: 20px; overflow-y: auto; max-height: calc(100vh - 210px); display: flex; flex-direction: column; gap: 14px; }
.dialog-actions { padding: 14px 20px; border-top: 1px solid var(--surface-border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.confirm-message { margin: 0; color: var(--text); }
.help-body h3 { margin: 6px 0 0; font-size: 1rem; }
.help-body p { margin: 0; color: var(--text-2); }

/* ----- Toasts ----- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { pointer-events: auto; background: #0a0a14; color: #fff; border: 1px solid rgba(255, 255, 255, 0.12); border-left: 4px solid var(--brand); border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); min-width: 260px; max-width: 420px; font-size: 0.875rem; font-weight: 500; overflow-wrap: anywhere; animation: slideIn 0.3s ease; transition: opacity 0.3s ease, transform 0.3s ease; }
.toast button { background: none; border: 0; padding: 0; color: #c4b5fd; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; white-space: nowrap; }
.toast.leaving { opacity: 0; transform: translateX(40px); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.toast.good { border-left-color: #4ade80; }
.toast.bad { border-left-color: #f87171; }

/* ----- Information sections ----- */
.info-section { margin: 0 0 2.5rem; }
.info-section h2 { font-size: 1.75rem; margin: 0 0 1.25rem; }
.info-section .info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 1rem 0 1.5rem; }
.info-stack { display: grid; gap: 12px; }
.info-card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px; box-shadow: var(--surface-shadow); padding: 20px; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.info-card:hover { transform: translateY(-4px); box-shadow: var(--surface-hover-shadow); }
.info-card--small { padding: 16px; box-shadow: none; }
.info-card h3 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.info-card p { color: var(--text-2); margin-bottom: 0.75rem; }
.info-card p:last-child { margin-bottom: 0; }
.step-card { position: relative; padding-top: 24px; }
.step-num { position: absolute; top: -16px; left: 20px; width: 34px; height: 34px; border-radius: 50%; background: var(--gradient-brand); color: #fff; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 0.75rem; }
.step-head h3 { margin: 0; }
.step-emoji { font-size: 1.6rem; line-height: 1; }
.info-section details.info-card { padding: 0; }
.info-section details.info-card summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--text-strong); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.info-section details.info-card summary::-webkit-details-marker { display: none; }
.info-section details.info-card summary::after { content: '+'; color: var(--link); font-weight: 700; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.info-section details.info-card[open] summary::after { content: '\2212'; }
.info-section details.info-card p { padding: 0 20px 16px; margin: 0; color: var(--text-2); }






/* ===== Digital Mala components ===== */

/* ----- The site's text rules (p, ul, li, headings, tables) must not reach the tool: same weight as the site's, loaded later ----- */
:where(.app-shell) p, :where(.app-shell) ul, :where(.app-shell) ol, :where(.app-shell) li, :where(.dialog) p, :where(.focus) p { margin: 0; line-height: 1.5; }
:where(.app-shell) ul, :where(.app-shell) ol { padding: 0; list-style: none; }
:where(.app-shell) h2, :where(.app-shell) h3, :where(.app-shell) h4, :where(.dialog) h3 { margin: 0; line-height: 1.25; }
:where(.app-shell) th, :where(.app-shell) td, :where(.dialog) th, :where(.dialog) td { border: 0; padding: 0; }

/* ----- The tool's own colours: the mala's glow, a finished count, the pen's ink, the bead shadow, the calendar's blues (the
   original's, kept because the drawings read them) ----- */
:root {
    --glow: #c98a12;
    --done: #8a5a00;
    --ink: #a3241a;
    --bead-shadow: rgba(40, 30, 20, 0.22);
    --series: #2a78d6;
    --heat-0: #e6e8ec;
    --heat-1: #b7d3f6;
    --heat-2: #6da7ec;
    --heat-3: #2a78d6;
    --heat-4: #184f95;
    --grid: #e8eaee;
    --axis: #c3c8d0;
    --muted: #4b5563;
    --font-deva: "Tiro Devanagari Sanskrit", "Kohinoor Devanagari", "Nirmala UI", "Noto Serif Devanagari", "Mangal", serif;
}
:root:not([data-theme="light"]) {
    --glow: #f0b44a;
    --done: #f0b44a;
    --ink: #f0b24a;
    --bead-shadow: rgba(0, 0, 0, 0.6);
    --series: #3987e5;
    --heat-0: #23272e;
    --heat-1: #104281;
    --heat-2: #1c5cab;
    --heat-3: #2a78d6;
    --heat-4: #6da7ec;
    --grid: #23272e;
    --axis: #3c424c;
    --muted: #9ca3af;
}

/* ----- Long words (a name or a meaning typed without spaces) break inside the tool instead of widening the page ----- */
.app-shell, .dialog { overflow-wrap: anywhere; }
#placeBtn { max-width: 100%; }
#placeName { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ----- Layout of a view ----- */
.app-toolbar .view-tabs { flex: 0 1 auto; overflow-x: auto; scrollbar-width: thin; }
.toolbar-right { margin-left: auto; }
.view-tab { display: inline-flex; align-items: center; gap: 7px; position: relative; }
.view-tab .ico { width: 16px; height: 16px; }
.screen { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.screen:focus, .screen h2:focus { outline: none; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.view-head h2 { font-size: 1.5rem; color: var(--text-strong); }
.lead { margin-top: 4px; color: var(--text-2); max-width: 72ch; }
.card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); padding: 20px; min-width: 0; }
.block { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; min-height: 34px; }
.block-head h3 { font-size: 1.1rem; color: var(--text-strong); }
.num { font-variant-numeric: tabular-nums; }
.deva { font-family: var(--font-deva); }
.sub-line { display: block; }
.push { margin-right: auto; }
.empty { color: var(--text-2); border: 1px dashed var(--line-strong); border-radius: 14px; padding: 24px 12px; text-align: center; font-size: 0.925rem; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty p { max-width: 60ch; }
.empty-line { color: var(--text-2); font-size: 0.925rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; min-width: 0; max-width: 100%; }
.table-wrap:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; font-variant-numeric: tabular-nums; margin: 0; }
.data-table th, .data-table td { text-align: left; padding: 8px 14px 8px 0; border: 0; border-bottom: 1px solid var(--surface-border); white-space: nowrap; vertical-align: middle; color: var(--text); background: none; }
.data-table th { font-size: 0.8rem; color: var(--text-2); font-weight: 600; }
.data-table td.r, .data-table th.r { text-align: right; }
.data-table td.note { white-space: normal; min-width: 14ch; max-width: 40ch; color: var(--text-2); }
.data-table th.sr-th { font-size: 0; width: 44px; }
.range { width: 100%; margin: 0; accent-color: var(--brand); min-height: 28px; }
.deva-input { font-family: var(--font-deva); font-size: 1.1rem; }
.wide-select { width: 100%; }
.date-input { width: auto; color-scheme: light; }
:root:not([data-theme="light"]) .date-input { color-scheme: dark; }
.panel-row { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.panel-row .field { flex: 0 1 200px; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 24px; }

/* switches (the Clock's) */
.sw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--surface-border); }
.sw-row:first-child { border-top: 0; }
.sw-text { min-width: 0; flex: 1 1 200px; }
.switch { position: relative; width: 52px; height: 44px; flex: none; padding: 0; border: 0; background: transparent; cursor: pointer; }
.switch::before { content: ""; position: absolute; left: 3px; top: 8px; width: 46px; height: 28px; border-radius: 14px; background: var(--line-strong); transition: background 0.2s ease; }
.switch::after { content: ""; position: absolute; top: 12px; left: 7px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s ease; }
.switch[aria-checked="true"]::before { background: var(--gradient-brand); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 16px; }
.chip[aria-checked="true"], .chip[aria-pressed="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.chip[aria-checked="true"] .ico { color: inherit; }
.btn[aria-pressed="true"].btn-secondary { border-color: var(--brand); color: var(--link); background: var(--tint-brand); }

/* ----- Japa ----- */
.japa { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) {
    .japa { grid-template-columns: minmax(460px, 1.1fr) minmax(0, 0.9fr); }
    .stage-col { position: sticky; top: 96px; }
}
.stage-col { display: flex; flex-direction: column; gap: 12px; }
.side-col { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-content: start; min-width: 0; }
@media (min-width: 760px) and (max-width: 1099px) { .side-col { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.mantra-head { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; padding: 4px 0 2px; border: 0; background: transparent; text-align: center; border-radius: 12px; cursor: pointer; color: var(--text-strong); font: inherit; }
.mantra-head:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.m-text { font-size: clamp(1.6rem, 6vw, 2.3rem); line-height: 1.32; white-space: pre-line; overflow-wrap: anywhere; color: var(--text-strong); }
.m-text.mid { font-size: clamp(1.25rem, 4.6vw, 1.75rem); }
.m-text.long { font-size: clamp(1.02rem, 3.7vw, 1.3rem); line-height: 1.45; }
.m-iast { color: var(--text-2); font-size: 1rem; line-height: 1.35; max-width: 60ch; }
.m-iast.long { font-size: 0.88rem; }
.m-change { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; color: var(--link); font-size: 0.82rem; font-weight: 600; }
.m-change .ico { width: 16px; height: 16px; }
.mantra-head:hover .m-change { color: var(--link-hover); text-decoration: underline; }

/* The stage holds the mala. Its count sits inside the loop. */
.stage { position: relative; container-type: inline-size; width: min(100%, 640px, max(280px, calc((100svh - 81px - 330px) * 1.25))); aspect-ratio: 5 / 4; margin: 0 auto; cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; border-radius: 16px; }
.stage:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.mala-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.count-wrap { position: absolute; left: 12%; right: 12%; top: 46%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; text-align: center; }
.count { font-family: var(--font-deva); font-variant-numeric: lining-nums tabular-nums; font-size: 19cqw; line-height: 1; letter-spacing: -0.01em; color: var(--text-strong); transition: color 0.3s; }
.count.done { color: var(--done); }
.count-sub { margin-top: 0.4cqw; color: var(--text-2); font-size: max(0.82rem, 3.6cqw); font-weight: 600; }
.count-sub.done { color: var(--done); }
.stage-help { margin-top: 2cqw; color: var(--text-2); font-size: max(0.8rem, 3cqw); max-width: 70cqw; }
.breath { position: absolute; left: 50%; top: 50%; width: 46cqw; height: 46cqw; margin: -23cqw 0 0 -23cqw; border-radius: 50%; border: 2px solid var(--glow); opacity: 0; transform: scale(0.55); pointer-events: none; }
.stage.breathing .breath { opacity: 0.55; }
.stage.writing { cursor: crosshair; touch-action: none; }
.stage.writing .mala-canvas, .stage.writing .count-wrap { visibility: hidden; }
.pad-wrap { position: absolute; inset: 0; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); overflow: hidden; }
.pad { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.pad-guide { position: absolute; inset: 8%; display: grid; place-items: center; text-align: center; pointer-events: none; color: var(--text); opacity: 0.1; font-size: 16cqw; line-height: 1.15; overflow-wrap: anywhere; }
.pad-count { position: absolute; right: 12px; top: 8px; font-weight: 700; color: var(--text-2); font-size: 0.95rem; pointer-events: none; }

.tally { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 12px; border-top: 1px solid var(--surface-border); border-bottom: 1px solid var(--surface-border); padding: 8px 0; }
.t { display: flex; flex-direction: column; align-items: center; min-width: 0; position: relative; }
.t-val { font-weight: 700; font-size: 1.3rem; line-height: 1.25; white-space: nowrap; color: var(--text-strong); }
.t-lbl { font-size: 0.75rem; color: var(--text-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.t-bar { display: block; width: 70%; height: 3px; border-radius: 2px; background: var(--line); margin-top: 3px; overflow: hidden; }
.t-bar i { display: block; height: 100%; width: 0; background: var(--glow); border-radius: 2px; }
.target-line { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.target-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.target-bar i { display: block; height: 100%; width: 0; background: var(--glow); border-radius: 3px; transition: width 0.3s; }
.target-text { color: var(--text-2); font-weight: 600; white-space: nowrap; }

.japa-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.japa-actions .btn { padding: 10px 6px; font-size: 0.875rem; min-width: 0; }
.mode-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.mode-seg { flex: 1; flex-wrap: nowrap; }
.mode-seg button { flex: 1; padding: 8px 4px; min-width: 0; }
.mode-seg .ico { width: 16px; height: 16px; }
.mode-panel { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--surface-border); padding-top: 12px; }
.panel-switches { display: flex; flex-direction: column; }
.tiles-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.tiles-strip canvas { flex: none; width: 52px; height: 52px; border-radius: 8px; border: 1px solid var(--surface-border); background: var(--surface); }

.readouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; border-top: 1px solid var(--surface-border); }
.readout { display: flex; flex-direction: column; padding: 8px 0 10px; border-bottom: 1px solid var(--surface-border); min-width: 0; }
.r-label { font-size: 0.82rem; color: var(--text-2); font-weight: 600; }
.r-value { font-weight: 700; font-size: 1.45rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-strong); }
.r-sub { font-size: 0.8rem; color: var(--text-2); }
.day-line { color: var(--text); }
.about-meaning { font-size: 1rem; max-width: 64ch; color: var(--text); }

/* sankalpa */
.vow-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 900px) { .vow-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1360px) { .vow-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vow { display: flex; flex-direction: column; gap: 8px; }
.vow-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.vow-name { font-weight: 700; font-size: 1.02rem; color: var(--text-strong); overflow-wrap: anywhere; }
.vow-mantra { color: var(--text-2); font-size: 1rem; }
.vow-big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.vow-big b { font-size: 1.6rem; font-weight: 700; color: var(--text-strong); }
.vow-big span { color: var(--text-2); font-weight: 600; }
.bar { display: block; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--glow); }
.bar.thin { height: 5px; }
.bar.today i { background: var(--series); }
.vow-status { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.vow-status.ahead { color: var(--ok); }
.vow-status.behind { color: var(--warn); }
.vow-days { display: flex; flex-wrap: wrap; gap: 3px; }
.vow-days i { width: 10px; height: 10px; border-radius: 2px; background: var(--heat-0); }
.vow-days i.met { background: var(--heat-3); }
.vow-days i.part { background: var(--heat-1); }
.vow-days i.today { outline: 2px solid var(--text-strong); outline-offset: 1px; }
.vow-days i.future { background: transparent; border: 1px solid var(--line-strong); }
.vow-mini { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--surface-border); }
.vow-mini:first-child { border-top: 0; padding-top: 0; }
.vow-mini-top { display: flex; justify-content: space-between; gap: 8px; font-size: 0.9rem; color: var(--text); }
.vow-mini-top b { font-weight: 700; overflow-wrap: anywhere; }
.past-vows summary { cursor: pointer; font-weight: 600; color: var(--text-2); padding: 8px 0; }
.past-vows[open] .vow-list { margin-top: 8px; }
.vow-preview { font-weight: 600; min-height: 1.5em; color: var(--text); }

/* practice */
.practice-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 900px) { .practice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1360px) { .practice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.day-strip { height: 74px; position: relative; }
.day-strip svg { display: block; width: 100%; height: 74px; overflow: visible; }
.day-strip .night { fill: var(--surface-2); stroke: var(--surface-border); }
.day-strip .light { fill: var(--surface); stroke: var(--line-strong); }
.day-strip .win { fill: var(--glow); opacity: 0.28; }
.day-strip .win.on { opacity: 0.6; }
.day-strip .now { stroke: var(--text-strong); stroke-width: 2; }
.day-strip .lbl { fill: var(--muted); font-size: 11px; font-family: 'Inter', system-ui, sans-serif; }
.day-strip .sunline { fill: none; stroke: var(--glow); stroke-width: 2; }
.sandhya-list { display: flex; flex-direction: column; }
.sandhya-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 0; border-top: 1px solid var(--surface-border); }
.sandhya-list li.now { box-shadow: inset 3px 0 0 var(--glow); padding-left: 10px; }
.sandhya-list .s-name { font-weight: 700; color: var(--text-strong); }
.sandhya-list .s-time { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; color: var(--text); }
.sandhya-list .s-note { grid-column: 1 / -1; color: var(--text-2); font-size: 0.82rem; }
.steps summary { cursor: pointer; font-weight: 600; padding: 6px 0; color: var(--text-strong); }
.steps ol { margin: 6px 0 8px; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; list-style: decimal; color: var(--text); }
.steps ol li { padding-left: 2px; }
.tithi-now { font-size: 1.05rem; color: var(--text); }
.tithi-now b { font-weight: 700; color: var(--text-strong); }
.obs-list li { display: grid; grid-template-columns: 6.6em minmax(0, 1fr); gap: 2px 12px; padding: 9px 0; border-top: 1px solid var(--surface-border); }
.obs-list .o-date { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.obs-list .o-name { font-weight: 600; color: var(--text); }
.obs-list .o-span { grid-column: 2; color: var(--text-2); font-size: 0.82rem; }
.obs-list li:only-child { grid-template-columns: minmax(0, 1fr); }

/* mantras */
.filter-bar { display: flex; flex-direction: column; gap: 12px; }
.search { position: relative; display: block; max-width: 520px; }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 42px; }
.m-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 640px) { .m-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .m-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.m-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: start; padding: 16px; border: 1px solid var(--surface-border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--surface-shadow); text-align: left; width: 100%; color: inherit; font: inherit; cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.m-item:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--surface-hover-shadow); }
.m-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.m-item-text { font-size: 1.25rem; line-height: 1.35; color: var(--text-strong); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-item-name { font-weight: 700; font-size: 0.92rem; color: var(--text-strong); }
.m-item-meta { color: var(--text-2); font-size: 0.82rem; }
.m-item-side { grid-row: 1 / span 3; grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.m-item-count { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.9rem; color: var(--text); }
.m-item .tag { font-size: 0.75rem; font-weight: 700; color: #fff; background: var(--gradient-brand); border-radius: 9999px; padding: 2px 8px; }
.m-item .fav { width: 16px; height: 16px; color: var(--glow); fill: var(--glow); }
.md-text { font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.45; white-space: pre-line; color: var(--text-strong); overflow-wrap: anywhere; }
.md-alt { font-size: 1.5rem; line-height: 1.4; color: var(--text-strong); }
.md-iast { font-size: 1.05rem; color: var(--text-2); }
.md-meaning { font-size: 1rem; color: var(--text); }
.md-stats { display: flex; gap: 8px 24px; flex-wrap: wrap; border-top: 1px solid var(--surface-border); padding-top: 10px; }
.md-stats div { display: flex; flex-direction: column; }
.md-stats b { font-size: 1.2rem; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.md-stats span { color: var(--text-2); font-size: 0.8rem; font-weight: 600; }
#mdFav[aria-pressed="true"] .ico { fill: currentColor; }

/* journey */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; padding-top: 8px; padding-bottom: 8px; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; padding: 10px 0 12px; min-width: 0; }
.tile .r-value { font-size: 1.6rem; }
.heat-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.heat svg { display: block; max-width: none; height: auto; } /* keeps its size and scrolls sideways, as the original */
.heat .cell { stroke: var(--surface); stroke-width: 0; cursor: pointer; }
.heat .cell:hover, .heat .cell:focus { stroke: var(--text-strong); stroke-width: 1.5; outline: none; }
.heat .lbl { fill: var(--muted); font-size: 11px; font-family: 'Inter', system-ui, sans-serif; }
.legend { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; box-shadow: inset 0 0 0 1px var(--surface-border); }
.journey-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 1100px) { .journey-grid { grid-template-columns: 1.4fr 1fr; } }
.chart { position: relative; width: 100%; min-width: 0; height: 190px; }
.chart.short { height: 150px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .bar-mark { fill: var(--series); }
.chart .bar-mark.zero { fill: var(--line); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .bar-mark.hover { fill: var(--heat-4); }
.chart .goal { stroke: var(--text-strong); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .tick { fill: var(--muted); font-size: 11px; font-family: 'Inter', system-ui, sans-serif; }
.chart .goal-lbl { fill: var(--text-strong); font-size: 11px; font-weight: 600; font-family: 'Inter', system-ui, sans-serif; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.bars { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 48px; }
@media (min-width: 900px) { .bars { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bar-row { display: grid; grid-template-columns: minmax(0, 12em) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 0; border: 0; border-top: 1px solid var(--surface-border); font-size: 0.9rem; background: none; text-align: left; width: 100%; color: var(--text); font-family: inherit; }
button.bar-row { cursor: pointer; }
button.bar-row:hover .b-name { color: var(--link); }
.bar-row .b-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.bar-row .b-track { height: 10px; border-radius: 0 4px 4px 0; overflow: hidden; }
.bar-row .b-fill { display: block; height: 100%; background: var(--series); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-row .b-val { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.tip { position: fixed; z-index: 3100; pointer-events: none; max-width: 290px; background: var(--text-strong); color: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 0.85rem; line-height: 1.4; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.tip b { font-variant-numeric: tabular-nums; }

/* settings */
.set-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1360px) { .set-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.set { display: flex; flex-direction: column; gap: 0; }
.set h3 { margin-bottom: 4px; font-size: 1.1rem; color: var(--text-strong); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 0; border-bottom: 1px solid var(--surface-border); flex-wrap: wrap; }
.set-row:last-child { border-bottom: 0; }
.set-row.col { flex-direction: column; align-items: flex-start; }
.set-row.col > * { max-width: 100%; }
.set-row.col .range { width: 100%; }
.set-note { padding-top: 10px; }
.bead-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; width: 100%; }
.bead-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 1px solid var(--surface-border); border-radius: 12px; background: var(--surface); font-family: inherit; font-size: 0.78rem; font-weight: 600; line-height: 1.2; text-align: center; color: var(--text); cursor: pointer; transition: border-color 0.2s ease, transform 0.2s ease; }
.bead-pick canvas { width: 40px; height: 40px; }
.bead-pick:hover { border-color: var(--brand); transform: translateY(-1px); }
.bead-pick:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.bead-pick[aria-checked="true"] { box-shadow: 0 0 0 2px var(--brand); border-color: transparent; }
.thread-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.25); display: inline-block; flex: none; }

/* ----- Focus: the whole screen, black in both themes ----- */
.focus { position: fixed; inset: 0; z-index: 4000; background: #000; color: #f4efe6; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; cursor: pointer; container-type: inline-size; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.focus:focus { outline: none; }
.focus[hidden] { display: none; }
html:has(.focus:not([hidden])) { overflow: hidden; }
.focus-canvas { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: min(100vw, 125vh * 0.8); aspect-ratio: 5 / 4; display: block; }
.focus-count { position: absolute; left: 0; right: 0; top: 43%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.focus .count { color: #f4efe6; font-size: min(17vw, 20vh); }
.focus .count.done { color: #f0b44a; }
.focus .count-sub { color: #b4ad9f; font-size: max(1rem, min(4vw, 4.4vh)); }
.focus.hide-num .focus-count { visibility: hidden; }
.focus-dim { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.focus-bar { position: absolute; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 0 16px; }
.focus-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 9999px; border: 1px solid #4a505a; background: rgba(255, 255, 255, 0.06); color: #e2ddd2; font-family: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.focus-btn:hover { background: rgba(255, 255, 255, 0.12); border-color: #c4b5fd; }
.focus-btn:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
.focus-btn[aria-pressed="true"] { background: #f4efe6; color: #000; }
.focus-hint { position: absolute; left: 0; right: 0; top: calc(16px + env(safe-area-inset-top)); text-align: center; color: #a39d92; font-size: 0.95rem; pointer-events: none; transition: opacity 0.6s; }
.focus.quiet .focus-bar, .focus.quiet .focus-hint { opacity: 0.35; }
body.focusing .toasts { bottom: 90px; z-index: 4100; }

/* ----- Windows ----- */
.dialog .field > .label { font-weight: 600; font-size: 0.85rem; color: var(--text-strong); }
.dialog form { display: contents; }
.end-sum { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.nb-nav { display: flex; align-items: center; justify-content: center; gap: 12px; }
.nb-page { font-weight: 600; min-width: 12ch; text-align: center; font-variant-numeric: tabular-nums; color: var(--text); }
.nb-canvas { width: 100%; height: auto; display: block; border: 1px solid var(--surface-border); border-radius: 10px; background: #ffffff; }
.share-canvas { width: min(100%, 340px); height: auto; display: block; margin: 0 auto; border-radius: 12px; border: 1px solid var(--surface-border); }
.day-mantras { display: flex; flex-direction: column; }
#ddBody h3 { margin: 10px 0 0; font-size: 1rem; color: var(--text-strong); }
.dialog-actions .push { margin-right: auto; }

/* ----- Phones ----- */
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .app-toolbar { gap: 10px; }
    .toolbar-left, .toolbar-right { width: 100%; }
    .status-pill { min-width: 0; flex: 1 1 auto; }
    /* five tabs at 16 px do not fit one row on a phone: three, then two wider ones */
    .app-toolbar .view-tabs { width: 100%; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; border-radius: 24px; }
    .view-tab { grid-column: span 2; justify-content: center; padding: 8px 6px; gap: 5px; min-width: 0; }
    .view-tab:nth-child(n+4) { grid-column: span 3; }
    .toolbar-right .btn { flex: 1 1 auto; }
    .card { padding: 16px; }
    .japa-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mode-row > .label { display: none; }
    .toasts { bottom: 16px; right: 16px; left: 16px; align-items: stretch; }
    .toast { min-width: 0; max-width: none; }
    .dialog-body, .dialog-head, .dialog-actions { padding-left: 16px; padding-right: 16px; }
    .info-section h2 { font-size: 1.4rem; }
    .info-section .info-grid, .info-three { grid-template-columns: 1fr; }
    .info-card { padding: 16px; }
    .step-num { left: 16px; }
    .bar-row { grid-template-columns: minmax(0, 9em) minmax(0, 1fr) auto; }
    .focus-btn { padding: 8px 12px; }
}
@media (max-width: 459px) {
    .view-tab .ico, .mode-seg .ico { display: none; }
    .focus-btn .ico { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .btn, .info-card, .dialog, .dialog[open], .toast, .seg button, .chip, .view-tab, .switch::before, .switch::after, .m-item,
    .bead-pick, .count, .target-bar i, .focus-dim, .focus-hint { transition: none; animation: none; }
}
@media (forced-colors: active) {
    .bar i, .target-bar i, .t-bar i, .bar-row .b-fill, .legend i, .vow-days i { forced-color-adjust: none; }
    .heat .cell { stroke: CanvasText; stroke-width: 0.5; }
}
@media print {
    .app-toolbar, .japa-actions, .mode-row, .mode-panel, .actions, .theme-toggle { display: none !important; }
}
/* Phones: 16 px text, 44 px tap targets (AdSense audit H-04, 8 Oct 2026). The mala, the charts and the calendar are drawings. */
@media (max-width: 639.98px) {
    main button, main select, main summary, main [role="button"],
    main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]) { min-height: 44px; }
    main .seg button, main .view-tab, main .chip, main .bead-pick { min-height: 44px; }
    main .icon-btn { width: 44px; height: 44px; min-width: 44px; }
    main .range { min-height: 44px; }
    main :is(p, li, .hint, .label, .status-main, .status-sub, .form-hint, .input, .select, kbd, .seg button, .chip, .lead,
        .r-label, .r-sub, .t-lbl, .legend, .s-note, .o-span, .o-name, .m-item-name, .m-item-meta, .m-item-count, .vow-status,
        .vow-mini-top, .target-text, .bar-row, .data-table, .data-table th, .m-change, .count-sub, .stage-help, .bead-pick,
        .steps summary, .past-vows summary, .view-tab, .japa-actions .btn, .btn-sm, .day-line, .about-meaning, .tithi-now) { font-size: 1rem; }
    .dialog button, .dialog .btn, .dialog select, .dialog input:not([type="checkbox"]):not([type="range"]) { min-height: 44px; }
    .dialog .range, .dialog summary { min-height: 44px; }
    .dialog summary { display: flex; align-items: center; }
    main .chip, .dialog .chip { min-width: 44px; justify-content: center; }
    .dialog .dialog-close, .dialog .icon-btn { width: 44px; height: 44px; }
    .dialog :is(p, .hint, .label, .input, li, kbd, .md-stats span, .seg button, .chip, summary) { font-size: 1rem; }
    .focus :is(p, .focus-btn) { font-size: 1rem; }
}
