:root {
  --bg: #F3F6F4;
  --surface: #FFFFFF;
  --ink: #14312A;
  --text: #1E2B27;
  --muted: #5D6F67;
  --line: #D8E0DC;
  --accent: #2E7A57;
  --accent-soft: #DDEFE5;
  --pos: #1F7A4D;
  --neg: #B3261E;
  --neg-soft: #FBE6E4;
  --warn: #8A5A0B;
  --warn-soft: #FBF0D9;
  --plan: #8FB8A4;
  --figures: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1A16; --surface: #15231E; --ink: #E4EEE9; --text: #D5E1DB; --muted: #93A69D;
    --line: #26372F; --accent: #5FBF8F; --accent-soft: #1C3A2D; --pos: #6BCB98; --neg: #F08A80;
    --neg-soft: #3A1E1B; --warn: #E8B85A; --warn-soft: #33290F; --plan: #3F6F58;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--body); }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2 { color: var(--ink); line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; }
h2.sub { margin-top: 2.25rem; }
.lead { color: var(--muted); max-width: 62ch; margin: 0 0 1.5rem; }
.num { font-family: var(--figures); font-variant-numeric: tabular-nums lining-nums; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
code { font-size: .9em; background: var(--accent-soft); padding: .1em .35em; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Cabecera */
.top { display: flex; align-items: center; gap: 1.5rem; padding: .75rem max(1rem, calc((100vw - 1120px) / 2)); background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 5; }
@media (prefers-color-scheme: dark) { .top { background: #0A120F; border-bottom: 1px solid var(--line); } }
.brand { color: #fff; text-decoration: none; font-family: var(--figures); font-size: 1.15rem; white-space: nowrap; }
.nav { display: flex; gap: .25rem; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.nav a { color: #C9DDD3; text-decoration: none; padding: .35rem .65rem; border-radius: var(--r); white-space: nowrap; font-size: .92rem; }
.nav a:hover { color: #fff; }
.nav a[aria-current] { background: rgba(255,255,255,.12); color: #fff; }
.logout button { color: #C9DDD3; }

main.page { max-width: 1120px; margin: 0 auto; padding: 2rem 1rem 4rem; }
main.narrow { max-width: 460px; margin: 6vh auto; padding: 2rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
body.bare { background: var(--bg); }

/* Botones */
.btn { display: inline-block; background: var(--ink); color: #fff; border: 0; border-radius: var(--r); padding: .65rem 1.1rem; font: 600 .95rem var(--body); cursor: pointer; text-decoration: none; }
@media (prefers-color-scheme: dark) { .btn { background: var(--accent); color: #0B1511; } }
.btn:hover { filter: brightness(1.12); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.link.danger { color: var(--neg); }

/* Formularios */
.form { margin: 0 0 1rem; }
.form.stack .field { margin-bottom: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem 1.25rem; margin-bottom: 1.25rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field.wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .9rem; color: var(--ink); }
.field small, .opt { color: var(--muted); font-size: .8rem; font-weight: 400; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .55rem .65rem; min-height: 2.6rem; width: 100%; }
input:disabled { color: var(--muted); }
input[inputmode="decimal"], input[inputmode="numeric"] { font-family: var(--figures); font-variant-numeric: tabular-nums; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem .25rem; margin: 0 0 1.5rem; background: var(--surface); }
legend { font-weight: 700; color: var(--ink); padding: 0 .4rem; }
form.inline { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0 .75rem .75rem 0; }
form.inline input, form.inline select { width: auto; }

/* Avisos */
.flash { padding: .7rem .9rem; border-radius: var(--r); margin: 0 0 1.25rem; background: var(--accent-soft); color: var(--ink); }
.flash.error { background: var(--neg-soft); color: var(--neg); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.empty { color: var(--muted); font-style: italic; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; letter-spacing: .05em; background: var(--bg); padding: .5rem .75rem; border-radius: var(--r); word-break: break-all; }
.aside { margin-top: 2rem; font-size: .9rem; }

/* Tablas */
.tablewrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table.list { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.list th { text-align: left; font-weight: 600; color: var(--muted); padding: .6rem .8rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td .num { white-space: nowrap; }
table.list td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.num { text-align: right; }
table.list .act { text-align: right; white-space: nowrap; }
table.list .act form { display: inline; margin-left: .75rem; }
table.list.small { font-size: .82rem; }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; background: var(--bg); color: var(--muted); }
.pill.en_marcha { background: var(--warn-soft); color: var(--warn); }
.pill.hecho { background: var(--accent-soft); color: var(--pos); }

/* Acceso */
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .75rem; }
.qr { width: 220px; max-width: 100%; margin: .75rem 0; background: #fff; padding: 6px; border-radius: 8px; }
.qr svg { display: block; width: 100%; height: auto; }
.codes { columns: 2; list-style: none; padding: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; }
.codes li { padding: .3rem 0; }

/* Asistente */
.wizard { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2.5rem; }
.wizard > * { min-width: 0; }
body { overflow-x: hidden; }
.progress { list-style: none; margin: 0; padding: 0; position: sticky; top: 5rem; align-self: start; }
.progress li a { display: flex; gap: .75rem; align-items: center; padding: .45rem 0; text-decoration: none; color: var(--muted); }
.progress .n { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); font: 600 .85rem var(--figures); flex: none; background: var(--surface); }
.progress li.done .n { background: var(--accent-soft); border-color: transparent; color: var(--pos); }
.progress li.now a { color: var(--ink); font-weight: 600; }
.progress li.now .n { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.wstep { min-width: 0; }
.wnav { display: flex; gap: .75rem; justify-content: space-between; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0 0 1.25rem; }
.chips span { color: var(--muted); font-size: .85rem; margin-right: .25rem; }
.chip { font: .85rem var(--body); border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: .3rem .7rem; cursor: pointer; }
.chip:hover { border-color: var(--accent); }

/* Panel */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: end; padding: 2rem 0 2.25rem; border-bottom: 2px solid var(--ink); margin-bottom: 1.5rem; }
.hl { margin: 0; color: var(--muted); }
.big { font-size: clamp(3rem, 9vw, 5.5rem); line-height: 1; margin: .35rem 0 .5rem; letter-spacing: -0.02em; }
.hs { margin: 0; color: var(--muted); }
.hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem; margin: 0; }
.hero-side dt { color: var(--muted); font-size: .85rem; }
.hero-side dd { margin: 0; font-size: 1.35rem; color: var(--ink); }
.hero-side small { display: block; font: .8rem var(--body); color: var(--muted); }
.cta { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; background: var(--warn-soft); padding: .8rem 1rem; border-radius: 10px; margin: 0 0 2rem; }
.cta span { color: var(--warn); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.cols section, .split { min-width: 0; }
svg.bars, svg.hist { width: 100%; height: auto; display: block; }
svg .bl { fill: var(--text); font: 12px var(--body); }
svg .bv, svg .mv { fill: var(--muted); font: 11px var(--figures); }
svg .ml { fill: var(--muted); font: 12px var(--body); }
svg .b-hoy { fill: var(--ink); }
svg .b-plan { fill: var(--plan); }
svg .axis { stroke: var(--line); stroke-width: 1; }
svg .pos { fill: var(--pos); } svg .neg { fill: var(--neg); }
.legend { font-size: .8rem; color: var(--muted); display: flex; gap: .4rem; align-items: center; }
.legend .k { width: 12px; height: 8px; border-radius: 2px; display: inline-block; margin-left: .6rem; }
.legend .k.hoy { background: var(--ink); } .legend .k.plan { background: var(--plan); }
ul.plan, ul.debts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
ul.plan li, ul.debts li { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.pt, .dn { flex: 1 1 12rem; color: var(--ink); font-weight: 600; }
.pa { color: var(--pos); }
.pd, .dl { color: var(--muted); font-size: .85rem; }
.dp { margin-left: auto; color: var(--muted); }
ul.plan li.hecho .pt { text-decoration: line-through; color: var(--muted); font-weight: 400; }
dl.summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin: 0 0 2rem; }
dl.summary > div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; }
dl.summary dt { color: var(--muted); font-size: .85rem; }
dl.summary dd { margin: .2rem 0 0; font-size: 1.5rem; color: var(--ink); }
dl.summary dd.note { font: .8rem var(--body); color: var(--muted); }

@media (max-width: 820px) {
  .top { gap: .75rem; padding: .6rem 1rem; flex-wrap: wrap; justify-content: space-between; }
  .nav { order: 3; flex-basis: 100%; }
  .wizard, .cols, .hero { grid-template-columns: minmax(0, 1fr); }
  .progress { position: static; display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .5rem; }
  .progress .t { display: none; }
  .progress li.now .t { display: inline; }
  .hero { padding-top: 1rem; }
  main.page { padding-top: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* ---------- v2: panel visual y móvil ---------- */
:root { --c0:#14312A; --c1:#2E7A57; --c2:#7FB69A; --c3:#B88A3E; --c4:#5B6C8F; --c5:#A4543F; --c6:#8C7AA9; --c7:#3E8E9E; --c8:#C7B98F; --c9:#6B7C75; --c10:#2B4C7E; --c11:#9E6B8C; --save:#36B37E; }
@media (prefers-color-scheme: dark) { :root { --c0:#CFE3D9; --c1:#5FBF8F; --c2:#2F6B52; --c3:#D9A85A; --c4:#8EA2CF; --c5:#E08A72; --c6:#B9A6DA; --c7:#6BC2D2; --c8:#8C8162; --c9:#93A69D; --c10:#7C9BD1; --c11:#D29BBF; --save:#7BE0AE; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem 1.2rem; margin-bottom: 1.25rem; min-width: 0; }
.card h2 { margin-bottom: .9rem; }
.sub2 { margin: 1.4rem 0 .6rem; font-size: 1rem; }
.grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 1.25rem; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .grid2, .grid2 + .card, .card + .grid2 { margin-top: 1.25rem; }

.hero2 { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 1.5rem 2.5rem; align-items: end; padding: 1.5rem 0 1.75rem; border-bottom: 2px solid var(--ink); margin-bottom: 1.5rem; }
.goal svg, .cushion svg { width: 100%; height: 10px; display: block; margin: .25rem 0 .35rem; }
.cushion svg { height: 18px; }
.goal p, .cushion p { margin: 0; color: var(--muted); font-size: .9rem; }
.g-track { fill: var(--line); } .g-fill { fill: var(--save); }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1.25rem; margin: 0; }
.kpis dt { color: var(--muted); font-size: .82rem; }
.kpis dd { margin: 0; font-size: 1.35rem; color: var(--ink); line-height: 1.2; }
.kpis dd.note { font: .78rem var(--body); color: var(--muted); }
.kpis.small dd:not(.note) { font-size: 1.2rem; }

.alerts { background: var(--warn-soft); border-radius: 14px; padding: .9rem 1.2rem; margin-bottom: 1.25rem; }
.alerts h2 { color: var(--warn); font-size: .95rem; margin-bottom: .4rem; }
.alerts ul { margin: 0; padding-left: 1.1rem; }
.alerts li { margin: .25rem 0; }
.alerts a { color: var(--warn); }

.donut-wrap { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 1.25rem; align-items: center; }
svg.donut { width: 100%; height: auto; }
svg.donut path { stroke-linecap: butt; }
svg.donut .track { stroke: var(--line); }
.dc-big { font: 600 20px var(--figures); fill: var(--ink); }
.dc-sub { font: 11px var(--body); fill: var(--muted); }
.sl0{stroke:var(--c0)} .sl1{stroke:var(--c1)} .sl2{stroke:var(--c2)} .sl3{stroke:var(--c3)} .sl4{stroke:var(--c4)} .sl5{stroke:var(--c5)} .sl6{stroke:var(--c6)} .sl7{stroke:var(--c7)} .sl8{stroke:var(--c8)} .sl9{stroke:var(--c9)} .sl10{stroke:var(--c10)} .sl11{stroke:var(--c11)} .sl-ahorro{stroke:var(--save)}
.legend-list { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.legend-list li { display: grid; grid-template-columns: 12px minmax(0,1fr) auto 3.2rem; gap: .5rem; align-items: center; padding: .28rem 0; border-bottom: 1px solid var(--line); }
.legend-list li:last-child { border-bottom: 0; }
.legend-list .sw { width: 12px; height: 12px; border-radius: 3px; }
.sw.sl0{background:var(--c0)} .sw.sl1{background:var(--c1)} .sw.sl2{background:var(--c2)} .sw.sl3{background:var(--c3)} .sw.sl4{background:var(--c4)} .sw.sl5{background:var(--c5)} .sw.sl6{background:var(--c6)} .sw.sl7{background:var(--c7)} .sw.sl8{background:var(--c8)} .sw.sl9{background:var(--c9)} .sw.sl10{background:var(--c10)} .sw.sl11{background:var(--c11)} .sw.sl-ahorro{background:var(--save)}
.lk { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv { text-align: right; } .lp { text-align: right; color: var(--muted); font-size: .8rem; }

ul.plan2, ul.vars, ul.debts2 { list-style: none; margin: 0; padding: 0; }
ul.plan2 li { padding: .75rem 0; border-bottom: 1px solid var(--line); }
ul.plan2 li:first-child { padding-top: 0; }
.pl-head { display: flex; justify-content: space-between; gap: .75rem; align-items: center; margin-bottom: .35rem; }
.pl-nums { display: flex; flex-wrap: wrap; gap: .2rem 1rem; margin: .3rem 0 0; font-size: .82rem; color: var(--muted); }
.pl-nums b { color: var(--ink); font-weight: 400; }
.pl-nums .pa b { color: var(--pos); }
ul.plan2 li.hecho .pt { text-decoration: line-through; color: var(--muted); }
svg.pbar { width: 100%; height: 22px; display: block; }
.pb-track { fill: var(--bg); } .pb-hoy { fill: #B9C6C0; } .pb-obj { fill: var(--pos); }
.pb-ok { fill: var(--pos); } .pb-bad { fill: var(--neg); }
@media (prefers-color-scheme: dark) { .pb-hoy { fill: #2C3F37; } }
.sum { margin: .9rem 0 0; color: var(--muted); }

svg.evo { width: 100%; height: auto; display: block; }
.evo-line { stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.evo-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.obj-line { stroke: var(--save); stroke-width: 1.5; stroke-dasharray: 5 4; }
.legend .k.line { height: 3px; background: var(--ink); }
.legend .k.pos { background: var(--pos); }
.legend .k.obj { height: 0; border-top: 2px dashed var(--save); }

ul.debts2 li { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .1rem .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
ul.debts2 .dl { grid-column: 1 / -1; color: var(--muted); font-size: .82rem; }
ul.vars li { display: grid; grid-template-columns: minmax(0,9rem) minmax(0,1fr) 5rem; gap: .2rem .9rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line); }
ul.vars .vv { text-align: right; }
ul.vars .vp { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); }
ul.vars li.ok .vv { color: var(--pos); } ul.vars li.bad .vv { color: var(--neg); } ul.vars li.warn .vv { color: var(--warn); }

.menu { list-style: none; padding: 0; margin: 0 0 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.menu li + li { border-top: 1px solid var(--line); }
.menu a { display: block; padding: 1rem 1.1rem; color: var(--ink); text-decoration: none; font-weight: 600; }

/* Barra inferior (solo móvil) */
.tabs { display: none; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[href*="p=mas"] .ic { fill: currentColor; stroke: none; }

@media (max-width: 820px) {
  .top .nav, .top .logout { display: none; }
  .top { position: static; padding: .75rem 1rem; }
  .tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0); }
  .tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .45rem; color: var(--muted); text-decoration: none; font-size: .72rem; }
  .tabs a[aria-current] { color: var(--ink); font-weight: 600; }
  body.app main.page { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0)); }
  .hero2, .grid2 { grid-template-columns: minmax(0,1fr); }
  .hero2 { padding-top: .25rem; gap: 1.25rem; }
  .donut-wrap { grid-template-columns: minmax(0,1fr); justify-items: center; }
  svg.donut { max-width: 220px; }
  .legend-list { width: 100%; }
  .card { padding: 1rem; border-radius: 12px; }
  h1 { font-size: 1.5rem; }
  /* Tablas como tarjetas */
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list thead { display: none; }
  .tablewrap { border: 0; background: transparent; overflow: visible; }
  table.list tr { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .6rem .9rem; margin-bottom: .6rem; }
  table.list td { border: 0; padding: .2rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  table.list td::before { content: attr(data-label); color: var(--muted); font-size: .82rem; text-align: left; }
  table.list td.first { font-weight: 600; color: var(--ink); font-size: 1rem; text-align: left; }
  table.list td.first::before { content: none; }
  table.list td.act { justify-content: flex-end; gap: 1.25rem; padding-top: .5rem; }
  table.list td.act::before { content: none; }
  table.list td.act form { margin: 0; }
  table.list td.num { text-align: right; }
  .grid { grid-template-columns: minmax(0,1fr); }
  .btn { width: 100%; text-align: center; padding: .8rem 1rem; }
  .wnav .btn, form.inline .btn { width: auto; }
}

/* ---------- importador ---------- */
.hint { color: var(--muted); font-size: .85rem; margin: 0 0 .8rem; }
.uprow { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: .6rem; margin-bottom: .6rem; align-items: center; }
.uprow input[type=file] { padding: .4rem; }
ul.pend { list-style: none; margin: 0 0 1rem; padding: 0; }
ul.pend li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.pm { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .1rem 1rem; }
.pc { font-weight: 600; color: var(--ink); word-break: break-word; }
.pf { grid-column: 1; color: var(--muted); font-size: .8rem; }
.pi { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.pa2 { display: grid; grid-template-columns: minmax(0, 1.3fr) auto minmax(0, 1fr); gap: .5rem; margin-top: .5rem; align-items: center; }
.rc { display: flex; gap: .3rem; align-items: center; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.rc input { width: auto; min-height: 0; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.25rem 0; }
.actions form { margin: 0; }
details.card summary { cursor: pointer; font-weight: 600; color: var(--ink); }
details.card[open] summary { margin-bottom: .8rem; }
ul.rules { list-style: none; margin: 0; padding: 0; }
ul.rules li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem; margin-bottom: .6rem; }
ul.rules li.dead { opacity: .6; }
form.rule { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: .5rem; align-items: start; margin: 0; }
form.rule textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.rdel { margin: .3rem 0 0; text-align: right; }
@media (max-width: 820px) {
  .uprow, .pa2, form.rule { grid-template-columns: minmax(0,1fr); }
  .rc { white-space: normal; }
}
