/* The M3 Expressive layer, on top of style.css: tokens, then the screens, each section overriding the ones before. */

/* ===== m3x-tokens ===== */
/* M3 Expressive tokens for seimei.
   Colors stay the theme's own (theme.js sets them); this adds the shape scale, emphasized type and spring motion.
   The springs are linear() fits of the Compose MotionScheme.expressive() springs. */
:root {
  /* Shape scale (dp = CSS px). */
  --shape-xs: 4px;
  --shape-sm: 8px;
  --shape-md: 12px;
  --shape-lg: 16px;
  --shape-lg-inc: 20px;
  --shape-xl: 28px;
  --shape-xl-inc: 32px;
  --shape-xxl: 48px;
  --shape-full: 999px;

  /* Emphasized type: same size, heavier weight (Google Sans Flex has the axis) */
  --w-regular: 400;
  --w-emph: 600;

  /* Spatial springs (they overshoot: position, size, shape) */
  --spring-fast: linear(0, .177, .491, .785, .977, 1.072, 1.093, 1.076, 1.046, 1.019, 1.001, .993, .991, .993, .996, .998, 1);
  --spring-fast-ms: 370ms;
  --spring: linear(0, .103, .3, .506, .684, .817, .907, .962, .994, 1.009, 1.014, 1.014, 1.012, 1.008, 1.006, 1.003, 1);
  --spring-ms: 410ms;
  --spring-slow-ms: 570ms;

  /* Effects springs (no overshoot: color, opacity) */
  --effects-fast: linear(0, .269, .585, .788, .897, .951, .978, .99, .995, .998, 1);
  --effects-fast-ms: 155ms;
  --effects: linear(0, .241, .548, .757, .876, .938, .97, .986, .993, .997, 1);
  --effects-ms: 225ms;

  /* Touch */
  --target: 48px;
}

@media (prefers-reduced-motion: reduce) {
  :root { --spring-fast: linear(0, 1); --spring: linear(0, 1); --spring-fast-ms: 1ms; --spring-ms: 1ms; --spring-slow-ms: 1ms; }
}

/* Segmented list: rows of one group touch with 2px gaps, big outer and small inner corners */
.m3x-seg { display: flex; flex-direction: column; gap: 2px; }
.m3x-seg > * { border-radius: var(--shape-xs); background: var(--container); }
.m3x-seg > :first-child { border-top-left-radius: var(--shape-lg-inc); border-top-right-radius: var(--shape-lg-inc); }
.m3x-seg > :last-child { border-bottom-left-radius: var(--shape-lg-inc); border-bottom-right-radius: var(--shape-lg-inc); }

/* Shape morph on press: round at rest, squarer under the finger, springing back */
.morph { transition: border-radius var(--spring-fast-ms) var(--spring-fast); }
.morph:active { border-radius: var(--shape-md); }

/* No bare status dots: state reads as words in the tone of the text or its container, or as the loading indicator.
   The nav badge (a count or a small badge on an icon) is not one of these and stays. */
.status .dot { display: none; }
.status[data-s="working"] { color: var(--primary); }
.status[data-s="starting"] { color: var(--warn); }
.trig::before, .working::before, .agent time.fresh::before { content: none; }
.agent time.fresh { font-weight: 500; }

/* ===== approval card ===== */
/* Decisions in thumb reach, 48px targets, risk you can see before you tap. */
.wcard.approval { border-radius: var(--shape-xl); padding: 16px; gap: 12px; }
.wcard.approval .head { align-items: center; }
/* A title alone centers on its tile; with a subtitle the two lines start at the tile's top */
.wcard.approval .head:has(.sub) { align-items: flex-start; }
.wcard.approval .badge { width: 40px; height: 40px; border-radius: var(--shape-md); }
.wcard.approval .title b { font-size: 16px; font-weight: var(--w-emph); line-height: 1.3; }
.wcard.approval .title { flex: 1; }
.wcard.approval .head:has(.sub) .title { padding-top: 1px; }
.wcard.approval .sub { font-size: 13px; }

.wcard.approval .body.cmd, .wcard.approval .body.plan { border-radius: var(--shape-lg); padding: 12px 14px; background: var(--surface-lowest); }

/* Rule choices: one segmented list, full-width 48px rows */
.wcard.approval .choices.m3x-seg { gap: 2px; }
.wcard.approval .choices.m3x-seg .choice {
  min-height: var(--target); border: 0; border-radius: var(--shape-xs); background: var(--container-high); padding: 13px 16px;
  font-size: 14px; line-height: 22px;
  transition: border-radius var(--spring-fast-ms) var(--spring-fast), background-color var(--effects-ms) var(--effects);
}
.wcard.approval .choices.m3x-seg .choice:first-child { border-top-left-radius: var(--shape-lg-inc); border-top-right-radius: var(--shape-lg-inc); }
.wcard.approval .choices.m3x-seg .choice:last-child { border-bottom-left-radius: var(--shape-lg-inc); border-bottom-right-radius: var(--shape-lg-inc); }
.wcard.approval .choices.m3x-seg .choice code { background: var(--container-highest); }
.wcard.approval .choices.m3x-seg .choice:active { border-radius: var(--shape-lg); }
/* The rule that lets the agent run anything wears the warning container and an icon, not just orange words at the end */
.wcard.approval .choices.m3x-seg .choice:has(.warn) { background: var(--warn-container); color: var(--on-warn-container); padding-left: 44px; position: relative; }
.wcard.approval .choices.m3x-seg .choice:has(.warn)::before {
  content: ""; position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px; background: var(--on-warn-container);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 20h20zM12 10v4M12 17v.1'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 20h20zM12 10v4M12 17v.1'/%3E%3C/svg%3E") center / contain no-repeat;
}
.wcard.approval .choices.m3x-seg .choice:has(.warn) small { color: inherit; opacity: .86; }
.wcard.approval .choices.m3x-seg .choice:has(.warn) small.warn { color: var(--on-warn-container); opacity: 1; font-weight: 600; }
.wcard.approval .choices.m3x-seg .choice:has(.warn) code { background: color-mix(in srgb, var(--warn) 16%, transparent); }

/* Chat question approval cards: warm tonal surface, no purple outline, warm 56px segmented choices */
.wcard.approval.question:not(.settled) { background: var(--warn-container); color: var(--on-warn-container); box-shadow: none; }
.wcard.approval.question:not(.settled) .badge { background: var(--warn); color: var(--on-warn); }
.wcard.approval.question:not(.settled) .title b,
.wcard.approval.question:not(.settled) .body { color: var(--on-warn-container); }
.wcard.approval.question:not(.settled) .sub { color: color-mix(in srgb, var(--on-warn-container) 82%, transparent); }
.wcard.approval.question:not(.settled) .choices.m3x-seg .choice {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
  min-height: 56px; padding: 12px 16px;
  background: color-mix(in srgb, var(--warn) 10%, var(--warn-container)); color: var(--on-warn-container);
}
.wcard.approval.question:not(.settled) .choices.m3x-seg .choice b { font-size: 14px; line-height: 20px; font-weight: var(--w-emph); }
.wcard.approval.question:not(.settled) .choices.m3x-seg .choice small { font-size: 12px; line-height: 16px; color: var(--on-warn-container); opacity: .85; }
.wcard.approval.question:not(.settled) .foot .btn.tonal,
.wcard.approval.question:not(.settled) .foot .btn.icon { background: color-mix(in srgb, var(--warn) 16%, var(--warn-container)); color: var(--on-warn-container); }
.wcard.approval.question:not(.settled) .foot .btn.filled { background: var(--warn); color: var(--on-warn); }
.wcard.approval.question:not(.settled) .foot .btn.text { color: var(--on-warn-container); }
.wcard.approval.question:not(.settled) textarea.note { border-color: var(--warn); color: var(--on-warn-container); }

/* Foot: a full-width button group, the main action largest and on the thumb side */
.wcard.approval .foot { margin: 4px 0 0; gap: 8px; min-height: 0; }
.wcard.approval:not(.settled) .foot .left { display: none; } /* the buttons say it waits; settled cards keep their result line */
.wcard.approval .foot .btn { min-height: 52px; padding: 0 18px; border-radius: 26px; font-size: 15px; font-weight: 500; white-space: nowrap; }
.wcard.approval .foot .btn.icon { flex: none; width: 52px; height: 52px; border-radius: var(--shape-lg); background: var(--container-high); color: var(--text-2); }
.wcard.approval .foot .btn.tonal { flex: 1 1 auto; }
.wcard.approval .foot .btn.filled { flex: 1.4 1 auto; font-weight: var(--w-emph); }
.wcard.approval .foot .btn.morph:active { border-radius: var(--shape-md); }

/* ===== working state ===== */
/* A contained loading indicator where the reply will appear, and a Stop that changes shape, not just icon. */
.working { gap: 12px; margin-top: 10px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
.working::before { content: none; }
.working .loader { width: 40px; height: 40px; }
.working .loader > i { width: 30px; height: 30px; }

/* Send is round; while a turn runs Stop shows as a rounded square, so the shape alone says "busy".
   chat.js swaps two buttons with hidden, so a transition never runs: a keyframe does, since display:none to shown restarts it. */
#stop { border-radius: var(--shape-lg); animation: stop-in var(--spring-ms) var(--spring); }
@keyframes stop-in { from { border-radius: 26px; transform: scale(.92); } }
#stop .square { width: 16px; height: 16px; border-radius: var(--shape-xs); }

/* ===== agents list ===== */
/* Each group a segmented list on a container; tile shape and color tell the state, a loading indicator shows "working". */
.agroup { gap: 2px; margin-top: 20px; }
.agroup h2 { padding: 0 16px 8px; font-size: 14px; font-weight: var(--w-emph); letter-spacing: 0; }
.agroup .agent { background: var(--container); border-radius: var(--shape-xs); min-height: 64px; padding: 10px 16px 10px 10px; }
.agroup > h2 + .agent { border-top-left-radius: var(--shape-lg-inc); border-top-right-radius: var(--shape-lg-inc); }
.agroup > .agent:last-child { border-bottom-left-radius: var(--shape-lg-inc); border-bottom-right-radius: var(--shape-lg-inc); }
.agroup .agent { transition: border-radius var(--spring-fast-ms) var(--spring-fast); }
.agroup .agent:active { border-radius: var(--shape-lg); }

/* Needs you: the one group that asks for a tap gets the warm container */
.agroup.ask .agent { background: var(--warn-container); }
.agroup.ask .agent .top b { font-weight: var(--w-emph); }
.agent.ask .line { color: var(--on-warn-container); }
/* The question is the content: up to two lines instead of an ellipsis after 40 characters */
.agroup.ask .agent .sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 20px; }
.agroup.ask .agent { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
/* Project names neutral: in this list color means state (warm asks, primary works) */
.agent .proj { color: var(--text-2) !important; }
.agroup.ask .agent .proj { color: var(--on-warn-container) !important; }

/* Tiles: shape says state. Asking is a filled squircle, working morphs, idle is a circle, done fades back. */
.tile { width: 44px; height: 44px; transition: border-radius var(--spring-ms) var(--spring); }
.tile.ask { background: var(--warn); color: var(--on-warn); border-radius: var(--shape-lg); }
.tile.work { border-radius: 50%; }
.tile.work .loader > i { width: 28px; height: 28px; }
.tile.idle { border-radius: 50%; }
.tile.done { border-radius: 50%; background: var(--container-high); }
.agroup.done .agent { background: color-mix(in srgb, var(--container) 55%, var(--surface-low)); }

/* ===== usage ===== */
/* Usage v6: harness picker, pool-grouped quota, unified sessions, API-equivalent yield, and cache telemetry. */
#usage {
  gap: 24px;
  padding-top: 16px;
  padding-bottom: 48px;
  --u-warn-text: color-mix(in srgb, var(--warn) 40%, var(--on-warn-container));
  --u-error-text: color-mix(in srgb, var(--error) 55%, var(--on-error-container));
}

/* Drawer usage ring tinting: warn at >=80%, error at >=90% */
.dfoot .ditem[data-tone="warn"] .ring-ico .f { stroke: var(--warn); }
.dfoot .ditem[data-tone="bad"] .ring-ico .f { stroke: var(--error); }

/* Harness connected button group: 48px unclipped targets, no checkmarks, spring pill morph */
#usage .hsel { display: flex; gap: 2px; }
#usage .hsel button {
  position: relative; flex: 1; min-width: 0; height: 48px; min-height: 48px; padding: 0 14px; border: 0;
  border-radius: var(--shape-sm); background: var(--container); color: var(--text-2);
  font: 500 14px/20px var(--sans); overflow: visible;
  display: inline-flex; align-items: center; justify-content: center;
  transition:
    border-radius var(--spring-fast-ms) var(--spring-fast),
    background-color var(--effects-ms) var(--effects),
    color var(--effects-ms) var(--effects);
}
#usage .hsel button > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#usage .hsel button:first-child { border-radius: 24px var(--shape-sm) var(--shape-sm) 24px; }
#usage .hsel button:last-child { border-radius: var(--shape-sm) 24px 24px var(--shape-sm); }
#usage .hsel button:active { border-radius: var(--shape-md); }
#usage .hsel button.on {
  background: var(--primary); color: var(--on-primary);
  border-radius: 24px; font-weight: var(--w-emph);
}

/* Section wrappers and headers */
#usage .usec { display: flex; flex-direction: column; gap: 8px; }
#usage .usec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 0 16px;
}
#usage .usec-head h2 {
  margin: 0; font-size: 14px; line-height: 20px; font-weight: var(--w-emph); color: var(--text-2);
}
#usage .usec-head .umeta {
  font-size: 12px; line-height: 16px; color: var(--text-3); font-variant-numeric: tabular-nums;
}
#usage .upool-head {
  padding: 0 16px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-3);
}
#usage .ufoot {
  margin: 2px 0 0; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 12px; line-height: 16px; color: var(--text-3); font-variant-numeric: tabular-nums;
}
#usage .ufoot .ustale { color: var(--u-warn-text); font-weight: 500; }
#usage .urefresh {
  position: relative; overflow: visible; border: 0; background: none; padding: 4px 8px; margin: -4px -8px;
  border-radius: var(--shape-full); color: var(--primary); font: 500 12px/16px var(--sans);
}
#usage .urefresh::before { content: ""; position: absolute; inset: -12px -8px; }

/* Section bar with Today / Quota week connected toggle (unclipped 48px touch zone) */
#usage .usec-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 0 16px;
}
#usage .usec-bar h2 {
  margin: 0; font-size: 14px; line-height: 20px; font-weight: var(--w-emph); color: var(--text-2);
  display: flex; align-items: baseline; gap: 8px;
}
#usage .usec-bar h2 small {
  font-size: 12px; line-height: 16px; font-weight: 400; color: var(--text-3); font-variant-numeric: tabular-nums;
}
#usage .uscope { display: inline-flex; gap: 2px; }
#usage .uscope button {
  position: relative; height: 36px; padding: 0 12px; border: 0; overflow: visible;
  border-radius: var(--shape-sm); background: var(--container); color: var(--text-2);
  font: 500 12px/16px var(--sans);
  transition:
    border-radius var(--spring-fast-ms) var(--spring-fast),
    background-color var(--effects-ms) var(--effects),
    color var(--effects-ms) var(--effects);
}
#usage .uscope button::before { content: ""; position: absolute; inset: -6px 0; }
#usage .uscope button:first-child { border-radius: 18px var(--shape-sm) var(--shape-sm) 18px; }
#usage .uscope button:last-child { border-radius: var(--shape-sm) 18px 18px var(--shape-sm); }
#usage .uscope button:active { border-radius: var(--shape-md); }
#usage .uscope button.on {
  background: var(--primary); color: var(--on-primary);
  border-radius: 18px; font-weight: var(--w-emph);
}

