/* Mobile-first design system. Base styles for 360–430 px, wider layouts from 768/1024 px.
   No inline styles anywhere (CSP style-src 'self'). */
:root {
  --bg: #f6f6f7; --surface: #fff; --surface-2: #fafafa; --text: #18181b; --muted: #6b6b76;
  --line: #e7e7ea; --line-strong: #d4d4d8;
  --brand: #c8232c; --brand-dark: #a11b22; --brand-soft: #fdecec;
  --ink: #18181b; --ink-hover: #2e2e33;
  --green: #15803d; --green-soft: #e9f7ef; --amber: #b45309; --amber-soft: #fef5e6;
  --blue: #1d4ed8; --blue-soft: #eaf0fe; --red: #b91c1c; --red-soft: #fdeeee;
  --radius: 14px; --radius-sm: 10px; --tap: 44px;
  --shadow: 0 1px 2px rgba(16, 16, 20, .04), 0 1px 1px rgba(16, 16, 20, .02);
  --shadow-lg: 0 10px 30px rgba(16, 16, 20, .08);
  --sidebar: 248px;
  --input-bg: #fff; --hover: #f4f4f5; --chip: #f1f1f3; --track: #ececef; --row-hover: #fbfbfc;
  --on-ink: #fff; --retry-soft: #fff1e6; --switch-off: #d4d4d8;
  color-scheme: light;
}
@font-face { font-family: "Mountains of Christmas"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/mountains-of-christmas-700-latin.woff2") format("woff2"); } /* Apache 2.0, see fonts/LICENSE-MountainsOfChristmas.txt */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
       background: var(--bg); color: var(--text); overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-underline-offset: 2px; }
h1 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0; letter-spacing: -.005em; }
h3 { font-size: .95rem; margin: 1rem 0 .25rem; }
p { margin: .4rem 0; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .875rem; margin: .25rem 0 .5rem; }
.err { color: var(--red); }
.ok { color: var(--green); }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Public top bar ---------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center;
          justify-content: space-between; gap: .5rem; padding: .4rem .9rem; min-height: 56px;
          background: var(--brand); color: #fff; }
.brand { color: inherit; font-weight: 700; text-decoration: none; min-height: var(--tap);
         display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.brand-mark { font-size: 1.4rem; line-height: 1; }
.nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; justify-content: flex-end; }
.navlink { color: #fff; text-decoration: none; padding: 0 .6rem; min-height: var(--tap);
           display: inline-flex; align-items: center; }
.linkbtn { background: none; border: 0; font: inherit; cursor: pointer; }
.inline { display: inline; margin: 0; }

.container { max-width: 1100px; margin: 0 auto; padding: 1rem .9rem 2rem; }
.narrow { max-width: 600px; margin-left: auto; margin-right: auto; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* --- Cards ------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card > h2:first-child, .card-head { margin-bottom: .6rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-sub { color: var(--muted); font-size: .875rem; margin: -.35rem 0 .75rem; }
.card-foot { border-top: 1px solid var(--line); margin: 1rem -1.1rem -1.1rem; padding: .85rem 1.1rem;
             background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius);
             display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.card-alert { border-color: #f3b4b7; background: linear-gradient(0deg, var(--surface), var(--brand-soft)); }

/* --- Alerts ------------------------------------------------------------------------ */
.alert { border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: .9rem; border: 1px solid;
         font-size: .95rem; }
.alert-ok { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, transparent); color: var(--green); }
.alert-error { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 30%, transparent); color: var(--red); }
.alert-warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 30%, transparent); color: var(--amber); }
.alert-info { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 30%, transparent); color: var(--blue); }

/* --- Forms ------------------------------------------------------------------------- */
.form label { display: block; font-weight: 600; font-size: .95rem; margin-top: .9rem; }
.form label:first-of-type { margin-top: .25rem; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number],
input[type=datetime-local], input[type=time], input[type=date], input[type=file], select, textarea {
  width: 100%; font: inherit; font-size: 16px; /* >= 16px prevents iOS zoom */ padding: .6rem .8rem;
  min-height: var(--tap); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--text); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #8f8f99;
  box-shadow: 0 0 0 3px rgba(24, 24, 27, .08); }
input[type=file] { padding: .45rem; }
textarea { resize: vertical; line-height: 1.45; }
.form .check { font-weight: 400; display: flex; gap: .7rem; align-items: flex-start; min-height: var(--tap); padding-top: .55rem; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; flex: none; accent-color: var(--ink); margin: .05rem 0 0; }
.counter { text-align: right; }
.form-row { display: grid; gap: .75rem; grid-template-columns: 1fr 1fr; }
.form-row > div > label { margin-top: .9rem; }

/* Toggle switch (checkbox with class="switch") */
input.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px;
  background: var(--switch-off); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
input.switch:checked { background: var(--green); }
input.switch:checked::after { transform: translateX(18px); }
input.switch:focus-visible { box-shadow: 0 0 0 3px rgba(21, 128, 61, .25); }

/* --- Buttons ------------------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
       min-height: var(--tap); min-width: var(--tap); padding: 0 1rem; border-radius: var(--radius-sm);
       border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit;
       font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
       transition: background .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink-hover); }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); }
.btn-danger { color: var(--red); border-color: #f0c2c2; }
.btn-danger:hover { background: var(--red-soft); }
.btn-danger-solid { background: #c81e1e; border-color: #c81e1e; color: #fff; }
.btn-danger-solid:hover { background: #991b1b; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-icon { padding: 0; width: var(--tap); }
.btn-block { width: 100%; margin-top: 1rem; }
.btn-small { min-height: 36px; padding: 0 .75rem; font-size: .875rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.actions form { margin: 0; }

/* --- Badges and pills ------------------------------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600;
         border-radius: 999px; padding: .2rem .6rem; white-space: nowrap; background: var(--chip); color: var(--muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge-plain::before { content: none; }
.badge-pending, .badge-rendering { background: var(--chip); color: var(--muted); }
.badge-ready { background: var(--amber-soft); color: var(--amber); }
.badge-approved, .badge-calling { background: var(--blue-soft); color: var(--blue); }
.badge-done, .badge-ok { background: var(--green-soft); color: var(--green); }
.badge-retry { background: var(--retry-soft); color: var(--amber); }
.badge-failed, .badge-err { background: var(--red-soft); color: var(--red); }
.badge-cancelled { background: var(--chip); color: var(--muted); }

/* --- Orders (cards) ---------------------------------------------------------------------- */
.cards { display: grid; gap: .9rem; grid-template-columns: 1fr; }
.cards > .card { margin: 0; }
.call-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.call-name { font-size: 1.1rem; margin: 0; }
.call-phone { display: inline-block; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; margin: .9rem 0 .5rem; }
.meta div { min-width: 0; }
.meta .full { grid-column: 1 / -1; }
.meta dt { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.meta dd { margin: 0; font-variant-numeric: tabular-nums; }
.text summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; color: var(--blue);
                font-weight: 500; }
.text p { white-space: pre-wrap; margin: .25rem 0 .5rem; background: var(--surface-2); border: 1px solid var(--line);
          border-radius: var(--radius-sm); padding: .7rem .8rem; }
audio { width: 100%; margin: .35rem 0 .6rem; }
.orderlist { list-style: none; margin: .25rem 0 0; padding: 0; }
.orderlist li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; padding: .55rem 0;
                border-bottom: 1px solid var(--line); min-height: var(--tap); }
