/* Tally — the app accent (mirrors style.css; keep the two in step) and the "try it right here" model of the ledger. */
[data-app="tally"] { --a1: #2e5e91; --a2: #1d2633; --b1: #2e5e91; --b2: #1d2633; --ink-l: #23466e; --ink-d: #9cc0ea; }

/* ───────── Page bits ───────── */
.ty-perms { display: grid; gap: 8px; }
.ty-perms > div { display: grid; grid-template-columns: 128px 1fr auto; gap: 4px 14px; align-items: start; padding: 13px 16px; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: 14.5px; }
.ty-perms b { font-weight: 650; }
.ty-perms span { color: var(--muted); }
.ty-perms i { font-style: normal; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; padding: 3px 8px; border-radius: 999px; color: var(--accent-ink); background: color-mix(in srgb, var(--accent-ink) 11%, transparent); }
.ty-perms i.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.ty-perms i.warn { color: var(--thread-ink); background: color-mix(in srgb, var(--thread) 14%, transparent); }
@media (max-width: 600px) { .ty-perms > div { grid-template-columns: 1fr auto; } .ty-perms span { grid-column: 1 / -1; grid-row: 2; } }
.ty-mcp { display: grid; gap: 12px; }
.ty-mcp p { margin: 0; padding: 16px 18px; border-radius: 18px; font-size: 15.5px; line-height: 1.5; max-width: 470px; }
.ty-mcp .ty-ask { justify-self: end; background: var(--accent-ink); color: var(--bg); border-bottom-right-radius: 6px; }
.ty-mcp .ty-a { background: var(--card); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm); border-bottom-left-radius: 6px; }
.ty-mcp .ty-via { display: block; margin-bottom: 6px; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.ty-small { font-size: 14.5px; margin-top: 12px; }
#mcp .code { font-size: 13px; }
#mcp .split > *, #how .split > * { min-width: 0; }

/* ───────── The model ───────── */
.ty {
  --ty-desk: #eee7d7; --ty-paper: #fbf7ec; --ty-well: #f1eada; --ty-ink: #1d2633; --ty-ink2: rgba(29,38,51,.66); --ty-ink3: rgba(29,38,51,.46);
  --ty-rule: rgba(29,38,51,.10); --ty-rule2: rgba(29,38,51,.20); --ty-wash: rgba(29,38,51,.05); --ty-ruling: rgba(58,110,165,.16);
  --ty-margin: rgba(196,71,58,.55); --ty-red: #b43c30; --ty-acc: #23466e; --ty-on: #fbf7ec; --ty-ghost: rgba(29,38,51,.22);
  --ty-work: #2e5e91; --ty-social: #a3456f; --ty-fun: #a9771f; --ty-other: #6b7078;
  position: relative; height: 680px; display: grid; grid-template-columns: 184px minmax(0, 1fr); background: var(--ty-desk); color: var(--ty-ink);
  font-family: var(--font); font-size: 13px; user-select: none; -webkit-user-select: none; overflow: hidden;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ty {
  --ty-desk: #111317; --ty-paper: #1a1d23; --ty-well: #22262d; --ty-ink: #ece6d8; --ty-ink2: rgba(236,230,216,.68); --ty-ink3: rgba(236,230,216,.46);
  --ty-rule: rgba(236,230,216,.10); --ty-rule2: rgba(236,230,216,.22); --ty-wash: rgba(236,230,216,.06); --ty-ruling: rgba(127,166,214,.11);
  --ty-margin: rgba(224,112,95,.5); --ty-red: #ec7b6b; --ty-acc: #9cc0ea; --ty-on: #111317; --ty-ghost: rgba(236,230,216,.22);
  --ty-work: #8db6e6; --ty-social: #e38db3; --ty-fun: #e6b866; --ty-other: #a2a7af; } }
:root[data-theme="dark"] .ty {
  --ty-desk: #111317; --ty-paper: #1a1d23; --ty-well: #22262d; --ty-ink: #ece6d8; --ty-ink2: rgba(236,230,216,.68); --ty-ink3: rgba(236,230,216,.46);
  --ty-rule: rgba(236,230,216,.10); --ty-rule2: rgba(236,230,216,.22); --ty-wash: rgba(236,230,216,.06); --ty-ruling: rgba(127,166,214,.11);
  --ty-margin: rgba(224,112,95,.5); --ty-red: #ec7b6b; --ty-acc: #9cc0ea; --ty-on: #111317; --ty-ghost: rgba(236,230,216,.22);
  --ty-work: #8db6e6; --ty-social: #e38db3; --ty-fun: #e6b866; --ty-other: #a2a7af; }
.ty button { font: inherit; color: inherit; }
.ty :focus-visible { outline: 2px solid var(--ty-acc); outline-offset: 2px; border-radius: 6px; }
.ty .ty-main:focus-visible { outline: none; }
.ty-serif, .ty-title, .ty-total b, .ty-stats dd, .ty-t, .ty-agstats b, .ty-dh, .ty-up h4, .ty-lnum b, .ty-step b, .ty-agbig b { font-family: var(--font-serif); font-weight: 400; }

/* Sidebar */
.ty-side { display: flex; flex-direction: column; padding: 14px 10px 12px; border-right: 1px solid var(--ty-rule); }
.ty-side .lights { padding: 0 6px 18px; }
.ty-brand { display: flex; align-items: center; gap: 8px; padding: 0 8px 18px; font-family: var(--font-serif); font-size: 19px; }
.ty-nav { display: flex; flex-direction: column; gap: 2px; }
.ty-nav hr { width: 100%; border: 0; border-top: 1px solid var(--ty-rule); margin: 8px 0; }
.ty-nav button { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 0; border-radius: 7px; background: none; cursor: pointer; text-align: left; color: var(--ty-ink2); }
.ty-nav button svg { flex: none; opacity: .8; }
.ty-nav button:hover { background: var(--ty-wash); color: var(--ty-ink); }
.ty-nav button[aria-current="true"] { background: var(--ty-paper); color: var(--ty-ink); font-weight: 600; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.ty-nav button[aria-current="true"]::before { content: ""; position: absolute; left: -6px; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--ty-red); }
.ty-samp { margin: auto 0 0; padding: 8px; font-size: 11px; line-height: 1.4; color: var(--ty-ink3); }
.ty-samp b { display: block; color: var(--ty-ink2); font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; }

/* Main */
.ty-main { overflow-y: auto; padding: 20px 24px 24px; min-height: 0; scrollbar-width: thin; outline: none; }
.ty-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.ty-head > div:first-child { min-width: 0; }
.ty-kick { margin: 0 0 3px; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ty-ink3); }
.ty-title { margin: 0; font-size: 22px; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ty-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ty-ib { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; cursor: pointer; font-size: 17px; line-height: 1; color: var(--ty-ink2); }
.ty-ib:hover:not(:disabled) { background: var(--ty-wash); color: var(--ty-ink); }
.ty-ib:disabled { opacity: .3; cursor: default; }
.ty .ty-q { padding: 3px 10px; border: 1px solid var(--ty-rule2); border-radius: 6px; background: var(--ty-paper); cursor: pointer; font-size: 12px; font-weight: 500; }
.ty .ty-q:hover { background: var(--ty-well); }
.ty-pri { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 0; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; background: var(--ty-acc); color: var(--ty-on) !important; }
.ty-pri:hover:not(:disabled) { filter: brightness(1.12); }
.ty-pri:disabled { opacity: .4; cursor: default; }
.ty-live { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; color: var(--ty-ink2); background: var(--ty-wash); }
.ty-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ty-red); animation: tyPulse 1.2s infinite; }
.ty-live b { color: var(--ty-ink); }
@keyframes tyPulse { 50% { opacity: .3; } }
.ty-link { border: 0; background: none; padding: 0; cursor: pointer; color: var(--ty-acc) !important; font-size: 12px; }
.ty-link:hover { text-decoration: underline; }

.ty-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; align-items: start; }
.ty-col { display: grid; gap: 14px; }
.ty-card { position: relative; background: var(--ty-paper); border: 1px solid var(--ty-rule); border-radius: 10px; padding: 14px 16px; }
.ty-card + .ty-card { margin-top: 0; }
.ty-main > .ty-card { margin-bottom: 14px; }
.ty-cardh { display: flex; align-items: baseline; justify-content: space-between; }
.ty-foot { margin: 12px 0 0; font-family: var(--font-serif); font-style: italic; font-size: 11px; color: var(--ty-ink3); }
.ty-empty { color: var(--ty-ink3); font-family: var(--font-serif); font-style: italic; padding: 18px 0; margin: 0; }

/* The ledger card: a red margin line, ruled rows */
.ty-ledger { padding-left: 26px; }
.ty-ledger::before { content: ""; position: absolute; left: 12px; top: 0; bottom: 0; width: 4px; border-left: 1px solid var(--ty-margin); border-right: 1px solid var(--ty-margin); pointer-events: none; }
.ty-total { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ty-total b { font-size: 34px; line-height: 1.05; letter-spacing: -.01em; }
.ty-total i { font-family: var(--font-serif); font-size: 13px; color: var(--ty-ink3); }
.ty-cmp { margin-left: auto; font-size: 11.5px; color: var(--ty-ink2); }
.ty-bar { display: flex; gap: 3px; height: 7px; margin-bottom: 8px; }
.ty-bar i { min-width: 4px; border-radius: 4px; background: var(--ty-wash); flex-grow: 1; transition: flex-grow .4s var(--ease); }
.ty-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--ty-ink2); padding-bottom: 8px; border-bottom: 3px double var(--ty-ink); }
.ty-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ty-legend i { width: 7px; height: 7px; border-radius: 50%; }
.ty-legend b { color: var(--ty-ink); font-weight: 600; }
.ty-rule { border-bottom: 1px solid var(--ty-ink); margin-top: 4px; }
.ty-rows { display: flex; flex-direction: column; }
.ty-row, .ty-wrow { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) 22px 62px; align-items: center; gap: 8px; min-height: 34px; width: 100%; padding: 0 2px; border: 0; border-bottom: 1px solid var(--ty-ruling); background: none; cursor: pointer; text-align: left; }
.ty-row:hover, .ty-wrow:hover:not(.future) { background: var(--ty-wash); }
.ty-row { grid-template-columns: 8px minmax(100px, 170px) minmax(0, 1fr) 22px 62px; }
.ty-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.ty-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ty-name b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ty-globe { flex: none; color: var(--ty-ink3); }
.ty-mk { position: relative; display: flex; align-items: center; min-width: 0; overflow: hidden; }
.ty-more { visibility: hidden; color: var(--ty-ink2); text-align: center; font-weight: 700; letter-spacing: -1px; }
.ty-row:hover .ty-more, .ty-row:focus-visible .ty-more { visibility: visible; }
.ty-t { text-align: right; font-size: 14px; white-space: nowrap; }
.ty-row.over .ty-name b, .ty-row.over .ty-t { color: var(--ty-red); }
.ty-hint { margin-left: 10px; white-space: nowrap; font-family: var(--font-serif); font-size: 12px; color: var(--ty-red); animation: tyNudge 1.6s var(--ease) infinite; }
@keyframes tyNudge { 50% { transform: translateX(-4px); } }
.ty-wrow { grid-template-columns: 64px minmax(0, 1fr) 62px; min-height: 38px; }
.ty-wrow > span:first-child { font-weight: 500; }
.ty-wrow.today > span:first-child { color: var(--ty-acc); font-weight: 600; }
.ty-wrow.future { cursor: default; color: var(--ty-ink2); }