/* Shared symmetric segmented stack (20px outer, 4px inner, 2px gap, uniform open detachment) */
#usage .ugrp { display: flex; flex-direction: column; gap: 2px; }
#usage .ugrp > .useg {
  background: var(--container); border-radius: var(--shape-xs); overflow: hidden;
  transition:
    border-radius var(--spring-fast-ms) var(--spring-fast),
    margin var(--spring-fast-ms) var(--spring-fast),
    background-color var(--effects-ms) var(--effects);
}
#usage .useg > button:focus-visible { outline-offset: -3px; }
#usage .ugrp > .useg:first-child { border-top-left-radius: var(--shape-lg-inc); border-top-right-radius: var(--shape-lg-inc); }
#usage .ugrp > .useg:last-child { border-bottom-left-radius: var(--shape-lg-inc); border-bottom-right-radius: var(--shape-lg-inc); }
#usage .ugrp > .useg.open { border-radius: var(--shape-lg-inc); margin: 6px 0; }
#usage .ugrp > .useg.open:first-child { margin-top: 0; }
#usage .ugrp > .useg.open:last-child { margin-bottom: 0; }
#usage .ugrp > .useg:has(+ .useg.open) { border-bottom-left-radius: var(--shape-lg-inc); border-bottom-right-radius: var(--shape-lg-inc); }
#usage .ugrp > .useg.open + .useg { border-top-left-radius: var(--shape-lg-inc); border-top-right-radius: var(--shape-lg-inc); }

/* Accordion chevron (downward v rotating 180deg) vs navigation jump chevron (>) */
#usage .uchev {
  flex: none; color: var(--text-3);
  transition: transform var(--spring-fast-ms) var(--spring-fast);
}
#usage .open > button .uchev { transform: rotate(180deg); }
#usage .ujump-chev { flex: none; color: var(--text-3); }

/* 1. Quota rows */
#usage .uqrow {
  padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 10px;
}
#usage .uqrow.warn { background: var(--warn-container); color: var(--on-warn-container); }
#usage .uqrow.bad { background: var(--error-container); color: var(--on-error-container); }
#usage .uqtop { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
#usage .uqtitle { font-size: 16px; line-height: 24px; font-weight: var(--w-emph); color: var(--text); }
#usage .uqrow.warn .uqtitle { color: var(--on-warn-container); }
#usage .uqrow.bad .uqtitle { color: var(--on-error-container); }
#usage .uqproj {
  font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-3);
  font-variant-numeric: tabular-nums; text-align: right;
}
#usage .uqproj.warn { color: var(--u-warn-text); font-weight: var(--w-emph); }
#usage .uqproj.bad { color: var(--u-error-text); font-weight: var(--w-emph); }
#usage .uqrow.warn .uqproj { color: var(--on-warn-container); }
#usage .uqrow.bad .uqproj { color: var(--on-error-container); }

#usage .uqpct { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
#usage .uqpct strong {
  font-size: 36px; line-height: 44px; font-weight: var(--w-emph);
  letter-spacing: -.02em; color: var(--text);
}
#usage .uqrow.compact .uqpct strong { font-size: 28px; line-height: 36px; }
#usage .uqrow.warn .uqpct strong { color: var(--on-warn-container); }
#usage .uqrow.bad .uqpct strong { color: var(--on-error-container); }
#usage .uqpct span { font-size: 14px; line-height: 20px; color: var(--text-3); }
#usage .uqrow.warn .uqpct span, #usage .uqrow.bad .uqpct span { color: inherit; opacity: .88; }

/* Flat M3E linear progress bar: active pill + 4px gap + rest track, no stop dot, 10px min-width */
#usage .ubar { display: flex; align-items: center; height: 10px; width: 100%; }
#usage .ubar .ufill {
  flex: none; height: 100%; min-width: 10px; border-radius: var(--shape-full); background: var(--primary);
  transition: width var(--spring-ms) var(--spring);
}
#usage .ubar .ufill.zero { display: none; }
#usage .ubar .urest {
  flex: 1; height: 100%; margin-left: 4px; border-radius: var(--shape-full); background: var(--outline-variant);
}
#usage .ubar .ufill.zero + .urest { margin-left: 0; }
#usage .ubar .ufill.full + .urest { display: none; }
#usage .uqrow.warn .ubar .ufill { background: var(--warn); }
#usage .uqrow.bad .ubar .ufill { background: var(--error); }
#usage .uqrow.warn .ubar .urest { background: color-mix(in srgb, var(--on-warn-container) 20%, transparent); }
#usage .uqrow.bad .ubar .urest { background: color-mix(in srgb, var(--on-error-container) 20%, transparent); }

#usage .uqsub {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-size: 12px; line-height: 16px; color: var(--text-3); font-variant-numeric: tabular-nums;
}
#usage .uqrow.warn .uqsub, #usage .uqrow.bad .uqsub { color: inherit; opacity: .88; }

/* Expandable secondary pool row inside Quota */
#usage .upool-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px;
  padding: 12px 16px 12px 20px; border: 0; background: none; color: var(--text); text-align: left;
}
#usage .upool-btn .uptx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#usage .upool-btn b { font-size: 14px; line-height: 20px; font-weight: var(--w-emph); color: var(--text-2); }
#usage .upool-btn .upsums {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  font-size: 12px; line-height: 16px; color: var(--text-3); font-variant-numeric: tabular-nums;
}
#usage .useg.open .upool-btn .upsums { display: none; }
#usage .upool-body {
  display: flex; flex-direction: column;
  border-top: 1px solid color-mix(in srgb, var(--outline) 22%, transparent);
}
#usage .upool-body .uqrow + .uqrow {
  border-top: 1px solid color-mix(in srgb, var(--outline) 18%, transparent);
}

/* 2. Agents & sessions */
#usage .usplit {
  margin: -2px 0 2px; padding: 0 16px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-size: 12px; line-height: 16px; color: var(--text-3); font-variant-numeric: tabular-nums;
}
#usage .usplit b { color: var(--text-2); font-weight: 500; }

#usage .usbtn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px;
  padding: 12px 14px; border: 0; background: none; color: var(--text); text-align: left;
}
#usage .ustile {
  position: relative; flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 50%; background: var(--container-high); color: var(--text-2);
}
#usage .ustile > svg { position: relative; z-index: 1; }
#usage .ustile.yours { border-radius: var(--shape-md); background: var(--tonal); color: var(--on-tonal); }
#usage .ustile.seimei { background: var(--container-highest); color: var(--text); }
#usage .ustile.sh { border-radius: 0; background: none; }
#usage .ustile.sh::before {
  content: ""; position: absolute; inset: 0; clip-path: var(--me); background: var(--container-high);
}
#usage .ustile.sh.work { color: var(--on-primary-container); }
#usage .ustile.sh.work::before { background: var(--primary-container); animation: tile-work 9s linear infinite; animation-delay: inherit; }
#usage .ustile.sh.ask { color: var(--on-warn); }
#usage .ustile.sh.ask::before { background: var(--warn); }
html.doc-hidden #usage .ustile.sh.work::before { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { #usage .ustile.sh.work::before { animation: none; } }

#usage .usmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#usage .usname {
  font-size: 16px; line-height: 24px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#usage .ussub {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; row-gap: 0; min-width: 0;
  font-size: 12px; line-height: 16px; color: var(--text-3); font-variant-numeric: tabular-nums;
}
#usage .ussub .usmodel { flex: none; color: var(--text-2); }
#usage .ussub .usrole { flex: none; color: var(--text-3); }
#usage .ussub .usrole.st-work { color: var(--primary); font-weight: 500; }
#usage .ussub .usrole.st-ask { color: var(--u-warn-text); font-weight: 500; }
#usage .ussub .uscache { flex: none; font-weight: var(--w-emph); }
#usage .ussub .uscache.warn { color: var(--u-warn-text); }
#usage .ussub .uscache.bad { color: var(--u-error-text); }
#usage .useg.open .ussub .uscache { display: none; }

#usage .ustrail {
  flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  font-variant-numeric: tabular-nums;
}
#usage .ustrail b { font-size: 16px; line-height: 24px; font-weight: var(--w-emph); color: var(--text); }
#usage .ustrail small { font-size: 12px; line-height: 16px; color: var(--text-3); }

/* Expanded session details directly on --container below a hairline divider (no nested dark box) */
#usage .usdetail {
  margin: 0 16px 14px; padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--outline) 22%, transparent);
  display: flex; flex-direction: column; gap: 12px;
}
#usage .ucache-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border-radius: var(--shape-md); background: var(--container-high);
  font-variant-numeric: tabular-nums;
}
#usage .ucache-row.warn { background: var(--warn-container); color: var(--on-warn-container); }
#usage .ucache-row.bad { background: var(--error-container); color: var(--on-error-container); }
#usage .ucache-row .uclbl { font-size: 14px; line-height: 20px; color: var(--text-2); font-weight: 500; }
#usage .ucache-row.warn .uclbl, #usage .ucache-row.bad .uclbl { color: inherit; }
#usage .ucache-row .ucval {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-size: 14px; line-height: 20px; font-weight: var(--w-emph); color: var(--text);
}
#usage .ucache-row.warn .ucval { color: var(--on-warn-container); }
#usage .ucache-row.bad .ucval { color: var(--on-error-container); }
#usage .ucache-row .ucval small { font-size: 12px; line-height: 16px; font-weight: 500; color: inherit; opacity: .88; }

#usage .utok-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 390px) { #usage .utok-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#usage .utok-cell { display: flex; flex-direction: column; gap: 2px; }
#usage .utok-cell span { font-size: 11px; line-height: 16px; color: var(--text-3); }
#usage .utok-cell b {
  font-size: 14px; line-height: 20px; font-weight: var(--w-emph);
  font-variant-numeric: tabular-nums; color: var(--text);
}

#usage .ukv {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0;
  padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--outline) 22%, transparent);
  font-size: 14px; line-height: 20px;
}
#usage .ukv dt { color: var(--text-3); }
#usage .ukv dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#usage .ukv dd.mono { font: 12px/20px var(--mono); }

#usage .usactions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
#usage .ubtn-tonal {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 18px; border: 0; border-radius: 24px;
  background: var(--tonal); color: var(--on-tonal); font: 500 14px/20px var(--sans);
  transition:
    border-radius var(--spring-fast-ms) var(--spring-fast),
    scale var(--spring-fast-ms) var(--spring-fast);
}
#usage .ubtn-tonal:active { border-radius: var(--shape-md); scale: .97; }

#usage .usmore {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 48px; border: 0; background: none; color: var(--primary);
  font: 500 14px/20px var(--sans);
}

/* 3. API-equivalent */
#usage .uybtn {
  display: flex; flex-direction: column; gap: 12px; width: 100%;
  padding: 18px 16px 16px 20px; border: 0; background: none; color: var(--text); text-align: left;
}
#usage .uybtn.static { cursor: default; }
#usage .uytop { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; width: 100%; }
#usage .uymain { display: flex; flex-direction: column; gap: 2px; }
#usage .uymain .uylbl { font-size: 12px; line-height: 16px; color: var(--text-3); }
#usage .uymain .uyval {
  font-size: 36px; line-height: 44px; font-weight: var(--w-emph);
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text);
}
#usage .uyright { display: inline-flex; align-items: center; gap: 8px; }
#usage .uyproj {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums;
}
#usage .uyproj .uyplbl { font-size: 12px; line-height: 16px; color: var(--text-3); }
#usage .uyproj .uypval { font-size: 22px; line-height: 28px; font-weight: var(--w-emph); color: var(--primary); }
#usage .uyproj .uypval.muted { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text-3); }

#usage .uyield-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%;
  padding-top: 10px; padding-right: 4px;
  border-top: 1px solid color-mix(in srgb, var(--outline) 22%, transparent);
  font-size: 14px; line-height: 20px; color: var(--text-2); font-variant-numeric: tabular-nums;
}
#usage .uyield-foot > span:first-child { white-space: nowrap; flex-shrink: 0; }
#usage .uyield-foot .uymodels { color: var(--text-3); text-align: right; font-size: 12px; line-height: 16px; }
#usage .useg.open .uyield-foot .uymodels { display: none; }

#usage .upbtn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px;
  padding: 12px 14px 12px 20px; border: 0; background: none; color: var(--text); text-align: left;
}
#usage .upbtn.static { cursor: default; }
#usage .upleft { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#usage .upleft b { font-size: 16px; line-height: 24px; font-weight: 500; color: var(--text); }
#usage .upleft small { font-size: 12px; line-height: 16px; color: var(--text-3); font-variant-numeric: tabular-nums; }
#usage .upright {
  flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  font-variant-numeric: tabular-nums;
}
#usage .upright .upamt { font-size: 16px; line-height: 24px; font-weight: var(--w-emph); color: var(--text); }
#usage .upright small { font-size: 12px; line-height: 16px; color: var(--text-3); }

/* Expanded model rows directly on --container below hairline divider */
#usage .upmodels {
  margin: 0 20px 14px; padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--outline) 22%, transparent);
  display: flex; flex-direction: column; gap: 10px;
}
#usage .upmrow { display: flex; flex-direction: column; gap: 2px; }
#usage .upmrow + .upmrow {
  padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--outline) 14%, transparent);
}
#usage .upmrow-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums;
}
#usage .upmrow-name { display: inline-flex; align-items: baseline; gap: 8px; }
#usage .upmrow-name b { font-weight: 500; color: var(--text); }
#usage .upmrow-name small { font-size: 12px; line-height: 16px; color: var(--text-3); }
#usage .upmrow-top > span { font-weight: var(--w-emph); color: var(--text); }
#usage .upmrow-sub {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  font-size: 12px; line-height: 16px; color: var(--text-3); font-variant-numeric: tabular-nums;
}

/* 4. Cache */
#usage .uccard { padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 14px; }
#usage .uccard-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
#usage .uchit { display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
#usage .uchit .uclbl { font-size: 12px; line-height: 16px; color: var(--text-3); }
#usage .uchit-val { display: flex; align-items: baseline; gap: 6px; }
#usage .uchit-val strong {
  font-size: 36px; line-height: 44px; font-weight: var(--w-emph);
  letter-spacing: -.02em; color: var(--text);
}
#usage .uchit-val strong.warn { color: var(--u-warn-text); }
#usage .uchit-val strong.bad { color: var(--u-error-text); }
#usage .ucsave {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums;
}
#usage .ucsave span { font-size: 12px; line-height: 16px; color: var(--text-3); }
#usage .ucsave strong { font-size: 22px; line-height: 28px; font-weight: var(--w-emph); color: var(--text); }

#usage .ucttl-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--outline) 22%, transparent);
  font-variant-numeric: tabular-nums;
}
#usage .ucttl-l { display: inline-flex; align-items: baseline; gap: 8px; }
#usage .ucttl-l span { font-size: 12px; line-height: 16px; color: var(--text-3); }
#usage .ucttl-l b { font-size: 14px; line-height: 20px; font-weight: var(--w-emph); color: var(--text); }
#usage .ucttl-row small { font-size: 12px; line-height: 16px; color: var(--text-3); text-align: right; }

#usage .ucwin-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px;
  padding: 12px 14px 12px 20px; border: 0; background: none; color: var(--text); text-align: left;
}
#usage .ucwin-btn > b { font-size: 14px; line-height: 20px; font-weight: var(--w-emph); color: var(--text-2); }
#usage .ucwin-btn > b.warn { color: var(--u-warn-text); }
#usage .ucwin-btn > b.bad { color: var(--u-error-text); }
#usage .ucwin-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-variant-numeric: tabular-nums; }
#usage .ucwin-l b { font-size: 14px; line-height: 20px; font-weight: var(--w-emph); color: var(--text-2); }
#usage .ucwin-l small { font-size: 12px; line-height: 16px; color: var(--text-3); }
#usage .ucwin-l small.warn { color: var(--u-warn-text); font-weight: 500; }
#usage .ucwin-l small.bad { color: var(--u-error-text); font-weight: 500; }
#usage .ucwin-sum {
  margin-left: auto; font-size: 12px; line-height: 16px; color: var(--text-3);
  font-variant-numeric: tabular-nums; text-align: right;
}
#usage .ucwin-sum .warn { color: var(--u-warn-text); font-weight: 500; }
#usage .ucwin-sum .bad { color: var(--u-error-text); font-weight: 500; }
#usage .useg.open .ucwin-sum { display: none; }
#usage .useg.open .ucwin-btn .uchev { margin-left: auto; }

#usage .ucinv-body {
  margin: 0 20px 14px; padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--outline) 22%, transparent);
}
#usage .ucause-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 390px) { #usage .ucause-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#usage .ucause-cell { display: flex; flex-direction: column; gap: 2px; }
#usage .ucause-cell b { font-size: 16px; line-height: 24px; font-weight: var(--w-emph); color: var(--text); }
#usage .ucause-cell span { font-size: 11px; line-height: 16px; color: var(--text-3); white-space: nowrap; }
#usage .ucause-cell.warn b { color: var(--u-warn-text); }
#usage .ucause-cell.bad b { color: var(--u-error-text); }

