/* Answers in the chat: Markdown and components (answer/*.mjs). Every
   component sits in the same card: a slim top bar (icon, name, a detail,
   its tools, Copy in the corner) over its body. Chart colours are the
   validated categorical set: colour-blind safe, chosen per mode. */

.ac-answer {
  flex: 1; min-width: 0;
  --ac-s1: #2a78d6; --ac-s2: #eb6834; --ac-s3: #1baf7a; --ac-s4: #eda100;
  --ac-s5: #e87ba4; --ac-s6: #008300; --ac-s7: #6250d6; --ac-s8: #e34948;
  --ac-fill: color-mix(in srgb, var(--text) 5%, transparent);
  --ac-fill-2: color-mix(in srgb, var(--text) 9%, transparent);
  --ac-good: var(--mint); --ac-bad: var(--err); --ac-mid: var(--sun);
}
@media (prefers-color-scheme: dark) {
  .ac-answer {
    --ac-s1: #3987e5; --ac-s2: #d95926; --ac-s3: #199e70; --ac-s4: #c98500;
    --ac-s5: #d55181; --ac-s6: #008300; --ac-s7: #9085e9; --ac-s8: #e66767;
  }
}

/* ---------------------------------------------------------------- Markdown */
.ac-answer > p { margin: 0 0 8px; }
.ac-answer > :last-child { margin-bottom: 0; }
.ac-answer .ac-h { margin: 14px 0 6px; font-family: var(--display); letter-spacing: -.01em; line-height: 1.3; }
.ac-answer h3.ac-h { font-size: 16px; }
.ac-answer h4.ac-h { font-size: 14.5px; }
.ac-answer h5.ac-h, .ac-answer h6.ac-h { font-size: 13.5px; }
.ac-answer > .ac-h:first-child { margin-top: 2px; }
.ac-answer ul, .ac-answer ol { margin: 4px 0 8px; padding-left: 22px; }
.ac-answer li { margin: 2px 0; }
.ac-answer li > ul, .ac-answer li > ol { margin: 2px 0; }
.ac-answer blockquote { margin: 6px 0 10px; padding: 2px 0 2px 12px; border-left: 3px solid var(--line-2); color: var(--text-2); }
.ac-answer hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.ac-answer a.ac-link { color: var(--accent-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 2px; cursor: pointer; }
.ac-answer a.ac-link:hover { text-decoration-color: currentColor; }
.ac-answer s { color: var(--text-3); }

/* ---------------------------------------------------------------- the card */
.ac { margin: 10px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; user-select: text; animation: ac-in .32s var(--ease) both; }
.ac:first-child { margin-top: 2px; }
.ac:last-child { margin-bottom: 0; }
@keyframes ac-in { from { opacity: 0; transform: translateY(4px); filter: blur(2px); } }
.ac-top { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 6px 0 10px; border-bottom: 1px solid var(--line); }
.ac-ico { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--ac-fill); color: var(--text-2); flex: none; }
.ac-i { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ac-i.sm { width: 12px; height: 12px; stroke-width: 2.2; }
.ac-ico .ac-i { width: 13px; height: 13px; }
.ac-name { font-size: 12.5px; font-weight: 650; color: var(--text); white-space: nowrap; }
.ac-detail { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ac-detail:not(:empty)::before { content: '· '; }
.ac-tools { margin-left: auto; display: flex; align-items: center; gap: 2px; flex: none; }
.ac-tool { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 28px; height: 28px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); font: 600 12px var(--font); cursor: pointer; transition: background .15s, color .15s; }
.ac-tool:hover { background: var(--ac-fill); color: var(--text); }
.ac-tool[aria-pressed="true"] { background: var(--ac-fill-2); color: var(--text); }
.ac-tool.done { color: var(--mint); }
.ac-tool[hidden] { display: none; }
.ac-body { padding: 12px 14px 14px; min-width: 0; container-type: inline-size; }
.ach-title { font-weight: 650; font-size: 14px; color: var(--text); margin-bottom: 8px; }
.ach-title span { font-weight: 500; color: var(--text-3); font-size: 12.5px; }
.ac-foot { margin-top: 10px; font-size: 12.5px; color: var(--text-3); }
.ac-label { font: 650 11px var(--font); letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.ac-more { display: block; margin: 8px auto 0; padding: 5px 12px; border: 0; border-radius: 999px; background: var(--ac-fill); color: var(--text-2); font: 600 12px var(--font); cursor: pointer; }
.ac-more:hover { background: var(--ac-fill-2); color: var(--text); }
.ac-more[hidden] { display: none; }
.ac-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--text); font: 600 12.5px var(--font); cursor: pointer; transition: background .15s, transform .12s var(--ease); }
.ac-btn:hover { background: var(--ac-fill); }
.ac-btn:active { transform: scale(.97); }
.ac-btn.primary { background: var(--btn); color: var(--btn-ink); border-color: transparent; }
.ac-btn.primary:hover { filter: brightness(1.08); background: var(--btn); }
.ac-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--ac-fill); }
.ac-seg button { height: 24px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font: 600 11.5px var(--font); cursor: pointer; }
.ac-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.ac-stepper { display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 3px; border-radius: 999px; background: var(--ac-fill); }
.ac-stepper .num { min-width: 22px; text-align: center; font-weight: 650; }
.ac-step { width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); cursor: pointer; }
.ac-step:hover { background: var(--ac-fill-2); }
.acl-progress { position: relative; display: block; height: 4px; border-radius: 999px; background: var(--ac-fill-2); overflow: hidden; }
.acl-progress i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--mint); transition: width .3s var(--ease); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.ac-broken .ac-raw { margin: 0; max-height: 220px; overflow: auto; font: 11.5px/1.5 var(--mono); color: var(--text-3); white-space: pre-wrap; }