/* Marks */
.ty-marks { flex: none; display: block; overflow: visible; }
.ty-marks .ghost { stroke: var(--ty-ghost); stroke-dasharray: .18 .12; }
.ty-marks line.in { stroke-dasharray: 1; stroke-dashoffset: 1; animation: tyInk .26s ease-out forwards; animation-delay: calc(var(--i) * 24ms + var(--d, 0ms)); }
@keyframes tyInk { to { stroke-dashoffset: 0; } }

/* At a glance, limits, agents */
.ty-hours { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; }
.ty-hours i { height: 15px; border-radius: 2px; background: var(--ty-wash); }
.ty-hlab { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 3px; font-family: var(--font-mono); font-size: 9px; color: var(--ty-ink3); }
.ty-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 12px 0 0; }
.ty-stats dt { font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ty-ink3); }
.ty-stats dd { margin: 1px 0 0; font-size: 17px; }
.ty-lm { padding: 7px 0 2px; }
.ty-lm > div { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.ty-lm b { font-weight: 600; }
.ty-lm span { font-family: var(--font-serif); color: var(--ty-ink2); }
.ty-lm.over b, .ty-lm.over span { color: var(--ty-red); }
.ty-agbig { margin: 6px 0 2px; color: var(--ty-ink2); }
.ty-agbig b { font-size: 22px; color: var(--ty-ink); margin-right: 4px; }
.ty-agaway { margin: 0; font-size: 12px; color: var(--ty-ink2); }

/* Week & month side lists */
.ty-tr { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; column-gap: 6px; padding: 4px 0; }
.ty-tr b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ty-tr .ty-t { font-size: 13px; }
.ty-tr .ty-marks { grid-column: 2 / -1; margin-top: 1px; }

/* Month calendar */
.ty-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.ty-dow { text-align: center; font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ty-ink3); padding-bottom: 2px; }
.ty-cell { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 58px; padding: 5px 6px; border: 0; border-radius: 6px; background: var(--ty-well); cursor: pointer; text-align: left; overflow: hidden; }
.ty-cell b { font-family: var(--font-serif); font-weight: 400; font-size: 14px; }
.ty-cell small { position: absolute; right: 6px; top: 7px; font-family: var(--font-serif); font-size: 10px; color: var(--ty-ink2); }
.ty-cell .ty-mk { margin-top: auto; }
.ty-hh { display: none; }
.ty-cell:hover { background: var(--ty-wash); box-shadow: inset 0 0 0 1px var(--ty-rule2); }
.ty-cell.today { box-shadow: inset 0 0 0 1.5px var(--ty-acc); }
.ty-cell.today b { color: var(--ty-acc); font-weight: 600; }
.ty-cell.blank { background: none; cursor: default; }
.ty-cell.future { background: color-mix(in srgb, var(--ty-well) 45%, transparent); color: var(--ty-ink3); cursor: default; }