#usage .ucwin-body { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 6px; }
#usage .ucflag-btn {
  width: 100%; min-height: 48px; border: 0; text-align: left;
  background: var(--container-high); border-radius: var(--shape-md); padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-variant-numeric: tabular-nums;
}
#usage .ucflag-btn .ufl { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#usage .ucflag-btn .ufl b {
  font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#usage .ucflag-btn .ufl small { font-size: 12px; line-height: 16px; color: var(--text-3); }
#usage .ucflag-btn .ufr { display: inline-flex; align-items: center; gap: 6px; flex: none; }
#usage .ucflag-btn .ufr strong { font-size: 14px; line-height: 20px; font-weight: var(--w-emph); }
#usage .ucflag-btn .ufr strong.warn { color: var(--u-warn-text); }
#usage .ucflag-btn .ufr strong.bad { color: var(--u-error-text); }

/* Empty and loading rows */
#usage .uempty {
  padding: 18px 20px; font-size: 14px; line-height: 20px; color: var(--text-3);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* ===== offline ===== */
/* Offline on an empty chat: the away card replaces the empty-state hello instead of drawing over it. */
body.offline .hello, body.offline #fp-card { display: none; }

/* ===== tasks ===== */
/* Contained segmented groups, 48dp+ rows on the type scale, warm only for what needs the user, step progress as an M3X bar. */
.tasks { padding: 12px 12px 24px; }

/* The Now / All switch, a connected button group */
.tview { display: flex; gap: 2px; margin: 4px; }
.tview button {
  flex: 1; min-height: 48px; border: 0; font: 500 14px/20px var(--sans); color: var(--text-2); background: var(--container);
  border-radius: var(--shape-sm);
  transition: border-radius var(--spring-fast-ms) var(--spring-fast), background-color var(--effects-ms) var(--effects), color var(--effects-ms) var(--effects);
}
.tview button:first-child { border-radius: 24px var(--shape-sm) var(--shape-sm) 24px; }
.tview button:last-child { border-radius: var(--shape-sm) 24px 24px var(--shape-sm); }
.tview button.on { background: var(--primary); color: var(--on-primary); border-radius: 24px; font-weight: var(--w-emph); }

/* Group headers: the count is the header's own tone, just lighter */
.tg { margin: 20px 16px 8px; font-size: 14px; line-height: 20px; font-weight: var(--w-emph); color: var(--text-2); display: flex; align-items: baseline; gap: 8px; }
.tg small { font-size: 14px; font-weight: 400; opacity: .75; font-variant-numeric: tabular-nums; }
.tg.ask { color: var(--warn); }
.tg.run { color: var(--primary); }

/* Segmented groups: 2px gaps, big outer corners, small inner ones */
.tgrp { display: flex; flex-direction: column; gap: 2px; }
.tgrp > * { --row-bg: var(--container); border-radius: var(--shape-xs); background: var(--row-bg); }
.tgrp > :first-child { border-top-left-radius: var(--shape-lg-inc); border-top-right-radius: var(--shape-lg-inc); }
.tgrp > :last-child { border-bottom-left-radius: var(--shape-lg-inc); border-bottom-right-radius: var(--shape-lg-inc); }
.tgrp.needs > * { --row-bg: var(--warn-container); background: var(--row-bg); }