.orderlist li:last-child { border-bottom: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* --- Segmented control -------------------------------------------------------------------- */
.segmented { display: inline-flex; background: var(--track); border-radius: 12px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.segmented a { padding: 0 .9rem; min-height: var(--tap); display: inline-flex; align-items: center; white-space: nowrap;
               text-decoration: none; color: var(--muted); border-radius: 9px; font-weight: 600; font-size: .9rem; }
.segmented a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.count { display: inline-flex; min-width: 1.4rem; height: 1.4rem; align-items: center; justify-content: center;
         border-radius: 999px; background: var(--brand); color: #fff; font-size: .75rem; margin-left: .35rem; padding: 0 .35rem; }

/* --- Tables --------------------------------------------------------------------------------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
              box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1rem; }
table.list { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.list th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
                color: var(--muted); font-weight: 600; background: var(--surface-2); padding: .65rem .9rem;
                border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle;
                font-variant-numeric: tabular-nums; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td { background: var(--row-hover); }
tr.muted td { color: var(--muted); }
td.num, th.num { text-align: right; }
td.empty-row { text-align: center; color: var(--muted); padding: 2rem; }

/* --- Admin shell ------------------------------------------------------------------------------ */
.admin-shell { min-height: 100vh; }
.sidebar { display: none; }
.mobilebar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.mobilebar-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
                 padding: .35rem .6rem .35rem .9rem; min-height: 56px; }
.mobilebar .brand { color: var(--text); }
.menu { position: relative; }
.menu > summary { list-style: none; display: inline-flex; align-items: center; gap: .4rem; min-height: var(--tap);
                  padding: 0 .8rem; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
                  font-weight: 600; cursor: pointer; background: var(--surface); color: var(--text); }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { background: var(--hover); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); width: min(300px, calc(100vw - 1.5rem));
              background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
              box-shadow: var(--shadow-lg); padding: .4rem; }
.navlist { list-style: none; margin: 0; padding: 0; }
.navlist a, .navlist button { display: flex; align-items: center; gap: .7rem; min-height: var(--tap); width: 100%;
  padding: 0 .75rem; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font: inherit;
  font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left; }
.navlist a:hover, .navlist button:hover { background: var(--hover); color: var(--text); }
.navlist a.active { background: var(--brand-soft); color: var(--brand-text, var(--brand-dark)); font-weight: 600; }
.navlist a.active .icon { stroke: var(--brand); }
.navlist .sep { height: 1px; background: var(--line); margin: .35rem .5rem; }
.navlabel { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #a1a1aa;
            padding: .8rem .75rem .3rem; font-weight: 600; }
.admin-main { padding: 1rem .9rem 2.5rem; max-width: 1200px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem;
            flex-wrap: wrap; margin: .25rem 0 1.1rem; }
.pagehead p { margin: .15rem 0 0; color: var(--muted); }
.userchip { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; color: var(--muted); font-size: .875rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text, var(--brand-dark));
          display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }

/* --- Dashboard ----------------------------------------------------------------------------------- */
.kpis { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem;
       box-shadow: var(--shadow); min-width: 0; }
.kpi-label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: .2rem;
             font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .8rem; color: var(--muted); }
.kpi-link { text-decoration: none; color: inherit; display: block; }
.kpi-link:hover .kpi, a.kpi:hover { border-color: var(--line-strong); }
.grid2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.grid2 > .card { margin: 0; }
.grid2 + .card, .card + .grid2 { margin-top: 1rem; }
.statusrows { list-style: none; margin: 0; padding: 0; }
.statusrows li { display: flex; align-items: center; justify-content: space-between; gap: .75rem;
                 padding: .6rem 0; border-bottom: 1px solid var(--line); min-height: var(--tap); }
.statusrows li:last-child { border-bottom: 0; }
.statusrows .k { color: var(--muted); }
.statusrows .v { text-align: right; }
/* dashboard: what is running right now */
.lines { display: grid; gap: .5rem; padding: .25rem 0 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.lines-head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.lines-count { color: var(--muted); }
.lines-count b { font-size: 1.6rem; color: var(--text); font-variant-numeric: tabular-nums; }
.lines-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(14px, 1fr)); gap: 6px; }
.line { height: 22px; border-radius: 6px; background: var(--track); }
.line.on { background: var(--green); }
.lines .hint { margin: 0; }
.slotgrid { display: grid; gap: .75rem; align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.slotgroup { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem .85rem; background: var(--surface-2); min-width: 0; }
.slotgroup.is-active { border-color: var(--green); background: var(--green-soft); }
.slotgroup-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-weight: 600; margin-bottom: .4rem; }
.slotgroup-n { color: var(--muted); font-weight: 500; }
.slotgroup-n b { font-size: 1.35rem; color: var(--text); font-variant-numeric: tabular-nums; }
.slots { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.slot { display: grid; grid-template-columns: 10px 1.1rem minmax(0, 1fr) auto; align-items: center; gap: .5rem; font-size: .92rem; min-height: 1.9rem; }
.slot-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--switch-off); }
.slot.on .slot-dot { background: var(--green); box-shadow: 0 0 0 0 var(--green); }
.slot-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.slot-task { overflow-wrap: anywhere; }
.slot.on .slot-task { font-weight: 600; }
.slot-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.slot-free { grid-template-columns: 10px minmax(0, 1fr); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 500; }
@media (prefers-reduced-motion: no-preference) {
  .slot.on .slot-dot { animation: slot-pulse 1.6s ease-out infinite; }
  @keyframes slot-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 55%, transparent); }
                          100% { box-shadow: 0 0 0 7px transparent; } }
}
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.bars li { display: grid; grid-template-columns: 9.5rem 1fr 2.5rem; align-items: center; gap: .6rem; font-size: .9rem; }
.bars .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
progress { appearance: none; -webkit-appearance: none; width: 100%; height: 8px; border: 0; border-radius: 999px;
           background: var(--track); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--track); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--ink); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--ink); border-radius: 999px; }
progress.brand::-webkit-progress-value { background: var(--brand); }
progress.brand::-moz-progress-bar { background: var(--brand); }
.estop { display: flex; flex-direction: column; gap: .75rem; }
.estop h2 { display: flex; align-items: center; gap: .5rem; }

/* --- Settings ------------------------------------------------------------------------------------- */
.tabbar { display: flex; gap: .25rem; overflow-x: auto; margin: 0 -.9rem 1rem; padding: 0 .9rem; scrollbar-width: none;
          border-bottom: 1px solid var(--line); }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar a { flex: none; min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 .9rem; margin-bottom: -1px;
            color: var(--muted); text-decoration: none; font-size: .925rem; font-weight: 500; border-bottom: 2px solid transparent; }