/* Agents */
.ty-agstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.ty-agstats .ty-card { padding: 12px 14px; }
.ty-agstats b { display: block; font-size: 24px; line-height: 1.15; }
.ty-agstats span { font-size: 11px; color: var(--ty-ink2); }
.ty-agstats .ty-away { box-shadow: inset 0 0 0 1.5px var(--ty-acc); }
.ty-yarow { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 6px; font-size: 11.5px; color: var(--ty-ink2); }
.ty-yarow .ty-hours i { height: 19px; }
.ty-hours i.away { box-shadow: inset 0 0 0 1.5px var(--ty-acc); }
.ty-awaykey { display: inline-block; width: 11px; height: 11px; border-radius: 2px; vertical-align: -1px; box-shadow: inset 0 0 0 1.5px var(--ty-acc); }
.ty-sess { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto 80px 52px; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--ty-rule); }
.ty-sess:last-child { border-bottom: 0; }
.ty-tool { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--ty-well); font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--ty-acc); }
.ty-tool.cc { font-size: 16px; font-weight: 400; }
.ty-sess b { font-weight: 600; }
.ty-sess small { display: block; color: var(--ty-ink3); font-size: 11px; }
.ty-when { font-family: var(--font-serif); white-space: nowrap; }
.ty-rep { text-align: right; color: var(--ty-ink3); font-size: 11.5px; }
.ty-tok { text-align: right; font-family: var(--font-mono) !important; }
.ty-bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); align-items: end; gap: 5px; height: 76px; }
.ty-bars i { border-radius: 2px 2px 0 0; background: var(--ty-ink3); }
.ty-bars i.now { background: var(--ty-acc); }