/* A row: optional tile, title, supporting line, optional bar. One text edge for rows without a tile. */
.tr { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 12px 16px; color: var(--text); }
.tr .tx, .prow .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tr .tl, .prow .tl { font-size: 16px; line-height: 24px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr .ts, .prow .ts { font-size: 14px; line-height: 20px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr .ts-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tr .ts-row .ts { flex: 1; min-width: 0; }
.tr .ref { flex: none; font-size: 12px; line-height: 16px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tr .tc, .prow .tc { flex: none; width: 24px; color: var(--text-3); display: grid; place-items: center; }
.prow .pcnt { flex: none; min-width: 24px; height: 24px; padding: 0 8px; border-radius: var(--shape-full); background: var(--container-highest); color: var(--text-2); font: 500 12px/24px var(--sans); text-align: center; font-variant-numeric: tabular-nums; }
.tgrp.needs .tr .ts { color: color-mix(in srgb, var(--on-warn-container) 85%, transparent); }
.tgrp.needs .tr .ref { color: color-mix(in srgb, var(--on-warn-container) 85%, transparent); }
/* What needs the user is worth two lines; an ellipsis would hide the half that says what to decide */
.tgrp.needs .tr .ts { white-space: normal; }
.tgrp.needs .tr .tl, .tr.k-ask .tl, .tr.k-review .tl { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Tiles: warm inside Needs you, primary for active work, hollow circle for your own items */
.tt { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.tt.ask { background: var(--warn); color: var(--on-warn); border-radius: var(--shape-md); }
.tt.review { background: var(--primary); color: var(--on-primary); }
.tgrp.needs .tt.review { background: var(--warn); color: var(--on-warn); }
.tt.you { position: relative; background: none; }
.tt.you::before { content: ""; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--warn); }
.tt.you::after { content: ""; position: absolute; inset: -4px; }
.tt.slot { width: 40px; height: 40px; border-radius: 50%; color: var(--text-3); background: none; }
.tt.slot.run { color: var(--primary); }
.tt.slot.ask, .tt.slot.review { color: var(--on-warn-container); }
.tt.slot.done { color: var(--ok); }

/* Step progress: an M3X bar (active part, a gap, the track) and the count in words; no stop dot */
.tr .tb { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.tr .prog { flex: 1; display: flex; height: 4px; position: relative; }
.tr .prog i { flex: none; border-radius: var(--shape-full); background: var(--primary); }
.tr .prog::after { content: ""; flex: 1; margin-left: 4px; border-radius: var(--shape-full); background: var(--container-highest); }
.tr:not(.k-run) .prog i[style="width: 0%"] { display: none; }
.tr:not(.k-run) .prog:has(i[style="width: 0%"])::after { margin-left: 0; }
.tr.k-run .prog.zero, .tr.k-run .prog.ind { overflow: hidden; }
.tr.k-run .prog.zero::after, .tr.k-run .prog.ind::after { margin-left: 0; }
.tr.k-run .prog.zero i, .tr.k-run .prog.ind i { position: absolute; left: 0; top: 0; width: 36% !important; animation: wave-ind 1.8s ease-in-out infinite; }
@keyframes wave-ind { 0% { left: -36%; } 100% { left: 100%; } }
.tr .pn { flex: none; font-size: 12px; line-height: 16px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.tmore, .tfold { display: flex; align-items: center; gap: 16px; min-height: 48px; width: 100%; padding: 0 16px; border: 0; font: 500 14px var(--sans); color: var(--text-2); text-align: left; }
.tgrp.needs .tmore { color: var(--on-warn-container); }
.tfold svg { color: var(--ok); }

/* The way out to everything else */
.tall {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 64px; margin-top: 24px; padding: 12px 16px; border: 0;
  border-radius: var(--shape-xl); background: var(--tonal); color: var(--on-tonal); text-align: left; font: inherit;
}
.tall > span { flex: 1; display: flex; flex-direction: column; }
.tall b { font-size: 16px; line-height: 24px; font-weight: var(--w-emph); }
.tall small { font-size: 14px; line-height: 20px; opacity: .75; }
.tall svg { flex: none; width: 24px; }
.tall.quiet { background: var(--container); color: var(--text-2); margin-top: 12px; border-radius: var(--shape-lg-inc); }
.prow .tc svg, .tall.quiet svg { transition: transform .2s var(--ease); }
.prow.open .tc svg, .tall.quiet.open svg { transform: rotate(180deg); }

/* All tasks: one segmented list. Project rows and an open project's items share its edges; items are set in by their text only. */
.prow { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 64px; padding: 12px 16px; border: 0; color: var(--text); text-align: left; font: inherit; }
.prow .tl { font-weight: var(--w-emph); }
.prow .sw, .tr .ts .sw { color: var(--warn); font-weight: 500; }
.prow .sn { color: var(--primary); }
.prow.open { background: var(--container-high) !important; }
.tgrp.board > .in { --row-bg: var(--container-high); background: var(--row-bg); }
.tgrp.board > .tr.in { padding-left: 16px; gap: 12px; min-height: 56px; }
.tgrp.board > .tfold.in { padding-left: 24px; gap: 16px; color: var(--text-3); }
.tgrp.board > .tr.k-ask { background: var(--warn-container); }
.tgrp.board > .tr.k-ask .tl { color: var(--on-warn-container); }
.tgrp.board > .tr.k-ask .ts, .tgrp.board > .tr.k-ask .ref { color: color-mix(in srgb, var(--on-warn-container) 85%, transparent); }
.tgrp.board .tr .nx { color: var(--primary); }

/* Swipe to complete (tasks.js swipeToTick): the content slides, the row becomes the "Done" container under it */
.tr.swipe { position: relative; overflow: hidden; touch-action: pan-y; }
.tr.swipe > * { transition: transform var(--spring-fast-ms) var(--spring-fast); }
.tr.swiping { background: var(--ok-container) !important; color: var(--on-ok-container); }
.tr.swiping > * { transform: translateX(var(--dx, 0)); transition: none; }
.tr.swiping::before { content: "Done"; position: absolute; left: 20px; top: 50%; translate: 0 -50%; font-size: 14px; font-weight: 500; opacity: .55; }
.tr.swiping.armed::before { opacity: 1; }

/* ===== showcase ===== */
/* What the sections above do not cover: chat event lines and the report, question cards, notes, the trajectory, the shikigami page, login, offline, sheets. */

/* ---------- Chat: notes are plain centered text, no pill ---------- */
.note { background: none; padding: 0; border-radius: 0; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-3); }
.note.warn { color: var(--warn); }
.trig { margin: 8px 0 -4px; font-size: 12px; line-height: 16px; }

/* Event lines (summoned, finished, failed): quiet, like the tool chip, one tap to the shikigami's page */
.evline {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; max-width: 100%; min-height: 40px;
  padding: 8px 8px 8px 16px; border: 0; border-radius: var(--shape-md); background: var(--container);
  color: var(--text-2); font: 400 14px/20px var(--sans); text-align: left; cursor: pointer;
  transition: border-radius var(--spring-fast-ms) var(--spring-fast);
}
.evline:active { border-radius: var(--shape-lg); }
.evline > span { min-width: 0; }
.evline b { color: var(--text); font-weight: 500; }
.evline small { margin-left: 8px; font-size: 12px; line-height: 16px; color: var(--text-3); }
.evline svg { flex: none; color: var(--text-3); }
.evline.failed { background: var(--error-container); color: var(--on-error-container); }
.evline.failed b { color: var(--on-error-container); }
.evline.failed small { display: block; margin: 2px 0 0; color: var(--on-error-container); opacity: .85; }
.evline.failed svg { color: var(--on-error-container); }

/* The report: the event line on top, the report under it, one segmented block; no tile, no badge, no outline */
.report { align-self: stretch; display: flex; flex-direction: column; gap: 2px; }
.report .evline { align-self: stretch; border-radius: var(--shape-lg-inc) var(--shape-lg-inc) var(--shape-xs) var(--shape-xs); }
.report .evline span { flex: 1; }
.report .rbody {
  padding: 12px 16px 14px; border-radius: var(--shape-xs) var(--shape-xs) var(--shape-lg-inc) var(--shape-lg-inc);
  background: var(--container); font-size: 14px; line-height: 20px; color: var(--text);
}
.report .rbody p { margin: 0 0 8px; }
.report .rbody p:last-child { margin: 0; }
.report .rbody ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.report .rbody code { font-size: 13px; overflow-wrap: anywhere; }

/* Trajectory: "Reply in chat" is a tonal button, not an outline */
.reply-btn { min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--shape-full); background: var(--tonal); color: var(--on-tonal); font: 500 14px/20px var(--sans); }

/* The activity fold: a count of what happened, centered, 48px */
.fold { min-height: 40px; padding: 8px 16px; font: 500 12px/16px var(--sans); }

/* ---------- A question in chat: a decision, so tile and card, in the warm container ---------- */
.wcard.asking { border-radius: var(--shape-xl); padding: 16px; gap: 12px; background: var(--warn-container); box-shadow: none; border: 0; }
.wcard.asking .head { align-items: center; }
.wcard.asking .badge {
  width: 40px; height: 40px; border-radius: var(--shape-md); background: var(--warn); color: var(--on-warn);
  display: grid; place-items: center;
}
.wcard.asking .badge svg { width: 22px; height: 22px; }
.wcard.asking .title b { font-size: 16px; line-height: 24px; font-weight: var(--w-emph); color: var(--on-warn-container); }
.wcard.asking .body { font-size: 14px; line-height: 20px; color: var(--on-warn-container); }
.wcard.asking .body p { margin: 0; }
.wcard.asking .settle { color: var(--on-warn-container); opacity: .8; }
@media (hover: hover) { .wcard.asking .settle:hover { color: var(--on-warn-container); opacity: 1; background: color-mix(in srgb, var(--warn) 16%, transparent); } }
.wcard.asking .foot { display: flex; gap: 8px; margin: 4px 0 0; }
.wcard.asking .foot .btn { flex: 1; min-width: 0; min-height: 48px; border-radius: 24px; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcard.asking .foot .btn.tonal { background: color-mix(in srgb, var(--warn) 16%, var(--warn-container)); color: var(--on-warn-container); }
.wcard.asking .foot .btn.filled { flex: 1.4; background: var(--warn); color: var(--on-warn); font-weight: var(--w-emph); }

/* User bubbles and assistant text on the type scale */
.msg { font-size: 16px; line-height: 24px; }
.msg.user { border-radius: var(--shape-lg-inc) var(--shape-lg-inc) var(--shape-xs) var(--shape-lg-inc); }

/* ---------- Shikigami and session page ---------- */
.spage { padding-bottom: 0; }
.stl { background: var(--surface-low); border-radius: var(--shape-xl) var(--shape-xl) 0 0; clip-path: inset(0 round var(--shape-xl) var(--shape-xl) 0 0); padding: 12px 16px 36px; }
.sfoot {
  position: relative; z-index: 1; max-width: none; margin: -24px 0 0; padding: 10px 12px max(12px, env(safe-area-inset-bottom));
  background: var(--container); border-radius: 24px 24px 0 0;
}
.sfoot > * { max-width: 720px; margin-left: auto; margin-right: auto; }
@media (min-width: 900px) {
  .stl, .sfoot { margin-left: 24px; margin-right: 24px; width: auto; }
}
.sbar .sub i { display: none; }
.sbar .sub span.work { color: var(--primary); }
.sbar .handoff { height: 40px; padding: 0 16px; border-radius: var(--shape-full); font: 500 14px/20px var(--sans); position: relative; }
.sbar .handoff::after { content: ""; position: absolute; inset: -4px 0; }
.chip .spin { display: none; }
.chip { min-height: 40px; border-radius: var(--shape-md); font-size: 14px; }

/* The question on the page: warm container like the chat card, no outline, the filled warm tile */
.qcard { padding: 16px; gap: 12px; border-radius: var(--shape-xl); background: var(--warn-container); box-shadow: none; }
.qhead { align-items: flex-start; gap: 12px; }
.qic { width: 40px; height: 40px; border-radius: var(--shape-md); background: var(--warn); color: var(--on-warn); }
.qic[style*="--me"] { border-radius: 0; clip-path: var(--me); }
.qt b { font-size: 16px; line-height: 24px; font-weight: 500; color: var(--on-warn-container); }
.qt small, .qt span { color: var(--on-warn-container); opacity: .85; }
.qcard .qopts, .qcard .opts { gap: 2px; }
.qcard .qopt, .qcard .opt { border: 0; border-radius: var(--shape-xs); background: color-mix(in srgb, var(--warn) 10%, var(--warn-container)); min-height: 56px; }
.qcard .qopt:first-child, .qcard .opt:first-child { border-top-left-radius: var(--shape-lg-inc); border-top-right-radius: var(--shape-lg-inc); }
.qcard .qopt:last-child, .qcard .opt:last-child { border-bottom-left-radius: var(--shape-lg-inc); border-bottom-right-radius: var(--shape-lg-inc); }
.qnote { color: var(--on-warn-container); opacity: .85; font-size: 12px; line-height: 16px; }

/* Stop on a working shikigami's page: the same square as in chat */
.scomposer .fab.tonal { border-radius: var(--shape-lg); }

/* ---------- Agents: working is primary, not the project's tint ---------- */
.tile.work { background: var(--primary-container); }
.tile.idle { background: var(--container-high); color: var(--text-2); }

/* ---------- Login: one mark, no tile behind it, no rules around "or" ---------- */
.signin .mark { background: none; width: auto; height: auto; color: var(--primary); margin-bottom: 0; }
.signin h1 { font-size: 28px; line-height: 36px; }
.signin .sub { font-size: 14px; line-height: 20px; }
.signin .btn { border-radius: 28px; font-size: 16px; font-weight: 500; }
.signin .btn.filled { font-weight: var(--w-emph); }
.signin .field { border-radius: var(--shape-lg); background: var(--container); box-shadow: inset 0 0 0 1px var(--outline-variant); }
.signin .field:focus-within { box-shadow: inset 0 0 0 2px var(--primary); }
.or::before, .or::after { content: none; }
.or { justify-content: center; font-size: 12px; line-height: 16px; }

/* ---------- Offline: no second star in a tile; the words and the one action ---------- */
.away .badge { display: none; }
.away button { min-height: 48px; padding: 0 24px; font-size: 14px; }

/* ---------- Sheets ---------- */
.sheet { border-radius: var(--shape-xl) var(--shape-xl) 0 0; }
.sheet h2.list { font-size: 22px; line-height: 28px; }
.sheet .usage-note { padding: 0; margin: 4px 0 0; font-size: 14px; line-height: 20px; color: var(--text-3); }

/* Theme: light or dark is a full-width connected button group at 48, the accents 40px swatches with 48px targets */
.trow { margin: 8px 0; }
.trl { font-size: 14px; line-height: 20px; color: var(--text-2); }
.tseg { width: 100%; border: 0; gap: 2px; border-radius: 0; overflow: visible; }
.tseg button {
  flex: 1; min-height: 48px; padding: 0 16px; border-radius: var(--shape-sm); background: var(--surface-low); color: var(--text);
  font: 500 14px/20px var(--sans);
  transition: border-radius var(--spring-fast-ms) var(--spring-fast), background-color var(--effects-ms) var(--effects), color var(--effects-ms) var(--effects);
}
.tseg button + button { border-left: 0; }
.tseg button:first-child { border-radius: 24px var(--shape-sm) var(--shape-sm) 24px; }
.tseg button:last-child { border-radius: var(--shape-sm) 24px 24px var(--shape-sm); }
.tseg button.on { background: var(--primary); color: var(--on-primary); border-radius: 24px; font-weight: var(--w-emph); }
.ttile { border-radius: var(--shape-xl); }
.tprev { border-radius: 22px; }
.trow:has(.tdots) { flex-direction: column; align-items: flex-start; }
.tdots { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 4px; }
.tdot { width: 40px; height: 40px; margin: 4px; }
.tdot.tseed-dot { position: relative; display: inline-block; cursor: pointer; border-radius: 50%; }
.tdot.tseed-dot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; margin: 0; }

/* Connected button groups and clickable tune rows inside sheets */
.sheet .seg button {
  background: var(--surface-low); color: var(--text);
  transition: border-radius var(--spring-fast-ms) var(--spring-fast), background-color var(--effects-ms) var(--effects), color var(--effects-ms) var(--effects);
}
.sheet .seg:has(> :nth-child(5)) button { flex: 1 0 auto; padding: 0 8px; font-size: 12px; }
.sheet .seg button.on { background: var(--primary); color: var(--on-primary); }
.tunes.m3x-seg > .tune-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 12px 16px;
  border: 0; background: var(--surface-low); color: var(--text); font: 400 14px/20px var(--sans); text-align: left; cursor: pointer;
}
.tune-row .tk { color: var(--text-3); }
.tune-row .tv { margin-left: auto; font-weight: 500; color: var(--text); text-align: right; }
.tune-row svg { flex: none; color: var(--text-3); }

/* Activity log: one segmented list per day, the decision in words in its tone, no pills, no rules */
.alist { display: flex; flex-direction: column; gap: 2px; }
.aday { margin: 16px 0 8px; padding: 0 16px; font-size: 14px; font-weight: var(--w-emph); color: var(--text-2); }
.arow { border: 0; padding: 12px 16px; gap: 4px; background: var(--container-high); border-radius: var(--shape-xs); cursor: pointer; }
.aday + .arow { border-top-left-radius: var(--shape-lg-inc); border-top-right-radius: var(--shape-lg-inc); }
.arow:has(+ .aday), .arow:last-child { border-bottom-left-radius: var(--shape-lg-inc); border-bottom-right-radius: var(--shape-lg-inc); }
.atop { font-size: 14px; line-height: 20px; }
.atop time { font-size: 12px; font-variant-numeric: tabular-nums; }
.atop .tag { padding: 0; background: none; border-radius: 0; font-size: 12px; font-weight: 500; }
.arow.bad .atop .tag { color: var(--error); }
.arow code { font-size: 13px; line-height: 20px; }
.arow.open code { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Phone app */
.pblock { gap: 12px; padding: 16px 0 0; width: 100%; }
.pacts { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.pacts .btn { flex: 1 1 160px; min-height: 48px; padding: 0 20px; border-radius: 24px; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; }
.pblock .btn { min-height: 48px; padding: 0 24px; border-radius: 24px; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; }
.psec { margin: 24px 0 8px; padding: 0 16px; font-size: 14px; font-weight: var(--w-emph); color: var(--text-2); }
.sheet .alist .prow { border: 0; padding: 10px 8px 10px 16px; min-height: 64px; background: var(--container-high); border-radius: var(--shape-xs); }
.sheet .alist .prow:first-child { border-top-left-radius: var(--shape-lg-inc); border-top-right-radius: var(--shape-lg-inc); }
.sheet .alist .prow:last-child { border-bottom-left-radius: var(--shape-lg-inc); border-bottom-right-radius: var(--shape-lg-inc); }
.sheet .alist:has(.prow) { gap: 2px; }
.ptext { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; }
.ptext b { font-size: 16px; line-height: 24px; font-weight: 500; }
.ptext span { font-size: 14px; line-height: 20px; color: var(--text-3); }
.ptext .pmeta { display: flex; flex-direction: column; gap: 1px; font-size: 12px; line-height: 16px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.prow .btn.text { min-height: 48px; padding: 0 16px; border-radius: 24px; }
.prow .btn.text.danger { color: var(--error); }

/* ---------- Menu ---------- */
.menu { border-radius: var(--shape-lg); }
.menu button { min-height: 48px; font-size: 14px; }

/* ---------- On the type scale (12/14/16/20/22/28/34): what the rules above left between steps ---------- */
code, .wcard.approval .body.cmd, .arow code, .report .rbody code { font-size: 14px; }
.wcard.approval .choices.m3x-seg .choice small, .wcard.approval .choices.m3x-seg .choice code { font-size: 12px; }
.wcard.approval .choices.m3x-seg .choice code { font-size: 12px; }
.wcard.approval .foot .btn, .working, .prow .btn.text { font-size: 14px; }
.wcard.approval.settled .foot .left { font-size: 12px; line-height: 16px; font-weight: 500; }
.wcard.approval.approved .foot .left { color: var(--ok); }
.wcard.approval.denied .foot .left, .wcard.approval.expired .foot .left { color: var(--error); }
.wcard.approval.cancelled .foot .left, .wcard.approval.restart .foot .left { color: var(--text-3); }
.card h3, #fp-card h3 { font-size: 16px; line-height: 24px; }
.agent .top b { font-size: 16px; line-height: 24px; }
.agent time { font-size: 12px; line-height: 16px; }
.agent .sub, .agent .proj, .agent .line, .agent .sub span { font-size: 14px; line-height: 20px; }
.sbar h1 { font-size: 22px; line-height: 28px; }
.sbar .sub, .sbar .sub b, .sbar .sub span { font-size: 12px; line-height: 16px; }
.sbar .sub b { color: var(--text-2) !important; }
.sbar .ring span { font-size: 12px; }
.stl h4, .sthread h4 { font-size: 16px; line-height: 24px; }
.qopt b { font-size: 14px; line-height: 20px; }
.qopt small { font-size: 12px; line-height: 16px; }
.meter .pct { font-size: 34px; line-height: 40px; }
.meter span, .meter .sub { font-size: 14px; line-height: 20px; }
.usage-note { font-size: 14px; line-height: 20px; }
.crow b, .urow b { font-size: 16px; line-height: 24px; }
.away p { font-size: 16px; line-height: 24px; }
.card .actions .btn { font-size: 14px; }
.archrow .txt b { font-size: 16px; line-height: 24px; }
.archrow .txt span { font-size: 14px; line-height: 20px; }
.msg.assistant code { font-size: 14px; }
.qt small { font-size: 12px; line-height: 16px; }
.urow span, .urow time { font-size: 14px; line-height: 20px; }

/* Busy button spinner and the jump-to-latest pill */
.btn.busy { gap: 8px; }
.btn.busy:disabled, .btn.held:disabled { opacity: 1; }
.btn.held:disabled { opacity: .38; }
.btn.busy::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.jump { position: fixed; left: 50%; right: auto; transform: translateX(-50%); bottom: 96px; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 14px; border: 0; border-radius: var(--shape-full); background: var(--tonal); color: var(--on-tonal); font: 500 14px/20px var(--sans); box-shadow: 0 2px 8px rgb(0 0 0 / .28); z-index: 5; }
.jump b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--primary); color: var(--on-primary); font: 600 12px/20px var(--sans); text-align: center; font-variant-numeric: tabular-nums; }

/* Contrast and touch-target fixes */

/* 48 to touch: the lane tabs, event lines, Reply in chat, the fold, snackbar actions, menu, attach and mic. */
.ltab { height: 48px; }
@media (orientation: landscape) and (max-height: 520px) { .ltab { height: 34px; } }
.evline, .reply-btn { min-height: 48px; }
.snack button { min-height: 48px; padding: 0 16px; border-radius: 24px; }
.snack:has(button) { padding: 4px 4px 4px 16px; }
.icon-btn, .field .attach, .field .mic { width: 48px; height: 48px; }
/* Chips and the handoff keep their 40 look; their hit areas reach 48 past the clip of .sl */
.sbar .handoff.sl { overflow: visible; }
/* A block, not a flex row: in a flex row the dot separator loses its spaces and takes the 6 gap on each side */
.sbar .sub { display: block; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
/* One chip style: tool chips take the model chip's 48 height, padding, corners and type; no hit area tricks */
.chip { min-height: 48px; padding: 8px 8px 8px 12px; border-radius: var(--shape-md); font: 400 14px/20px var(--sans); color: var(--text-2); }
.chip::before { content: none; }
.chip svg:last-child { width: 20px; height: 20px; color: var(--text-3); }
.activity.running .chip { padding-left: 16px; }
.sbar .handoff::after { inset: 0; }
.sbar .handoff::before { content: ""; position: absolute; inset: -4px 0; }
.field .attach { margin: 2px 0 2px 4px; }
.field .mic { margin: 2px 2px 2px 0; }
.tdots { gap: 0; }
/* The swatches are 48 boxes around their 40 discs; the clip is forced since the inline background shorthand would reset it.
   The selected ring sits in the box: 2 clear, then 2 ring. */
.tdot { width: 48px; height: 48px; margin: 0; background-clip: content-box !important; padding: 4px; border: 0; box-sizing: border-box; }
.tdot.on { box-shadow: inset 0 0 0 2px var(--text); }
.tseed { width: 48px; height: 48px; }

/* Nav: the active pill on primary (7.3:1 on the bar), its icon on-primary; the label keeps its color */

/* Usage is neutral, as primary is for working: meters, percentages and the idle nav ring are on-surface-variant on an outline-variant track.
   Error only near the limit (90%+); the 5-hour note is plain supporting text.
   theme.js maps no outlineVariant, so it is mixed from the theme's outline. */
:root { --outline-variant: color-mix(in srgb, var(--outline) 45%, var(--surface)); }
.note.warn { color: var(--text-2); }
.meter, .meter.ok, .meter.warn { --tone: var(--text-2); }
.meter.bad { --tone: var(--error); }
.ditem .ring-ico .t { stroke: var(--outline-variant); opacity: 1; }
.ring-ico .f { stroke: var(--text-2); }
.ditem[data-tone="warn"] .ring-ico .f { stroke: var(--warn); }
.ditem[data-tone="bad"] .ring-ico .f { stroke: var(--error); }

/* Wavy progress on a running task's step bar (amplitude 3, wavelength 40, 4 thick, a 4 gap, the flat track).
   Usage meters are amounts and stay flat; the wave masks the theme's primary, so accents and themes carry over. */
.tr.k-run .prog { height: 10px; align-items: center; }
.tr.k-run .prog i { position: relative; overflow: hidden; height: 10px; border-radius: 0; background: none; }
.tr.k-run .prog i::before {
  content: ""; position: absolute; inset: 0 0 0 -40px; background: var(--primary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='10' viewBox='0 0 40 10'%3E%3Cpath d='M0 5 C 5 1.05 15 1.05 20 5 S 35 8.95 40 5' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") left center / 40px 10px repeat-x; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='10' viewBox='0 0 40 10'%3E%3Cpath d='M0 5 C 5 1.05 15 1.05 20 5 S 35 8.95 40 5' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") left center / 40px 10px repeat-x;
  animation: wave 1.2s linear infinite;
}
.tr.k-run .prog::after { height: 4px; }
.tr.k-run .prog.zero i, .tr.k-run .prog.ind i {
  z-index: 1;
  background: var(--row-bg, var(--container));
  box-shadow: -4px 0 0 var(--row-bg, var(--container)), 4px 0 0 var(--row-bg, var(--container));
}
.tr.k-run .prog.zero i::after, .tr.k-run .prog.ind i::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--row-bg, var(--container)) 0, transparent 5px, transparent calc(100% - 5px), var(--row-bg, var(--container)) 100%);
}
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(40px); } }
@media (prefers-reduced-motion: reduce) { .tr.k-run .prog i::before { animation: none; } }

/* Contrast: choice descriptions on the warm options */
.qcard .qopt small { color: var(--on-warn-container); opacity: .82; }

/* Sending: the contained indicator in the button; the row fixes the widths, not the label */
.btn.busy::before { content: none; }
.wcard.approval .foot .btn.tonal { flex: 1 1 0; }
.wcard.approval .foot .btn.filled { flex: 1.4 1 0; }
.wcard.approval .choice.held:disabled { opacity: .38; }

/* Tasks on the 16 grid; the toggle has room below it */
.tasks { padding-left: 0; padding-right: 0; }
.tview { margin: 4px 0; }
.tview + .tgrp { margin-top: 20px; }