.tabbar a:hover { color: var(--text); }
.tabbar a.active { color: var(--text); font-weight: 650; border-bottom-color: var(--brand); }
@media (min-width: 1024px) { .tabbar { margin: 0 0 1.25rem; padding: 0; flex-wrap: wrap; } }
.setting { display: grid; gap: .35rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.setting:first-of-type { padding-top: .25rem; }
.setting:last-of-type { border-bottom: 0; }
.setting-label { font-weight: 600; font-size: .95rem; margin: 0; }
.setting-help { color: var(--muted); font-size: .85rem; margin: 0; }
.setting-bool { grid-template-columns: 1fr auto; align-items: center; }
.setting-bool .setting-text { cursor: pointer; }
.secret { display: grid; gap: .6rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.secret:last-child { border-bottom: 0; padding-bottom: 0; }
.secret-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.secret-form { display: flex; gap: .5rem; }
.secret-form input { flex: 1; min-width: 0; }
.anchor { scroll-margin-top: 80px; }

/* Times */
.weekdays { display: grid; gap: 0; margin-bottom: .5rem; }
.weekday { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; padding: .55rem 0;
           border-bottom: 1px solid var(--line); min-height: 52px; }
.weekday:last-child { border-bottom: 0; }
.weekday strong { width: 7.5rem; }
.chiprow { display: inline-flex; align-items: center; gap: .15rem; margin: 0; background: var(--chip);
           border-radius: 999px; padding-left: .8rem; font-variant-numeric: tabular-nums; font-weight: 500; }
.chiprow .btn { border-radius: 999px; border: 0; background: transparent; color: var(--muted); }
.chiprow .btn:hover { color: var(--red); background: var(--red-soft); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem .9rem; }
.login-card { width: 100%; max-width: 400px; }
.login-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.1rem; margin-bottom: 1.25rem;
               justify-content: center; }

/* --- Breakpoints ---------------------------------------------------------------------------------- */
@media (min-width: 640px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .setting { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; column-gap: 1.5rem; }
  .setting-bool { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .setting > .setting-text { padding-top: .5rem; }
  .setting-bool > .setting-text { padding-top: 0; }
}
@media (min-width: 768px) {
  .container { padding: 1.5rem 1.5rem 3rem; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 1.6rem; }
  .admin-main { padding: 1.5rem 1.75rem 3rem; }
}
@media (min-width: 1024px) {
  .sidebar { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
             background: var(--surface); border-right: 1px solid var(--line); padding: .9rem .75rem; overflow-y: auto; }
  .sidebar .brand { color: var(--text); padding: 0 .5rem .6rem; }
  .sidebar .navlist { flex: 1; }
  .mobilebar { display: none; }
  .admin-content { margin-left: var(--sidebar); }
  .admin-main { padding: 2rem 2.25rem 3rem; }
}
@media (min-width: 1280px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Narrow screens: tables become cards (one per row). */
@media (max-width: 767px) {
  .table-wrap { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  table.list, table.list thead, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list thead { display: none; }
  table.list tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
                  padding: .6rem .9rem; margin-bottom: .6rem; box-shadow: var(--shadow); }
  table.list td { border: 0; padding: .2rem 0; display: flex; gap: .75rem; align-items: baseline; }
  table.list tbody tr:hover td { background: transparent; }
  table.list td::before { content: attr(data-label); flex: 0 0 8rem; font-size: .8rem; color: var(--muted); }
  table.list td:not([data-label]) { display: block; padding-top: .4rem; }
  table.list td:not([data-label])::before { content: none; }
  table.list td audio { min-width: 0; }
  td.num { text-align: left; }
  .bars li { grid-template-columns: 7.5rem 1fr 2rem; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
}

/* Small helpers */
.form > .btn, .form > button.btn { margin-top: 1rem; }
.sectiontitle { margin: 1.5rem 0 .75rem; }
code { font: .85em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--chip); padding: .1rem .35rem; border-radius: 6px; }
.pagehead .segmented { margin-left: auto; }

/* ======================================================================================
   Public pages: festive night sky, snow, snowy hills, paper cards
   ====================================================================================== */
body.pub {
  --night-1: #0b1730; --night-2: #13284d; --night-3: #1d3a68;
  --gold: #e9b54b; --gold-soft: #fff4dc; --pine: #14532d; --paper: #fffdf9; --snow: #f4f7fb;
  --script: "Mountains of Christmas", "Iowan Old Style", Georgia, serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --paper-line: #ece6da; --field-line: #dcd5c7; --step-line: #ebe5da; --dot-line: #e2dbcd;
  --hill-back: #dfe8f3; --consent-line: #f1dfb5; --paper-hi: #fff;
  background: var(--snow); overflow-x: clip;
}
.pub .sky { position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 25% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 38% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 10%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 66% 26%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 34%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 44%, #fff 50%, transparent 51%),
    linear-gradient(180deg, var(--night-1) 0%, var(--night-2) 55%, var(--night-3) 100%);
  padding-bottom: 70px; }
.pub .sky-compact { padding-bottom: 60px; }
.moon { position: absolute; z-index: 1; right: 7%; top: 22px; width: 30px; height: 30px; border-radius: 50%;
        background: radial-gradient(circle at 38% 38%, #fffaf0, #f6e7c4 70%);
        box-shadow: 0 0 0 10px rgba(255, 240, 205, .07), 0 0 40px 14px rgba(255, 236, 190, .22); }
.moon::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: rgba(214, 196, 158, .45);
               top: 9px; left: 15px; box-shadow: -7px 9px 0 -1px rgba(214, 196, 158, .35); }
@media (min-width: 900px) { .moon { right: 10%; top: 28px; width: 64px; height: 64px; }
  .moon::after { width: 12px; height: 12px; top: 18px; left: 34px; box-shadow: -16px 18px 0 -2px rgba(214, 196, 158, .35); } }
.pub .snow { position: absolute; inset: -200px 0 0 0; pointer-events: none;
  background-image:
    radial-gradient(3px 3px at 20px 30px, rgba(255,255,255,.9) 50%, transparent 51%),
    radial-gradient(2px 2px at 80px 120px, rgba(255,255,255,.8) 50%, transparent 51%),
    radial-gradient(3px 3px at 150px 60px, rgba(255,255,255,.85) 50%, transparent 51%),
    radial-gradient(2px 2px at 190px 170px, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(2.5px 2.5px at 110px 190px, rgba(255,255,255,.8) 50%, transparent 51%);
  background-size: 220px 220px; animation: snowfall 14s linear infinite; opacity: .75; }
.pub .snow-2 { background-size: 340px 340px; animation-duration: 22s; opacity: .45; filter: blur(.6px); }
@keyframes snowfall { from { transform: translateY(0); } to { transform: translateY(220px); } }
.pub .snow-2 { animation-name: snowfall2; }
@keyframes snowfall2 { from { transform: translate(0, 0); } to { transform: translate(40px, 340px); } }
@media (prefers-reduced-motion: reduce) { .pub .snow { animation: none; } }


.hero { position: relative; z-index: 2; max-width: 1120px; margin: 0 auto; padding: 5.5rem 1rem .5rem; }
.eyebrow { display: inline-block; color: var(--gold); font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
           font-size: .8rem; margin: 0 0 .4rem; }
.hero-title { font-family: var(--script); font-weight: 700; font-size: clamp(2.6rem, 11vw, 4.8rem); line-height: 1.1;
              letter-spacing: .01em; margin: 0 0 1rem; color: #ffe3a1;
              /* snow caps: the top of every text line is white, the rest warm gold */
              background: linear-gradient(180deg, #fff 0, #fff 34%, #ffe7ad 34.5%, #f2bf55 100%) 0 0 / 100% 1.1em repeat-y;
              -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
              filter: drop-shadow(0 2px 0 rgba(122, 27, 32, .65)) drop-shadow(0 0 16px rgba(233, 181, 75, .28)); }
.hero-title::after { content: ""; display: block; width: min(260px, 70%); height: 22px; margin-top: .35rem;
                     background: url("/static/flourish.svg") left center / contain no-repeat; opacity: .9; }
.hero-title.small { font-size: clamp(2.2rem, 9vw, 3.6rem); }
.hero-lead { font-size: 1.1rem; max-width: 34rem; color: rgba(255,255,255,.88); margin: 0 0 1.25rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; grid-template-columns: 1fr; max-width: 46rem; }
.steps li { display: flex; align-items: center; gap: .75rem; background: rgba(255,255,255,.08); overflow-wrap: normal; hyphens: auto;
            border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: .65rem .85rem; font-size: .92rem;
            color: rgba(255,255,255,.85); backdrop-filter: blur(4px); }
.steps strong { color: #fff; font-size: 1rem; }
.step-n { flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
          background: var(--gold); color: var(--night-1); font-weight: 800; }

.hills { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 80px; z-index: 1; }
.hill-back { fill: var(--hill-back); }
.hill-front { fill: var(--snow); }

.pub-main { max-width: 1120px; margin: -30px auto 0; padding: 0 1rem 2rem; position: relative; z-index: 3; }
.pub-grid { display: grid; gap: 1.1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
.side { display: grid; gap: 1.1rem; }
.paper { background: var(--paper); color: var(--text); border: 1px solid var(--paper-line); border-radius: 20px; padding: 1.25rem;
         box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px rgba(15, 23, 42, .08); position: relative; }
.form-card { border-top: 5px solid var(--brand); }
.form-card::before { content: "❄"; position: absolute; right: 1.1rem; top: .9rem; color: #c9d6e6; font-size: 1.4rem; }
.paper-title { font-family: var(--script); font-weight: 700; font-size: 1.85rem; line-height: 1.15; margin: 0 0 .5rem; }
.paper-title.small { font-size: 1.5rem; }
.paper.narrow { max-width: 640px; margin: 0 auto; }
.pub .form label { margin-top: 1rem; }
.pub input[type=text], .pub input[type=tel], .pub textarea { background: var(--input-bg); border-color: var(--field-line); border-radius: 12px; }
.pub input:focus, .pub textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(200, 35, 44, .12); }
.pub input[type=checkbox] { accent-color: var(--brand); }
.consent { background: var(--gold-soft); border: 1px solid var(--consent-line); border-radius: 12px; padding: .75rem .85rem !important; margin-top: 1rem; }
.btn-lg { min-height: 52px; font-size: 1.02rem; border-radius: 14px; padding: 0 1.25rem; }
.pub .btn-brand { background: linear-gradient(180deg, #d9333c, var(--brand)); border-color: var(--brand-dark);
                  box-shadow: 0 6px 16px rgba(200, 35, 44, .28); }
.pub .btn-brand:hover { background: linear-gradient(180deg, #c92b34, var(--brand-dark)); }
.btn-light { background: var(--paper); }
.center { text-align: center; }
.tips ul { margin: .25rem 0 .5rem; padding-left: 1.1rem; }
.tips li { margin: .3rem 0; }
.tips li::marker { content: "✦  "; color: var(--gold); }
.when { background: linear-gradient(160deg, var(--paper-hi), var(--gold-soft)); }
.pub .orderlist li { justify-content: space-between; }
.pub-foot { text-align: center; color: var(--muted); padding: 1rem 1rem 2.5rem; font-size: .9rem; letter-spacing: .08em; }

/* Order page */
.progress-steps { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr);
                  position: relative; counter-reset: step; }
.progress-steps::before { content: ""; position: absolute; top: 13px; left: 12.5%; right: 12.5%; height: 3px; background: var(--step-line); border-radius: 3px; }
.progress-steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem;
                     font-size: .8rem; color: var(--muted); text-align: center; }
.progress-steps .dot { width: 28px; height: 28px; border-radius: 50%; background: var(--paper); border: 3px solid var(--dot-line); position: relative; z-index: 1;
                       display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 800; }
.progress-steps li.done { color: var(--pine); font-weight: 600; }
.progress-steps li.done .dot { background: var(--pine); border-color: var(--pine); color: #fff; }
.progress-steps li.done .dot::after { content: "✓"; }
.progress-steps li.current { color: var(--brand); font-weight: 700; }
.progress-steps li.current .dot { border-color: var(--brand); box-shadow: 0 0 0 5px rgba(200,35,44,.15); animation: pulse 1.8s ease-in-out infinite; }
.progress-steps li.fail .dot { border-color: var(--red); background: var(--red-soft); }
.progress-steps li.fail .dot::after { content: "!"; color: var(--red); }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(200,35,44,.05); } }
@media (prefers-reduced-motion: reduce) { .progress-steps li.current .dot { animation: none; } }
.status-msg { margin: .75rem 0; font-size: 1.02rem; }
.player { background: linear-gradient(160deg, var(--night-2), var(--night-3)); border-radius: 16px; padding: .7rem .8rem; margin: .5rem 0 1rem; }
.player audio { margin: 0; display: block; }
.order-actions { margin: .25rem 0 .75rem; }
.order-actions form, .order-actions > .btn { flex: 1 1 auto; }
.order-actions .btn { width: 100%; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2.5px solid #e8dccb; border-top-color: var(--brand);
           border-radius: 50%; vertical-align: -2px; margin-right: .35rem; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 640px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .order-actions form, .order-actions > .btn { flex: 0 1 auto; }
  .order-actions .btn { width: auto; }
}
@media (min-width: 900px) {
  .pub .sky { padding-bottom: 110px; }
  .pub .sky-compact { padding-bottom: 80px; }
  .hills { height: 120px; }
  .hero { padding: 5.5rem 1rem 1rem; }
  .pub-main { margin-top: -60px; }
  .pub-grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1.5rem; }
  .paper { padding: 1.75rem; }
  .side { position: sticky; top: 1.5rem; }
}

/* Reply from the callee */
.reply { background: linear-gradient(160deg, var(--paper-hi, #fff), var(--gold-soft, #fff4dc)); border: 1px solid var(--consent-line, #f1dfb5);
         border-radius: 16px; padding: .9rem 1rem .4rem; margin: .5rem 0 1rem; }
.reply-title { margin: 0; font-size: 1.05rem; }
.player-reply { background: linear-gradient(160deg, #7a1b20, var(--brand)); }

.progress-steps li.done .dot { color: #fff; }
@media (prefers-color-scheme: dark) { :root .progress-steps li.done .dot { background: #1f8a4c; border-color: #1f8a4c; } }

/* Sender number */
.callerbox { border: 1px solid var(--paper-line, var(--line)); border-radius: 14px; padding: .2rem .9rem .6rem; margin-top: 1rem; }
.callerbox > summary { min-height: var(--tap); display: flex; align-items: center; gap: .4rem; cursor: pointer; font-weight: 600; }
.lawbox { background: var(--surface-2); border-radius: 12px; padding: .6rem .8rem; margin-top: .75rem; font-size: .875rem; color: var(--muted); }
.lawbox p { margin: .25rem 0; }
.lawbox strong { color: var(--text); }
.callerbox-order { border: 1px solid var(--consent-line, var(--line)); background: var(--gold-soft, var(--surface-2));
                   border-radius: 16px; padding: .8rem 1rem; margin: .5rem 0 1rem; }
.callerbox-order.ok { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.codeform { display: flex; gap: .5rem; margin: .75rem 0 .5rem; }
.codeform input { flex: 1 1 0; width: 0; min-width: 0; font-size: 1.2rem; letter-spacing: .3em; text-align: center; }
.codeform input::placeholder { letter-spacing: normal; font-size: 1rem; }
.codeform .btn { flex: none; }
.callerbox-order .call-head { flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }
.callerbox-order .call-head strong { min-width: 0; }
.callerbox-order .actions { margin-top: .25rem; }
.pub .lawbox { background: color-mix(in srgb, var(--paper) 70%, var(--snow)); }


/* Activity charts (dataviz: single series, 4px rounded data end, hairline grid, tooltip) */
:root { --chart: #c8232c; --chart-hover: #a11b22; --grid: #ececef; }
@media (prefers-color-scheme: dark) { :root { --chart: #ef4444; --chart-hover: #f87171; --grid: #26262c; } }
.chart-headline { margin: -.25rem 0 .75rem; }
.charts { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.chart-title { margin: 0 0 .5rem; font-size: .9rem; font-weight: 600; }
.chart { margin: 0; }
.chart-plot { display: grid; grid-template-columns: auto 1fr; gap: .5rem; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; height: 160px;
           font-size: .75rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums;
           margin-top: -.45rem; margin-bottom: -.45rem; }
.chart-area { min-width: 0; }
.chart-cols { list-style: none; margin: 0; padding: 0; height: 160px; display: flex; align-items: flex-end; gap: 2px;
  background: linear-gradient(var(--grid), var(--grid)) top / 100% 1px no-repeat,
              linear-gradient(var(--grid), var(--grid)) center / 100% 1px no-repeat,
              linear-gradient(var(--line-strong), var(--line-strong)) bottom / 100% 1px no-repeat; }
.chart-col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative;
             cursor: default; outline: none; }
.chart-bar { display: block; width: 100%; max-width: 24px; background: var(--chart); border-radius: 4px 4px 0 0; min-height: 0; }
.chart-bar.zero { background: transparent; }
.chart-col:hover .chart-bar, .chart-col:focus-visible .chart-bar { background: var(--chart-hover); }
.chart-col:hover, .chart-col:focus-visible { background: color-mix(in srgb, var(--text) 5%, transparent); border-radius: 4px; }
.chart-col:hover::after, .chart-col:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px);
  left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--ink); color: var(--on-ink);
  font-size: .78rem; font-weight: 600; padding: .3rem .55rem; border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 5; pointer-events: none; }
.chart-col:first-child:hover::after, .chart-col:first-child:focus-visible::after { left: 0; transform: none; }
.chart-col:last-child:hover::after, .chart-col:last-child:focus-visible::after { left: auto; right: 0; transform: none; }
.chart-x { list-style: none; margin: .3rem 0 0; padding: 0; display: flex; gap: 2px; font-size: .72rem; color: var(--muted); }
.chart-x li { flex: 1; text-align: center; white-space: nowrap; overflow: visible; min-width: 0; }
.chart-table summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; color: var(--muted); font-size: .85rem; }
@media (min-width: 1024px) { .charts { grid-template-columns: 1.4fr 1fr; } }
.h-0 { height: 0%; }
.h-1 { height: 1%; }
.h-2 { height: 2%; }
.h-3 { height: 3%; }
.h-4 { height: 4%; }
.h-5 { height: 5%; }
.h-6 { height: 6%; }
.h-7 { height: 7%; }
.h-8 { height: 8%; }
.h-9 { height: 9%; }
.h-10 { height: 10%; }
.h-11 { height: 11%; }
.h-12 { height: 12%; }
.h-13 { height: 13%; }
.h-14 { height: 14%; }
.h-15 { height: 15%; }
.h-16 { height: 16%; }
.h-17 { height: 17%; }
.h-18 { height: 18%; }
.h-19 { height: 19%; }
.h-20 { height: 20%; }
.h-21 { height: 21%; }
.h-22 { height: 22%; }
.h-23 { height: 23%; }
.h-24 { height: 24%; }
.h-25 { height: 25%; }
.h-26 { height: 26%; }
.h-27 { height: 27%; }
.h-28 { height: 28%; }
.h-29 { height: 29%; }
.h-30 { height: 30%; }
.h-31 { height: 31%; }
.h-32 { height: 32%; }
.h-33 { height: 33%; }
.h-34 { height: 34%; }
.h-35 { height: 35%; }
.h-36 { height: 36%; }
.h-37 { height: 37%; }
.h-38 { height: 38%; }
.h-39 { height: 39%; }
.h-40 { height: 40%; }
.h-41 { height: 41%; }
.h-42 { height: 42%; }
.h-43 { height: 43%; }
.h-44 { height: 44%; }
.h-45 { height: 45%; }
.h-46 { height: 46%; }
.h-47 { height: 47%; }
.h-48 { height: 48%; }
.h-49 { height: 49%; }
.h-50 { height: 50%; }
.h-51 { height: 51%; }
.h-52 { height: 52%; }
.h-53 { height: 53%; }
.h-54 { height: 54%; }
.h-55 { height: 55%; }
.h-56 { height: 56%; }
.h-57 { height: 57%; }
.h-58 { height: 58%; }
.h-59 { height: 59%; }
.h-60 { height: 60%; }
.h-61 { height: 61%; }
.h-62 { height: 62%; }
.h-63 { height: 63%; }
.h-64 { height: 64%; }
.h-65 { height: 65%; }
.h-66 { height: 66%; }
.h-67 { height: 67%; }
.h-68 { height: 68%; }
.h-69 { height: 69%; }
.h-70 { height: 70%; }
.h-71 { height: 71%; }
.h-72 { height: 72%; }
.h-73 { height: 73%; }
.h-74 { height: 74%; }
.h-75 { height: 75%; }
.h-76 { height: 76%; }
.h-77 { height: 77%; }
.h-78 { height: 78%; }
.h-79 { height: 79%; }
.h-80 { height: 80%; }
.h-81 { height: 81%; }
.h-82 { height: 82%; }
.h-83 { height: 83%; }
.h-84 { height: 84%; }
.h-85 { height: 85%; }
.h-86 { height: 86%; }
.h-87 { height: 87%; }
.h-88 { height: 88%; }
.h-89 { height: 89%; }
.h-90 { height: 90%; }
.h-91 { height: 91%; }
.h-92 { height: 92%; }
.h-93 { height: 93%; }
.h-94 { height: 94%; }
.h-95 { height: 95%; }
.h-96 { height: 96%; }
.h-97 { height: 97%; }
.h-98 { height: 98%; }
.h-99 { height: 99%; }
.h-100 { height: 100%; }
.chart-x li:last-child { text-align: right; }
.chart-x li:first-child { text-align: left; }


/* ======================================================================================
   Santa in the chimney: a 54 s loop with six acts
   1) pops up, waves, "Ho ho ho!"  2) peeks, looks around  3) fire, launches, falls back
   4) sooty face, coughs a soot ring  5) a cat ends up on his hat  6) stuck at the belly, PLOPP
   ====================================================================================== */
/* phones: as wide as the content, so the roof spans the whole column like on desktop */
.santa-scene { width: 100%; max-width: 480px; margin: -.5rem auto .75rem; }
.santa-scene svg { display: block; width: 100%; height: auto; overflow: visible; }
.santa-scene * { transform-box: view-box; }
.santa { transform-origin: 162px 110px; animation: santa-acts 54s infinite; }
.arm { transform-origin: 186px 104px; animation: wave .55s ease-in-out infinite alternate; }
.eyes { transform-origin: 162px 59px; animation: blink 4.5s infinite; }
.look { animation: look 54s infinite; }
.bubble { opacity: 0; }
.bubble-ho { transform-origin: 120px 60px; animation: bubble-ho 54s infinite; }
.bubble-hm { transform-origin: 120px 104px; animation: bubble-hm 54s infinite; }
.bubble-jo { transform-origin: 130px 40px; animation: bubble-jo 54s infinite; }
.bubble-text { font: 700 18px var(--serif, Georgia, serif); fill: #c8232c; }
.bubble-small { font-size: 15px; }
.plopp-text { font: 700 30px var(--script, Georgia, serif); fill: #ffd166; stroke: #7a1b20; stroke-width: 1.2px; paint-order: stroke; }
.puff { fill: #e8eef6; opacity: 0; transform-box: fill-box; transform-origin: center; animation: puff 3s ease-out infinite; }
.p2 { animation-delay: 1s; }
.p3 { animation-delay: 2s; }
.fire { transform-origin: 162px 122px; animation: fire 54s infinite; opacity: 0; }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker .18s ease-in-out infinite alternate; }
.f2 { animation-duration: .23s; }
.f3 { animation-duration: .15s; }
.boost { opacity: 0; animation: boost 54s infinite; }
.boost-outer, .boost-inner { transform-box: fill-box; transform-origin: 50% 0; animation: flicker .12s ease-in-out infinite alternate; }
.chimney { transform-origin: 162px 230px; animation: rumble 54s infinite; }
.burst { opacity: 0; transform-origin: 166px 104px; animation: burst 54s infinite; }

@keyframes santa-acts {
  /* act 1: hello */
  0%, 1.5% { transform: translate(0, 118px); }
  2.75% { transform: translate(0, -10px); }
  3.5% { transform: translate(0, 0); }
  13.5% { transform: translate(0, 0); }
  14.5% { transform: translate(0, -8px); }
  16% { transform: translate(0, 118px); }
  /* act 2: peek */
  17.5% { transform: translate(0, 118px); }
  19% { transform: translate(0, 62px); }
  25% { transform: translate(0, 62px); }
  25.5% { transform: translate(0, 56px); }
  26.5%, 30% { transform: translate(0, 118px); }
  /* act 3: lift-off */
  31.75% { transform: translate(0, 118px); animation-timing-function: cubic-bezier(.3, 0, .2, 1); }
  33% { transform: translate(0, -12px) rotate(-3deg); animation-timing-function: cubic-bezier(.6, 0, 1, .6); }
  36% { transform: translate(-40px, -620px) rotate(-14deg); }
  42% { transform: translate(30px, -620px) rotate(170deg); animation-timing-function: cubic-bezier(.5, 0, 1, 1); }
  46% { transform: translate(0, 118px) rotate(180deg); }
  46.05%, 51% { transform: translate(0, 118px); }
  /* act 4: sooty face, cough */
  53.5%, 55% { transform: translate(0, 32px); }
  55.4% { transform: translate(0, 24px); }
  55.9% { transform: translate(0, 34px); }
  56.4% { transform: translate(0, 24px); }
  57%, 60% { transform: translate(0, 32px); }
  62%, 72% { transform: translate(0, 118px); }
  /* act 5: the cat ends up on his hat */
  74%, 79.6% { transform: translate(0, 0); }
  80.6%, 85% { transform: translate(0, 118px); }
  /* act 6: stuck at the belly, then PLOPP */
  86.5% { transform: translate(0, 6px); }
  87% { transform: translate(0, 10px); }
  88% { transform: translate(-3px, 8px) rotate(-5deg); }
  89% { transform: translate(3px, 8px) rotate(5deg); }
  90% { transform: translate(-3px, 8px) rotate(-5deg); }
  91% { transform: translate(3px, 8px) rotate(5deg); }
  92% { transform: translate(-2px, 7px) rotate(-3deg); }
  93% { transform: translate(0, 2px); }
  93.8% { transform: translate(0, 6px); animation-timing-function: cubic-bezier(.6, 0, 1, .5); }
  94.3%, 100% { transform: translate(0, 118px); }
}
@keyframes look {
  0%, 19.5% { transform: translateX(0); }
  20.5%, 22% { transform: translateX(-2.6px); }
  23%, 24.5% { transform: translateX(2.6px); }
  25.5%, 74% { transform: translate(0, 0); }
  75%, 79.4% { transform: translate(.8px, -2.8px); }  /* act 5: eyes up at the cat */
  80%, 100% { transform: translate(0, 0); }
}
@keyframes bubble-ho {
  0%, 4.5% { opacity: 0; transform: scale(.4); }
  5.5% { opacity: 1; transform: scale(1.08); }
  6.25%, 12% { opacity: 1; transform: scale(1); }
  13%, 50%, 100% { opacity: 0; transform: scale(.6); }
}
@keyframes bubble-hm {
  0%, 20.5% { opacity: 0; transform: scale(.4); }
  21.5%, 24.5% { opacity: 1; transform: scale(1); }
  25.5%, 50%, 100% { opacity: 0; transform: scale(.6); }
}
@keyframes bubble-jo {
  0%, 32.5% { opacity: 0; transform: scale(.4); }
  33.5% { opacity: 1; transform: scale(1.1); }
  34%, 36.5% { opacity: 1; transform: scale(1); }
  37.5%, 50%, 100% { opacity: 0; transform: scale(.6); }
}
@keyframes fire {
  0%, 29% { opacity: 0; transform: scaleY(0); }
  30% { opacity: 1; transform: scaleY(.5); }
  31.5% { opacity: 1; transform: scaleY(.9); }
  33% { opacity: 1; transform: scaleY(1.5); }
  35% { opacity: 1; transform: scaleY(1); }
  37.5%, 50%, 100% { opacity: 0; transform: scaleY(0); }
}
@keyframes flicker { from { transform: scale(.9, .85); } to { transform: scale(1.05, 1.1); } }
@keyframes boost {
  0%, 32.25% { opacity: 0; }
  33%, 36.5% { opacity: 1; }
  37.5%, 50%, 100% { opacity: 0; }
}
@keyframes rumble {
  0%, 29% { transform: translate(0, 0); }
  29.5% { transform: translate(-2px, 0) rotate(-1deg); }
  30% { transform: translate(2px, -1px) rotate(1deg); }
  30.5% { transform: translate(-2px, 0) rotate(-.8deg); }
  31% { transform: translate(2px, -1px) rotate(.8deg); }
  31.5% { transform: translate(-1px, 0); }
  32%, 45.75% { transform: translate(0, 0); }
  46.25% { transform: translate(0, 3px) scaleY(.97); }
  47%, 87.5% { transform: translate(0, 0); }
  /* act 6: stuck */
  88.5% { transform: translate(-1px, 0) rotate(-.6deg); }
  89.5% { transform: translate(1px, 0) rotate(.6deg); }
  90.5% { transform: translate(-1px, 0) rotate(-.6deg); }
  91.5% { transform: translate(1px, 0) rotate(.6deg); }
  92.5%, 94.2% { transform: translate(0, 0); }
  94.6% { transform: translate(0, 4px) scaleY(.95); }
  95.2% { transform: translate(0, -2px) scaleY(1.02); }
  96%, 100% { transform: translate(0, 0); }
}
@keyframes burst {
  0%, 45.75% { opacity: 0; transform: scale(.3); }
  46.3% { opacity: .9; transform: translate(0, -30px) scale(1); }
  49% { opacity: 0; transform: translate(10px, -90px) scale(1.9); }
  50%, 100% { opacity: 0; }
}
@keyframes wave { from { transform: rotate(-12deg); } to { transform: rotate(18deg); } }
@keyframes blink { 0%, 46%, 50%, 100% { transform: scaleY(1); } 48% { transform: scaleY(.1); } }
@keyframes puff {
  0% { opacity: 0; transform: translate(0, 0) scale(.6); }
  20% { opacity: .85; }
  100% { opacity: 0; transform: translate(-14px, -70px) scale(1.9); }
}

/* Sleigh with reindeer crossing the night sky */
.sleigh-wrap { position: absolute; z-index: 1; top: 14px; left: 0; width: 150px; pointer-events: none;
               animation: sleigh-fly 32s linear infinite; animation-delay: 4s; transform: translateX(-260px); }
.sleigh { display: block; width: 100%; height: auto; overflow: visible; animation: sleigh-bob 1.6s ease-in-out infinite alternate; }
.silhouette { fill: #f3e3b8; stroke: #f3e3b8; }
.silhouette .rein, .silhouette .antler, .silhouette .legs path, .silhouette .runner { fill: none; }
.legs { transform-box: fill-box; transform-origin: 50% 0; }
.legs-a { animation: gallop .32s ease-in-out infinite alternate; }
.legs-b { animation: gallop .32s ease-in-out infinite alternate-reverse; }
.rudolph { fill: #ff4d4d; filter: drop-shadow(0 0 4px #ff4d4d); animation: nose 1s ease-in-out infinite alternate; }
.stardust circle { fill: #ffe9a8; animation: twinkle 1.2s ease-in-out infinite alternate; }
.stardust circle:nth-child(2n) { animation-delay: .4s; }
.stardust circle:nth-child(3n) { animation-delay: .8s; }
@keyframes sleigh-fly {
  0% { transform: translate(-260px, 40px) rotate(-6deg); }
  38% { transform: translate(calc(100vw + 60px), -40px) rotate(-6deg); }
  100% { transform: translate(calc(100vw + 60px), -40px) rotate(-6deg); }
}
@keyframes sleigh-bob { from { transform: translateY(-4px); } to { transform: translateY(4px); } }
@keyframes gallop { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }
@keyframes nose { from { opacity: .7; } to { opacity: 1; } }
@keyframes twinkle { from { opacity: .15; } to { opacity: .9; } }

.boots { opacity: 0; animation: boots 54s infinite; }
.boot { transform-origin: 162px 122px; }
.boot-l { animation: kick .2s ease-in-out infinite alternate; transform-origin: 144px 120px; }
.boot-r { animation: kick .2s ease-in-out infinite alternate-reverse; transform-origin: 179px 120px; }
.bubble-uff { transform-origin: 130px 90px; animation: bubble-uff 54s infinite; }
@keyframes boots {
  0%, 46% { opacity: 0; transform: translateY(40px); }
  46.3% { opacity: 1; transform: translateY(-22px); }
  46.7%, 48.75% { opacity: 1; transform: translateY(-16px); }
  49.75% { opacity: 1; transform: translateY(44px); }
  50%, 100% { opacity: 0; transform: translateY(44px); }
}
@keyframes kick { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } }
@keyframes bubble-uff {
  0%, 46.5% { opacity: 0; transform: scale(.4); }
  47% { opacity: 1; transform: scale(1.1); }
  47.3%, 49% { opacity: 1; transform: scale(1); }
  49.5%, 50%, 100% { opacity: 0; transform: scale(.6); }
}

/* acts 4-6 */
.soot-face, .soot-ring, .plopp, .roofcat { opacity: 0; }
.bubble-hust, .bubble-aeh, .bubble-miau, .bubble-stuck { transform-box: fill-box; transform-origin: 50% 100%; }
.plopp { transform-box: fill-box; transform-origin: 50% 100%; }
.roofcat-body, .roofcat-tail { transform-box: fill-box; }
@media (prefers-reduced-motion: no-preference) {
  .soot-face { animation: soot-face 54s infinite; }
  .soot-ring { animation: soot-ring 54s infinite; }
  .bubble-hust { animation: bubble-hust 54s infinite; }
  .roofcat { animation: roofcat 54s infinite; }
  .roofcat-body { transform-origin: 50% 100%; animation: roofcat-squash 54s infinite; }
  .roofcat-tail { transform-origin: 100% 100%; animation: dn-tail 1.4s ease-in-out infinite alternate; }
  .bubble-aeh { animation: bubble-aeh 54s infinite; }
  .bubble-miau { animation: bubble-miau 54s infinite; }
  .bubble-stuck { animation: bubble-stuck 54s infinite; }
  .plopp { animation: plopp 54s infinite; }
}
@keyframes soot-face { 0%, 50.9% { opacity: 0; } 51%, 62% { opacity: 1; } 62.1%, 100% { opacity: 0; } }
@keyframes soot-ring { 0%, 55.3% { opacity: 0; transform: translate(0, 0) scale(.4); }
  55.6% { opacity: .95; transform: translate(0, -10px) scale(.7); }
  60% { opacity: 0; transform: translate(6px, -80px) scale(1.6); } 100% { opacity: 0; } }
@keyframes bubble-hust { 0%, 55.2% { opacity: 0; transform: scale(.5); } 55.7% { opacity: 1; transform: scale(1.1); }
  56.2%, 59.5% { opacity: 1; transform: scale(1); } 60.5%, 100% { opacity: 0; } }
/* cat: walks in from the right, jumps onto the rim, rides up on the hat, hangs in the air, flees */
@keyframes roofcat {
  0%, 63.9% { opacity: 0; transform: translate(255px, 159px); }
  64% { opacity: 1; transform: translate(255px, 159px); }
  68.8% { opacity: 1; transform: translate(212px, 167px); }
  69.6% { opacity: 1; transform: translate(196px, 92px); }
  70.3%, 72% { opacity: 1; transform: translate(188px, 106px); }
  74%, 80.6% { opacity: 1; transform: translate(180px, 27px); }
  81.5% { opacity: 1; transform: translate(188px, 106px); }
  82.3% { opacity: 1; transform: translate(212px, 150px); }
  83.8% { opacity: 1; transform: translate(262px, 157px); }
  84%, 100% { opacity: 0; transform: translate(262px, 157px); } }
@keyframes roofcat-squash { 0%, 70.2% { transform: none; } 70.5% { transform: scale(1.15, .8); } 71.2%, 81.4% { transform: none; }
  81.7% { transform: scale(1.2, .75); } 82.2%, 100% { transform: none; } }
@keyframes bubble-aeh { 0%, 74.9% { opacity: 0; transform: scale(.5); } 75.4% { opacity: 1; transform: scale(1.1); }
  75.9%, 78.6% { opacity: 1; transform: scale(1); } 79.2%, 100% { opacity: 0; } }
@keyframes bubble-miau { 0%, 77.4% { opacity: 0; transform: scale(.5); } 77.9% { opacity: 1; transform: scale(1.12); }
  78.4%, 80.4% { opacity: 1; transform: scale(1); } 81%, 100% { opacity: 0; } }
@keyframes bubble-stuck { 0%, 87.9% { opacity: 0; transform: scale(.5); } 88.4% { opacity: 1; transform: scale(1.1); }
  88.9%, 93% { opacity: 1; transform: scale(1); } 93.6%, 100% { opacity: 0; } }
@keyframes plopp { 0%, 94.1% { opacity: 0; transform: scale(.3) rotate(-8deg); } 94.6% { opacity: 1; transform: scale(1.25) rotate(4deg); }
  95.4%, 97.6% { opacity: 1; transform: scale(1) rotate(-2deg); } 98.6%, 100% { opacity: 0; transform: translateY(-14px) scale(.9); } }

@media (prefers-reduced-motion: reduce) {
  .santa, .arm, .eyes, .look, .puff, .fire, .flame, .boost, .chimney, .burst, .bubble-hm, .bubble-jo,
  .boots, .boot, .bubble-uff { animation: none; }
  .santa { transform: none; }
  .bubble-ho { animation: none; opacity: 1; }
  .sleigh-wrap { display: none; }
}
@media (min-width: 900px) {
  .hero { min-height: 340px; }
  /* as wide as the side column below (grid 1.65fr | 1fr, gap 1.5rem, hero padding 1rem),
     so the roof spans the whole box */
  .hero { --scene-w: calc((100% - 2rem - 1.5rem) / 2.65); }
  .santa-scene { position: absolute; right: 1rem; bottom: -62px; width: var(--scene-w); margin: 0; }
  .hero-lead, .hero-title, .steps { max-width: calc(100% - var(--scene-w) - 2rem); }
  .sleigh-wrap { width: 220px; top: 18px; }
}

/* Percent sliders (admin settings) */
.pct { width: 100%; }
.pct-row { display: flex; align-items: center; gap: .75rem; }
.pct-range { flex: 1; min-width: 0; height: var(--tap); accent-color: var(--ink); margin: 0; }
.pct-range.unset { opacity: .35; }
.pct-num { display: inline-flex; align-items: center; gap: .3rem; flex: none; }
.pct-num input { width: 5.2rem; text-align: right; }
.pct-scale { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: -.25rem; padding-right: 6.5rem; }

/* --- Dark mode: follows the device setting --- */
@media (prefers-color-scheme: dark) {
  :root {
  --bg: #0e0e11; --surface: #17171b; --surface-2: #1c1c21; --text: #ececef; --muted: #a1a1aa;
  --line: #27272d; --line-strong: #3a3a42;
  --brand-soft: rgba(239, 68, 68, .14); --brand-text: #fca5a5;
  --ink: #f4f4f5; --ink-hover: #d4d4d8; --on-ink: #18181b;
  --green: #4ade80; --green-soft: rgba(74, 222, 128, .12); --amber: #fbbf24; --amber-soft: rgba(251, 191, 36, .12);
  --blue: #93b4ff; --blue-soft: rgba(96, 140, 255, .14); --red: #f87171; --red-soft: rgba(248, 113, 113, .13);
  --input-bg: #111114; --hover: #232329; --chip: #24242a; --track: #26262c; --row-hover: #1b1b20;
  --retry-soft: rgba(251, 146, 60, .14); --switch-off: #3f3f46;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
  }
  :root body.pub {
  --paper: #161d2c; --snow: #0a101c; --gold-soft: rgba(233, 181, 75, .12); --paper-line: #253049;
  --field-line: #2d3954; --step-line: #2a3550; --dot-line: #34405c; --hill-back: #1a2740;
  --consent-line: rgba(233, 181, 75, .3); --paper-hi: #1a2234; --input-bg: #0f1522;
  --pine: #5fd38a; --surface: #1a2234; --hover: #222c41;
  }
}
.nowrap { white-space: nowrap; }

/* Background form submit: spinner in the pressed button (app.js) */
.btn.is-busy, button.is-busy { cursor: progress; opacity: .85; }
.btn.is-busy::before, button.is-busy::before { content: ""; display: inline-block; flex: none; width: 1em; height: 1em;
  margin-right: .5em; vertical-align: -.15em; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite; }
@media (prefers-reduced-motion: reduce) { .btn.is-busy::before, button.is-busy::before { animation-duration: 2s; } }

/* --- "Erledigt" page: Santa's Feierabend on the roof (30 s loop, _santa_done.html) ---------- */
.dn-scene .dn-chair, .dn-scene .dn-arm, .dn-scene .dn-boot-a, .dn-scene .dn-boot-b,
.dn-scene .dn-santa, .dn-scene .dn-body, .dn-scene .dn-bubble { transform-box: fill-box; }
.dn-scene .dn-bubble { transform-origin: 50% 100%; }
.dn-sign-text { font: 700 9.5px var(--script, Georgia, serif); fill: #7a1b20; }
.dn-small { font-size: 15px; }
.dn-z { font: 700 14px Georgia, serif; fill: #e8eef7; }
.dn-scene .dn-z.z2 { font-size: 17px; } .dn-scene .dn-z.z3 { font-size: 21px; }
.dn-scene .dn-bubble, .dn-scene .dn-splat, .dn-scene .dn-snowball, .dn-scene .dn-eyes-open { opacity: 0; }
.dn-scene .dn-rudolph { transform: translateY(0); }

@media (prefers-reduced-motion: no-preference) {
  .dn-scene .dn-zzz { animation: dn-zzz 30s infinite; }
  .dn-scene .dn-z { animation: dn-float 2.4s ease-in-out infinite; }
  .dn-scene .dn-z.z2 { animation-delay: .4s; } .dn-scene .dn-z.z3 { animation-delay: .8s; }
  .dn-scene .dn-body { transform-origin: 50% 100%; animation: dn-breathe 30s infinite; }
  .dn-scene .dn-eyes-closed { animation: dn-closed 30s infinite; }
  .dn-scene .dn-eyes-open { animation: dn-open 30s infinite; }
  .dn-scene .dn-snowball { animation: dn-snowball 30s infinite; }
  .dn-scene .dn-splat { animation: dn-splat 30s infinite; }
  .dn-scene .dn-santa { transform-origin: 50% 100%; animation: dn-jolt 30s infinite; }
  .dn-scene .dn-hey { animation: dn-b-hey 30s infinite; }
  .dn-scene .dn-rudolph { animation: dn-rudolph 30s infinite; }
  .dn-scene .dn-nose { animation: nose 1.1s ease-in-out infinite; }
  .dn-scene .dn-cookie-b { animation: dn-steal 30s infinite; }
  .dn-scene .dn-cookies { animation: dn-b-cookies 30s infinite; }
  .dn-scene .dn-mampf { animation: dn-b-mampf 30s infinite; }
  .dn-scene .dn-arm { transform-origin: 0% 100%; animation: dn-arm 30s infinite; }
  .dn-scene .dn-steam { animation: flicker 1.4s ease-in-out infinite; }
  .dn-scene .dn-prost { animation: dn-b-prost 30s infinite; }
  .dn-scene .dn-chair { transform-origin: 8% 100%; animation: dn-tip 30s infinite; }
  .dn-scene .dn-boot-a { transform-origin: 0% 50%; animation: dn-kick-a 30s infinite; }
  .dn-scene .dn-boot-b { transform-origin: 0% 50%; animation: dn-kick-b 30s infinite; }
  .dn-scene .dn-hoppla { animation: dn-b-hoppla 30s infinite; }
  .dn-scene .dn-sign { transform-box: fill-box; transform-origin: 50% 0%; animation: dn-sign 30s infinite; }
}
/* act 1: nap (0-26 %, again from 95 %) */
@keyframes dn-zzz { 0%, 25% { opacity: 1; } 27%, 94% { opacity: 0; } 96%, 100% { opacity: 1; } }
@keyframes dn-float { 0% { transform: translate(0, 4px); opacity: .2; } 50% { opacity: 1; } 100% { transform: translate(-6px, -8px); opacity: 0; } }
@keyframes dn-breathe { 0%, 4%, 8%, 12%, 16%, 20%, 24%, 96%, 100% { transform: scale(1); }
  2%, 6%, 10%, 14%, 18%, 22%, 98% { transform: scale(1.04); } 26%, 95% { transform: scale(1); } }
@keyframes dn-closed { 0%, 28.9% { opacity: 1; } 29%, 94.9% { opacity: 0; } 95%, 100% { opacity: 1; } }
@keyframes dn-open { 0%, 28.9% { opacity: 0; } 29%, 94.9% { opacity: 1; } 95%, 100% { opacity: 0; } }
/* act 2: snowball */
@keyframes dn-snowball { 0%, 25.9% { opacity: 0; transform: translate(-130px, -10px); }
  26% { opacity: 1; transform: translate(-130px, -10px); } 27.5% { transform: translate(-65px, -45px); }
  29% { opacity: 1; transform: translate(0, 0); } 29.3%, 100% { opacity: 0; transform: translate(0, 0); } }
@keyframes dn-splat { 0%, 28.9% { opacity: 0; } 29%, 58% { opacity: 1; } 64%, 100% { opacity: 0; } }
@keyframes dn-jolt { 0%, 28.9% { transform: none; } 29.5% { transform: translateY(-14px) rotate(6deg); }
  31% { transform: translateY(-4px) rotate(-3deg); } 32.5%, 100% { transform: none; } }
@keyframes dn-b-hey { 0%, 29.9% { opacity: 0; transform: scale(.6); } 30.5% { opacity: 1; transform: scale(1.08); }
  31.5%, 37% { opacity: 1; transform: scale(1); } 38%, 100% { opacity: 0; } }
/* act 3: Rudolph steals a cookie */
@keyframes dn-rudolph { 0%, 40% { transform: translateY(0); } 42.5%, 52% { transform: translateY(-34px); }
  54%, 61% { transform: translateY(0); } 62.5%, 67% { transform: translateY(-30px); } 69%, 100% { transform: translateY(0); } }
@keyframes dn-steal { 0%, 46% { transform: translate(0, 0); opacity: 1; } 49% { transform: translate(40px, -56px); opacity: 1; }
  50%, 96% { transform: translate(40px, -56px); opacity: 0; } 97% { transform: translate(0, 0); opacity: 0; } 100% { opacity: 1; } }
@keyframes dn-b-cookies { 0%, 54.9% { opacity: 0; } 55.5%, 61.5% { opacity: 1; } 62.5%, 100% { opacity: 0; } }
@keyframes dn-b-mampf { 0%, 63.4% { opacity: 0; } 64%, 67.5% { opacity: 1; } 68.5%, 100% { opacity: 0; } }
/* act 4: cheers, then the deck chair tips over */
@keyframes dn-arm { 0%, 69% { transform: none; } 71%, 77% { transform: rotate(-28deg); } 79%, 100% { transform: none; } }
@keyframes dn-b-prost { 0%, 70.4% { opacity: 0; } 71%, 77.5% { opacity: 1; } 78.5%, 100% { opacity: 0; } }
@keyframes dn-tip { 0%, 79% { transform: none; } 80.5% { transform: rotate(-42deg); } 82% { transform: rotate(-36deg); }
  86% { transform: rotate(-40deg); } 89% { transform: rotate(-38deg); } 91.5% { transform: rotate(4deg); }
  92.5% { transform: rotate(-2deg); } 93.5%, 100% { transform: none; } }
@keyframes dn-kick-a { 0%, 80.5% { transform: none; } 81.5%, 83.5%, 85.5%, 87.5% { transform: rotate(-35deg); }
  82.5%, 84.5%, 86.5%, 88.5% { transform: rotate(20deg); } 90%, 100% { transform: none; } }
@keyframes dn-kick-b { 0%, 80.5% { transform: none; } 81.5%, 83.5%, 85.5%, 87.5% { transform: rotate(25deg); }
  82.5%, 84.5%, 86.5%, 88.5% { transform: rotate(-30deg); } 90%, 100% { transform: none; } }
@keyframes dn-b-hoppla { 0%, 80.9% { opacity: 0; transform: scale(.6); } 81.5% { opacity: 1; transform: scale(1.1); }
  82.5%, 89% { opacity: 1; transform: scale(1); } 90%, 100% { opacity: 0; } }
@keyframes dn-sign { 0%, 80% { transform: none; } 81% { transform: rotate(8deg); } 82% { transform: rotate(-6deg); }
  83% { transform: rotate(3deg); } 84%, 100% { transform: none; } }
/* the roof cat (rotated frame: x runs along the slope, roof at y ~ 191) */
.dn-scene .dn-cat { transform: translate(-60px, 191px); }
.dn-scene .dn-cat-body, .dn-scene .dn-cat-tail { transform-box: fill-box; }
@media (prefers-reduced-motion: no-preference) {
  .dn-scene .dn-cat { animation: dn-cat 30s infinite; }
  .dn-scene .dn-cat-body { transform-origin: 50% 100%; animation: dn-cat-scare 30s infinite; }
  .dn-scene .dn-cat-tail { transform-origin: 100% 100%; animation: dn-tail 1.6s ease-in-out infinite alternate; }
}
@keyframes dn-cat {
  0%, 5% { transform: translate(-60px, 191px); }
  9% { transform: translate(10px, 189px); } 9.6% { transform: translate(14px, 191px); }
  12.5%, 28.9% { transform: translate(18px, 191px); }            /* sits next to Santa */
  29.5% { transform: translate(22px, 158px); }                     /* jump of fright */
  30.5% { transform: translate(48px, 186px); }
  34%, 66% { transform: translate(300px, 150px); }                 /* gone, past the chimney */
  66.1% { transform: translate(-60px, 191px); }
  72% { transform: translate(-8px, 191px); } 74% { transform: translate(-8px, 191px); }   /* peeks back */
  78%, 79% { transform: translate(16px, 191px); }
  80.5% { transform: translate(20px, 172px); }                     /* the chair tips: up again */
  81.5% { transform: translate(8px, 191px); }
  86%, 100% { transform: translate(-60px, 191px); } }
@keyframes dn-cat-scare { 0%, 29% { transform: none; } 29.4% { transform: scale(1.1, 1.35); }
  30.5% { transform: scale(1.05, 1.15); } 31.5%, 80% { transform: none; } 80.5% { transform: scale(1.1, 1.3); }
  82%, 100% { transform: none; } }
@keyframes dn-tail { from { transform: rotate(-12deg); } to { transform: rotate(14deg); } }
@media (prefers-reduced-motion: reduce) { .dn-scene .dn-eyes-closed { opacity: 1; } .dn-scene .dn-cat { transform: translate(18px, 191px); } }