/* Limits page */
.ty-lrow { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 38px 26px; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ty-rule); }
.ty-lrow:last-child { border-bottom: 0; }
.ty-lrow.off { opacity: .55; }
.ty-lk { color: var(--ty-ink3); }
.ty-lname b { display: block; font-weight: 600; margin-bottom: 3px; }
.ty-lnum { text-align: right; }
.ty-lnum b { display: block; font-size: 14px; }
.ty-lnum small { color: var(--ty-ink3); font-size: 11px; }
.ty-lrow.over .ty-lname b, .ty-lrow.over .ty-lnum b, .ty-lrow.over .ty-lnum small { color: var(--ty-red); }
.ty-switch { position: relative; width: 36px; height: 20px; padding: 0; border: 0; border-radius: 999px; background: var(--ty-rule2); cursor: pointer; flex: none; transition: background .2s; }
.ty-switch i { position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.ty-switch[aria-checked="true"] { background: var(--ty-acc); }
.ty-switch[aria-checked="true"] i { transform: translateX(16px); }
.ty-when-out { max-width: 620px; }
.ty-when-out label { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 6px 0; }

/* Layer: menu, dialogs, the "Time's up" card, the notification */
.ty-layer { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.ty-layer:empty { display: none; }
.ty-layer.modal { pointer-events: auto; display: grid; place-items: center; padding: 18px; background: color-mix(in srgb, var(--ty-desk) 55%, transparent); animation: tyFade .18s ease-out; }
.ty-layer.menu { pointer-events: none; }
.ty-layer.card { pointer-events: none; }
@keyframes tyFade { from { opacity: 0; } }
.ty-menu { position: absolute; pointer-events: auto; min-width: 210px; padding: 5px; border-radius: 9px; background: var(--ty-paper); box-shadow: 0 0 0 1px var(--ty-rule2), 0 12px 32px rgba(0,0,0,.18); animation: tyFade .12s ease-out; }
.ty-menu p { margin: 2px 8px 4px; font-size: 11px; font-weight: 600; color: var(--ty-ink3); }
.ty-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 9px; border: 0; border-radius: 5px; background: none; text-align: left; cursor: pointer; }
.ty-menu button[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: var(--ty-acc); }
.ty-menu button:hover, .ty-menu button:focus-visible { background: var(--ty-acc); color: var(--ty-on); outline: none; }
.ty-menu hr { border: 0; border-top: 1px solid var(--ty-rule); margin: 4px 6px; }
.ty-menu small { display: block; padding: 2px 9px 4px; color: var(--ty-ink3); font-size: 11px; }
.ty-dlg { width: min(520px, 100%); max-height: 100%; overflow-y: auto; padding: 20px 22px; border-radius: 12px; background: var(--ty-paper); box-shadow: 0 0 0 1px var(--ty-rule2), 0 24px 60px rgba(0,0,0,.25); animation: tyRise .22s var(--ease); }
@keyframes tyRise { from { transform: translateY(10px); opacity: 0; } }
.ty-dh { margin: 0 0 12px; font-size: 18px; }
.ty-dlg .ty-kick { margin-top: 12px; }
.ty-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ty-chip { padding: 3px 9px; border: 1px solid var(--ty-rule2); border-radius: 6px; background: var(--ty-paper); cursor: pointer; font-size: 12px; font-weight: 500; }
.ty-chip:hover { background: var(--ty-well); }
.ty-chip[aria-pressed="true"] { background: var(--ty-acc); border-color: var(--ty-acc); color: var(--ty-on); }
.ty-step { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.ty-step b { min-width: 56px; text-align: center; font-size: 16px; }
.ty-pick { margin-top: 8px; max-height: 150px; overflow-y: auto; border-radius: 7px; background: var(--ty-well); padding: 3px; }
.ty-pick button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border: 0; border-radius: 5px; background: none; cursor: pointer; text-align: left; }
.ty-pick button small { margin-left: auto; color: var(--ty-ink3); font-size: 11px; }
.ty-pick button:hover { background: var(--ty-wash); }
.ty-pick button[aria-selected="true"] { background: var(--ty-acc); color: var(--ty-on); }
.ty-pick button[aria-selected="true"] small, .ty-pick button[aria-selected="true"] .ty-globe { color: inherit; opacity: .8; }
.ty-appi { width: 12px; height: 12px; border-radius: 3px; border: 1.2px solid var(--ty-ink3); flex: none; }
.ty-dact { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.ty-dact .ty-q, .ty-dact .ty-pri { padding: 6px 14px; font-size: 13px; }
.ty-sheetdlg { width: min(470px, 100%); padding: 16px; background: var(--ty-well); display: flex; flex-direction: column; overflow: hidden; }
.ty-sheetwrap { flex: 1; min-height: 0; display: grid; place-items: center; }
.ty-sheetwrap canvas { display: block; max-width: 100%; max-height: 520px; width: auto; height: auto; aspect-ratio: 1080 / 1350; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 30px rgba(0,0,0,.14); }
.ty-sheetdlg .ty-dact { margin-top: 12px; }
.ty-seg { display: inline-flex; border-radius: 6px; box-shadow: 0 0 0 1px var(--ty-rule2); overflow: hidden; }
.ty-seg button { border: 0; background: var(--ty-paper); padding: 4px 9px; font-size: 11.5px; cursor: pointer; }
.ty-seg button + button { border-left: 1px solid var(--ty-rule2); }
.ty-seg button[aria-pressed="true"] { background: var(--ty-ink); color: var(--ty-paper); }
.ty-up { position: absolute; left: 50%; top: 70px; width: min(390px, calc(100% - 28px)); transform: translateX(-50%); pointer-events: auto; padding: 18px 20px 16px 30px; border-radius: 12px; background: var(--ty-paper); box-shadow: 0 0 0 1px var(--ty-rule2), 0 22px 60px rgba(0,0,0,.28); animation: tyDrop .32s var(--ease); }
.ty-up::before { content: ""; position: absolute; left: 12px; top: 0; bottom: 0; width: 4px; border-left: 1px solid var(--ty-margin); border-right: 1px solid var(--ty-margin); }
@keyframes tyDrop { from { transform: translate(-50%, -14px); opacity: 0; } }
.ty-upk { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ty-red); }
.ty-up h4 { margin: 0 0 6px; font-size: 20px; line-height: 1.25; }
.ty-up p:not(.ty-upk) { margin: 0; color: var(--ty-ink2); font-size: 12.5px; }
.ty-up .ty-dact { margin-top: 14px; }
.ty-banner { position: absolute; right: 12px; top: 70px; z-index: 25; display: flex; gap: 10px; width: min(330px, calc(100% - 24px)); padding: 10px 12px; border-radius: 13px; background: color-mix(in srgb, var(--ty-paper) 88%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 0 0 1px var(--ty-rule2), 0 10px 30px rgba(0,0,0,.18); transform: translateX(calc(100% + 24px)); transition: transform .35s var(--ease); pointer-events: none; }
.ty-banner.show { transform: none; }
.ty-bi { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 7px; background: linear-gradient(140deg, #2e5e91, #1d2633); color: #fbf7ec; }
.ty-banner b { font-size: 11.5px; }
.ty-banner p { margin: 1px 0 0; font-size: 12px; color: var(--ty-ink2); line-height: 1.35; }
.ty-banner strong { color: var(--ty-ink); font-weight: 600; display: block; }

/* Narrow windows and phones: sections become tabs across the top, side cards drop below */
@media (max-width: 900px) {
  .ty-grid { grid-template-columns: minmax(0, 1fr); }
  .ty-col { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .ty-agstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .ty { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 640px; font-size: 12.5px; }
  .ty-side { flex-direction: row; align-items: center; gap: 4px; padding: 8px 8px; border-right: 0; border-bottom: 1px solid var(--ty-rule); overflow-x: auto; scrollbar-width: none; }
  .ty-side::-webkit-scrollbar { display: none; }
  .ty-side .lights, .ty-samp, .ty-nav hr { display: none; }
  .ty-brand { padding: 0 6px 0 2px; font-size: 16px; }
  .ty-brand span { display: none; }
  .ty-nav { flex-direction: row; gap: 2px; }
  .ty-nav button { padding: 6px 9px; white-space: nowrap; }
  .ty-nav button svg { display: none; }
  .ty-nav button[aria-current="true"]::before { left: 9px; right: 9px; top: auto; bottom: 1px; width: auto; height: 2px; }
  .ty-main { padding: 14px 12px 18px; }
  .ty-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .ty-tools { justify-content: flex-start; }
  .ty-title { font-size: 19px; white-space: normal; }
  .ty-ledger { padding-left: 22px; padding-right: 10px; }
  .ty-ledger::before { left: 9px; }
  .ty-row { grid-template-columns: 8px minmax(78px, 112px) minmax(0, 1fr) 50px; gap: 6px; }
  .ty-more { display: none; }
  .ty-hint { display: none; }
  .ty-wrow { grid-template-columns: 48px minmax(0, 1fr) 52px; }
  .ty-total b { font-size: 28px; }
  .ty-cmp { margin-left: 0; width: 100%; }
  .ty-cal { gap: 3px; }
  .ty-cell { min-height: 42px; padding: 3px 4px; }
  .ty-cell small, .ty-cell .ty-mk { display: none; }
  .ty-cell b { font-size: 12px; }
  .ty-hh { display: block !important; margin-top: auto; font-style: normal; font-family: var(--font-serif); font-size: 10.5px; color: var(--ty-ink2); }
  .ty-sess { grid-template-columns: 24px minmax(0, 1fr) 48px; }
  .ty-when, .ty-rep { display: none; }
  .ty-lrow { grid-template-columns: minmax(0, 1fr) auto 38px 26px; }
  .ty-lk { display: none; }
  .ty-when-out label { align-items: flex-start; }
  .ty-dlg { padding: 16px; }
  .ty-step { margin-left: 0; }
  .ty-sheetwrap canvas { max-height: 420px; }
  .ty-up { top: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .ty-marks line.in { animation: none; stroke-dashoffset: 0; }
  .ty-hint, .ty-live i { animation: none; }
}