.archrow .cnt { flex: none; font-size: 14px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* The choices as one segmented group */
.qcard .qopts { display: flex; flex-direction: column; }

/* An answered question: the question and its answer, quiet */
.wcard.approval.question.settled { background: var(--container); color: var(--text); gap: 6px; padding: 12px 16px; }
.wcard.approval.question.settled .body { max-height: none; -webkit-mask-image: none; mask-image: none; color: var(--text-2); font-size: 14px; line-height: 20px; }
.wcard.approval.question.settled .foot .left { font-size: 14px; line-height: 20px; }
/* A settled command fades only when it overflows (one line here fits); its tile stays neutral */
.wcard.approval.settled .body { -webkit-mask-image: none; mask-image: none; }
.wcard.approval.settled .badge { background: var(--container-high); color: var(--text-2); }

/* One monospace */
.report .rbody code { font: 13px var(--mono); background: var(--container-high); border-radius: 6px; padding: .1em .35em; }

/* The note button round and tonal like Deny */
.wcard.approval .foot .btn.icon { border-radius: 26px; background: var(--tonal); color: var(--on-tonal); }

.usage-h { color: var(--text-2); }

/* The buttons under the title */
.card .actions { margin: 12px 0 0; gap: 8px; }

.tct code { background: none; padding: 0; }
.tcard { border: 0; box-shadow: none; }

/* One card shape in chat; the failure line spans the column */
.card { border-radius: var(--shape-xl); }
.report .evline { border-radius: var(--shape-xl) var(--shape-xl) var(--shape-xs) var(--shape-xs); }
.report .rbody { border-radius: var(--shape-xs) var(--shape-xs) var(--shape-xl) var(--shape-xl); }
.evline.failed { align-self: stretch; border-radius: var(--shape-xl); padding: 10px 12px 10px 20px; }
.evline.failed > span { flex: 1; }

/* Even sheet spacing: 14 under the title and between the blocks, with no extra room before Today or the version line.
   The same 14 between the line and each button (the block has its own 12 gap). */
.alist > .aday:first-child { margin-top: 0; }
#sheet-body .pblock { padding-top: 0; }
#sheet-body .pblock .usage-note { margin: 0 0 2px; }

/* The fold as a row of the column, left aligned, nothing cut */
.fold { align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px;
  max-width: none; padding: 12px 16px 12px 20px; border-radius: var(--shape-xl); text-align: left; font: 400 14px/20px var(--sans); }
.fold span { white-space: normal; overflow: visible; text-overflow: clip; }
.fold b { flex: none; }

/* ===== expressive/shapes ===== */
/* The M3 Expressive shape library as clip-paths, from androidx MaterialShapes.kt.
   120 points each, so any two interpolate. */
:root {
  --shape-circle: polygon(50.65% 0.03%, 53.27% 0.16%, 55.87% 0.38%, 58.46% 0.77%, 61.02% 1.28%, 63.56% 1.91%, 66.05% 2.70%, 68.52% 3.59%, 70.91% 4.65%, 73.27% 5.76%, 75.53% 7.08%, 77.78% 8.43%, 79.88% 9.99%, 81.96% 11.57%, 83.90% 13.33%, 85.80% 15.13%, 87.55% 17.07%, 89.24% 19.07%, 90.79% 21.17%, 92.25% 23.34%, 93.59% 25.59%, 94.80% 27.91%, 95.91% 30.27%, 96.86% 32.71%, 97.74% 35.18%, 98.40% 37.71%, 99.04% 40.25%, 99.42% 42.83%, 99.78% 45.43%, 99.90% 48.04%, 99.97% 50.65%, 99.84% 53.27%, 99.62% 55.87%, 99.23% 58.46%, 98.72% 61.02%, 98.09% 63.56%, 97.30% 66.05%, 96.41% 68.52%, 95.35% 70.91%, 94.24% 73.27%, 92.92% 75.53%, 91.57% 77.78%, 90.01% 79.88%, 88.43% 81.96%, 86.67% 83.90%, 84.87% 85.80%, 82.93% 87.55%, 80.93% 89.24%, 78.83% 90.79%, 76.66% 92.25%, 74.41% 93.59%, 72.09% 94.80%, 69.73% 95.91%, 67.29% 96.86%, 64.82% 97.74%, 62.29% 98.40%, 59.75% 99.04%, 57.17% 99.42%, 54.57% 99.78%, 51.96% 99.90%, 49.35% 99.97%, 46.73% 99.84%, 44.13% 99.62%, 41.54% 99.23%, 38.98% 98.72%, 36.44% 98.09%, 33.95% 97.30%, 31.48% 96.41%, 29.09% 95.35%, 26.73% 94.24%, 24.47% 92.92%, 22.22% 91.57%, 20.12% 90.01%, 18.04% 88.43%, 16.10% 86.67%, 14.20% 84.87%, 12.45% 82.93%, 10.76% 80.93%, 9.21% 78.83%, 7.75% 76.66%, 6.41% 74.41%, 5.20% 72.09%, 4.09% 69.73%, 3.14% 67.29%, 2.26% 64.82%, 1.60% 62.29%, 0.96% 59.75%, 0.58% 57.17%, 0.22% 54.57%, 0.10% 51.96%, 0.03% 49.35%, 0.16% 46.73%, 0.38% 44.13%, 0.77% 41.54%, 1.28% 38.98%, 1.91% 36.44%, 2.70% 33.95%, 3.59% 31.48%, 4.65% 29.09%, 5.76% 26.73%, 7.08% 24.47%, 8.43% 22.22%, 9.99% 20.12%, 11.57% 18.04%, 13.33% 16.10%, 15.13% 14.20%, 17.07% 12.45%, 19.07% 10.76%, 21.17% 9.21%, 23.34% 7.75%, 25.59% 6.41%, 27.91% 5.20%, 30.27% 4.09%, 32.71% 3.14%, 35.18% 2.26%, 37.71% 1.60%, 40.25% 0.96%, 42.83% 0.58%, 45.43% 0.22%, 48.04% 0.10%);
  --shape-cookie4: polygon(50.58% 6.04%, 52.89% 5.87%, 55.27% 5.44%, 57.78% 4.71%, 60.50% 3.59%, 63.45% 2.31%, 66.58% 1.14%, 69.79% 0.40%, 73.03% 0.05%, 76.26% 0.09%, 79.41% 0.56%, 82.47% 1.41%, 85.39% 2.61%, 88.14% 4.14%, 90.68% 5.99%, 92.95% 8.16%, 94.96% 10.57%, 96.66% 13.21%, 98.05% 16.04%, 99.05% 19.05%, 99.69% 22.17%, 99.95% 25.37%, 99.83% 28.59%, 99.25% 31.83%, 98.26% 35.01%, 97.01% 38.06%, 95.79% 40.89%, 94.87% 43.49%, 94.30% 45.93%, 94.01% 48.27%, 93.96% 50.58%, 94.13% 52.89%, 94.56% 55.27%, 95.29% 57.78%, 96.41% 60.50%, 97.69% 63.45%, 98.86% 66.58%, 99.60% 69.79%, 99.95% 73.03%, 99.91% 76.26%, 99.44% 79.41%, 98.59% 82.47%, 97.39% 85.39%, 95.86% 88.14%, 94.01% 90.68%, 91.84% 92.95%, 89.43% 94.96%, 86.79% 96.66%, 83.96% 98.05%, 80.95% 99.05%, 77.83% 99.69%, 74.63% 99.95%, 71.41% 99.83%, 68.17% 99.25%, 64.99% 98.26%, 61.94% 97.01%, 59.11% 95.79%, 56.51% 94.87%, 54.07% 94.30%, 51.73% 94.01%, 49.42% 93.96%, 47.11% 94.13%, 44.73% 94.56%, 42.22% 95.29%, 39.50% 96.41%, 36.55% 97.69%, 33.42% 98.86%, 30.21% 99.60%, 26.97% 99.95%, 23.74% 99.91%, 20.59% 99.44%, 17.53% 98.59%, 14.61% 97.39%, 11.86% 95.86%, 9.32% 94.01%, 7.05% 91.84%, 5.04% 89.43%, 3.34% 86.79%, 1.95% 83.96%, 0.95% 80.95%, 0.31% 77.83%, 0.05% 74.63%, 0.17% 71.41%, 0.75% 68.17%, 1.74% 64.99%, 2.99% 61.94%, 4.21% 59.11%, 5.13% 56.51%, 5.70% 54.07%, 5.99% 51.73%, 6.04% 49.42%, 5.87% 47.11%, 5.44% 44.73%, 4.71% 42.22%, 3.59% 39.50%, 2.31% 36.55%, 1.14% 33.42%, 0.40% 30.21%, 0.05% 26.97%, 0.09% 23.74%, 0.56% 20.59%, 1.41% 17.53%, 2.61% 14.61%, 4.14% 11.86%, 5.99% 9.32%, 8.16% 7.05%, 10.57% 5.04%, 13.21% 3.34%, 16.04% 1.95%, 19.05% 0.95%, 22.17% 0.31%, 25.37% 0.05%, 28.59% 0.17%, 31.83% 0.75%, 35.01% 1.74%, 38.06% 2.99%, 40.89% 4.21%, 43.49% 5.13%, 45.93% 5.70%, 48.27% 5.99%);
  --shape-cookie6: polygon(50.65% 0.02%, 53.26% 0.22%, 55.84% 0.70%, 58.35% 1.43%, 60.77% 2.42%, 63.07% 3.66%, 65.24% 5.12%, 67.24% 6.80%, 69.13% 8.50%, 71.08% 9.94%, 73.10% 11.17%, 75.26% 12.20%, 77.59% 13.06%, 80.06% 13.85%, 82.46% 14.88%, 84.75% 16.15%, 86.90% 17.64%, 88.87% 19.36%, 90.66% 21.26%, 92.25% 23.34%, 93.61% 25.58%, 94.75% 27.93%, 95.61% 30.40%, 96.23% 32.94%, 96.59% 35.53%, 96.67% 38.15%, 96.49% 40.75%, 96.03% 43.33%, 95.51% 45.82%, 95.23% 48.22%, 95.18% 50.59%, 95.36% 52.97%, 95.79% 55.42%, 96.34% 57.96%, 96.64% 60.55%, 96.69% 63.17%, 96.47% 65.78%, 95.97% 68.34%, 95.22% 70.85%, 94.21% 73.26%, 92.96% 75.56%, 91.48% 77.72%, 89.78% 79.70%, 87.89% 81.51%, 85.82% 83.11%, 83.60% 84.49%, 81.25% 85.64%, 78.79% 86.53%, 76.38% 87.32%, 74.15% 88.28%, 72.08% 89.43%, 70.11% 90.77%, 68.20% 92.36%, 66.27% 94.11%, 64.18% 95.67%, 61.94% 97.02%, 59.57% 98.13%, 57.10% 98.98%, 54.56% 99.59%, 51.96% 99.92%, 49.35% 99.98%, 46.74% 99.78%, 44.16% 99.30%, 41.65% 98.57%, 39.23% 97.58%, 36.93% 96.34%, 34.76% 94.88%, 32.76% 93.20%, 30.87% 91.50%, 28.92% 90.06%, 26.90% 88.83%, 24.74% 87.80%, 22.41% 86.94%, 19.94% 86.15%, 17.54% 85.12%, 15.25% 83.85%, 13.10% 82.36%, 11.13% 80.64%, 9.34% 78.74%, 7.75% 76.66%, 6.39% 74.42%, 5.25% 72.07%, 4.39% 69.60%, 3.77% 67.06%, 3.41% 64.47%, 3.33% 61.85%, 3.51% 59.25%, 3.97% 56.67%, 4.49% 54.18%, 4.77% 51.78%, 4.82% 49.41%, 4.64% 47.03%, 4.21% 44.58%, 3.66% 42.04%, 3.36% 39.45%, 3.31% 36.83%, 3.53% 34.22%, 4.03% 31.66%, 4.78% 29.15%, 5.79% 26.74%, 7.04% 24.44%, 8.52% 22.28%, 10.22% 20.30%, 12.11% 18.49%, 14.18% 16.89%, 16.40% 15.51%, 18.75% 14.36%, 21.21% 13.47%, 23.62% 12.68%, 25.85% 11.72%, 27.92% 10.57%, 29.89% 9.23%, 31.80% 7.64%, 33.73% 5.89%, 35.82% 4.33%, 38.06% 2.98%, 40.43% 1.87%, 42.90% 1.02%, 45.44% 0.41%, 48.04% 0.08%);
  --shape-cookie9: polygon(50.65% 0.54%, 53.22% 0.86%, 55.73% 1.60%, 58.11% 2.78%, 60.32% 4.39%, 62.40% 6.03%, 64.52% 7.22%, 66.73% 8.05%, 69.11% 8.55%, 71.74% 8.67%, 74.50% 8.81%, 77.12% 9.41%, 79.56% 10.41%, 81.78% 11.79%, 83.73% 13.52%, 85.37% 15.55%, 86.67% 17.84%, 87.58% 20.38%, 88.09% 23.08%, 88.77% 25.54%, 89.77% 27.73%, 91.08% 29.74%, 92.79% 31.62%, 94.91% 33.43%, 96.78% 35.48%, 98.23% 37.75%, 99.24% 40.20%, 99.83% 42.77%, 99.99% 45.41%, 99.70% 48.05%, 98.95% 50.64%, 97.74% 53.13%, 96.47% 55.50%, 95.66% 57.85%, 95.23% 60.24%, 95.19% 62.74%, 95.58% 65.47%, 95.86% 68.30%, 95.65% 71.04%, 94.98% 73.66%, 93.87% 76.10%, 92.38% 78.32%, 90.52% 80.26%, 88.33% 81.88%, 85.83% 83.12%, 83.22% 84.10%, 80.99% 85.34%, 79.06% 86.86%, 77.36% 88.71%, 75.87% 91.00%, 74.31% 93.41%, 72.41% 95.45%, 70.23% 97.09%, 67.82% 98.32%, 65.25% 99.12%, 62.56% 99.47%, 59.81% 99.34%, 57.06% 98.71%, 54.39% 97.77%, 51.86% 97.26%, 49.38% 97.16%, 46.89% 97.46%, 44.29% 98.22%, 41.56% 99.09%, 38.81% 99.46%, 36.08% 99.34%, 33.44% 98.77%, 30.95% 97.76%, 28.65% 96.32%, 26.60% 94.48%, 24.87% 92.25%, 23.42% 89.79%, 21.82% 87.74%, 20.01% 86.06%, 17.94% 84.68%, 15.52% 83.59%, 12.89% 82.54%, 10.54% 81.11%, 8.50% 79.33%, 6.82% 77.24%, 5.53% 74.91%, 4.64% 72.37%, 4.19% 69.68%, 4.21% 66.89%, 4.68% 64.07%, 4.84% 61.47%, 4.60% 59.03%, 3.99% 56.67%, 2.96% 54.32%, 1.60% 51.90%, 0.62% 49.35%, 0.10% 46.73%, 0.03% 44.09%, 0.40% 41.48%, 1.22% 38.96%, 2.45% 36.59%, 4.10% 34.42%, 6.17% 32.51%, 8.12% 30.69%, 9.62% 28.75%, 10.77% 26.66%, 11.61% 24.35%, 12.14% 21.73%, 12.83% 19.09%, 13.94% 16.66%, 15.41% 14.49%, 17.21% 12.62%, 19.30% 11.06%, 21.63% 9.85%, 24.17% 9.05%, 26.86% 8.69%, 29.62% 8.66%, 32.10% 8.34%, 34.39% 7.68%, 36.55% 6.68%, 38.64% 5.27%, 40.76% 3.53%, 43.06% 2.14%, 45.51% 1.18%, 48.06% 0.64%);
  --shape-cookie12: polygon(50.65% 0.02%, 53.24% 0.56%, 55.70% 1.86%, 57.92% 3.91%, 60.10% 5.36%, 62.38% 6.12%, 64.83% 6.30%, 67.66% 5.74%, 70.56% 5.41%, 73.20% 5.89%, 75.56% 7.05%, 77.53% 8.80%, 79.00% 11.16%, 79.90% 14.05%, 81.07% 16.39%, 82.66% 18.19%, 84.70% 19.57%, 87.42% 20.50%, 90.10% 21.66%, 92.15% 23.41%, 93.61% 25.58%, 94.44% 28.09%, 94.54% 30.86%, 93.87% 33.81%, 93.71% 36.43%, 94.19% 38.78%, 95.26% 41.00%, 97.16% 43.16%, 98.89% 45.51%, 99.80% 48.04%, 99.98% 50.65%, 99.44% 53.24%, 98.14% 55.70%, 96.09% 57.92%, 94.64% 60.10%, 93.88% 62.38%, 93.70% 64.83%, 94.26% 67.66%, 94.59% 70.56%, 94.11% 73.20%, 92.95% 75.56%, 91.20% 77.53%, 88.84% 79.00%, 85.95% 79.90%, 83.61% 81.07%, 81.81% 82.66%, 80.43% 84.70%, 79.50% 87.42%, 78.34% 90.10%, 76.59% 92.15%, 74.42% 93.61%, 71.91% 94.44%, 69.14% 94.54%, 66.19% 93.87%, 63.57% 93.71%, 61.22% 94.19%, 59.00% 95.26%, 56.84% 97.16%, 54.49% 98.89%, 51.96% 99.80%, 49.35% 99.98%, 46.76% 99.44%, 44.30% 98.14%, 42.08% 96.09%, 39.90% 94.64%, 37.62% 93.88%, 35.17% 93.70%, 32.34% 94.26%, 29.44% 94.59%, 26.80% 94.11%, 24.44% 92.95%, 22.47% 91.20%, 21.00% 88.84%, 20.10% 85.95%, 18.93% 83.61%, 17.34% 81.81%, 15.30% 80.43%, 12.58% 79.50%, 9.90% 78.34%, 7.85% 76.59%, 6.39% 74.42%, 5.56% 71.91%, 5.46% 69.14%, 6.13% 66.19%, 6.29% 63.57%, 5.81% 61.22%, 4.74% 59.00%, 2.84% 56.84%, 1.11% 54.49%, 0.20% 51.96%, 0.02% 49.35%, 0.56% 46.76%, 1.86% 44.30%, 3.91% 42.08%, 5.36% 39.90%, 6.12% 37.62%, 6.30% 35.17%, 5.74% 32.34%, 5.41% 29.44%, 5.89% 26.80%, 7.05% 24.44%, 8.80% 22.47%, 11.16% 21.00%, 14.05% 20.10%, 16.39% 18.93%, 18.19% 17.34%, 19.57% 15.30%, 20.50% 12.58%, 21.66% 9.90%, 23.41% 7.85%, 25.58% 6.39%, 28.09% 5.56%, 30.86% 5.46%, 33.81% 6.13%, 36.43% 6.29%, 38.78% 5.81%, 41.00% 4.74%, 43.16% 2.84%, 45.51% 1.11%, 48.04% 0.20%);
  --shape-clover4: polygon(50.56% 6.99%, 52.93% 5.23%, 55.48% 3.68%, 58.18% 2.38%, 61.01% 1.34%, 63.93% 0.61%, 66.92% 0.16%, 69.95% 0.00%, 72.97% 0.17%, 75.97% 0.63%, 78.92% 1.39%, 81.77% 2.46%, 84.50% 3.80%, 87.09% 5.40%, 89.50% 7.27%, 91.70% 9.37%, 93.69% 11.68%, 95.43% 14.18%, 96.91% 16.85%, 98.11% 19.64%, 99.03% 22.54%, 99.64% 25.52%, 99.95% 28.54%, 99.96% 31.57%, 99.65% 34.58%, 99.06% 37.54%, 98.18% 40.42%, 97.00% 43.19%, 95.57% 45.81%, 93.90% 48.28%, 93.01% 50.56%, 94.77% 52.93%, 96.32% 55.48%, 97.62% 58.18%, 98.66% 61.01%, 99.39% 63.93%, 99.84% 66.92%, 100.00% 69.95%, 99.83% 72.97%, 99.37% 75.97%, 98.61% 78.92%, 97.54% 81.77%, 96.20% 84.50%, 94.60% 87.09%, 92.73% 89.50%, 90.63% 91.70%, 88.32% 93.69%, 85.82% 95.43%, 83.15% 96.91%, 80.36% 98.11%, 77.46% 99.03%, 74.48% 99.64%, 71.46% 99.95%, 68.43% 99.96%, 65.42% 99.65%, 62.46% 99.06%, 59.58% 98.18%, 56.81% 97.00%, 54.19% 95.57%, 51.72% 93.90%, 49.44% 93.01%, 47.07% 94.77%, 44.52% 96.32%, 41.82% 97.62%, 38.99% 98.66%, 36.07% 99.39%, 33.08% 99.84%, 30.05% 100.00%, 27.03% 99.83%, 24.03% 99.37%, 21.08% 98.61%, 18.23% 97.54%, 15.50% 96.20%, 12.91% 94.60%, 10.50% 92.73%, 8.30% 90.63%, 6.31% 88.32%, 4.57% 85.82%, 3.09% 83.15%, 1.89% 80.36%, 0.97% 77.46%, 0.36% 74.48%, 0.05% 71.46%, 0.04% 68.43%, 0.35% 65.42%, 0.94% 62.46%, 1.82% 59.58%, 3.00% 56.81%, 4.43% 54.19%, 6.10% 51.72%, 6.99% 49.44%, 5.23% 47.07%, 3.68% 44.52%, 2.38% 41.82%, 1.34% 38.99%, 0.61% 36.07%, 0.16% 33.08%, 0.00% 30.05%, 0.17% 27.03%, 0.63% 24.03%, 1.39% 21.08%, 2.46% 18.23%, 3.80% 15.50%, 5.40% 12.91%, 7.27% 10.50%, 9.37% 8.30%, 11.68% 6.31%, 14.18% 4.57%, 16.85% 3.09%, 19.64% 1.89%, 22.54% 0.97%, 25.52% 0.36%, 28.54% 0.05%, 31.57% 0.04%, 34.58% 0.35%, 37.54% 0.94%, 40.42% 1.82%, 43.19% 3.00%, 45.81% 4.43%, 48.28% 6.10%);
  --shape-clover8: polygon(50.61% 3.41%, 53.14% 2.10%, 55.79% 1.05%, 58.53% 0.37%, 61.30% 0.07%, 64.06% 0.15%, 66.77% 0.59%, 69.40% 1.37%, 71.90% 2.49%, 74.23% 3.94%, 76.36% 5.69%, 78.26% 7.71%, 79.88% 9.98%, 81.19% 12.49%, 82.16% 15.21%, 83.38% 17.48%, 86.09% 18.35%, 88.71% 19.48%, 91.12% 20.94%, 93.30% 22.68%, 95.19% 24.69%, 96.80% 26.92%, 98.11% 29.33%, 99.09% 31.89%, 99.71% 34.57%, 99.97% 37.31%, 99.88% 40.08%, 99.43% 42.83%, 98.58% 45.54%, 97.35% 48.14%, 96.59% 50.61%, 97.90% 53.14%, 98.95% 55.79%, 99.63% 58.53%, 99.93% 61.30%, 99.85% 64.06%, 99.41% 66.77%, 98.63% 69.40%, 97.51% 71.90%, 96.06% 74.23%, 94.31% 76.36%, 92.29% 78.26%, 90.02% 79.88%, 87.51% 81.19%, 84.79% 82.16%, 82.52% 83.38%, 81.65% 86.09%, 80.52% 88.71%, 79.06% 91.12%, 77.32% 93.30%, 75.31% 95.19%, 73.08% 96.80%, 70.67% 98.11%, 68.11% 99.09%, 65.43% 99.71%, 62.69% 99.97%, 59.92% 99.88%, 57.17% 99.43%, 54.46% 98.58%, 51.86% 97.35%, 49.39% 96.59%, 46.86% 97.90%, 44.21% 98.95%, 41.47% 99.63%, 38.70% 99.93%, 35.94% 99.85%, 33.23% 99.41%, 30.60% 98.63%, 28.10% 97.51%, 25.77% 96.06%, 23.64% 94.31%, 21.74% 92.29%, 20.12% 90.02%, 18.81% 87.51%, 17.84% 84.79%, 16.62% 82.52%, 13.91% 81.65%, 11.29% 80.52%, 8.88% 79.06%, 6.70% 77.32%, 4.81% 75.31%, 3.20% 73.08%, 1.89% 70.67%, 0.91% 68.11%, 0.29% 65.43%, 0.03% 62.69%, 0.12% 59.92%, 0.57% 57.17%, 1.42% 54.46%, 2.65% 51.86%, 3.41% 49.39%, 2.10% 46.86%, 1.05% 44.21%, 0.37% 41.47%, 0.07% 38.70%, 0.15% 35.94%, 0.59% 33.23%, 1.37% 30.60%, 2.49% 28.10%, 3.94% 25.77%, 5.69% 23.64%, 7.71% 21.74%, 9.98% 20.12%, 12.49% 18.81%, 15.21% 17.84%, 17.48% 16.62%, 18.35% 13.91%, 19.48% 11.29%, 20.94% 8.88%, 22.68% 6.70%, 24.69% 4.81%, 26.92% 3.20%, 29.33% 1.89%, 31.89% 0.91%, 34.57% 0.29%, 37.31% 0.03%, 40.08% 0.12%, 42.83% 0.57%, 45.54% 1.42%, 48.14% 2.65%);
  --shape-sunny: polygon(50.65% 0.03%, 53.23% 0.70%, 55.64% 2.34%, 57.86% 4.23%, 59.95% 6.01%, 61.93% 7.70%, 63.81% 9.30%, 65.71% 10.62%, 67.83% 11.32%, 70.23% 11.55%, 72.75% 11.75%, 75.41% 11.97%, 78.23% 12.19%, 81.21% 12.47%, 83.80% 13.44%, 85.80% 15.13%, 87.15% 17.42%, 87.69% 20.29%, 87.92% 23.20%, 88.14% 25.93%, 88.35% 28.52%, 88.55% 30.99%, 88.96% 33.26%, 89.96% 35.26%, 91.49% 37.12%, 93.13% 39.05%, 94.87% 41.08%, 96.70% 43.23%, 98.61% 45.53%, 99.75% 48.05%, 99.97% 50.65%, 99.30% 53.23%, 97.66% 55.64%, 95.77% 57.86%, 93.99% 59.95%, 92.30% 61.93%, 90.70% 63.81%, 89.38% 65.71%, 88.68% 67.83%, 88.45% 70.23%, 88.25% 72.75%, 88.03% 75.41%, 87.81% 78.23%, 87.53% 81.21%, 86.56% 83.80%, 84.87% 85.80%, 82.58% 87.15%, 79.71% 87.69%, 76.80% 87.92%, 74.07% 88.14%, 71.48% 88.35%, 69.01% 88.55%, 66.74% 88.96%, 64.74% 89.96%, 62.88% 91.49%, 60.95% 93.13%, 58.92% 94.87%, 56.77% 96.70%, 54.47% 98.61%, 51.95% 99.75%, 49.35% 99.97%, 46.77% 99.30%, 44.36% 97.66%, 42.14% 95.77%, 40.05% 93.99%, 38.07% 92.30%, 36.19% 90.70%, 34.29% 89.38%, 32.17% 88.68%, 29.77% 88.45%, 27.25% 88.25%, 24.59% 88.03%, 21.77% 87.81%, 18.79% 87.53%, 16.20% 86.56%, 14.20% 84.87%, 12.85% 82.58%, 12.31% 79.71%, 12.08% 76.80%, 11.86% 74.07%, 11.65% 71.48%, 11.45% 69.01%, 11.04% 66.74%, 10.04% 64.74%, 8.51% 62.88%, 6.87% 60.95%, 5.13% 58.92%, 3.30% 56.77%, 1.39% 54.47%, 0.25% 51.95%, 0.03% 49.35%, 0.70% 46.77%, 2.34% 44.36%, 4.23% 42.14%, 6.01% 40.05%, 7.70% 38.07%, 9.30% 36.19%, 10.62% 34.29%, 11.32% 32.17%, 11.55% 29.77%, 11.75% 27.25%, 11.97% 24.59%, 12.19% 21.77%, 12.47% 18.79%, 13.44% 16.20%, 15.13% 14.20%, 17.42% 12.85%, 20.29% 12.31%, 23.20% 12.08%, 25.93% 11.86%, 28.52% 11.65%, 30.99% 11.45%, 33.26% 11.04%, 35.26% 10.04%, 37.12% 8.51%, 39.05% 6.87%, 41.08% 5.13%, 43.23% 3.30%, 45.53% 1.39%, 48.05% 0.25%);
  --shape-very-sunny: polygon(50.65% 0.03%, 53.23% 0.65%, 55.66% 2.17%, 57.75% 4.90%, 59.53% 7.87%, 61.13% 10.53%, 62.77% 12.38%, 64.55% 13.54%, 66.50% 14.21%, 68.74% 14.38%, 71.51% 13.85%, 74.69% 13.05%, 78.20% 12.23%, 81.28% 12.38%, 83.81% 13.43%, 85.80% 15.13%, 87.18% 17.39%, 87.82% 20.18%, 87.37% 23.59%, 86.53% 26.95%, 85.78% 29.96%, 85.63% 32.43%, 86.06% 34.51%, 86.97% 36.36%, 88.44% 38.07%, 90.77% 39.65%, 93.58% 41.33%, 96.65% 43.24%, 98.72% 45.52%, 99.77% 48.04%, 99.97% 50.65%, 99.35% 53.23%, 97.83% 55.66%, 95.10% 57.75%, 92.13% 59.53%, 89.47% 61.13%, 87.62% 62.77%, 86.46% 64.55%, 85.79% 66.50%, 85.62% 68.74%, 86.15% 71.51%, 86.95% 74.69%, 87.77% 78.20%, 87.62% 81.28%, 86.57% 83.81%, 84.87% 85.80%, 82.61% 87.18%, 79.82% 87.82%, 76.41% 87.37%, 73.05% 86.53%, 70.04% 85.78%, 67.57% 85.63%, 65.49% 86.06%, 63.64% 86.97%, 61.93% 88.44%, 60.35% 90.77%, 58.67% 93.58%, 56.76% 96.65%, 54.48% 98.72%, 51.96% 99.77%, 49.35% 99.97%, 46.77% 99.35%, 44.34% 97.83%, 42.25% 95.10%, 40.47% 92.13%, 38.87% 89.47%, 37.23% 87.62%, 35.45% 86.46%, 33.50% 85.79%, 31.26% 85.62%, 28.49% 86.15%, 25.31% 86.95%, 21.80% 87.77%, 18.72% 87.62%, 16.19% 86.57%, 14.20% 84.87%, 12.82% 82.61%, 12.18% 79.82%, 12.63% 76.41%, 13.47% 73.05%, 14.22% 70.04%, 14.37% 67.57%, 13.94% 65.49%, 13.03% 63.64%, 11.56% 61.93%, 9.23% 60.35%, 6.42% 58.67%, 3.35% 56.76%, 1.28% 54.48%, 0.23% 51.96%, 0.03% 49.35%, 0.65% 46.77%, 2.17% 44.34%, 4.90% 42.25%, 7.87% 40.47%, 10.53% 38.87%, 12.38% 37.23%, 13.54% 35.45%, 14.21% 33.50%, 14.38% 31.26%, 13.85% 28.49%, 13.05% 25.31%, 12.23% 21.80%, 12.38% 18.72%, 13.43% 16.19%, 15.13% 14.20%, 17.39% 12.82%, 20.18% 12.18%, 23.59% 12.63%, 26.95% 13.47%, 29.96% 14.22%, 32.43% 14.37%, 34.51% 13.94%, 36.36% 13.03%, 38.07% 11.56%, 39.65% 9.23%, 41.33% 6.42%, 43.24% 3.35%, 45.52% 1.28%, 48.04% 0.23%);
  --shape-soft-burst: polygon(50.65% 0.05%, 53.20% 1.12%, 55.43% 4.09%, 57.36% 7.18%, 59.07% 9.93%, 60.76% 11.85%, 62.67% 12.68%, 64.89% 12.68%, 67.69% 11.62%, 70.88% 10.31%, 74.49% 8.83%, 77.60% 8.70%, 79.89% 9.97%, 81.33% 12.34%, 81.38% 16.05%, 81.12% 19.68%, 80.89% 22.91%, 81.13% 25.46%, 82.18% 27.25%, 83.98% 28.56%, 86.87% 29.35%, 90.23% 30.16%, 94.01% 31.09%, 96.60% 32.81%, 97.71% 35.19%, 97.48% 37.94%, 95.35% 40.98%, 93.00% 43.77%, 90.91% 46.24%, 89.61% 48.44%, 89.41% 50.52%, 90.09% 52.63%, 91.97% 54.97%, 94.20% 57.60%, 96.72% 60.57%, 97.81% 63.48%, 97.30% 66.06%, 95.50% 68.15%, 91.99% 69.36%, 88.45% 70.23%, 85.31% 71.00%, 82.96% 72.02%, 81.58% 73.58%, 80.89% 75.69%, 81.03% 78.69%, 81.30% 82.13%, 81.58% 86.01%, 80.75% 89.01%, 78.83% 90.79%, 76.14% 91.43%, 72.59% 90.34%, 69.22% 88.97%, 66.22% 87.74%, 63.72% 87.19%, 61.69% 87.64%, 59.89% 88.94%, 58.24% 91.45%, 56.44% 94.39%, 54.38% 97.70%, 51.95% 99.64%, 49.35% 99.95%, 46.80% 98.88%, 44.57% 95.91%, 42.64% 92.82%, 40.93% 90.07%, 39.24% 88.15%, 37.33% 87.32%, 35.11% 87.32%, 32.31% 88.38%, 29.12% 89.69%, 25.51% 91.17%, 22.40% 91.30%, 20.11% 90.03%, 18.67% 87.66%, 18.62% 83.95%, 18.88% 80.32%, 19.11% 77.09%, 18.87% 74.54%, 17.82% 72.75%, 16.02% 71.44%, 13.13% 70.65%, 9.77% 69.84%, 5.99% 68.91%, 3.40% 67.19%, 2.29% 64.81%, 2.52% 62.06%, 4.65% 59.02%, 7.00% 56.23%, 9.09% 53.76%, 10.39% 51.56%, 10.59% 49.48%, 9.91% 47.37%, 8.03% 45.03%, 5.80% 42.40%, 3.28% 39.43%, 2.19% 36.52%, 2.70% 33.94%, 4.50% 31.85%, 8.01% 30.64%, 11.55% 29.77%, 14.69% 29.00%, 17.04% 27.98%, 18.42% 26.42%, 19.11% 24.31%, 18.97% 21.31%, 18.70% 17.87%, 18.42% 13.99%, 19.25% 10.99%, 21.17% 9.21%, 23.86% 8.57%, 27.41% 9.66%, 30.78% 11.03%, 33.78% 12.26%, 36.28% 12.81%, 38.31% 12.36%, 40.11% 11.06%, 41.76% 8.55%, 43.56% 5.61%, 45.62% 2.30%, 48.05% 0.36%);
  --shape-flower: polygon(50.65% 0.01%, 53.22% 0.92%, 55.57% 2.97%, 57.65% 5.47%, 59.40% 8.45%, 60.73% 11.95%, 61.82% 15.19%, 62.76% 18.01%, 64.92% 17.64%, 67.78% 16.21%, 71.08% 14.57%, 74.47% 13.38%, 77.76% 12.82%, 80.94% 12.80%, 83.80% 13.44%, 85.81% 15.12%, 86.98% 17.57%, 87.19% 20.68%, 86.90% 23.92%, 86.03% 27.27%, 84.49% 30.68%, 82.97% 33.74%, 81.65% 36.40%, 83.43% 37.67%, 86.47% 38.68%, 89.95% 39.85%, 93.20% 41.41%, 95.92% 43.34%, 98.18% 45.57%, 99.75% 48.05%, 99.99% 50.65%, 99.08% 53.22%, 97.03% 55.57%, 94.53% 57.65%, 91.55% 59.40%, 88.05% 60.73%, 84.81% 61.82%, 81.99% 62.76%, 82.36% 64.92%, 83.79% 67.78%, 85.43% 71.08%, 86.62% 74.47%, 87.18% 77.76%, 87.20% 80.94%, 86.56% 83.80%, 84.88% 85.81%, 82.43% 86.98%, 79.32% 87.19%, 76.08% 86.90%, 72.73% 86.03%, 69.32% 84.49%, 66.26% 82.97%, 63.60% 81.65%, 62.33% 83.43%, 61.32% 86.47%, 60.15% 89.95%, 58.59% 93.20%, 56.66% 95.92%, 54.43% 98.18%, 51.95% 99.75%, 49.35% 99.99%, 46.78% 99.08%, 44.43% 97.03%, 42.35% 94.53%, 40.60% 91.55%, 39.27% 88.05%, 38.18% 84.81%, 37.24% 81.99%, 35.08% 82.36%, 32.22% 83.79%, 28.92% 85.43%, 25.53% 86.62%, 22.24% 87.18%, 19.06% 87.20%, 16.20% 86.56%, 14.19% 84.88%, 13.02% 82.43%, 12.81% 79.32%, 13.10% 76.08%, 13.97% 72.73%, 15.51% 69.32%, 17.03% 66.26%, 18.35% 63.60%, 16.57% 62.33%, 13.53% 61.32%, 10.05% 60.15%, 6.80% 58.59%, 4.08% 56.66%, 1.82% 54.43%, 0.25% 51.95%, 0.01% 49.35%, 0.92% 46.78%, 2.97% 44.43%, 5.47% 42.35%, 8.45% 40.60%, 11.95% 39.27%, 15.19% 38.18%, 18.01% 37.24%, 17.64% 35.08%, 16.21% 32.22%, 14.57% 28.92%, 13.38% 25.53%, 12.82% 22.24%, 12.80% 19.06%, 13.44% 16.20%, 15.12% 14.19%, 17.57% 13.02%, 20.68% 12.81%, 23.92% 13.10%, 27.27% 13.97%, 30.68% 15.51%, 33.74% 17.03%, 36.40% 18.35%, 37.67% 16.57%, 38.68% 13.53%, 39.85% 10.05%, 41.41% 6.80%, 43.34% 4.08%, 45.57% 1.82%, 48.05% 0.25%);
  --shape-pentagon: polygon(50.62% 2.98%, 53.06% 3.24%, 55.46% 3.85%, 57.76% 4.81%, 59.93% 6.11%, 61.97% 7.55%, 63.94% 8.94%, 65.84% 10.29%, 67.70% 11.60%, 69.53% 12.89%, 71.33% 14.16%, 73.11% 15.41%, 74.89% 16.67%, 76.67% 17.93%, 78.47% 19.20%, 80.30% 20.49%, 82.16% 21.80%, 84.06% 23.15%, 86.03% 24.53%, 88.08% 25.98%, 90.21% 27.48%, 92.45% 29.06%, 94.68% 30.80%, 96.54% 32.83%, 98.02% 35.09%, 99.09% 37.53%, 99.76% 40.10%, 100.00% 42.75%, 99.80% 45.42%, 99.16% 48.07%, 98.31% 50.63%, 97.48% 53.11%, 96.67% 55.52%, 95.88% 57.88%, 95.11% 60.21%, 94.34% 62.51%, 93.58% 64.79%, 92.81% 67.08%, 92.05% 69.38%, 91.27% 71.71%, 90.48% 74.08%, 89.67% 76.51%, 88.83% 79.00%, 87.97% 81.58%, 87.07% 84.27%, 86.07% 87.02%, 84.68% 89.54%, 82.91% 91.75%, 80.82% 93.62%, 78.46% 95.11%, 75.88% 96.21%, 73.11% 96.86%, 70.21% 97.04%, 67.35% 97.04%, 64.61% 97.04%, 61.95% 97.04%, 59.36% 97.04%, 56.82% 97.04%, 54.32% 97.04%, 51.85% 97.04%, 49.38% 97.04%, 46.92% 97.04%, 44.43% 97.04%, 41.92% 97.04%, 39.36% 97.04%, 36.73% 97.04%, 34.03% 97.04%, 31.23% 97.04%, 28.33% 97.01%, 25.49% 96.58%, 22.81% 95.71%, 20.32% 94.41%, 18.09% 92.73%, 16.16% 90.68%, 14.58% 88.32%, 13.39% 85.66%, 12.47% 82.91%, 11.59% 80.28%, 10.75% 77.74%, 9.93% 75.29%, 9.13% 72.89%, 8.34% 70.54%, 7.57% 68.23%, 6.80% 65.94%, 6.04% 63.65%, 5.28% 61.36%, 4.50% 59.05%, 3.72% 56.71%, 2.93% 54.33%, 2.11% 51.88%, 1.27% 49.36%, 0.47% 46.75%, 0.05% 44.09%, 0.07% 41.42%, 0.52% 38.80%, 1.39% 36.29%, 2.67% 33.93%, 4.34% 31.78%, 6.40% 29.90%, 8.68% 28.26%, 10.87% 26.72%, 12.96% 25.25%, 14.96% 23.83%, 16.90% 22.47%, 18.78% 21.14%, 20.62% 19.84%, 22.43% 18.56%, 24.22% 17.30%, 26.00% 16.04%, 27.78% 14.79%, 29.57% 13.52%, 31.38% 12.25%, 33.22% 10.95%, 35.10% 9.62%, 37.04% 8.25%, 39.04% 6.84%, 41.13% 5.43%, 43.37% 4.29%, 45.73% 3.50%, 48.16% 3.06%);
  --shape-gem: polygon(50.65% 0.01%, 53.26% 0.24%, 55.82% 0.80%, 58.31% 1.67%, 60.67% 2.85%, 62.88% 4.31%, 64.99% 5.84%, 67.03% 7.31%, 69.02% 8.75%, 70.96% 10.15%, 72.88% 11.54%, 74.78% 12.91%, 76.68% 14.28%, 78.57% 15.65%, 80.48% 17.03%, 82.41% 18.42%, 84.38% 19.85%, 86.35% 21.35%, 88.15% 23.04%, 89.75% 24.92%, 91.15% 26.96%, 92.31% 29.13%, 93.24% 31.42%, 93.91% 33.80%, 94.33% 36.24%, 94.67% 38.66%, 95.01% 41.05%, 95.35% 43.42%, 95.69% 45.80%, 96.03% 48.19%, 96.37% 50.61%, 96.72% 53.06%, 97.08% 55.57%, 97.44% 58.15%, 97.82% 60.82%, 98.22% 63.60%, 98.47% 66.45%, 98.35% 69.29%, 97.84% 72.05%, 96.97% 74.71%, 95.76% 77.23%, 94.23% 79.55%, 92.39% 81.65%, 90.28% 83.50%, 87.92% 85.05%, 85.37% 86.31%, 82.85% 87.46%, 80.40% 88.57%, 78.02% 89.65%, 75.68% 90.71%, 73.38% 91.75%, 71.10% 92.79%, 68.83% 93.82%, 66.55% 94.85%, 64.25% 95.89%, 61.92% 96.95%, 59.55% 98.02%, 57.09% 98.92%, 54.55% 99.56%, 51.96% 99.92%, 49.35% 99.99%, 46.74% 99.78%, 44.17% 99.29%, 41.66% 98.52%, 39.25% 97.50%, 36.91% 96.42%, 34.60% 95.36%, 32.32% 94.32%, 30.05% 93.28%, 27.78% 92.24%, 25.49% 91.19%, 23.19% 90.13%, 20.84% 89.05%, 18.43% 87.95%, 15.96% 86.82%, 13.41% 85.64%, 10.94% 84.26%, 8.70% 82.56%, 6.71% 80.59%, 5.02% 78.38%, 3.63% 75.97%, 2.58% 73.38%, 1.88% 70.67%, 1.55% 67.87%, 1.60% 65.03%, 1.98% 62.20%, 2.37% 59.47%, 2.76% 56.85%, 3.13% 54.31%, 3.49% 51.83%, 3.85% 49.40%, 4.20% 47.00%, 4.54% 44.62%, 4.89% 42.25%, 5.24% 39.87%, 5.59% 37.47%, 5.95% 35.05%, 6.47% 32.64%, 7.26% 30.30%, 8.29% 28.06%, 9.56% 25.94%, 11.05% 23.97%, 12.74% 22.18%, 14.62% 20.57%, 16.61% 19.13%, 18.57% 17.73%, 20.49% 16.35%, 22.40% 14.99%, 24.29% 13.63%, 26.19% 12.27%, 28.10% 10.90%, 30.03% 9.51%, 32.00% 8.10%, 34.01% 6.66%, 36.08% 5.18%, 38.23% 3.65%, 40.51% 2.30%, 42.93% 1.25%, 45.45% 0.52%, 48.04% 0.10%);
  --shape-puffy-diamond: polygon(50.65% 0.02%, 53.25% 0.37%, 55.78% 1.20%, 58.16% 2.49%, 60.35% 4.28%, 62.24% 6.60%, 63.73% 9.55%, 64.59% 13.42%, 64.69% 18.13%, 66.92% 17.85%, 69.09% 17.91%, 71.18% 18.30%, 73.18% 18.96%, 75.04% 19.89%, 76.74% 21.08%, 78.24% 22.49%, 79.55% 24.09%, 80.61% 25.87%, 81.41% 27.80%, 81.93% 29.85%, 82.16% 31.99%, 82.05% 34.19%, 83.91% 35.43%, 88.67% 35.73%, 92.00% 36.96%, 94.62% 38.67%, 96.67% 40.72%, 98.22% 43.01%, 99.27% 45.47%, 99.86% 48.04%, 99.98% 50.65%, 99.63% 53.25%, 98.80% 55.78%, 97.51% 58.16%, 95.72% 60.35%, 93.40% 62.24%, 90.45% 63.73%, 86.58% 64.59%, 81.87% 64.69%, 82.15% 66.92%, 82.09% 69.09%, 81.70% 71.18%, 81.04% 73.18%, 80.11% 75.04%, 78.92% 76.74%, 77.51% 78.24%, 75.91% 79.55%, 74.13% 80.61%, 72.20% 81.41%, 70.15% 81.93%, 68.01% 82.16%, 65.81% 82.05%, 64.57% 83.91%, 64.27% 88.67%, 63.04% 92.00%, 61.33% 94.62%, 59.28% 96.67%, 56.99% 98.22%, 54.53% 99.27%, 51.96% 99.86%, 49.35% 99.98%, 46.75% 99.63%, 44.22% 98.80%, 41.84% 97.51%, 39.65% 95.72%, 37.76% 93.40%, 36.27% 90.45%, 35.41% 86.58%, 35.31% 81.87%, 33.08% 82.15%, 30.91% 82.09%, 28.82% 81.70%, 26.82% 81.04%, 24.96% 80.11%, 23.26% 78.92%, 21.76% 77.51%, 20.45% 75.91%, 19.39% 74.13%, 18.59% 72.20%, 18.07% 70.15%, 17.84% 68.01%, 17.95% 65.81%, 16.09% 64.57%, 11.33% 64.27%, 8.00% 63.04%, 5.38% 61.33%, 3.33% 59.28%, 1.78% 56.99%, 0.73% 54.53%, 0.14% 51.96%, 0.02% 49.35%, 0.37% 46.75%, 1.20% 44.22%, 2.49% 41.84%, 4.28% 39.65%, 6.60% 37.76%, 9.55% 36.27%, 13.42% 35.41%, 18.13% 35.31%, 17.85% 33.08%, 17.91% 30.91%, 18.30% 28.82%, 18.96% 26.82%, 19.89% 24.96%, 21.08% 23.26%, 22.49% 21.76%, 24.09% 20.45%, 25.87% 19.39%, 27.80% 18.59%, 29.85% 18.07%, 31.99% 17.84%, 34.19% 17.95%, 35.43% 16.09%, 35.73% 11.33%, 36.96% 8.00%, 38.67% 5.38%, 40.72% 3.33%, 43.01% 1.78%, 45.47% 0.73%, 48.04% 0.14%);
}
.shape-circle { clip-path: var(--shape-circle); }
.shape-cookie4 { clip-path: var(--shape-cookie4); }
.shape-cookie6 { clip-path: var(--shape-cookie6); }
.shape-cookie9 { clip-path: var(--shape-cookie9); }
.shape-cookie12 { clip-path: var(--shape-cookie12); }
.shape-clover4 { clip-path: var(--shape-clover4); }
.shape-clover8 { clip-path: var(--shape-clover8); }
.shape-sunny { clip-path: var(--shape-sunny); }
.shape-very-sunny { clip-path: var(--shape-very-sunny); }
.shape-soft-burst { clip-path: var(--shape-soft-burst); }
.shape-flower { clip-path: var(--shape-flower); }
.shape-pentagon { clip-path: var(--shape-pentagon); }
.shape-gem { clip-path: var(--shape-gem); }
.shape-puffy-diamond { clip-path: var(--shape-puffy-diamond); }

/* ===== final ===== */
/* The expressive moments on top of the showcase and the shape library: by shape, weight, colour and motion, never by size.
   Every box keeps its showcase size and type scale; emphasized type is the baseline role one weight step up. */
:root { --title-m-emph: 700 16px/24px var(--sans); }

/* Needs you, the hero: its own corner set (28 outer, 8 inner) against the routine groups, the asker's shape on the tile.
   Emphasized titles; header, rows and tiles stay the showcase size. */
.tgrp.needs > * { border-radius: var(--shape-sm); }
.tgrp.needs > :first-child { border-top-left-radius: var(--shape-xl); border-top-right-radius: var(--shape-xl); }
.tgrp.needs > :last-child { border-bottom-left-radius: var(--shape-xl); border-bottom-right-radius: var(--shape-xl); }
.tgrp.needs .tr .tl { font: var(--title-m-emph); color: var(--on-warn-container); }
.tgrp.needs .tt[style*="--me"] { border-radius: 0; clip-path: var(--me); }

.agroup.ask .agent { border-radius: var(--shape-sm); }
.agroup.ask > h2 + .agent { border-top-left-radius: var(--shape-xl); border-top-right-radius: var(--shape-xl); }
.agroup.ask > .agent:last-child { border-bottom-left-radius: var(--shape-xl); border-bottom-right-radius: var(--shape-xl); }
.agroup.ask .agent .top b { font: var(--title-m-emph); color: var(--on-warn-container); }
.agroup > .agent:active,
.agroup > .agent:last-child:active,
.agroup.ask > .agent:active,
.agroup.ask > .agent:last-child:active { border-radius: var(--shape-lg); }

/* The decision on an approval card: Allow leads with its icon; under the finger it takes 12 corners and widens while Deny gives way.
   The buttons keep the showcase 52. */
.wcard.approval .foot .btn.filled { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.wcard.approval .foot .btn { transition: border-radius var(--spring-fast-ms) var(--spring-fast), scale var(--spring-fast-ms) var(--spring-fast), flex-grow var(--spring-fast-ms) var(--spring-fast), background-color var(--effects-fast-ms) var(--effects-fast); }
.wcard.approval .foot .btn.morph:active { border-radius: var(--shape-md); }
.wcard.approval .foot:has(.filled:active) .btn.filled { flex-grow: 1.9; }
.wcard.approval .foot:has(.filled:active) .btn.tonal { flex-grow: .8; }
.wcard.approval .foot:has(.tonal:active) .btn.tonal { flex-grow: 1.3; }
.wcard.approval .foot:has(.tonal:active) .btn.filled { flex-grow: 1.1; }

/* Shikigami tiles: a library shape is the identity, the tone its state; finished ones stay circles.
   A working one rotates and pulses its shape pseudo-element on the compositor while keeping its centered glyph upright. */
.tile.sh { border-radius: 0; clip-path: var(--me); }
.tile.sh.work { position: relative; background: none; clip-path: none; color: var(--on-primary); }
.tile.sh.work::before {
  content: ""; position: absolute; inset: 0; background: var(--primary); clip-path: var(--me);
  animation: tile-work 9s linear infinite; animation-delay: inherit;
}
.tile.sh.work .loader { display: none; }
.tile.sh.work > svg { position: relative; z-index: 1; animation: none; }
.tile.sh.idle { background: var(--container-highest); color: var(--text-2); }
.tile.sh.ask { background: var(--warn); color: var(--on-warn); }
.tile.sh > svg { animation: none; }
.agent.bad .tile { background: var(--error-container); color: var(--on-error-container); }
.agent.bad .line { color: var(--error); }
.agent .top .nbadge { position: static; flex: none; }
.agent .wtime { margin-left: auto; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-variant-numeric: tabular-nums; }
.agent .wtime time { margin-left: 0; }
.agent .wtime small { font-size: 11px; line-height: 16px; color: var(--text-3); }
.agent .wmeta { display: inline-block; margin-left: 8px; font-size: 12px; line-height: 16px; color: var(--text-2); font-weight: 500; }
.archrow { background: var(--container); border-radius: var(--shape-lg-inc); min-height: 56px; padding: 10px 16px 10px 10px; margin-top: 16px; }
.wcard.asking .badge[style*="--me"] { border-radius: 0; clip-path: var(--me); }
@keyframes tile-work {
  0% { transform: rotate(0deg) scale(1); }
  12.5% { transform: rotate(45deg) scale(.92); }
  25% { transform: rotate(90deg) scale(1); }
  37.5% { transform: rotate(135deg) scale(.92); }
  50% { transform: rotate(180deg) scale(1); }
  62.5% { transform: rotate(225deg) scale(.92); }
  75% { transform: rotate(270deg) scale(1); }
  87.5% { transform: rotate(315deg) scale(.92); }
  100% { transform: rotate(360deg) scale(1); }
}

/* All clear: in Needs you's place, one row at a needs row's height on the done tone (primary is for working).
   A very sunny tile that settles in, an emphasized title and since when. */
.allclear { display: flex; align-items: center; gap: 16px; min-height: 68px; box-sizing: border-box; margin: 16px 0 0; padding: 12px 16px;
  border-radius: var(--shape-xl); background: var(--ok-container); color: var(--on-ok-container); }
.allclear .shape { flex: none; width: 40px; height: 40px; display: grid; place-items: center; background: var(--ok); color: var(--ok-container);
  clip-path: var(--shape-very-sunny); animation: arrive var(--spring-slow-ms) var(--spring) both; }
.allclear .txt { display: flex; flex-direction: column; }
.allclear b { font: var(--title-m-emph); }
.allclear .txt span { font: 400 14px/20px var(--sans); }
@keyframes arrive { from { transform: scale(.4); } }

/* Pause infinite animations while the tab is hidden. */
html.doc-hidden .loader > i,
html.doc-hidden .loader > i::before,
html.doc-hidden .tile.sh.work::before,
html.doc-hidden .tr.k-run .prog i,
html.doc-hidden .tr.k-run .prog i::before,
html.doc-hidden .status[data-s="working"] .dot,
html.doc-hidden .chip .spin,
html.doc-hidden .call.run b,
html.doc-hidden .working::before,
html.doc-hidden .spinner,
html.doc-hidden .tile.work svg,
html.doc-hidden .field .live .wait i,
html.doc-hidden .fab.stopping .square,
html.doc-hidden .field .mic.busy .spin,
html.doc-hidden .btn.busy::before { animation-play-state: paused; }

/* Press: shape first (a corner step down), then a small squish toward the finger, both on the fast spatial spring.
   The nav pill widens inside its item; nothing at rest changes size. */
.fab, .btn, .chip { transition: border-radius var(--spring-fast-ms) var(--spring-fast), scale var(--spring-fast-ms) var(--spring-fast), flex-grow var(--spring-fast-ms) var(--spring-fast), width var(--spring-fast-ms) var(--spring-fast); }
.fab:active, #stop:active, .scomposer .fab.tonal:active { border-radius: var(--shape-md); }
.fab:active { scale: .92; }
.btn:active { scale: .96 1; }
.wcard.asking .foot .btn.morph:active, .signin .btn.morph:active { border-radius: var(--shape-md); }
.report .evline:active, .evline.failed:active { border-radius: var(--shape-lg); }
.chip:active { border-radius: var(--shape-sm); scale: .96; }

@media (prefers-reduced-motion: reduce) {
  .tile.sh.work::before, .tr.k-run .prog.zero i, .tr.k-run .prog.ind i, .allclear .shape,
  .fab.stopping .square, .field .mic.busy .spin, .call.run b, .field .live .wait i { animation: none; }
  .fab:active, .btn:active, .chip:active { scale: none; }
}

/* ===== app ===== */
/* A snackbar sits above the composer (util.js snackPlace); the thread makes room under it */
body.snacked .thread { padding-bottom: 104px; }
body.snacked .tasks { padding-bottom: 96px; }
/* A paired phone's row keeps the sheet's 12 gap; the Tasks project row shares the class name */
.sheet .alist .prow { gap: 12px; }
/* A button that is a link (Download the app) reads as a button */
a.btn { text-decoration: none; }
/* Tasks: a row with a shikigami opens its page, a ticked task of yours is a check on the done tone.
   The paused projects open under their row. */
.tr.go { cursor: pointer; }
.tt.you { padding: 0; border: 0; cursor: pointer; color: var(--ok); }
.tt.you.done::before { display: none; }
.tr.k-done .tl { color: var(--text-3); }
.tgrp.board.held { margin-top: 2px; }
.tall.quiet:has(+ .tgrp.board.held) { border-bottom-left-radius: var(--shape-xs); border-bottom-right-radius: var(--shape-xs); }
.tgrp.board.held > :first-child { border-top-left-radius: var(--shape-xs); border-top-right-radius: var(--shape-xs); }
/* The top bar on scroll (app.js lift): it fills with surface-container once its screen has moved off its rest */
.bar, .ltabs { transition: background-color var(--effects-ms, 200ms) var(--effects, ease), box-shadow var(--effects-ms, 200ms) var(--effects, ease); }
.log, .page { transition: border-radius var(--effects-ms, 200ms) var(--effects, ease); }
body.lifted .bar, body.lifted[data-tab="chat"] .ltabs { background: var(--container); }
body.lifted:not([data-tab="chat"]) .bar, body.lifted[data-tab="chat"] .ltabs { box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--outline) 28%, transparent); }
body.lifted .log, body.lifted .page { border-radius: 0; clip-path: none; }
/* Jump to latest (chat.js) lives on the chat lanes only; its bottom is set above the composer */
body:not([data-tab="chat"]) .jump, body[data-lane="k"] .jump, body.spage-open .jump { display: none; }
/* The one live region: read, not seen */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* The M3 dialog (util.js ask): what can't be undone */
.dlg { width: min(312px, calc(100vw - 48px)); padding: 24px; border: 0; border-radius: var(--shape-xl); background: var(--container-high); color: var(--text); }
.dlg::backdrop { background: rgb(0 0 0 / .5); }
.dlg h2 { margin: 0 0 16px; font: 400 24px/32px var(--sans); }
.dlg p { margin: 0 0 24px; font: 400 14px/20px var(--sans); color: var(--text-2); }
.dlg .acts { display: flex; justify-content: flex-end; gap: 8px; }
.dlg .btn.text { min-height: 48px; padding: 0 12px; border: 0; border-radius: 24px; background: none; color: var(--primary); font: 500 14px/20px var(--sans); }
@media (prefers-reduced-motion: reduce) { .thread > * { animation: fadeIn .2s; } }
/* Focus moved by the app (a page title, a settled card's outcome) shows no ring; the keyboard's own focus does */
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
h1[tabindex="-1"]:focus { outline: none; }

