/*
 * Relationship Calculator: the tool's own components, styled in the site's design language (12 Nov 2026, automatic mode,
 * on the UltraCompress Pro template). The first part copies the Love Calculator's shared block (tokens, page, hero,
 * buttons, toolbar and pill tabs, fields, windows, toasts, information sections). Base: /libs/site-pages.css (tokens,
 * Inter and Space Grotesk, theme toggle, focus rings) and /libs/shared-nav.css (the site's header and footer). The second
 * part is the original's components (the name form and its woven band, the relationship picker, the result, My circle,
 * the play area, the five questions and the share picture) on the site's tokens, with the original's rose accent as the
 * tool's own colour. The original's Google Fonts (Bricolage Grotesque and Figtree), its twill page, its own theme, its
 * narrow column and its bottom tab bar are gone. Light is the default; dark applies when <html> has no data-theme.
 * Written once from the Love Calculator's file and the original's styles, then edited by hand: this file is the source.
 */


/* ----- 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] { display: none !important; } /* the script hides fields 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); }


/* ===== Relationship Calculator components ===== */

/* ----- The site's text rules (p, ul, li, headings) must not reach the tool: same weight as the site's, loaded later ----- */
:where(.app-shell) p, :where(.app-shell) ul, :where(.app-shell) li, :where(.dialog) p { margin: 0; line-height: 1.5; }
:where(.app-shell) ul { padding: 0; list-style: none; }
:where(.app-shell) h2, :where(.app-shell) h3, :where(.app-shell) h4, :where(.dialog) h2 { margin: 0; line-height: 1.25; }
:root { --head: 81px; }
@media (max-width: 639.98px) { :root { --head: 65px; } }

/* ----- Cards: the site's white cards, one layer ----- */
.card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card:empty { display: none; }

/* ----- The tool's colours: the original's rose accent and warm notes, and the band's neutral threads per theme ----- */
:root {
    --rc-accent: #be185d;
    --rc-accent-soft: #fdf2f8;
    --rc-accent-line: #fbcfe8;
    --rc-sun-soft: #fff6dc;
    --rc-sun-ink: #5c3d00;
    --rc-sunk: #eef0f6;
    --rc-n1: #C9CDE4; --rc-n2: #DADDEE; --rc-n3: #B9BEDA; --rc-n4: #EDEFF8;
    --rc-band-gap: #141736;
}
:root:not([data-theme="light"]) {
    --rc-accent: #f9a8d4;
    --rc-accent-soft: rgba(244, 114, 182, 0.12);
    --rc-accent-line: rgba(244, 114, 182, 0.34);
    --rc-sun-soft: rgba(251, 191, 36, 0.12);
    --rc-sun-ink: #fde68a;
    --rc-sunk: rgba(255, 255, 255, 0.07);
    --rc-n1: #2C3162; --rc-n2: #363B73; --rc-n3: #252A57; --rc-n4: #3F4581;
    --rc-band-gap: #090B1C;
}
/* The two names' thread colours (set by the script on the form, the result and the play area). */
.app-shell { --a: var(--line-strong); --b: var(--line-strong); --a-on: var(--text-strong); --b-on: var(--text-strong); }