/* ---------------------------------------------------------------- chart */
.ach-wrap { position: relative; }
.ach-wrap[hidden], .ach-table[hidden], .ach-legend[hidden] { display: none; }
.ach-plot { width: 100%; min-height: 40px; }
.ach-svg { display: block; overflow: visible; }
.ach-grid { stroke: var(--line); stroke-width: 1; }
.ach-zero { stroke: var(--line-2); stroke-width: 1; }
.ach-yl, .ach-xl { font: 10.5px var(--font); fill: var(--text-3); font-variant-numeric: tabular-nums; }
.ach-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ach-area { opacity: .12; }
.ach-dot { stroke: var(--surface); stroke-width: 2; }
.ach-cross { stroke: var(--text-3); stroke-width: 1; opacity: .6; }
.ach-hit { fill: transparent; cursor: crosshair; }
.ach-band .ach-bar { transition: opacity .12s; }
.ach-plot:has(.ach-band.on) .ach-band:not(.on) .ach-bar { opacity: .45; }
.ach-legend { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: -2px 0 8px; }
.ach-key { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 7px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font: 500 12px var(--font); cursor: pointer; }
.ach-key:hover { background: var(--ac-fill); }
.ach-key i { width: 10px; height: 10px; border-radius: 3px; }
.ach-key[aria-pressed="false"] { color: var(--text-3); text-decoration: line-through; }
.ach-key[aria-pressed="false"] i { opacity: .25; }
.ach-tip { position: absolute; z-index: 2; min-width: 120px; padding: 7px 10px; border-radius: 10px; background: var(--btn); color: var(--btn-ink); font-size: 12px; line-height: 1.45; pointer-events: none; box-shadow: var(--shadow-md); }
.ach-tip[hidden] { display: none; }
.ach-tip-h { font-weight: 650; margin-bottom: 3px; }
.ach-tip-row { display: flex; align-items: center; gap: 6px; }
.ach-tip-row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.ach-tip-row span { opacity: .8; flex: 1; }
.ach-tip-row b { font-variant-numeric: tabular-nums; margin-left: 10px; }
.ach-tip-row.total { border-top: 1px solid color-mix(in srgb, var(--btn-ink) 25%, transparent); margin-top: 3px; padding-top: 3px; }
.ach-table table, .act { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ach-table th, .ach-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.ach-table td.num, .ach-table th:not(:first-child) { text-align: right; }
.ach-ranked { display: flex; flex-direction: column; gap: 6px; }
.ach-rank { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 12.5px; }
.ach-rank-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.ach-rank-bar { height: 14px; display: flex; }
.ach-rank-bar i { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.ach-rank b { font-weight: 650; font-size: 12px; }
.ach-pie-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ach-pie { flex: none; overflow: visible; }
.ach-slice { stroke: var(--surface); stroke-width: 2; transition: transform .15s var(--ease), opacity .15s; transform-origin: center; transform-box: view-box; cursor: default; }
.ach-pie:has(.on) .ach-slice:not(.on) { opacity: .45; }
.ach-ring { fill: none; }
.ach-pie-v { font: 700 19px var(--display); fill: var(--text); }
.ach-pie-l { font: 11px var(--font); fill: var(--text-3); }
.ach-pie-keys, .ach-split-keys { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 2px; }
.ach-split-keys { margin-top: 10px; }
.ach-pie-key { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; font-size: 12.5px; }
.ach-pie-key.on { background: var(--ac-fill); }
.ach-pie-key i { width: 10px; height: 10px; border-radius: 3px; }
.ach-pie-key span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ach-pie-key b { font-weight: 650; }
.ach-split { display: flex; gap: 2px; height: 16px; border-radius: 6px; overflow: hidden; }
.ach-split i { display: block; min-width: 3px; }

/* ---------------------------------------------------------------- table */
.act-scroll { overflow-x: auto; margin: -2px -4px 0; padding: 0 4px; }
.act th { position: sticky; top: 0; background: var(--surface); text-align: left; font-weight: 650; font-size: 12px; color: var(--text-2); border-bottom: 1px solid var(--line-2); padding: 0; white-space: nowrap; }
.act th button { display: inline-flex; align-items: center; gap: 4px; width: 100%; padding: 7px 8px; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: inherit; }
.act th.num button { justify-content: flex-end; }
.act th button:hover { color: var(--text); }
.act td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text); }
.act td.num, .act th.num { text-align: right; font-variant-numeric: tabular-nums; }
.act tbody tr:hover td { background: var(--ac-fill); }
.act tbody tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------- stats */
.acs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.acs-tile { padding: 10px 12px; border-radius: 12px; background: var(--ac-fill); min-width: 0; }
.acs-label { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acs-value { font: 700 22px/1.25 var(--display); letter-spacing: -.01em; color: var(--text); margin: 2px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acs-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 22px; }
.acs-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acs-delta.good { color: var(--ac-good); }
.acs-delta.bad { color: var(--ac-bad); }
.acs-delta.flat { color: var(--text-3); }
.acs-spark { flex: none; overflow: visible; }
.acs-spark path { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.acs-spark.good path { stroke: var(--ac-good); }
.acs-spark.bad path { stroke: var(--ac-bad); }
.acs-spark circle { fill: var(--text-2); }

/* ---------------------------------------------------------------- breakdown */
.acb .ach-split { margin-bottom: 10px; }
.acb-list { display: flex; flex-direction: column; }
.acb-row { display: grid; grid-template-columns: 10px 1fr auto auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.acb-row i { width: 10px; height: 10px; border-radius: 3px; }
.acb-l { display: flex; flex-direction: column; min-width: 0; }
.acb-l small { color: var(--text-3); font-size: 11.5px; }
.acb-pct { color: var(--text-3); font-size: 12px; }
.acb-total { display: flex; justify-content: space-between; padding: 9px 0 4px; font-weight: 650; }
.acb-total b { font: 700 16px var(--display); }
.acb-split { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: var(--ac-fill); font-size: 13px; color: var(--text-2); }
.acb-each { margin-left: auto; white-space: nowrap; }
.acb-each > b { color: var(--text); font-size: 14px; }

/* ---------------------------------------------------------------- scorecard */
.acsc-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.acsc-score { position: relative; width: 76px; height: 76px; flex: none; }
.acsc-num { position: absolute; inset: 0; display: grid; place-items: center; font: 700 22px var(--display); }
.acsc-track { fill: none; stroke: var(--ac-fill-2); stroke-width: 7; }
.acsc-fill { fill: none; stroke-width: 7; stroke-linecap: round; }
.acsc-fill.good, .acsc-bar i.good { stroke: var(--ac-good); background: var(--ac-good); }
.acsc-fill.mid, .acsc-bar i.mid { stroke: var(--ac-mid); background: var(--ac-mid); }
.acsc-fill.low, .acsc-bar i.low { stroke: var(--ac-bad); background: var(--ac-bad); }
.acsc-sub { display: flex; flex-direction: column; min-width: 0; }
.acsc-sub b { font-size: 14.5px; }
.acsc-sub span { font-size: 12.5px; color: var(--text-3); }
.acsc-list { display: flex; flex-direction: column; gap: 10px; }
.acsc-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.acsc-top b small { color: var(--text-3); font-weight: 500; }
.acsc-bar { height: 6px; border-radius: 999px; background: var(--ac-fill-2); margin: 4px 0 3px; overflow: hidden; }
.acsc-bar i { display: block; height: 100%; border-radius: 999px; }
.acsc-note { font-size: 12px; color: var(--text-3); line-height: 1.45; }

/* ---------------------------------------------------------------- matrix */
.acm { display: grid; grid-template-columns: 22px 1fr; gap: 6px; }
.acm-y { display: flex; flex-direction: row; justify-content: space-between; align-items: center; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; color: var(--text-3); padding: 4px 0; }
.acm-y b, .acm-x b { color: var(--text-2); font-weight: 650; }
.acm-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.acm-field { position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1.45; min-height: 200px; max-height: 340px; border-radius: 12px; overflow: hidden; gap: 2px; background: var(--surface); }
.acm-q { background: var(--ac-fill); padding: 8px 10px; }
.acm-q.top_left { background: color-mix(in srgb, var(--mint) 9%, transparent); }
.acm-q span { font: 650 11px var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.acm-q.bottom_left, .acm-q.bottom_right { display: flex; align-items: flex-end; }
.acm-q.top_right, .acm-q.bottom_right { justify-content: flex-end; text-align: right; display: flex; }
.acm-q.top_right { align-items: flex-start; }
.acm-dot { position: absolute; display: flex; align-items: center; gap: 6px; transform: translate(-5px, -50%); font-size: 12px; color: var(--text); white-space: nowrap; outline: 0; }
.acm-dot.left { flex-direction: row-reverse; transform: translate(calc(-100% + 5px), -50%); }
.acm-dot i { width: 10px; height: 10px; border-radius: 999px; background: var(--ac-s1); box-shadow: 0 0 0 2px var(--surface); flex: none; }
.acm-dot span { transform: translateY(var(--dy, 0px)); padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--surface) 80%, transparent); max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.acm-dot i { position: relative; }
.acm-dot.lead i::after { content: ''; position: absolute; left: 4.5px; top: 10px; width: 1px; height: calc(var(--lead) - 4px); background: var(--text-3); opacity: .5; }
.acm-dot.lead.up i::after { top: auto; bottom: 10px; }
.acm-dot:hover span, .acm-dot:focus span { background: var(--surface); box-shadow: var(--shadow-sm); max-width: none; }
.acm-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); }

/* ---------------------------------------------------------------- checklist, steps */
.acl-check { list-style: none; margin: 8px 0 0; padding: 0; }
.acl-check li { border-bottom: 1px solid var(--line); }
.acl-check li:last-child { border-bottom: 0; }
.acl-check label { display: grid; grid-template-columns: 18px 1fr; align-items: baseline; column-gap: 10px; padding: 7px 2px; cursor: pointer; font-size: 13.5px; }
.acl-check small, .acre-ing small { grid-column: 2; color: var(--text-3); font-size: 12px; }
.acl-check li.done .acl-t, .acre-ing li.done span { color: var(--text-3); text-decoration: line-through; }
.ac input[type="checkbox"] { appearance: none; width: 18px; height: 18px; margin: 0; align-self: center; display: grid; place-content: center; border-radius: 6px; border: 1.5px solid var(--line-2); background: transparent; cursor: pointer; transition: background .15s, border-color .15s; }
.ac input[type="checkbox"]::after { content: ''; width: 4.5px; height: 9px; border: solid var(--surface); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg) scale(0); transition: transform .18s var(--ease); }
.ac input[type="checkbox"]:checked { background: var(--mint); border-color: var(--mint); }
.ac input[type="checkbox"]:checked::after { transform: translateY(-1px) rotate(45deg) scale(1); }
.acl-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.acl-steps li { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding-bottom: 14px; }
.acl-steps li:last-child { padding-bottom: 0; }
.acl-steps li:not(:last-child)::before { content: ''; position: absolute; left: 13.5px; top: 30px; bottom: 2px; width: 1px; background: var(--line-2); }
.acl-n { position: relative; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font: 650 12.5px var(--font); cursor: pointer; transition: background .15s, border-color .15s; }
.acl-n .ac-i { display: none; }
.acl-n:hover { border-color: var(--mint); }
.acl-steps li.done .acl-n { background: var(--mint); border-color: var(--mint); color: var(--surface); }
.acl-steps li.done .acl-n span { display: none; }
.acl-steps li.done .acl-n .ac-i { display: block; }
.acl-step b { display: block; font-size: 13.5px; line-height: 28px; }
.acl-step p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.55; }
.acl-steps li.done .acl-step { opacity: .55; }