/* ---------- Empty chat state ---------- */
.hello { gap: 10px; }
.hello-mark {
  width: 72px; height: 72px; display: grid; place-items: center;
  background: var(--primary-container); color: var(--on-primary-container);
  clip-path: var(--shape-soft-burst);
}
.hello b { font: 600 22px/28px var(--sans); color: var(--text); }
.hello p { margin: 0; font: 400 14px/20px var(--sans); color: var(--text-3); }

/* ---------- Navigation drawer (M3 modal on compact, permanent rail at >=1080px) ---------- */
.dwrap { position: fixed; inset: 0; z-index: 9; }
.dwrap .scrim { animation: fadeIn .3s; }
.drawer { position: absolute; top: 0; bottom: 0; left: 0; width: min(340px, calc(100vw - 56px)); display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); background: var(--container); border-radius: 0 16px 16px 0;
  box-shadow: 0 6px 24px rgb(0 0 0 / .35); animation: drawerIn .45s var(--ease); touch-action: pan-y; }
@keyframes drawerIn { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes drawerOut { from { transform: none; } to { transform: translateX(-100%); } }
.dwrap.closing { pointer-events: none; }
.dwrap.closing .scrim { animation: fadeOut var(--effects-fast-ms) var(--effects-fast) forwards; }
.dwrap.closing .drawer { animation: drawerOut var(--effects-fast-ms) var(--effects-fast) forwards; }
@media (prefers-reduced-motion: reduce) {
  .drawer, .dwrap .scrim, .sheet, .sheet-wrap .scrim,
  .dwrap.closing .scrim, .dwrap.closing .drawer,
  .sheet-wrap.closing .scrim, .sheet-wrap.closing .sheet { animation: none; }
}
.dscroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 12px 4px; }
.dfoot { padding: 4px 12px 12px; border-top: 1px solid var(--container-high); }
.drawer hr { border: 0; border-top: 1px solid var(--container-high); margin: 6px 16px; }
.ditem { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 16px; border: 0; border-radius: 26px;
  background: none; color: var(--text-2); font: 500 14px/20px var(--sans); text-align: left; }