/* ----- Shared pieces ----- */
.app-shell { scroll-margin-top: calc(var(--head) + 16px); }
/* Names of up to 24 letters without a space must wrap, not push the page sideways. */
.app-shell :is(p, h2, h3, h4, li, b, strong) { overflow-wrap: anywhere; }
.view { min-width: 0; }
.view-head { margin-bottom: 20px; }
.view-title { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); color: var(--text-strong); }
.lede { color: var(--text-2); font-size: 1.05rem; margin-top: 8px; max-width: 46rem; }
.card-title { font-size: 1.2rem; color: var(--text-strong); outline: none; }
.sub-title { font-size: 1.1rem; color: var(--text-strong); }
.back-link { align-self: flex-start; color: var(--text-2); padding: 6px 0; }
.form-error { color: var(--bad); font-weight: 600; }
.form-error:empty { display: none; }
.view-tab .count { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 9999px; background: #be185d; color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 20px; text-align: center; }
.view-tab.active .count { background: #fff; color: #9d174d; }
.band { position: relative; height: 56px; border-radius: 12px; overflow: hidden; background: var(--rc-sunk); }
.band canvas { display: block; width: 100%; height: 100%; }
.em { flex: none; font-size: 1.3rem; line-height: 1; white-space: nowrap; }
.em.duo { position: relative; width: 2rem; height: 1.75rem; }
.em.duo span { position: absolute; left: 0; top: 0; line-height: 1; }
.em.duo span + span { left: auto; top: auto; right: -1px; bottom: -1px; font-size: 0.92rem; }

/* ----- Calculate: the form ----- */
.rc-form { display: grid; gap: 20px; }
.form-head { min-width: 0; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: end; }
.input.name-input { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.2rem; border-bottom-width: 4px; }
.fa .name-input.has { border-bottom-color: var(--a); }
.fb .name-input.has { border-bottom-color: var(--b); }
.amp { padding-bottom: 12px; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 800; font-size: 1.5rem; line-height: 1; color: var(--text-3); }
.band-note { font-size: 0.9rem; color: var(--text-2); min-height: 1.4em; }
.rel-search { position: relative; }
.rel-search .ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.rel-search .input { padding-left: 42px; border-radius: 9999px; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cat { display: inline-flex; align-items: center; padding: 8px 15px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-size: 0.88rem; 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; }
.cat:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.cat[aria-pressed="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.cat:focus-visible, .rel:focus-visible, .next:focus-visible, .opt:focus-visible, .vote:focus-visible, .bond-main:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.rels { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rel { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-weight: 600; font-size: 0.92rem; line-height: 1.2; text-align: left; color: var(--text-strong); cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease; }
.rel:hover { border-color: var(--brand); transform: translateY(-1px); }
.rel .lb { min-width: 0; overflow-wrap: anywhere; }
.rel[aria-pressed="true"] { border-color: var(--rc-accent); background: var(--rc-accent-soft); box-shadow: inset 0 0 0 1px var(--rc-accent); }
.none { grid-column: 1 / -1; padding: 12px 0; color: var(--text-2); }
.go { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.btn.btn-big { width: 100%; min-height: 56px; font-size: 1.1rem; white-space: normal; }
.go .alt { align-self: center; padding: 8px 4px; text-align: center; font-weight: 600; }

@media (min-width: 900px) {
    .rc-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-areas: "head picker" "names picker" "go picker"; column-gap: 32px; align-items: start; }
    .form-head { grid-area: head; }
    .names-card { grid-area: names; }
    .picker { grid-area: picker; }
    .go { grid-area: go; }
}

/* ----- Calculate: the result ----- */
.res { display: grid; gap: 24px; }
.res-hero { min-width: 0; }
.res-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-tag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 9999px; background: var(--rc-sunk); font-weight: 600; font-size: 0.9rem; color: var(--text-2); overflow-wrap: anywhere; }
.chip-tag.deep { background: var(--rc-sun-soft); color: var(--rc-sun-ink); }
.names { margin-top: 14px; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 800; font-size: clamp(1.9rem, 1.2rem + 3vw, 3rem); line-height: 1.12; letter-spacing: -0.02em; color: var(--text-strong); outline: none; }
.names .n { text-decoration: underline; text-decoration-thickness: 0.11em; text-underline-offset: 0.16em; text-decoration-skip-ink: none; }
.names .na { text-decoration-color: var(--a); }
.names .nb { text-decoration-color: var(--b); }
.names .and { color: var(--text-3); }
.score-row { display: flex; flex-wrap: wrap; align-items: flex-end; column-gap: 20px; row-gap: 6px; margin-top: 18px; }
.score { display: flex; align-items: flex-start; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 800; font-size: clamp(5.5rem, 3rem + 10vw, 9rem); line-height: 0.8; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.score .pct { margin: 0.14em 0 0 0.06em; font-size: 0.32em; line-height: 1; letter-spacing: 0; color: var(--text-2); }
.score-meta { padding-bottom: 6px; min-width: 0; }
.score-label { font-weight: 600; font-size: 0.95rem; color: var(--text-2); }
.tier { margin-top: 2px; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: clamp(1.4rem, 1rem + 1.6vw, 2rem); line-height: 1.1; color: var(--rc-accent); overflow-wrap: anywhere; }
.tier, .tier-line, .peace { opacity: 0; transform: translateY(8px); transition: opacity 0.45s ease, transform 0.45s ease; }
.res.done .tier, .res.done .tier-line, .res.done .peace { opacity: 1; transform: none; }
.res .band { height: 72px; margin-top: 20px; border-radius: 14px; }
.res .band canvas { clip-path: inset(0 100% 0 0); transition: clip-path 1.5s cubic-bezier(0.3, 0.7, 0.2, 1); }
.res .band.woven canvas { clip-path: inset(0 0 0 0); }
.tier-line { margin-top: 14px; max-width: 44ch; font-size: 1.08rem; color: var(--text-2); }
.peace { margin-top: 8px; font-weight: 600; color: var(--text); }
.peace b { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.2rem; }
.made-of { margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: var(--rc-sunk); color: var(--text); font-size: 0.95rem; max-width: 46rem; }
.care { margin-top: 12px; border-left: 4px solid var(--rc-accent); padding: 2px 0 2px 14px; color: var(--text); max-width: 46rem; }
.res-cards { display: grid; gap: 16px; min-width: 0; }
.dims { display: grid; gap: 14px; }
.dim-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-weight: 600; color: var(--text-strong); }
.dim-top .tag { margin-left: 8px; padding: 2px 8px; border-radius: 9999px; background: var(--rc-sun-soft); color: var(--rc-sun-ink); font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.dim-top .tag.low { background: var(--rc-sunk); color: var(--text-2); }
.dim-top .val { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-variant-numeric: tabular-nums; }
.dim-bar { height: 12px; margin-top: 6px; border-radius: 9999px; background: var(--rc-sunk); overflow: hidden; }
.dim-fill { width: 0; height: 100%; border-radius: 9999px; background: repeating-linear-gradient(-55deg, var(--a) 0 7px, var(--b) 7px 14px); transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.card.note { background: var(--rc-sun-soft); border-color: transparent; box-shadow: none; }
.card.note .card-title, .card.note p { color: var(--rc-sun-ink); }
.plain { display: grid; gap: 10px; }
.plain li { position: relative; padding-left: 22px; color: var(--text); }
.plain li::before { content: ""; position: absolute; left: 2px; top: 0.52em; width: 9px; height: 9px; border-radius: 2px; background: var(--a); transform: rotate(45deg); }
.plain li:nth-child(even)::before { background: var(--b); }
.idea { font-size: 1.08rem; font-weight: 500; color: var(--text); }
.bubble { padding: 14px 16px; border: 1px solid var(--surface-border); border-radius: 20px 20px 20px 6px; background: var(--surface-2); font-size: 1.05rem; font-weight: 500; color: var(--text); }
.res-actions .btn { white-space: normal; text-align: center; }
.nexts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.next { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-weight: 600; font-size: 0.9rem; color: var(--text-strong); cursor: pointer; transition: border-color 0.2s ease, transform 0.2s ease; }
.next:hover { border-color: var(--brand); transform: translateY(-1px); }
.res-again { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }

@media (min-width: 900px) {
    .res { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "hero cards" "actions cards" "next cards" "again cards"; column-gap: 40px; align-items: start; grid-template-rows: auto auto auto 1fr; }
    .res-hero { grid-area: hero; }
    .res-cards { grid-area: cards; }
    .res-actions { grid-area: actions; }
    .res-next { grid-area: next; }
    .res-again { grid-area: again; }
}

/* ----- My circle ----- */
.circle-grid { display: grid; gap: 20px; }
.circle-side { display: grid; gap: 20px; min-width: 0; align-content: start; }
.card.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat b { display: block; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 800; font-size: 1.6rem; line-height: 1.05; color: var(--text-strong); }
.stat span { display: block; margin-top: 4px; font-size: 0.85rem; color: var(--text-2); overflow-wrap: anywhere; }
.card.today { background: var(--rc-sun-soft); border-color: transparent; box-shadow: none; gap: 6px; }
.card.today .card-title, .card.today p { color: var(--rc-sun-ink); }
.today .who { font-weight: 600; }
.today .what { font-size: 1.1rem; font-weight: 500; }
.today .actions { margin-top: 8px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--text-2); font-size: 0.82rem; line-height: 1.3; }
.badge b { display: block; font-size: 0.92rem; color: var(--text-strong); }
.badge.on { border: 1px solid transparent; background: var(--gradient-brand); color: #fff; }
.badge.on b { color: #fff; }
.empty-card p { color: var(--text-2); max-width: 40rem; }
.circle-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.bonds { display: grid; gap: 12px; }
.card.bond { padding: 0; gap: 0; overflow: hidden; }
.bond .band.strip { height: 16px; border-radius: 0; }
.bond-main { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px 6px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.bond-text { display: flex; flex-direction: column; min-width: 0; }
.bond-names { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.1rem; line-height: 1.15; color: var(--text-strong); overflow-wrap: anywhere; }
.bond-rel { margin-top: 2px; font-size: 0.88rem; color: var(--text-2); overflow-wrap: anywhere; }
.bond-score { margin-left: auto; padding-left: 8px; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 800; font-size: 1.6rem; line-height: 1; color: var(--text-strong); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bond-score small { font-size: 0.5em; color: var(--text-2); }
.bond-acts { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0 16px 12px; }
.bond-acts .link { padding: 6px 0; font-size: 0.9rem; font-weight: 600; }
.foot { justify-content: space-between; margin-top: 4px; }

@media (min-width: 900px) {
    .circle-grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: start; }
    .empty-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ----- Play ----- */
.play-grid { display: grid; gap: 20px; }
.play-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card.setup { padding: 0; gap: 0; }
.setup summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; font-weight: 600; color: var(--text-strong); cursor: pointer; list-style: none; border-radius: var(--radius-lg); }
.setup summary::-webkit-details-marker { display: none; }
.setup summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
#setupSum { min-width: 0; overflow-wrap: anywhere; }
.chg { flex: none; font-size: 0.9rem; color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.setup[open] .chg.closed, .setup:not([open]) .chg.opened { display: none; }
.players { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 0 18px; }
.pa .input { border-bottom: 4px solid var(--a); }
.pb .input { border-bottom: 4px solid var(--b); }
.deck { padding: 12px 18px 18px; }
.deck .select { width: 100%; }
.game-seg button { flex: 1 1 auto; }
.game-seg button[aria-pressed="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.play-area { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card.pcard { min-height: 200px; justify-content: center; padding: 26px 24px; gap: 8px; }
.pcard .pre { font-weight: 600; color: var(--text-2); }
.pcard .q { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.3rem); line-height: 1.12; color: var(--text-strong); }
.pcard .sub { color: var(--text-2); }
.pcard.pop { animation: pcpop 0.28s ease; }
@keyframes pcpop { from { transform: scale(0.97); opacity: 0.4; } to { transform: none; opacity: 1; } }
.votes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.vote { min-height: 66px; padding: 8px 12px; border: 0; border-radius: 18px; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.15rem; line-height: 1.1; overflow-wrap: anywhere; cursor: pointer; transition: transform 0.12s ease; }
.vote:hover { transform: translateY(-1px); }
.vote:active { transform: scale(0.97); }
.vote.a { background: var(--a); color: var(--a-on); }
.vote.b { background: var(--b); color: var(--b-on); }
.vote.both { grid-column: 1 / -1; min-height: 46px; border: 1px solid var(--chip-border); background: var(--surface); color: var(--text-strong); font-family: inherit; font-weight: 600; font-size: 0.95rem; }
.prog { display: flex; gap: 5px; }
.prog i { flex: 1; height: 5px; border-radius: 9999px; background: var(--rc-sunk); }
.prog i.on { background: var(--text-strong); }
.tally { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.tally div { padding: 12px 14px; border-radius: 16px; font-weight: 700; overflow-wrap: anywhere; }
.tally .a { background: var(--a); color: var(--a-on); }
.tally .b { background: var(--b); color: var(--b-on); }
.tally b { display: block; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 800; font-size: 2rem; line-height: 1; }

@media (min-width: 900px) {
    .play-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start; }
}

/* ----- Windows: the five questions and the share picture ----- */
.q-step { font-weight: 600; color: var(--text-2); }
.q-title { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); line-height: 1.2; color: var(--text-strong); outline: none; overflow-wrap: anywhere; }
.opts { display: grid; gap: 8px; }
.opt { min-height: 52px; padding: 10px 16px; border: 1px solid var(--chip-border); border-radius: 14px; background: var(--surface); font-family: inherit; font-weight: 600; font-size: 1rem; line-height: 1.3; color: var(--text-strong); text-align: left; cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease; }
.opt:hover { border-color: var(--brand); }
.opt.sel { border-color: var(--rc-accent); background: var(--rc-accent-soft); }
#cardImg { display: block; width: 100%; height: auto; max-height: 62vh; object-fit: contain; border-radius: 14px; background: var(--rc-sunk); }
#confetti { position: fixed; inset: 0; z-index: 55; width: 100%; height: 100%; pointer-events: none; display: none; }

/* ----- Phones ----- */
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .app-toolbar { padding-right: 52px; } /* the site's round theme button sits at the top right on phones (45 px, 15 px from the edge) */
    .view-tabs { display: flex; width: 100%; border-radius: 22px; }
    .view-tab { flex: 1 1 auto; padding: 8px 6px; }
    .card { padding: 16px; }
    .card.pcard { padding: 22px 18px; }
    .rels { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .card.stats { gap: 8px; }
    .stat b { font-size: 1.35rem; }
    .players { padding: 0 16px; }
    .deck { padding: 12px 16px 16px; }
    .setup summary { padding: 12px 16px; }
    .bond-main { padding: 12px 14px 6px; }
    .bond-acts { padding: 0 14px 10px; }
    .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; }
}

@media (prefers-reduced-motion: reduce) {
    .btn, .info-card, .dialog, .toast, .seg button, .cat, .rel, .next, .vote, .opt, .tier, .tier-line, .peace,
    .res .band canvas, .dim-fill, .pcard.pop, .input { transition: none; animation: none; }
}

/* Phones: 16 px text, 44 px tap targets (AdSense audit H-04, 8 Oct 2026). The bands 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"]) { min-height: 44px; }
    main .seg button, main .view-tab, main .cat, main .next { min-height: 44px; }
    main .view-tab, main .back-link, main .bond-acts .link, main .go .alt { min-width: 44px; }
    main :is(p, li, .label, .input, .select, .seg button, .view-tab, .muted, .cat, .rel, .chip-tag, .dim-top, .tag, .badge, .badge b,
        .stat span, .bond-rel, .next, .link, .band-note, .score-label, .chg, #setupSum, .made-of):not(.tier-line, .idea, .bubble, .what, .q, .names, .lede) { font-size: 1rem; }
    .dialog button, .dialog .btn, .dialog input:not([type="checkbox"]) { min-height: 44px; }
    .dialog .dialog-close { width: 44px; height: 44px; }
    .dialog :is(p, .label, .input, .opt, .q-step) { font-size: 1rem; }
}