/* ---------------------------------------------------------------- timeline */
.acl-time { list-style: none; margin: 0; padding: 0; }
.acl-time li { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 0 0 14px; }
.acl-time li::before { content: ''; position: absolute; left: 62px; top: 6px; width: 9px; height: 9px; border-radius: 999px; background: var(--surface); border: 2px solid var(--ac-s1); box-sizing: border-box; }
.acl-time li:not(:last-child)::after { content: ''; position: absolute; left: 66px; top: 17px; bottom: 0; width: 1px; background: var(--line-2); }
.acl-time li > div { padding-left: 16px; min-width: 0; }
.acl-when { font-size: 12px; font-weight: 650; color: var(--text-3); text-align: right; padding-top: 2px; font-variant-numeric: tabular-nums; }
.acl-time b { font-size: 13.5px; }
.acl-time p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.acl-time li.gap::before { border-color: var(--line-2); }

/* ---------------------------------------------------------------- tree */
.acl-tree { font-size: 13px; }
.acl-node { display: flex; align-items: center; gap: 5px; min-height: 26px; border-radius: 6px; }
.acl-node:hover { background: var(--ac-fill); }
.acl-node small { color: var(--text-3); font-size: 11.5px; margin-left: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acl-tw { width: 18px; height: 18px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: var(--text-3); cursor: pointer; padding: 0; flex: none; }
.acl-tw.leaf { cursor: default; }
.acl-tw .ac-i { transition: transform .15s var(--ease); }
.acl-tw[aria-expanded="true"] .ac-i { transform: rotate(90deg); }
.ac-fi { color: var(--text-3); }

/* ---------------------------------------------------------------- links */
.acl-links { display: flex; flex-direction: column; gap: 2px; margin: -4px -6px; }
.acl-link { display: grid; grid-template-columns: 30px 1fr 14px; align-items: start; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; outline: 0; }
.acl-link:hover, .acl-link:focus-visible { background: var(--ac-fill); }
.acl-fav { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--ac-fill-2); color: var(--text-2); font: 700 13px var(--display); }
.acl-lt { min-width: 0; }
.acl-lt b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acl-lt span { display: block; font-size: 11.5px; color: var(--text-3); }
.acl-lt p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.acl-go { color: var(--text-3); margin-top: 8px; }