.ditem > svg, .ditem > .glyph { flex: none; color: var(--text-3); }
.ditem > .glyph { background: var(--text-2); width: 22px; height: 22px; }
.ditem.on { background: var(--primary-container); color: var(--on-primary-container); }
.ditem.on > svg, .ditem.on > .glyph { color: inherit; background-color: currentColor; }
.ditem.on > svg { background: none; }
.ditem .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ditem time { flex: none; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ditem .nbadge { position: static; flex: none; }
.ditem.darch .lbl { color: var(--text-3); }
.ditem.warn time { color: var(--warn); }
.ditem.bad time { color: var(--error); }
.dhd { display: flex; align-items: center; gap: 4px; width: 100%; min-height: 48px; padding: 0 16px; border: 0; border-radius: 24px; background: none;
  color: var(--text-3); font: 500 12px/16px var(--sans); text-align: left; }
.dhd svg { opacity: .7; }
.tile.mini { flex: none; width: 28px; height: 28px; display: grid; place-items: center; }
.tile.mini svg { width: 16px; height: 16px; }
.tile.mini .loader { transform: scale(.6); }
.ditem.ag .lbl { display: flex; align-items: baseline; gap: 6px; }
.ditem.ag .lbl b { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.ditem.ag .lbl small { flex: 1 1 0; min-width: 40px; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.ditem.ag.ask .lbl b { color: var(--warn); }

@media (min-width: 1080px) {
  body:not(.login) { grid-template-columns: 280px minmax(0, 1fr); }
  body:not(.login) > .bar,
  body:not(.login) > .ltabs,
  body:not(.login) > main,
  body:not(.login) > .bottom { grid-column: 2; }
  body:not(.login) #drawer-btn { display: none; }
  body:not(.login) .dwrap {
    display: block !important; position: static; grid-column: 1; grid-row: 1 / 5; z-index: auto;
    height: 100dvh; overflow: hidden;
  }
  body:not(.login) .dwrap .scrim { display: none; }
  body:not(.login) .dwrap.closing { pointer-events: auto; }
  body:not(.login) .drawer,
  body:not(.login) .dwrap.closing .drawer {
    position: static; width: 100%; height: 100%; border-radius: 0; box-shadow: none; animation: none;
    background: var(--surface); border-right: 1px solid var(--container-high);
  }
  body:not(.login) .spage { left: 280px; }
  body:not(.login) .jump { left: calc(50% + 140px); }
}

/* Files: day headers aligned on the 16px grid, segmented file lists matching the rest of the app */
#files, #watches, #threads { padding-top: 4px; }
.fday { margin: 20px 0 8px; padding: 0 16px; font-size: 14px; line-height: 20px; font-weight: var(--w-emph); color: var(--text-2); }
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.fgrid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; cursor: pointer; background: var(--container); }
.flist { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.flist .fchip { max-width: none; min-height: 56px; padding: 10px 16px 10px 12px; border-radius: var(--shape-xs); background: var(--container); }
.flist .fchip:first-child { border-top-left-radius: var(--shape-lg-inc); border-top-right-radius: var(--shape-lg-inc); }
.flist .fchip:last-child { border-bottom-left-radius: var(--shape-lg-inc); border-bottom-right-radius: var(--shape-lg-inc); }
#watches .agroup:first-child { margin-top: 8px; }

/* Side threads: a thread's tile is the agents' idle tile with the thread icon; Send is the agent page's Take over pill */
.offerbtn { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; }
/* Sheet rows keep their height when a long sheet scrolls (overflow hidden would let a flex column squeeze them) */
.seg, .sfield { flex: none; }
.sfield { width: 100%; box-sizing: border-box; padding: 10px 14px; border: 1.5px solid var(--outline); border-radius: 12px; background: none;
  color: var(--text); font: 14px/20px var(--sans); resize: none; outline: none; }
.sfield:focus { border-color: var(--primary); }
.sfield.mono { font: 14px/20px var(--mono); }
textarea.sfield { min-height: 120px; max-height: 40dvh; overflow-y: auto; }
.squote { display: flex; align-items: center; gap: 8px; margin: 0 4px 8px; padding: 8px 12px; border-radius: var(--shape-md); background: var(--container); color: var(--text-3); font-size: 12px; line-height: 16px; }
.squote span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.squote svg { flex: none; }
.sbar .back { position: relative; overflow: visible; }
.sbar .back .nbadge { left: 28px; top: 6px; }

/* Settings: M3E segmented lists with trailing chevrons and a separate destructive logout row */
#settings { padding-top: 12px; gap: 16px; }
#settings .sgrp-h { margin: 8px 0 6px; padding: 0 16px; font-size: 14px; line-height: 20px; font-weight: var(--w-emph); color: var(--text-2); }
#settings .mopt { align-items: center; min-height: 56px; padding: 12px 16px; gap: 14px; font-size: 16px; line-height: 24px; }
#settings .mopt > span { flex: 1; min-width: 0; }
#settings .mopt .chev { flex: none; color: var(--text-3); }
#settings .mopt.danger { color: var(--error); }
#settings .mopt.danger > svg { color: var(--error); }
.trig.sender { align-self: flex-end; margin-bottom: -6px; }
