/* Ape Chronicles (/chronicle/<collection>/<mint>, chronicle1, Mortimer, 04-11-2026). The ape's book: its portrait and seals
   in the header, the sealed chronicles in the /story timeline (story.css: .sr-*), each owner's era marked on the line,
   the chronicle in the vote drawn like the roadmap (dashed), the record of every version and vote, and a side column with
   the votes, the owner's panel and the lore rules. Parchment gold (--chr) is the colour of a seal. Text never under 12 px. */
.chr-page [hidden], .chr-editor [hidden] { display: none !important; }   /* .btn and the panels set their own display */
.chr-hero, .chr-page, .chr-editor { --chr: #e8c27a; --chr-deep: #b8873b; --chr-soft: rgba(232, 194, 122, 0.12); --chr-line: rgba(232, 194, 122, 0.34); }

/* ---------- The header: the portrait, the title, the chips and the four figures ---------- */
.chr-hero { text-align: left; }
.chr-hero-grid { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 36px; align-items: center; max-width: 1080px; margin: 0 auto; }
.chr-portrait { position: relative; margin: 0; width: 236px; aspect-ratio: 1; border-radius: 28px; isolation: isolate; }
.chr-portrait img, .chr-portrait-ph { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 26px;
    background: #0b0618; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08); }
.chr-portrait-ph { display: grid; place-items: center; font-size: 2rem; font-weight: 900; color: var(--muted); }
.chr-portrait-ring { position: absolute; inset: -5px; z-index: 0; border-radius: 31px;
    background: conic-gradient(from 210deg, var(--tc, var(--cyan)), var(--chr), var(--violet), var(--tc, var(--cyan)));
    filter: blur(0.3px); opacity: 0.9; box-shadow: 0 0 60px -6px color-mix(in srgb, var(--tc, #00ddeb) 55%, transparent); }
.chr-portrait-seal { position: absolute; z-index: 2; right: -14px; bottom: -14px; width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #f7dfa6, var(--chr) 45%, var(--chr-deep)); box-shadow: 0 10px 26px -6px rgba(0, 0, 0, 0.7), 0 0 0 4px var(--bg-1), 0 0 26px rgba(232, 194, 122, 0.55);
    transform: rotate(-12deg); }
.chr-portrait-seal svg { width: 40px; height: 40px; }
.chr-portrait-seal svg path:first-child { fill: rgba(80, 48, 10, 0.18); stroke: rgba(80, 48, 10, 0.55); stroke-width: 1; }
.chr-seal-tick { fill: none; stroke: #3b2405; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chr-hero-text .eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--chr); }
.chr-scroll { width: 1.05em; height: 1.05em; flex: none; fill: currentColor; }
.chr-hero h1 { margin: 10px 0 12px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; }
.chr-hero h1 .c { color: var(--chr); background: linear-gradient(100deg, #f7dfa6, var(--chr) 45%, #f0b45a); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.chr-hero-text > p { max-width: 640px; margin: 0; color: #cdd5e3; font-size: 1.04rem; line-height: 1.6; }
.chr-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chr-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 5px 14px; border-radius: 999px; font-size: 0.86rem; font-weight: 700;
    color: #e6ebf3; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.chr-chip--tier i { width: 10px; height: 10px; border-radius: 50%; background: var(--tc, var(--cyan)); box-shadow: 0 0 10px var(--tc, var(--cyan)); }
a.chr-chip--tier:hover { border-color: var(--tc, var(--cyan)); background: rgba(255, 255, 255, 0.09); }
.chr-chip--holder { padding-left: 4px; }
.chr-chip--holder small { color: var(--muted); font-weight: 500; font-size: 0.82rem; }
.chr-chip--dh .dh-gem { width: 18px; height: 18px; }
.chr-chip--legend { color: #67e8f9; border-color: rgba(103, 232, 249, 0.35); }
.chr-chip--diamond { color: #f0abfc; border-color: rgba(240, 171, 252, 0.35); }
.chr-chip--gold { color: #facc15; border-color: rgba(250, 204, 21, 0.35); }
.chr-chip--stone { color: #cbd5e1; }
.chr-chip--fresh { color: #86efac; }
.chr-chip--team { color: #fbbf24; background: rgba(251, 191, 36, 0.08); border: 1px dashed rgba(251, 191, 36, 0.45); }
.chr-who { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: #fff; vertical-align: middle; }
.chr-who img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: rgba(255, 255, 255, 0.08); }
a.chr-who:hover span { color: var(--chr); }
.chr-who--chip img { width: 28px; height: 28px; }

.chr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; max-width: 1080px; margin: 34px auto 0; border-radius: 18px; overflow: hidden;
    background: var(--line); border: 1px solid var(--line); }
.chr-stats div { margin: 0; padding: 16px 20px; background: rgba(14, 6, 32, 0.92); }
.chr-stats dt { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.chr-stats dd { margin: 4px 0 0; font-size: 1.55rem; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
.chr-stat-chain dd { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; color: #5eead4; padding-top: 7px; }
.chr-stat-chain svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.chr-stat-chain.is-bad dd { color: #fca5a5; }

/* ---------- The page: the book and the side column ---------- */
.chr-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; max-width: 1180px; margin: 0 auto; align-items: start; }
.chr-main { min-width: 0; display: grid; gap: 40px; }
.chr-side { display: grid; gap: 18px; position: sticky; top: 92px; }
.chr-sr { max-width: none; }

/* An owner's era on the line: the seal on the timeline, who wrote it, when it was sealed */
.chr-era { position: relative; display: flex; align-items: center; min-height: 56px; padding: 4px 0 4px 64px; }
.chr-era + .sr-ch { margin-top: -6px; }
.chr-era-dot { position: absolute; left: calc(var(--sr-x) - 17px); top: 50%; width: 34px; height: 34px; margin-top: -17px; display: grid; place-items: center; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #f7dfa6, var(--chr) 45%, var(--chr-deep)); box-shadow: 0 0 0 4px var(--bg-1), 0 0 22px rgba(232, 194, 122, 0.6); }
.chr-era-dot svg { width: 24px; height: 24px; }
.chr-era-dot svg path:first-child { fill: rgba(80, 48, 10, 0.16); stroke: rgba(80, 48, 10, 0.5); stroke-width: 1; }
.chr-era-text { display: grid; gap: 3px; }
.chr-era-text > b { font-size: 0.78rem; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--chr); }
.chr-era-text > span { font-size: 0.95rem; color: #dbe2ee; }
.chr-era-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1.22rem; font-weight: 800; color: #f4f6fb; line-height: 1.3; }
.chr-era-name .chr-who { font-size: inherit; font-weight: inherit; }
.chr-era-team { color: #fbbf24 !important; font-size: 0.86rem !important; }
.chr-era-note { color: var(--muted) !important; font-size: 0.86rem !important; }
.chr-era.is-closed .chr-era-dot { filter: saturate(0.6); }

/* The chapters: the /story card with the seal's gold instead of the cyan */
.chr-ch .sr-meta time { color: var(--chr); }
.chr-badge { color: #f3d9a1; background: var(--chr-soft); border: 1px solid var(--chr-line); }
.chr-ch.is-done .sr-node { border-color: var(--chr); box-shadow: 0 0 14px rgba(232, 194, 122, 0.55); }
.chr-ch.is-done.is-lit .sr-node, .chr-ch.is-done.is-focus .sr-node { background: var(--chr); box-shadow: 0 0 0 4px rgba(232, 194, 122, 0.16), 0 0 18px rgba(232, 194, 122, 0.85); }
.chr-ch.is-done .sr-node::after { border-color: rgba(232, 194, 122, 0.7); }
.chr-sr .sr-line::before { background: linear-gradient(180deg, var(--chr), var(--orange) 50%, var(--violet)); }
.chr-sr .sr-line-fill { background: linear-gradient(180deg, var(--chr), var(--orange) 50%, var(--violet)) 0 0 / 100% var(--sr-done, 100%) no-repeat;
    box-shadow: 0 0 14px rgba(232, 194, 122, 0.55), 0 0 30px rgba(249, 115, 22, 0.3); }
.chr-sr .sr-line::after { display: none; }
.chr-ch.is-focus article { box-shadow: 0 24px 70px -18px rgba(232, 194, 122, 0.35), 0 0 90px -20px rgba(147, 112, 219, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04); }
.chr-body { color: #d6dce8; line-height: 1.7; font-size: 1.02rem; overflow-wrap: anywhere; }
.chr-body p { margin: 0 0 0.85em; }
.chr-body p:last-child { margin-bottom: 0; }
.chr-body strong { color: #fff; }
.chr-body em { color: #f3e6c8; }
/* chronicle2b (Mortimer, 04-11-2026: «demasiado grandes … que el texto de la segunda línea se pueda situar debajo»): a raised
   initial the height of one line, never floated, so the second line starts under it and the next paragraph is never pushed in */
.chr-ch .chr-body p:first-child::first-letter { font-size: 1.7em; line-height: 1; margin-right: 0.02em; font-weight: 900; color: var(--chr); }

/* The chronicle in the vote, drawn like the roadmap of /story */
.chr-sec-head { margin-bottom: 18px; }
.chr-sec-head h2 { margin: 10px 0 6px; font-size: 1.55rem; }
.chr-sec-head p { margin: 0; color: var(--muted); line-height: 1.55; }
.chr-sec-head .chr-who { color: #fff; }
.chr-sr--road .sr-list { gap: 18px; }
.chr-sr--road .sr-ch article { padding-left: 28px; }
.chr-sr--road .sr-node { display: none; }
.chr-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 11px; border-radius: 999px; font-size: 0.75rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
.chr-pill--vote { color: #c9b8ff; background: rgba(147, 112, 219, 0.14); border: 1px dashed rgba(185, 163, 240, 0.55); }
.chr-pill--vote i { width: 8px; height: 8px; border-radius: 50%; background: #c9b8ff; box-shadow: 0 0 10px #b9a3f0; animation: chr-blink 1.8s ease-in-out infinite; }
@keyframes chr-blink { 50% { opacity: 0.35; } }

/* A change in the vote: what is new or changed in full, the rest in one line */
.chr-same { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 18px; border-radius: 14px; color: var(--muted);
    background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line); }
.chr-same span { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.chr-same b { color: #dbe2ee; font-weight: 700; }
.chr-same small { margin-left: auto; font-size: 0.8rem; }
.chr-diff--new { color: #86efac; background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(74, 222, 128, 0.35); }
.chr-diff--changed { color: #fde68a; background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(251, 191, 36, 0.35); }
.chr-ch.is-new article { border-color: rgba(74, 222, 128, 0.35); }
.chr-ch.is-changed article { border-color: rgba(251, 191, 36, 0.35); }
.chr-removed { margin: 14px 0 0; font-size: 0.9rem; color: #fda4af; }
.chr-removed b { color: #fecdd3; }

/* The empty book */
.chr-empty { position: relative; overflow: hidden; padding: 56px 32px; text-align: center; border-radius: var(--radius); border: 1px dashed var(--chr-line);
    background: radial-gradient(120% 90% at 50% 0%, rgba(232, 194, 122, 0.1), transparent 60%), var(--panel); }
.chr-empty-art { width: 92px; height: 92px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 26px; color: var(--chr);
    background: var(--chr-soft); border: 1px solid var(--chr-line); box-shadow: 0 0 60px -10px rgba(232, 194, 122, 0.5); }
.chr-empty-art svg { width: 48px; height: 48px; }
.chr-empty h2 { margin: 0 0 8px; font-size: 1.5rem; }
.chr-empty p { max-width: 520px; margin: 0 auto; color: #cdd5e3; line-height: 1.6; }

/* The record: every version and every closed vote */
.chr-rec { border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.chr-rec + .chr-rec { margin-top: 12px; }
.chr-rec > summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 18px 22px; cursor: pointer; list-style: none; }
.chr-rec > summary::-webkit-details-marker { display: none; }
.chr-rec > summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.25s; margin-left: auto; }
.chr-rec[open] > summary::after { transform: rotate(225deg); }
.chr-rec-title { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; color: #fff; }
.chr-rec-title .chr-scroll { color: var(--chr); }
.chr-rec-meta { color: var(--muted); font-size: 0.88rem; }
.chr-versions, .chr-rounds { list-style: none; margin: 0; padding: 0 22px 18px; display: grid; gap: 10px; }
.chr-version, .chr-round { padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.chr-version.is-replaced { opacity: 0.7; border-style: dashed; }
.chr-version.is-team { border-color: rgba(251, 191, 36, 0.35); }
.chr-version-head, .chr-round-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 0.9rem; color: var(--muted); }
.chr-version-head b, .chr-round-state { color: #fff; font-weight: 800; }
.chr-round--sealed .chr-round-state { color: var(--chr); }
.chr-round--expired .chr-round-state { color: #cbd5e1; }
.chr-round--withdrawn .chr-round-state { color: #fda4af; }
.chr-tag { padding: 2px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; color: #f3d9a1; background: var(--chr-soft); border: 1px solid var(--chr-line); }
.chr-tag--muted { color: var(--muted); background: rgba(255, 255, 255, 0.04); border-color: var(--line); }
.chr-hash { margin-left: auto; padding: 3px 8px; border-radius: 8px; font-size: 0.78rem; color: #a7f3d0; background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.25); }
.chr-version-why { margin: 8px 0 0; font-size: 0.9rem; color: #fbbf24; }
.chr-version-read { margin-top: 10px; }
.chr-version-read > summary { display: inline-flex; cursor: pointer; font-size: 0.88rem; font-weight: 700; color: var(--chr); }
.chr-mini { margin-top: 12px; padding-left: 12px; border-left: 2px solid var(--chr-line); }
.chr-mini b { display: block; color: #fff; }
.chr-mini small { display: block; margin: 2px 0 6px; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--chr); }
.chr-mini .chr-body { font-size: 0.94rem; }
.chr-voters { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chr-voter { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px; border-radius: 999px; font-size: 0.86rem; font-weight: 700;
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.chr-voter img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.chr-voter i { font-style: normal; font-weight: 900; }
.chr-voter--yes i { color: #5eead4; }
.chr-voter--no i { color: #fda4af; }
.chr-voter small { color: var(--muted); font-weight: 500; font-size: 0.78rem; }
.chr-og { padding: 1px 6px; border-radius: 6px; font-style: normal; font-size: 0.75rem; font-weight: 900; letter-spacing: 0.06em; color: #1a0b00; background: linear-gradient(135deg, #fde68a, #f59e0b); }

/* ---------- The side column ---------- */
.chr-card { padding: 22px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.chr-card h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; font-size: 1.15rem; }
.chr-card h3 .chr-scroll { color: var(--chr); }
.chr-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.chr-card-sub { margin: -4px 0 16px; color: var(--muted); font-size: 0.9rem; }
.chr-card-sub a { color: var(--chr); font-weight: 700; }
.chr-clock { font-size: 0.84rem; font-weight: 800; color: #dbe2ee; font-variant-numeric: tabular-nums; }
.chr-vote { position: relative; border-color: rgba(185, 163, 240, 0.32); background: linear-gradient(160deg, rgba(147, 112, 219, 0.14), rgba(255, 255, 255, 0.02) 55%); }
.chr-meter { display: grid; gap: 6px; }
.chr-meter-row { display: flex; justify-content: space-between; gap: 10px; font-size: 0.88rem; color: #cdd5e3; }
.chr-meter-row b { color: #fff; font-variant-numeric: tabular-nums; }
.chr-bar { height: 8px; margin-bottom: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.chr-bar i { display: block; width: var(--w, 0%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #b9a3f0, #e2d6ff); box-shadow: 0 0 12px rgba(185, 163, 240, 0.6);
    transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.chr-bar--og i { background: linear-gradient(90deg, #f59e0b, #fde68a); box-shadow: 0 0 12px rgba(245, 158, 11, 0.5); }
.chr-bar--slots i { background: linear-gradient(90deg, var(--chr-deep), var(--chr)); }
.chr-fine { margin: 8px 0 0; font-size: 0.86rem; line-height: 1.5; color: var(--muted); }
.chr-vote-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.chr-vote .btn, .chr-own .btn, .chr-teamcard .btn { padding: 12px 14px; font-size: 0.92rem; }
.chr-btn-yes { color: #2a1802; background: linear-gradient(135deg, #f7dfa6, var(--chr) 50%, #d99a3d); box-shadow: 0 10px 26px -8px rgba(232, 194, 122, 0.6); }
.chr-btn-yes:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -8px rgba(232, 194, 122, 0.75); }
.chr-btn-yes svg { width: 18px; height: 18px; }
.chr-btn-yes svg path:first-child { fill: rgba(80, 48, 10, 0.2); stroke: #3b2405; stroke-width: 1.2; }
.chr-btn-no2 { color: #fff; background: linear-gradient(135deg, #e11d48, #9f1239); }
.chr-no, .chr-confirm { margin-top: 14px; padding: 14px; border-radius: 14px; background: rgba(7, 2, 15, 0.45); border: 1px solid var(--line); }
.chr-no p, .chr-confirm p { margin: 0 0 10px; font-size: 0.9rem; color: #dbe2ee; }
.chr-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chr-reasons label { cursor: pointer; }
.chr-reasons input { position: absolute; opacity: 0; pointer-events: none; }
.chr-reasons span { display: inline-flex; padding: 7px 12px; border-radius: 999px; font-size: 0.84rem; font-weight: 700; color: #dbe2ee; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); transition: background 0.2s, border-color 0.2s; }
.chr-reasons input:checked + span { color: #fff; background: linear-gradient(135deg, rgba(225, 29, 72, 0.55), rgba(159, 18, 57, 0.55)); border-color: #fb7185;
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.18); }
.chr-reasons input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }
.chr-no textarea, .chr-ed textarea, .chr-ed input { width: 100%; padding: 10px 12px; border-radius: 12px; font: inherit; font-size: 0.95rem; color: var(--text);
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-strong); resize: vertical; }
.chr-no textarea:focus, .chr-ed textarea:focus, .chr-ed input:focus { outline: none; border-color: var(--chr); box-shadow: 0 0 0 3px rgba(232, 194, 122, 0.18); }
.chr-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }
/* chronicle3: how many votes are still missing, and the author's «Ask the club to vote» */
.chr-need { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; padding: 9px 12px; border-radius: 12px; font-size: 0.86rem; font-weight: 800; line-height: 1.35;
    color: #e2d6ff; background: rgba(185, 163, 240, 0.1); border: 1px solid rgba(185, 163, 240, 0.26); }
.chr-need::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #b9a3f0; box-shadow: 0 0 0 4px rgba(185, 163, 240, 0.18); }
.chr-need.is-done { color: #f3d9a1; background: var(--chr-soft); border-color: var(--chr-line); }
.chr-need.is-done::before { background: var(--chr); box-shadow: 0 0 0 4px rgba(232, 194, 122, 0.2); }
.chr-locked { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 0.86rem; line-height: 1.45;
    color: #e2d6ff; background: rgba(185, 163, 240, 0.08); border: 1px solid rgba(185, 163, 240, 0.24); }
.chr-locked svg { flex: none; width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: #b9a3f0; stroke-width: 2; stroke-linecap: round; }
.chr-ask { margin-top: 16px; padding: 14px; border-radius: 14px; background: linear-gradient(160deg, rgba(232, 194, 122, 0.1), rgba(7, 2, 15, 0.35)); border: 1px solid var(--chr-line); }
.chr-ask .chr-mine-h { color: #f3d9a1; }
.chr-ask .chr-fine { margin-top: 0; }
.chr-ask .chr-row { justify-content: flex-start; margin-top: 12px; }
.chr-ask .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1 1 140px; }
.chr-ask .btn svg { flex: none; width: 16px; height: 16px; }
.chr-btn-x { color: #fff; background: #0b0b0f; border: 1px solid rgba(255, 255, 255, 0.22); }
.chr-btn-x svg { fill: currentColor; }
.chr-btn-x:hover { background: #17171d; border-color: rgba(255, 255, 255, 0.4); }
.chr-btn-copy svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.chr-btn-copy.is-done { color: #5eead4; border-color: rgba(94, 234, 212, 0.45); }
.chr-xp { margin: 12px 0 0; font-size: 0.82rem; font-weight: 800; color: #4ade80; }
.chr-done { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; font-weight: 700; font-size: 0.9rem; }
.chr-done--yes { color: #f3d9a1; background: var(--chr-soft); border: 1px solid var(--chr-line); }
.chr-done--no { color: #fecdd3; background: rgba(225, 29, 72, 0.1); border: 1px solid rgba(251, 113, 133, 0.3); }
.chr-why { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 0.9rem; color: #cdd5e3; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.chr-mine, .chr-team { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.chr-mine-h { margin: 0 0 8px; font-size: 0.75rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.chr-mine-reasons { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chr-mine-reasons li { padding: 4px 10px; border-radius: 999px; font-size: 0.84rem; color: #fecdd3; background: rgba(225, 29, 72, 0.1); border: 1px solid rgba(251, 113, 133, 0.25); }
.chr-notes { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; font-size: 0.88rem; color: #dbe2ee; }
.chr-btn-small { padding: 9px 14px !important; font-size: 0.86rem !important; }
.chr-btn-wide { width: 100%; margin-top: 12px; }
.chr-msg { margin: 10px 0 0; font-size: 0.86rem; color: #fca5a5; }
.chr-msg:empty { display: none; }
.chr-msg.is-ok { color: #5eead4; }
.chr-slots { display: flex; justify-content: space-between; font-size: 0.88rem; color: #cdd5e3; margin-bottom: 6px; }
.chr-slots b { color: #fff; }
.chr-own-seal { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 0.88rem; font-weight: 700; color: #facc15; }
.chr-own-seal .dh-gem { width: 18px; height: 18px; }
.chr-teamcard { border-color: rgba(251, 191, 36, 0.3); }
.chr-rules ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: #dbe2ee; font-size: 0.92rem; line-height: 1.5; }
.chr-rules h4 { margin: 18px 0 8px; font-size: 0.75rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: var(--chr); }
.chr-how { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 0.88rem; line-height: 1.5; color: #cdd5e3; }
.chr-how li { position: relative; padding-left: 18px; }
.chr-how li::before { content: ''; position: absolute; left: 2px; top: 0.6em; width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg); background: var(--chr); }
.chr-how b { color: #fff; }

/* ---------- The editor ---------- */
.chr-editor { width: min(1120px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 40px); margin: auto; padding: 0; border: 1px solid var(--line-strong);
    border-radius: 24px; color: var(--text); background: linear-gradient(180deg, #170834, #0d0420); box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7); overflow: hidden; }
.chr-editor::backdrop { background: rgba(4, 1, 10, 0.78); backdrop-filter: blur(6px); }
.chr-editor[open] { display: flex; }
.chr-ed { position: relative; display: flex; flex-direction: column; width: 100%; max-height: calc(100vh - 42px); margin: 0; }
.chr-ed-head { display: flex; align-items: center; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.chr-ed-head > div:first-child { flex: 1; min-width: 0; }
.chr-ed-head .eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--chr); }
.chr-ed-head h2 { margin: 4px 0 0; font-size: 1.35rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chr-ed-tabs { display: inline-flex; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.chr-ed-tabs button { padding: 8px 14px; border: 0; border-radius: 9px; font-weight: 800; font-size: 0.88rem; color: var(--muted); background: transparent; cursor: pointer; }
.chr-ed-tabs button:hover { color: #fff; }
.chr-ed-tabs button[aria-selected="true"] { color: #2a1802; background: var(--chr); }
.chr-ed-x { width: 40px; height: 40px; border-radius: 50%; font-size: 1.5rem; line-height: 1; color: #fff; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); }
.chr-ed-x:hover { background: rgba(255, 255, 255, 0.12); }
.chr-ed-body { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; padding: 22px 24px; }
.chr-ed-side { align-self: start; position: sticky; top: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.chr-ed-side > * { min-width: 0; }
/* chronicle2b: «This ape with you», the owner's days for the chapters */
.chr-ed-with { padding: 16px; border-radius: 16px; background: linear-gradient(160deg, rgba(250,204,21,0.10), rgba(250,204,21,0.02) 60%), var(--chr-soft); border: 1px solid rgba(250,204,21,0.28); }
.chr-ed-with > b { display: block; margin-bottom: 10px; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--chr); }
.chr-with-since { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; font-size: 0.86rem; color: #cdd5e3; line-height: 1.35; }
.chr-with-since .dh-gem { flex: none; width: 26px; height: 26px; margin-top: 1px; }
.chr-with-since strong { color: #fff; font-size: 0.98rem; }
.chr-with-since em { display: block; margin-top: 2px; font-style: normal; font-size: 0.78rem; font-weight: 700; color: var(--t, #facc15); }
.chr-with-list { list-style: none; margin: 0; padding: 0 0 0 10px; display: grid; gap: 2px; border-left: 1px solid rgba(250,204,21,0.25); }
.chr-with-list li { position: relative; }
.chr-with-list li::before { content: ''; position: absolute; left: -14px; top: 13px; width: 7px; height: 7px; border-radius: 50%; background: #64748b; box-shadow: 0 0 0 3px #0d1220; }
.chr-with-list li.is-mint::before, .chr-with-list li.is-came::before { background: var(--chr); }
.chr-with-list li.is-year::before { background: #facc15; box-shadow: 0 0 0 3px #0d1220, 0 0 10px rgba(250,204,21,0.7); }
.chr-with-list li.is-custody::before { background: transparent; border: 1px solid #94a3b8; }
.chr-with-list button { display: grid; gap: 1px; width: 100%; padding: 6px 8px; border: 0; border-radius: 10px; text-align: left; font: inherit; color: inherit; background: transparent; cursor: pointer; transition: background 0.15s ease; }
.chr-with-list button:hover:not(:disabled), .chr-with-list button:focus-visible { background: rgba(250,204,21,0.10); outline: none; }
.chr-with-list button:hover:not(:disabled) time::after, .chr-with-list button:focus-visible time::after { content: 'Use this day'; margin-left: 8px; font-size: 0.75rem; font-weight: 700; color: var(--chr); }
.chr-with-list button:disabled { cursor: default; opacity: 0.7; }
.chr-with-list time { font-size: 0.82rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.chr-with-list span { font-size: 0.78rem; color: #aab4c5; line-height: 1.35; overflow-wrap: anywhere; }
.chr-with-list li.is-year span { color: #fde68a; }
.chr-with-more { padding: 4px 8px; font-size: 0.75rem; color: #8b95a7; font-style: italic; }
.chr-with-more::before { display: none; }
.chr-with-hint { margin: 10px 0 0; font-size: 0.75rem; color: #8b95a7; line-height: 1.4; }
.chr-ed-ch.is-misdated .chr-ed-day input { border-color: #fb7185 !important; box-shadow: 0 0 0 3px rgba(251,113,133,0.18); color: #fecdd3; }
.chr-ed-ch.is-dated { animation: chrDated 1.2s ease; }
@keyframes chrDated { 0% { box-shadow: 0 0 0 2px rgba(250,204,21,0.9); } 100% { box-shadow: 0 0 0 2px rgba(250,204,21,0); } }
/* chronicle2b: the draft button says whether anything is left to save */
.chr-ed-save { display: inline-flex; align-items: center; gap: 7px; min-width: 132px; justify-content: center; transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease; }
.chr-ed-save svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.chr-ed-save:disabled { opacity: 1; cursor: default; color: #9aa4b6; border-color: rgba(148,163,184,0.25); box-shadow: none; }
.chr-ed-save.is-saved:disabled { color: #86efac; border-color: rgba(134,239,172,0.4); background: rgba(134,239,172,0.07); }
.chr-ed-save.is-saved svg { animation: chrSavedTick 0.35s ease; }
.chr-ed-save.is-pending { color: #fde68a; border-color: rgba(250,204,21,0.55); }
.chr-ed-save.is-saving:disabled { color: #cbd5e1; }
.chr-ed-save.is-bad { color: #fda4af; border-color: rgba(251,113,133,0.6); }
@keyframes chrSavedTick { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.chr-ed-rules { padding: 16px; border-radius: 16px; font-size: 0.86rem; color: #cdd5e3; background: var(--chr-soft); border: 1px solid var(--chr-line); }
.chr-ed-rules b { display: block; margin-bottom: 8px; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--chr); }
.chr-ed-rules ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; line-height: 1.45; }
.chr-ed-write, .chr-ed-preview { grid-column: 2; min-width: 0; }
.chr-ed-team { grid-column: 2; display: grid; gap: 6px; }
.chr-ed-team[hidden] { display: none; }
.chr-ed-team label { font-size: 0.86rem; font-weight: 700; color: #fbbf24; }
.chr-ed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: chap; }
.chr-ed-ch { position: relative; padding: 16px 16px 14px 56px; border-radius: 16px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); counter-increment: chap; }
.chr-ed-ch::before { content: counter(chap); position: absolute; left: 14px; top: 16px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
    font-weight: 900; font-size: 0.9rem; color: #2a1802; background: var(--chr); }
.chr-ed-ch.is-bad { border-color: rgba(251, 113, 133, 0.6); }
.chr-ed-top { display: grid; grid-template-columns: minmax(0, 1fr) 200px auto; gap: 8px; align-items: center; }
.chr-ed-day { position: relative; display: block; }
.chr-ed-day input { color-scheme: dark; cursor: pointer; padding-left: 38px !important; }
.chr-ed-day::before { content: ''; position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; pointer-events: none; background: var(--chr);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h2v2h6V2h2v2h2a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2V2zM5 9v10h14V9H5z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h2v2h6V2h2v2h2a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2V2zM5 9v10h14V9H5z'/%3E%3C/svg%3E") center / contain no-repeat; }
.chr-ed-day input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; margin: 0; padding: 0; opacity: 0; cursor: pointer; }   /* the whole field opens the calendar, one icon only */
.chr-ed-day input:invalid { color: var(--muted); }
.chr-ed-noday { color: #fda4af !important; }
.chr-ed-tools { display: flex; gap: 4px; }
.chr-ed-tools button, .chr-ed-fmt button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; font-weight: 900; color: #dbe2ee;
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.chr-ed-tools button:hover, .chr-ed-fmt button:hover { background: rgba(255, 255, 255, 0.12); }
.chr-ed-tools button:disabled { opacity: 0.35; cursor: default; }
.chr-ed-tools svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chr-ed-fmt { display: flex; gap: 4px; margin: 8px 0 6px; }
.chr-ed-fmt button i { font-family: Georgia, serif; }
.chr-ed-ch textarea { min-height: 150px; line-height: 1.6; }
.chr-ed-count { margin-top: 4px; text-align: right; font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chr-ed-count.is-over { color: #fda4af; font-weight: 800; }
.chr-ed-add { width: 100%; margin-top: 14px; padding: 14px; border-radius: 14px; font-weight: 800; color: var(--chr); background: transparent; border: 1.5px dashed var(--chr-line); }
.chr-ed-add:hover { background: var(--chr-soft); }
.chr-ed-add:disabled { opacity: 0.4; cursor: default; }
.chr-ed-add small { color: var(--muted); font-weight: 600; margin-left: 6px; }
.chr-ed-preview .sr-list { gap: 16px; }
.chr-ed-preview .sr-ch article { padding-left: 28px; }
.chr-ed-preview .sr-node { display: none; }
.chr-ed-empty { padding: 30px; text-align: center; color: var(--muted); }
.chr-ed-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 16px 24px; border-top: 1px solid var(--line); background: rgba(7, 2, 15, 0.4); }
.chr-ed-foot .chr-row { margin: 0 0 0 auto; }
.chr-ed-status { margin: 0; font-size: 0.88rem; color: var(--muted); }
.chr-ed-status.is-bad { color: #fda4af; }
.chr-ed-status.is-ok { color: #5eead4; }
.chr-ed-confirm { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; background: rgba(7, 2, 15, 0.82); backdrop-filter: blur(4px); }
.chr-ed-confirm[hidden] { display: none; }
.chr-ed-confirm-card { max-width: 460px; padding: 28px; text-align: center; border-radius: 22px; background: #160733; border: 1px solid var(--chr-line); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); }
.chr-ed-confirm-icon { width: 46px; height: 46px; color: var(--chr); }
.chr-ed-confirm-card h3 { margin: 10px 0 8px; font-size: 1.35rem; }
.chr-ed-confirm-card p { margin: 0; color: #cdd5e3; line-height: 1.55; }
.chr-ed-confirm-card .chr-row { justify-content: center; margin-top: 18px; }

/* ---------- Phones and small screens ---------- */
@media (max-width: 1080px) {
    .chr-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
}
@media (max-width: 900px) {
    .chr-layout { grid-template-columns: minmax(0, 1fr); }
    .chr-side { display: contents; }                       /* its cards join the column: the vote first, the rules last */
    .chr-vote, .chr-own { order: -1; }
    .chr-main { order: 0; }
    .chr-teamcard, .chr-rules { order: 1; }
    .chr-ed-body { grid-template-columns: minmax(0, 1fr); }
    .chr-ed-side { position: static; }
    .chr-ed-write, .chr-ed-preview, .chr-ed-team { grid-column: 1; }
}
@media (max-width: 640px) {
    /* chronicle2b: on a phone the days run sideways, so the chapters stay close */
    .chr-with-list { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; border-left: 0; scroll-snap-type: x mandatory; scrollbar-width: thin; }
    .chr-with-list li { flex: 0 0 auto; width: 132px; scroll-snap-align: start; }
    .chr-with-list li::before { display: none; }
    .chr-with-list button { height: 100%; align-content: start; padding: 8px 10px; border: 1px solid rgba(250,204,21,0.22); background: rgba(13,18,32,0.5); }
    .chr-with-list li.is-year button { border-color: rgba(250,204,21,0.55); }
    .chr-with-list button:hover:not(:disabled) time::after, .chr-with-list button:focus-visible time::after { content: none; }
    .chr-with-more { display: flex; align-items: center; width: auto !important; }
    .chr-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; justify-items: center; text-align: center; }
    .chr-portrait { width: 200px; }
    .chr-hero-text > p { margin: 0 auto; }
    .chr-chips { justify-content: center; }
    .chr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 26px; }
    .chr-stats div { padding: 14px 16px; }
    .chr-stats dd { font-size: 1.3rem; }
    .chr-stats .chr-stat-chain dd { font-size: 0.92rem; padding-top: 8px; }
    .chr-era { padding-left: 52px; }
    .chr-body { font-size: 0.98rem; }
    .chr-empty { padding: 40px 20px; }
    .chr-rec > summary { padding: 16px; }
    .chr-versions, .chr-rounds { padding: 0 14px 14px; }
    .chr-hash { margin-left: 0; }
    .chr-editor { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
    .chr-ed { max-height: 100dvh; height: 100%; }
    .chr-ed-head { flex-wrap: wrap; padding: 14px 16px; gap: 10px; }
    .chr-ed-head > div:first-child { flex-basis: calc(100% - 56px); }
    .chr-ed-tabs { order: 3; width: 100%; }
    .chr-ed-tabs button { flex: 1; }
    .chr-ed-body { padding: 16px; gap: 16px; }
    .chr-ed-ch { padding: 50px 12px 12px; }
    .chr-ed-ch::before { top: 12px; left: 12px; }
    .chr-ed-top { grid-template-columns: minmax(0, 1fr); }
    .chr-ed-tools { position: absolute; top: 10px; right: 10px; }
    .chr-ed-foot { padding: 12px 16px; }
    .chr-ed-foot .chr-row { width: 100%; margin: 0; }
    .chr-ed-foot .chr-row .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .chr-ed-save.is-saved svg { animation: none; }
    .chr-ed-ch.is-dated { animation: none; }
    .chr-pill--vote i { animation: none; }
    .chr-bar i { transition: none; }
}

/* chronicle2: the readers' 👍/👎 under each era's marker, and the way to every chronicle in the header */
.chr-era-rate { margin-top: 8px; }
a.chr-chip--all { color: var(--chr); border-color: var(--chr-line); background: var(--chr-soft); text-decoration: none; }
a.chr-chip--all:hover { background: rgba(232, 194, 122, 0.2); }