/* ---------------------------------------------------------------- comparison, pros & cons, decision */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.acc-opt { position: relative; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.acc-opt.picked { border-color: color-mix(in srgb, var(--mint) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 12%, transparent); }
.acc-pick { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--mint-soft); color: var(--mint); font: 650 11px var(--font); }
.acc-t { display: block; font-size: 14px; padding-right: 54px; }
.acc-opt p { margin: 4px 0 8px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.acc-opt ul, .acd-why, .acp-side ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.acc-opt li { display: grid; grid-template-columns: 14px 1fr; gap: 6px; font-size: 12.5px; }
.acc-opt li i, .acp-h i { font-style: normal; font-weight: 800; }
.acc-opt li.good i { color: var(--ac-good); }
.acc-opt li.bad i { color: var(--ac-bad); }
.acp { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.acp-side { padding: 10px 12px; border-radius: 12px; }
.acp-side.pro { background: color-mix(in srgb, var(--mint) 9%, transparent); }
.acp-side.con { background: color-mix(in srgb, var(--err) 8%, transparent); }
.acp-h { display: flex; align-items: center; gap: 6px; font-weight: 650; font-size: 13px; margin-bottom: 6px; }
.acp-h small { margin-left: auto; color: var(--text-3); font-weight: 600; }
.acp-side.pro .acp-h i { color: var(--ac-good); }
.acp-side.con .acp-h i { color: var(--ac-bad); }
.acp-side li { font-size: 13px; line-height: 1.45; padding-left: 12px; position: relative; }
.acp-side li::before { content: ''; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; border-radius: 999px; background: currentColor; opacity: .35; }
.acp-verdict { margin-top: 10px; padding: 9px 12px; border-radius: 12px; background: var(--ac-fill); font-size: 13px; }
.acd-q { font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.acd-verdict { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14.5px; }
.acd-badge { padding: 4px 12px; border-radius: 999px; font: 700 13px var(--display); }
.acd.yes .acd-badge { background: var(--mint-soft); color: var(--mint); }
.acd.no .acd-badge { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.acd.depends .acd-badge { background: var(--sun-soft); color: #a87500; }
@media (prefers-color-scheme: dark) { .acd.depends .acd-badge { color: var(--sun); } }
.acd-conf { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; }
.acd-conf .acl-progress { flex: 1; max-width: 220px; }
.acd-conf small { color: var(--text-3); font-size: 12px; }
.acd.no .acd-conf .acl-progress i { background: var(--err); }
.acd.depends .acd-conf .acl-progress i { background: var(--sun); }
.acd-why { margin-top: 8px; }
.acd-why li { font-size: 13px; padding-left: 14px; position: relative; line-height: 1.5; }
.acd-why li::before { content: ''; position: absolute; left: 2px; top: .6em; width: 5px; height: 5px; border-radius: 999px; background: var(--text-3); }
.acd-caveat { margin-top: 10px; font-size: 12.5px; color: var(--text-2); padding: 8px 10px; border-radius: 10px; background: var(--ac-fill); }

/* ---------------------------------------------------------------- options */
.aco-q { font-weight: 650; font-size: 14px; margin-bottom: 8px; }
.aco-list { display: flex; flex-direction: column; gap: 6px; }
.aco-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; transition: border-color .15s, background .15s, transform .12s var(--ease); }
.aco-opt:hover:not(:disabled) { border-color: var(--text-3); background: var(--ac-fill); }
.aco-opt:active:not(:disabled) { transform: scale(.99); }
.aco-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.aco-opt:disabled:not(.on) { opacity: .5; cursor: default; }
.aco-mark { width: 18px; height: 18px; flex: none; display: grid; place-items: center; border-radius: 999px; border: 1.5px solid var(--line-2); color: transparent; }
.aco-opt.on .aco-mark { background: var(--accent); border-color: var(--accent); color: #fff; }
.aco-l { display: flex; flex-direction: column; min-width: 0; }
.aco-l b { font-size: 13.5px; font-weight: 600; }
.aco-l small { font-size: 12px; color: var(--text-3); }
.aco-row { display: flex; gap: 6px; margin-top: 8px; }
.aco-other { flex: 1; min-width: 0; height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-size: 13px; outline: 0; }
.aco-other:focus { border-color: var(--accent); }
.aco-send { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--btn); color: var(--btn-ink); font: 600 12.5px var(--font); cursor: pointer; }
.aco-send:disabled { opacity: .35; cursor: default; }
.aco.answered .aco-row { display: none; }

/* ---------------------------------------------------------------- code */
.ac-code .ac-body { padding: 0; }
.ack { margin: 0; padding: 12px 14px; overflow-x: auto; font: 12.5px/1.6 var(--mono); background: var(--surface-2); color: var(--text); tab-size: 2; }
.ack code { font: inherit; background: none; padding: 0; }
.ack.folded { max-height: 380px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
.ac-code .ac-more { margin: 6px auto 10px; }
.ak-k { color: #8a3fd1; }
.ak-s { color: #13795f; }
.ak-n { color: #c2452b; }
.ak-c { color: var(--text-3); font-style: italic; }
@media (prefers-color-scheme: dark) { .ak-k { color: #c49bff; } .ak-s { color: var(--mint); } .ak-n { color: var(--coral); } }

/* ---------------------------------------------------------------- draft, rewrite */
.acdr { display: flex; flex-direction: column; }
.acdr-row { display: grid; grid-template-columns: 62px 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.acdr-row span { font-size: 12px; color: var(--text-3); font-weight: 550; }
.acdr-in { height: 34px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; outline: 0; }
.acdr-body { margin-top: 8px; padding: 8px 10px; min-height: 120px; border: 1px solid transparent; border-radius: 10px; background: var(--ac-fill); color: var(--text); font: 13.5px/1.6 var(--font); resize: none; outline: 0; }
.acdr-body:focus { background: var(--surface); border-color: var(--line-2); }
.acdr-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.acdr-count { color: var(--text-3); font-size: 12px; }
.acdr-btns { display: flex; gap: 6px; }
.acr-text { white-space: pre-wrap; font-size: 13.5px; line-height: 1.65; }
.acr-text ins { text-decoration: none; background: color-mix(in srgb, var(--mint) 18%, transparent); color: var(--text); border-radius: 3px; padding: 0 1px; }
.acr-text del + ins, .acr-text ins + del { margin-left: 3px; }
.acr-text del { color: var(--text-3); text-decoration-color: color-mix(in srgb, var(--err) 70%, transparent); background: color-mix(in srgb, var(--err) 8%, transparent); border-radius: 3px; }

/* ---------------------------------------------------------------- calculator */
.acx-inputs { display: flex; flex-direction: column; gap: 12px; }
.acx-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.acx-val { display: inline-flex; align-items: baseline; gap: 4px; }
.acx-val small { color: var(--text-3); font-size: 12px; }
.acx-in { width: 96px; height: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: var(--ac-fill); color: var(--text); font: 650 13px var(--font); text-align: right; outline: 0; }
.acx-in:focus { border-color: var(--line-2); background: var(--surface); }
.acx-row input[type="range"] { --p: 50%; width: 100%; appearance: none; height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--btn) var(--p), var(--ac-fill-2) var(--p)); outline: 0; cursor: pointer; }
.acx-row input[type="range"]::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; border-radius: 999px; background: var(--surface); border: 2px solid var(--btn); box-shadow: var(--shadow-sm); cursor: grab; }
.acx-outs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 14px; }
.acx-out { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--ac-fill); min-width: 0; }
.acx-out span { font-size: 12px; color: var(--text-3); }
.acx-out b { font: 700 17px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acx-out.main { background: var(--btn); }
.acx-out.main span { color: color-mix(in srgb, var(--btn-ink) 70%, transparent); }
.acx-out.main b { color: var(--btn-ink); font-size: 21px; }

/* ---------------------------------------------------------------- timer */
.acti { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.acti-face { position: relative; width: 108px; height: 108px; flex: none; }
.acti-track { fill: none; stroke: var(--ac-fill-2); stroke-width: 7; }
.acti-fill { fill: none; stroke: var(--coral); stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray .25s linear; }
.acti-center { position: absolute; inset: 0; display: grid; place-items: center; }
.acti-time { font: 700 22px var(--display); }
.acti-side { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; flex: 1; }
.acti-side .ach-title { margin: 0; }
.acti-label { font-size: 13px; color: var(--text-2); }
.acti-phases { display: flex; flex-wrap: wrap; gap: 4px; }
.acti-chip { padding: 2px 8px; border-radius: 999px; background: var(--ac-fill); font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.acti-chip.on { background: var(--coral-soft); color: var(--accent-ink); font-weight: 600; }
.acti-chip.past { text-decoration: line-through; }
.acti-play { min-width: 104px; }

/* ---------------------------------------------------------------- recipe */
.acre-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.acre-head .ach-title { margin: 0; }
.acre-serves { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.acre-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.acre-ing { list-style: none; margin: 0; padding: 0; }
.acre-ing label { display: grid; grid-template-columns: 18px 64px 1fr; align-items: baseline; gap: 8px; padding: 5px 0; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--line); }
.acre-ing b { font-weight: 650; }
.acre-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.55; }

/* ---------------------------------------------------------------- quiz, flashcards */
.acq-top { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.acq-top .acl-progress { flex: 1; }
.acq-q { font-size: 14.5px; font-weight: 650; line-height: 1.45; margin-bottom: 10px; }
.acq-cs { display: flex; flex-direction: column; gap: 6px; }
.acq-c { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.acq-c:hover:not(:disabled) { border-color: var(--text-3); background: var(--ac-fill); }
.acq-k { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--ac-fill-2); font: 700 11.5px var(--font); color: var(--text-2); }
.acq-c.right { border-color: var(--mint); background: color-mix(in srgb, var(--mint) 12%, transparent); }
.acq-c.right .acq-k { background: var(--mint); color: var(--surface); }
.acq-c.wrong { border-color: var(--err); background: color-mix(in srgb, var(--err) 10%, transparent); }
.acq-c.wrong .acq-k { background: var(--err); color: #fff; }
.acq-c.dim { opacity: .55; }
.acq-c:disabled { cursor: default; }
.acq-why { margin-top: 10px; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; background: var(--ac-fill); animation: ac-in .25s var(--ease); }
.acq-why.right b { color: var(--mint); }
.acq-why.wrong b { color: var(--err); }
.acq-nav { display: flex; justify-content: flex-end; margin-top: 10px; }
.acq-done { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; text-align: center; }
.acq-score { font: 700 34px var(--display); }
.acq-done p { margin: 0 0 4px; color: var(--text-2); }
.acq-dots { display: flex; gap: 5px; margin-bottom: 8px; }
.acq-dots i { width: 10px; height: 10px; border-radius: 999px; }
.acq-dots i.good { background: var(--mint); }
.acq-dots i.bad { background: var(--err); }
.acf-card { display: block; width: 100%; height: 170px; padding: 0; border: 0; background: transparent; perspective: 900px; cursor: pointer; font: inherit; color: var(--text); }
.acf-in { position: relative; width: 100%; height: 100%; transition: transform .45s var(--ease); transform-style: preserve-3d; }
.acf-card.flipped .acf-in { transform: rotateY(180deg); }
.acf-front, .acf-back { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px 20px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); backface-visibility: hidden; text-align: center; }
.acf-back { transform: rotateY(180deg); background: var(--surface); border-color: color-mix(in srgb, var(--mint) 45%, transparent); }
.acf-front span { font: 650 18px/1.35 var(--display); }
.acf-back span { font-size: 14px; line-height: 1.5; }
.acf-front small, .acf-back small { position: absolute; top: 10px; left: 14px; font: 650 10.5px var(--font); letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.acf-btns { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  .ac, .acq-why { animation: none; }
  .acf-in { transition: none; }
}

/* numbers keep their unit on the same line */
.act td.num { white-space: nowrap; }
/* quiet scrollbars inside cards */
.ac-answer .ac *::-webkit-scrollbar { height: 8px; width: 8px; }
.ac-answer .ac *::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
.ac-answer .ac *::-webkit-scrollbar-track { background: transparent; }
/* stats: the trend line sits beside the figure so the change reads in full */
.acs-tile { position: relative; }
.acs-tile .acs-spark { position: absolute; right: 12px; top: 30px; }
.acs-tile:has(.acs-spark) .acs-value { padding-right: 64px; }
.acs-tile .acs-delta { white-space: normal; }

.ac-btn.sm { height: 28px; padding: 0 11px; font-size: 12px; gap: 5px; }
.ac-btn.done, .ac-btn:disabled { color: var(--text-3); cursor: default; }
.ac-btn.done .ac-i { color: var(--mint); }
.ac-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border: 0; border-radius: 999px; background: var(--ac-fill); color: var(--text-2); font: 600 11.5px var(--font); cursor: pointer; }
.ac-chip:hover { background: var(--ac-fill-2); color: var(--text); }

/* ---------------------------------------------------------------- map */
.ac-map .ac-body, .ac-itinerary .ac-body { padding-bottom: 10px; }
.acmap { margin: 0 -14px; border-block: 1px solid var(--line); }
.ac-map .acmap:first-child { margin-top: -12px; border-top: 0; }
.acit-day .acmap { margin: 0 0 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.acmap-view { position: relative; height: var(--acmap-h, 240px); overflow: hidden; background: #e9e6df; cursor: grab; touch-action: none; outline: 0; user-select: none; -webkit-user-select: none; }
@container (min-width: 560px) { .acmap-view { height: var(--acmap-h, 320px); } }
.acmap-view.dragging { cursor: grabbing; }
.acmap-view:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.acmap-view.plain { background: var(--ac-fill) radial-gradient(circle, var(--line-2) 1px, transparent 1.2px) 0 0 / 18px 18px; }
.acmap-tiles { position: absolute; inset: 0; transition: transform .22s var(--ease), opacity .3s; }
.acmap-tiles.old { opacity: .9; pointer-events: none; }
.acmap-tile { position: absolute; left: 0; top: 0; width: 256px; height: 256px; opacity: 0; transition: opacity .25s; will-change: transform; }
.acmap-tile.in { opacity: 1; }
.acmap-route { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.acmap-route polyline { fill: none; stroke: var(--ac-s1); stroke-width: 2.5; stroke-dasharray: 2 6; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.acmap-pins { position: absolute; inset: 0; pointer-events: none; }
.acmap-pin { position: absolute; left: 0; top: 0; width: 0; height: 0; padding: 0; border: 0; background: none; pointer-events: auto; cursor: pointer; transition: opacity .2s; }
.acmap-pin b { position: absolute; left: -13px; top: -32px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--ac-s1); box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(0, 0, 0, .25); transition: transform .18s var(--ease), background .15s; }
.acmap-pin b { color: #fff; font: 700 11.5px/1 var(--font); }
.acmap-pin b > span { display: block; }
.acmap-pin b > * { transform: rotate(45deg); }
.acmap-pin:hover b, .acmap-pin:focus-visible b { transform: rotate(-45deg) scale(1.1); }
.acmap-pin.on b { background: var(--text); transform: rotate(-45deg) scale(1.15); z-index: 2; }
.acmap-pin.on { z-index: 3; }
.acmap-label { position: absolute; left: 16px; top: -38px; white-space: nowrap; padding: 3px 8px; border-radius: 8px; background: var(--surface); color: var(--text); font: 600 12px var(--font); box-shadow: var(--shadow-sm); opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s var(--ease); pointer-events: none; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.acmap-pin.on .acmap-label, .acmap-pin:hover .acmap-label { opacity: 1; transform: none; }
.acmap-pin.out { opacity: 0; pointer-events: none; }
.acmap-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.acmap-btn { display: grid; place-items: center; width: 30px; height: 30px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.acmap-btn + .acmap-btn { border-top: 1px solid var(--line); }
.acmap-btn:hover { background: var(--ac-fill); color: var(--text); }
.acmap-btn:disabled { opacity: .35; cursor: default; }
.acmap-credit { position: absolute; right: 0; bottom: 0; padding: 2px 6px; border: 0; border-top-left-radius: 6px; background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--text-3); font: 500 10.5px var(--font); cursor: pointer; }
.acmap-credit:hover { color: var(--text); }
.acmap-credit.off { cursor: default; }
.acmap-status { position: absolute; left: 10px; top: 10px; padding: 4px 10px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); font: 600 11.5px var(--font); color: var(--text-2); opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s var(--ease); pointer-events: none; }
.acmap-status.on { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) {
  .acmap-view { background: #2a2c2b; }
  /* OpenStreetMap's tiles are drawn for daylight: turned for the dark. */
  .acmap-tile { filter: invert(.92) hue-rotate(180deg) saturate(.6) brightness(.95) contrast(.9); }
  .acmap-pin b { box-shadow: 0 0 0 2px #1a1d1b, 0 3px 8px rgba(0, 0, 0, .5); }
  .acmap-pin.on b { background: #f3f2ee; color: #1a1d1b; }
}
.acmap-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.acmap-row { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 10px; padding: 6px 6px; margin: 0 -6px; border-radius: 10px; cursor: pointer; outline: 0; }
.acmap-row:hover, .acmap-row:focus-visible { background: var(--ac-fill); }
.acmap-row.on { background: var(--ac-fill-2); }
.acmap-n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: var(--ac-s1); color: #fff; font: 700 11px var(--font); }
.acmap-row.on .acmap-n { background: var(--text); color: var(--surface); }
.acmap-row.lost .acmap-n { background: var(--ac-fill-2); color: var(--text-3); }
.acmap-what { min-width: 0; }
.acmap-what b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acmap-what small { display: block; font-size: 12px; color: var(--text-3); line-height: 1.45; }

/* ---------------------------------------------------------------- itinerary */
.acit-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -14px 12px; padding: 0 14px 2px; scrollbar-width: none; }
.acit-tabs::-webkit-scrollbar { display: none; }
.acit-tab { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--text-2); cursor: pointer; text-align: left; transition: background .15s, border-color .15s; }
.acit-tab b { font-size: 12.5px; font-weight: 650; }
.acit-tab small { font-size: 11px; color: var(--text-3); }
.acit-tab:hover { background: var(--ac-fill); }
.acit-tab[aria-selected="true"] { background: var(--text); border-color: transparent; color: var(--surface); }
.acit-tab[aria-selected="true"] small { color: color-mix(in srgb, var(--surface) 70%, transparent); }
.acit-sum { margin: 0 0 10px; font-size: 13px; color: var(--text-2); }
.acit-items { list-style: none; margin: 0; padding: 0; }
.acit-item { position: relative; display: grid; grid-template-columns: 58px 22px 1fr; gap: 8px; padding-bottom: 14px; animation: ac-in .3s var(--ease) both; }
.acit-item:last-child { padding-bottom: 0; }
.acit-item:not(:last-child)::after { content: ''; position: absolute; left: 76px; top: 20px; bottom: 2px; width: 1px; background: var(--line-2); }
.acit-time { font-size: 12px; font-weight: 650; color: var(--text-3); text-align: right; padding-top: 2px; white-space: nowrap; }
.acit-dot { justify-self: center; width: 10px; height: 10px; margin-top: 5px; border-radius: 999px; border: 2px solid var(--ac-s1); background: var(--surface); box-sizing: border-box; }
.acit-dot.n { width: 20px; height: 20px; margin-top: 0; border: 0; background: var(--ac-s1); color: #fff; font: 700 10.5px/20px var(--font); text-align: center; }
.acit-what { min-width: 0; }
.acit-what b { display: block; font-size: 13.5px; font-weight: 600; }
.acit-what small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.acit-place { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; padding: 0; border: 0; background: none; color: var(--accent-ink); font: 500 12.5px var(--font); cursor: pointer; text-align: left; }
.acit-place:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------------- calendar */
.accal { display: grid; gap: 14px; }
@container (min-width: 560px) { .accal { grid-template-columns: minmax(250px, 300px) 1fr; } }
.accal-head { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; flex-wrap: wrap; }
.accal-head > b { font-size: 13.5px; font-weight: 650; min-width: 120px; text-align: center; }
.accal-jump { margin-left: auto; display: flex; gap: 4px; }
.accal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.accal-wd { text-align: center; font: 600 10.5px var(--font); color: var(--text-3); padding: 2px 0 4px; text-transform: uppercase; }
.accal-day { position: relative; aspect-ratio: 1; max-height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font: 500 12.5px var(--font); font-variant-numeric: tabular-nums; cursor: pointer; padding: 0; }
.accal-day:hover { background: var(--ac-fill); }
.accal-day.has { color: var(--text); font-weight: 650; }
.accal-day.today span { box-shadow: 0 0 0 1.5px var(--accent); border-radius: 999px; padding: 1px 5px; }
.accal-day.sel { background: var(--text); color: var(--surface); }
.accal-dots { position: absolute; bottom: 4px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; }
.accal-dots em { width: 4px; height: 4px; border-radius: 999px; background: var(--ac-s1); }
.accal-day.sel .accal-dots em { background: var(--surface); }
.accal-agenda { min-width: 0; }
.accal-evs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.accal-ev { display: grid; grid-template-columns: 62px 1fr; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--ac-fill); border-left: 3px solid var(--ac-s1); animation: ac-in .3s var(--ease) both; }
.accal-t { font-size: 12.5px; font-weight: 650; display: flex; flex-direction: column; gap: 1px; }
.accal-t small { font-weight: 500; color: var(--text-3); font-size: 11.5px; }
.accal-what { min-width: 0; }
.accal-what > b { display: block; font-size: 13.5px; font-weight: 650; }
.accal-what > small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
.accal-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------------------------------------------------------------- pictures */
.acg-pic { position: relative; width: 100%; height: 100%; background: var(--ac-fill); overflow: hidden; }
.acg-pic img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.acg-pic.in img { opacity: 1; }
.acg-pic:not(.in):not(.missing)::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--surface) 55%, transparent) 50%, transparent 70%) -100% 0 / 200% 100% no-repeat; animation: acg-shine 1.2s infinite; }
@keyframes acg-shine { to { background-position: 200% 0; } }
.acg-pic.missing { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-3); }
.acg-pic.missing small { font-size: 11px; text-align: center; padding: 0 6px; }
.acg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; border-radius: 12px; overflow: hidden; }
@container (min-width: 520px) { .acg-grid.n3, .acg-grid.n4 { grid-template-columns: repeat(3, 1fr); } }
.acg-grid.n1 { grid-template-columns: 1fr; }
.acg-item { position: relative; aspect-ratio: 4 / 3; padding: 0; border: 0; background: none; cursor: zoom-in; overflow: hidden; }
.acg-grid.n1 .acg-item { aspect-ratio: 16 / 10; }
.acg-item.w2 { grid-column: span 2; aspect-ratio: 16 / 9; }
@container (min-width: 520px) {
  /* Three across: the first picture takes a 2×2 corner when the rest then fill the rows. */
  .acg-grid.n3 .acg-item.w2, .acg-grid.n4 .acg-item.w2 { grid-column: auto; aspect-ratio: 4 / 3; }
  .acg-grid.n4 .acg-item.w3 { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
}
.acg-item img { transition: transform .35s var(--ease), opacity .3s; }
.acg-item:hover img { transform: scale(1.04); }
.acg-tag { position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px); padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font: 600 11px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; backdrop-filter: blur(4px); }
.acg-stage { position: relative; border-radius: 12px; overflow: hidden; background: #111; outline: 0; animation: ac-in .25s var(--ease) both; }
.acg-stage .acg-pic.big { height: auto; aspect-ratio: 4 / 3; max-height: 420px; background: #111; }
.acg-stage .acg-pic.big img { object-fit: contain; }
.acg-nav, .acg-close { position: absolute; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .5); color: #fff; cursor: pointer; backdrop-filter: blur(6px); }
.acg-nav { top: calc(50% - 30px); }
.acg-nav.prev { left: 8px; }
.acg-nav.next { right: 8px; }
.acg-close { top: 8px; right: 8px; }
.acg-nav:hover, .acg-close:hover { background: rgba(0, 0, 0, .7); }
.acg-cap { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: #111; color: #eee; font-size: 12.5px; }
.acg-cap small { color: #aaa; flex: none; }
.acc-img { aspect-ratio: 16 / 9; height: auto; margin: -12px -12px 10px; width: calc(100% + 24px); border-radius: 11px 11px 0 0; }

/* ---------------------------------------------------------------- before & after */
.acba-stage { position: relative; aspect-ratio: 4 / 3; max-height: 420px; border-radius: 12px; overflow: hidden; cursor: ew-resize; touch-action: none; user-select: none; --ba: 50%; }
.acba-stage .acg-pic { position: absolute; inset: 0; }
.acba-stage .ba-before { clip-path: inset(0 calc(100% - var(--ba)) 0 0); z-index: 1; }
.acba-handle { position: absolute; top: 0; bottom: 0; left: var(--ba); width: 2px; margin-left: -1px; background: #fff; z-index: 2; box-shadow: 0 0 6px rgba(0, 0, 0, .35); outline: 0; }
.acba-handle span { position: absolute; top: 50%; left: 50%; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 999px; background: #fff; color: #222; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.acba-handle:focus-visible span { box-shadow: 0 0 0 3px var(--accent); }
.acba-tag { position: absolute; top: 8px; z-index: 3; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font: 650 11px var(--font); letter-spacing: .03em; text-transform: uppercase; pointer-events: none; }
.acba-tag.l { left: 8px; }
.acba-tag.r { right: 8px; }
.acba-cols, .acba-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 14px minmax(0, 1fr) 52px; align-items: baseline; gap: 6px; }
.acba-cols .ac-label { margin: 0; }
.acba-rows { list-style: none; margin: 4px 0 0; padding: 0; }
.acba-row { padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.acba-l { color: var(--text-2); }
.acba-b { color: var(--text-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-3) 50%, transparent); }
.acba-arrow { color: var(--text-3); }
.acba-a { font-weight: 650; }
.acba-pct { justify-self: end; font-size: 11.5px; font-weight: 650; padding: 1px 6px; border-radius: 999px; background: var(--ac-fill); color: var(--text-2); }
.acba-pct.good { color: var(--ac-good); background: color-mix(in srgb, var(--ac-good) 12%, transparent); }
.acba-pct.bad { color: var(--ac-bad); background: color-mix(in srgb, var(--ac-bad) 12%, transparent); }
.acba-seg { margin-bottom: 10px; }
.acba-pair { display: grid; gap: 10px; }
.acba-text { padding: 10px 12px; border-radius: 12px; background: var(--ac-fill); min-width: 0; }
.acba-text.after { background: color-mix(in srgb, var(--mint) 9%, transparent); }
.acba-body { white-space: pre-wrap; font-size: 13px; line-height: 1.55; }
.acba-pair[data-show="before"] .acba-text.after, .acba-pair[data-show="after"] .acba-text.before { display: none; }
@container (min-width: 560px) {
  .acba-seg { display: none; }
  .acba-pair { grid-template-columns: 1fr 1fr; }
  .acba-pair .acba-text { display: block !important; }
}
