/* widget.css: see docs/design/css-notes.md */

.top { margin: var(--space-2) 0 var(--space-5); }
.brand { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.brand h1 { margin: 0; }
.app-mark { width: var(--icon-mark); height: var(--icon-mark); color: var(--accent); }
.lead { color: var(--muted); max-width: 68ch; font-size: var(--fs-md); line-height: var(--lh-body); margin-bottom: var(--space-3); }
.widget {
  container-type: inline-size; container-name: widget;
  background: var(--card); border: var(--border-w) solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.settings {
  display: grid; grid-template-columns: 168px auto auto minmax(0, 1fr); gap: var(--space-3) var(--space-4); align-items: end;
  padding: var(--space-4) var(--space-5); background: var(--surface-sunk);
  border-bottom: var(--border-w) solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.field label, .lbl { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--muted); line-height: var(--lh-snug); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg { display: flex; height: var(--tap); }
.seg > button { white-space: nowrap; flex: 1 1 auto; }

.more { min-width: 0; }
.more > summary { display: none; }
.more-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-3) var(--space-4); align-items: end; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: var(--space-6); align-items: start; padding: var(--space-4) var(--space-5) var(--space-5); }

.example { margin-bottom: var(--space-2); padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3); font-size: var(--fs-sm); background: var(--info-bg); border-color: var(--info-bd); }
.example[hidden] { display: none; }
.example > .icon { color: var(--accent-ink); }
.ex-t { flex: 1 1 auto; min-width: 0; }
.ex-btn {
  position: relative; flex: none; font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--accent-ink);
  background: var(--card); border: var(--border-w) solid var(--accent-bd); border-radius: var(--radius-xs);
  min-height: 36px; padding: 0 var(--space-3); cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.ex-btn::after { content: ""; position: absolute; inset: -4px 0; }
@media (hover: hover) { .ex-btn:hover { background: var(--accent-soft); border-color: var(--accent); } }

.head, .row { --res-w: 108px; display: grid; grid-template-columns: 60px minmax(120px, 132px) minmax(120px, 132px) minmax(0, 1fr) var(--res-w); gap: var(--space-2); align-items: center; }
.head { font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--muted); padding: var(--space-1) var(--space-2) var(--space-2); border-bottom: var(--border-w) solid var(--border); margin-bottom: var(--space-1); }
.r { text-align: right; }
.head { position: relative; }
.head::before, .row::before { content: ""; position: absolute; right: calc(var(--space-2) + var(--res-w)); top: -1px; bottom: -1px; border-left: var(--border-w) solid var(--border); pointer-events: none; }
.head::before { top: var(--space-1); bottom: calc(-1px - var(--space-1)); }
.row.warn::before, .row.err::before, .row.hint::before { top: 0; bottom: 0; }
.head > .r, .row > .res { padding-left: var(--space-2); }
.row {
  position: relative; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); border: var(--border-w) solid transparent;
  transition: background-color var(--dur-fast) var(--ease);
}
.row::after { content: ""; position: absolute; left: var(--space-2); right: var(--space-2); bottom: -1px; border-bottom: var(--border-w) solid var(--border); opacity: .6; pointer-events: none; }
.row:last-child::after, .row.warn::after, .row.err::after, .row.hint::after { display: none; }
@media (hover: hover) { .row:hover { background: var(--surface-sunk); } }
.row.warn { background: var(--warn-bg); border-color: var(--warn-bd); }
.row.err { background: var(--err-bg); border-color: var(--err-bd); }
.row.hint { background: var(--hint-bg); border-color: var(--hint-bd); }
.wkhead { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--accent-ink); letter-spacing: var(--tracking-caps); text-transform: uppercase; margin: var(--space-3) 0 var(--space-1); padding: 0 var(--space-2); }
.wkhead:first-child { margin-top: var(--space-1); }
.day { display: flex; flex-direction: column; line-height: var(--lh-tight); gap: 2px; }
.day b { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.day small { color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.ml { display: none; font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--muted); }
.cell { min-width: 0; }

.m24 .time-field > .select { display: none; }
.m24 .time-field > input { border-radius: var(--radius-sm); }
.tf.hint { border-color: var(--accent-bd); }
.tf > input.hint-ph::placeholder { color: var(--muted); font-style: italic; }
.row .time-field:has(> input:placeholder-shown) > .select { color: var(--muted); }

.bw { display: flex; gap: var(--space-2); align-items: center; min-width: 0; }
.bm { position: relative; flex: 0 1 96px; max-width: 96px; min-width: 0; }
.bm input { font-variant-numeric: tabular-nums; padding-right: 36px; }
.bm .u { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: var(--fs-sm); pointer-events: none; }
.bt { display: none; gap: 6px; align-items: center; flex: 1 1 auto; min-width: 0; }
.bt > .time-field { flex: 1 1 0; min-width: 0; max-width: 150px; }
.bt-sep { flex: none; align-self: center; margin: 0 2px; color: var(--muted); font-size: var(--fs-xs); }
.bt-on .bm { display: none; }
.bt-on .bt { display: flex; }
.tg.btn-quiet {
  flex: none; min-width: 100px; padding: 0 6px;
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--muted-quiet); line-height: var(--lh-tight);
  border-width: var(--border-w); background: none;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.tg.btn-quiet:focus-visible { border-color: var(--border); color: var(--accent-ink); background: none; }
@media (hover: hover) { .tg.btn-quiet:hover { border-color: var(--border); color: var(--accent-ink); background: none; } }
.tg.btn-quiet[data-mode=times] { background: none; color: var(--accent-ink); border-color: var(--border); }
.tg.btn-quiet[data-mode=times]:focus-visible { background: var(--accent-soft); border-color: var(--accent-bd); }
@media (hover: hover) { .tg.btn-quiet[data-mode=times]:hover { background: var(--accent-soft); border-color: var(--accent-bd); } }
.tg.btn-quiet > .icon { transition: opacity var(--dur) var(--ease); }
.bt-on .bw { gap: 6px; }

.res { display: grid; grid-template-columns: auto auto; grid-template-areas: "hm hm" "tag dec"; justify-content: end; justify-items: end; align-items: center; line-height: var(--lh-tight); gap: 2px var(--space-1); text-align: right; }
.res > .tag { grid-area: tag; } .res > .hm { grid-area: hm; } .res > .dec { grid-area: dec; }
.hm { font-family: var(--font-mono); font-weight: var(--fw-bold); font-size: var(--fs-body); font-variant-numeric: tabular-nums; }
.dec { font-family: var(--font-mono); color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.dec:empty { display: none; }
.row.ok .hm { color: var(--text); }
.row:not(.ok) .hm { color: var(--muted); font-weight: var(--fw-regular); }
.tag { font-size: 11px; padding: 2px 5px; }
.tag[hidden] { display: none; }
.tag .icon { width: 12px; height: 12px; }
.msg { grid-column: 2 / 5; display: flex; align-items: flex-start; gap: 6px; font-size: var(--fs-sm); line-height: var(--lh-snug); padding: 0 0 var(--space-1); }
.msg[hidden] { display: none; }
.msg > .icon { margin-top: 1px; }
.msg > .i-info, .row.hint .msg > .i-warn { display: none; }
.row.hint .msg > .i-info { display: block; color: var(--accent-ink); }
.row.hint .msg { color: var(--text); }
.row.err .msg { color: var(--invalid-bd); font-weight: var(--fw-medium); }
.row.warn .msg { color: var(--text); }
.row.warn .msg > .icon { color: var(--muted); }

.summary { position: sticky; top: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }
.total-card {
  padding: var(--space-4) 18px var(--space-5);
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 6px; row-gap: var(--space-1); align-items: baseline;
}
.cap { grid-column: 1 / -1; font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--accent-ink); margin-bottom: var(--space-1); padding-bottom: var(--space-1); border-bottom: var(--border-w) dashed var(--accent-bd); }
.big { display: contents; font-family: var(--font-mono); font-size: var(--fs-total); font-weight: var(--fw-heavy); line-height: var(--lh-tight); letter-spacing: var(--tracking-tight); font-variant-numeric: tabular-nums; color: var(--text); }
.big > :first-child { grid-column: 1; justify-self: end; }
.big > .unit { grid-column: 2; }
.big.dec { font-size: var(--fs-total-dec); font-weight: var(--fw-semibold); color: var(--muted); letter-spacing: 0; }
.summary.is-zero .big { color: var(--muted); }
.summary.is-zero .lines .p-hm, .summary.is-zero .lines .p-dec { color: var(--muted); font-weight: var(--fw-regular); }
.unit { font-family: var(--font-sans); font-size: var(--fs-body-sm); font-weight: var(--fw-medium); color: var(--muted); letter-spacing: 0; }
#weeksOut:empty { display: none; }
.weeks-out { padding: 0 var(--space-2); }
.weeks-grid { table-layout: fixed; }
.weeks-grid thead th { padding-top: 0; }
.weeks-grid td, .weeks-grid tbody th { padding-top: 6px; padding-bottom: 6px; }
.weeks-grid .n { box-sizing: content-box; font-family: var(--font-mono); font-size: var(--fs-body-sm); padding-right: 0; }
.weeks-grid .c-hm { width: 7ch; padding-left: var(--space-2); }
.weeks-grid .c-dec { width: 6ch; padding-left: var(--space-3); }
.weeks-grid thead .n > span { font-family: var(--font-sans); font-size: var(--fs-xs); letter-spacing: 0.02em; }
.weeks-grid thead .c-dec > span { display: inline-block; margin-left: calc(-1 * var(--space-3)); }
.weeks-grid td.c-hm { font-weight: var(--fw-semibold); }
.weeks-grid td.c-dec { font-weight: var(--fw-medium); }
.weeks-grid tbody tr.wk-ot > * { border-top: 0; padding-top: 0; color: var(--ot); }
.weeks-grid tr.wk-ot > th { padding-left: var(--space-3); font-size: var(--fs-sm); font-weight: var(--fw-medium); }

.lines { margin: 0; font-size: var(--fs-body-sm); }
.lines > div { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); padding: 6px var(--space-2); }
.lines > div + div { border-top: var(--border-w) solid var(--border); }
.lines dt { color: var(--muted); display: flex; flex-direction: column; line-height: var(--lh-snug); }
.dt-sub { font-size: var(--fs-xs); }
.lines dd { font-family: var(--font-mono); margin: 0; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; display: grid; grid-template-columns: auto 6ch; gap: var(--space-3); text-align: right; }
.p-dec { color: var(--muted); font-weight: var(--fw-medium); }
.lines > .ot-line.has-ot { background: var(--ot-soft); border-top-color: transparent; border-radius: var(--radius-xs); }
.lines > .ot-line.has-ot + div { border-top-color: transparent; }
.ot-line.has-ot dt, .ot-line.has-ot dd, .ot-line.has-ot .p-dec { color: var(--ot); }

.pay { display: flex; flex-direction: column; gap: var(--space-1); border-top: var(--border-w) solid var(--border); padding: var(--space-2) var(--space-2) 0; font-size: var(--fs-body-sm); }
.pay[hidden] { display: none; }
.pl { display: flex; justify-content: space-between; gap: var(--space-2); }
.pl span { color: var(--muted); }
.pl b { font-family: var(--font-mono); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.pl.strong { font-size: var(--fs-lg); }
.pl.strong span { color: var(--text); font-weight: var(--fw-semibold); font-size: var(--fs-body-sm); align-self: center; }
.pl.strong b { font-weight: var(--fw-bold); }
.fine { font-size: var(--fs-xs); color: var(--muted); line-height: var(--lh-snug); }

.target { display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--fs-body-sm); }
.target[hidden] { display: none; }
.tl { display: flex; gap: 6px; align-items: flex-start; padding: var(--space-2) 10px; font-size: var(--fs-sm); border-radius: var(--radius-sm); background: var(--surface-sunk); border: var(--border-w) solid var(--border); color: var(--text); line-height: var(--lh-snug); }
.tl > .icon { color: var(--accent-ink); margin-top: 1px; }
.tl.ok { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok); font-weight: var(--fw-semibold); }
.tl.ok > .icon { color: var(--ok); }
.tl.empty { background: var(--hint-bg); border-color: var(--hint-bd); }

.actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); margin-top: var(--space-1); }
.actions .btn { white-space: nowrap; }

.mbar { display: none; }

@media (min-width: 1081px) {
  .bt-on .tg.btn-quiet { width: var(--tap); min-width: var(--tap); padding: 0; margin-right: var(--space-1); }
  .bt-on .tg-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tg.btn-quiet[data-mode=min] { transition: color var(--dur) var(--ease), background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
  .tg.btn-quiet[data-mode=min] > .icon { opacity: 0; }
  .row:focus-within .tg.btn-quiet[data-mode=min] { color: var(--muted); }
  .row:focus-within .tg.btn-quiet[data-mode=min] > .icon, .tg.btn-quiet[data-mode=min]:focus-visible > .icon { opacity: 1; }
  .row .tg.btn-quiet[data-mode=min]:focus-visible { color: var(--accent-ink); }
  .tg.btn-quiet[data-mode=min] { justify-content: flex-start; margin-left: calc(var(--space-3) - var(--space-2) - var(--border-w) - 6px); }
  .tg.btn-quiet[data-mode=min] > .icon { order: 1; }
}
@media (min-width: 1081px) and (hover: hover) {
  .row:hover .tg.btn-quiet[data-mode=min] { color: var(--muted); }
  .row:hover .tg.btn-quiet[data-mode=min] > .icon { opacity: 1; }
  .row .tg.btn-quiet[data-mode=min]:hover { color: var(--accent-ink); }
}
@media (min-width: 1081px) and (max-width: 1279px) {
  .bt { flex-wrap: wrap; row-gap: var(--space-1); }
  .bt > .time-field { flex: 1 1 100%; max-width: none; }
  .bt-sep { display: none; }
  .bt-on > .cell.brk { padding: var(--space-1) 0; }
}

@media (min-width: 1280px) {
  .layout { grid-template-columns: minmax(0, 1fr) 336px; }
  .head, .row { grid-template-columns: 60px 120px 120px minmax(0, 1fr) var(--res-w); }
  .bt { gap: 2px; }
  .bt-sep { margin: 0 2px; }
  .bt .time-field.no-chevron > .select { background-image: var(--select-chevron); background-size: 10px 10px; background-position: right 6px center; padding: 0 18px 0 6px; text-align: left; text-align-last: auto; }
}

@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3) var(--space-5); align-items: start; }
  .summary > * { grid-column: 2; }
  .summary > #weeksOut, .summary > .total-card { grid-column: 1; }
  .summary > .total-card { grid-row: span 2; }
}

@media (max-width: 760px) {
  .top { margin: 0 0 var(--space-3); }
  .lead { margin-bottom: var(--space-2); }
  .settings { grid-template-columns: minmax(0, 1fr) var(--space-6) minmax(0, 1fr); gap: var(--space-2) var(--space-3); padding: 10px var(--space-3); }
  .f-start { grid-column: 1 / 3; }
  .f-weeks { grid-column: 3; }
  .f-fmt { grid-column: 1; align-self: start; }
  .f-fmt > .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .f-fmt > .seg > button { padding: 0 var(--space-2); }
  .more { grid-column: 2 / 4; align-self: start; }
  .more > summary {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
    min-height: var(--tap); padding: var(--space-1) 10px var(--space-1) var(--space-3); border: var(--border-w) solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-sunk); cursor: pointer; list-style: none; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text); line-height: var(--lh-snug);
  }
  .more > summary::-webkit-details-marker { display: none; }
@media (hover: hover) {   .more > summary:hover { border-color: var(--field); } }
  .more[open] > summary { background: var(--card); }
  .sum-t { min-width: 0; }
  .sum-o { color: var(--muted); font-size: var(--fs-xs); font-weight: var(--fw-regular); }
  .chev { display: inline-grid; place-items: center; width: var(--icon-sm); height: var(--icon-sm); flex: none; color: var(--muted); transition: transform var(--dur) var(--ease); }
  .chev::before { content: ""; width: 7px; height: 7px; border-right: var(--field-w) solid currentColor; border-bottom: var(--field-w) solid currentColor; transform: translateY(-2px) rotate(45deg); grid-area: 1 / 1; }
  .more[open] .chev { transform: rotate(180deg); }
  .more-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); margin-top: var(--space-3); margin-left: calc(-100% + var(--space-6)); width: calc(200% - var(--space-6)); }
  .f-name { grid-column: 1 / -1; }

  .layout { padding: var(--space-3); gap: var(--space-4); }
  .head { display: none; }
  .example { margin-bottom: var(--space-2); padding-top: 2px; padding-bottom: 2px; }
  .ex-btn { min-height: 32px; }
  .ex-btn::after { inset: -6px 0; }

  .row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "day res" "in out" "brk brk";
    gap: var(--space-2) var(--space-3); padding: var(--space-3); margin-bottom: var(--space-2);
    background: var(--card); border-color: var(--border); box-shadow: var(--shadow-sm);
  }
  .row::after, .row::before { display: none; }
  .row > .res { padding-left: 0; }
  .row:hover { background: var(--card); }
  .row.warn:hover { background: var(--warn-bg); } .row.err:hover { background: var(--err-bg); } .row.hint:hover { background: var(--hint-bg); }
  .row.warn, .row.err, .row.hint { grid-template-areas: "day res" "in out" "brk brk" "msg msg"; }
  .row > .day { grid-area: day; flex-direction: row; gap: var(--space-2); align-items: baseline; }
  .row > .cell:nth-child(2) { grid-area: in; }
  .row > .cell:nth-child(3) { grid-area: out; }
  .row > .cell.brk { grid-area: brk; flex-direction: row; align-items: center; gap: var(--space-3); }
  .row > .res { grid-area: res; display: flex; flex-direction: row; justify-content: flex-end; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
  .row > .msg { grid-area: msg; padding: 0; margin-top: calc(-1 * var(--space-1)); }
  .cell { display: flex; flex-direction: column; gap: var(--space-1); }
  .cell.brk > .ml { flex: none; width: 3.6em; font-size: var(--fs-sm); }
  .cell.brk > .bw { flex: 1 1 auto; }
  .ml { display: block; }
  .bm { flex: 0 1 112px; max-width: 112px; }
  .tg.btn-quiet { margin-left: auto; }
  .tag { align-self: center; }

  .summary { display: flex; align-items: stretch; }
  .summary > * { grid-column: auto; }
  .bt-on > .cell.brk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--space-3); row-gap: var(--space-1); align-items: center; }
  .bt-on > .cell.brk > .ml { grid-column: 1; grid-row: 1; width: auto; font-size: var(--fs-xs); }
  .bt-on .bw, .bt-on .bt { display: contents; }
  .bt-on .bt > .time-field { max-width: none; grid-row: 2; }
  .bt-on .bt > .time-field:first-child { grid-column: 1; }
  .bt-on .bt > .time-field:last-child { grid-column: 2; }
  .bt-on .bt-sep { display: none; }
  .bt-on .tg.btn-quiet {
    grid-column: 2; grid-row: 1; justify-self: end; position: relative;
    min-height: var(--space-6); min-width: 0; width: auto; margin: 0 calc(-1 * var(--space-1)) 0 0; padding: 0 var(--space-1);
    background: none; color: var(--accent-ink); border-color: transparent;
  }
  .bt-on .tg.btn-quiet::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, var(--tap)); height: var(--tap); transform: translate(-50%, -50%); }
  .bt .time-field.no-chevron > .select { background-image: var(--select-chevron); padding: 0 var(--select-pad) 0 var(--space-2); background-position: right var(--space-2) center; text-align: left; text-align-last: auto; }

  .mbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-bar); width: 100%;
    align-items: center; gap: var(--space-3); text-align: left; white-space: nowrap;
    min-height: var(--mbar-h); padding: var(--space-2) max(var(--space-3), var(--safe-r)) calc(var(--space-2) + var(--safe-b)) max(var(--space-4), var(--safe-l));
    font: inherit; color: var(--text); cursor: pointer;
    background: var(--card); border: 0; border-top: var(--border-w) solid var(--border); border-radius: 0; box-shadow: var(--shadow-bar);
    -webkit-tap-highlight-color: transparent;
  }
  .mbar:focus-visible { outline-offset: -3px; }
  .mbar > .mb-total, .mbar > .mb-ot { display: grid; grid-template-columns: auto auto; grid-template-areas: "k k" "v v2"; column-gap: 6px; align-items: baseline; line-height: var(--lh-tight); }
  .mbar .k { grid-area: k; font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
  .mbar .v { font-family: var(--font-mono); grid-area: v; font-size: var(--fs-total-2); font-weight: var(--fw-heavy); font-variant-numeric: tabular-nums; }
  .mbar .v2 { grid-area: v2; font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
  .mbar .mb-pay { display: block; margin-left: auto; min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
  .mbar > .mb-total, .mbar > .mb-ot { flex: none; }
  .mbar .mb-pay[hidden] { display: none; }
  .mb-go { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; margin-left: auto; border-radius: var(--radius-pill); background: var(--surface-sunk); color: var(--muted); transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
  .mb-pay:not([hidden]) + .mb-go { margin-left: 0; }
  .mbar:hover .mb-go, .mbar:active .mb-go { background: var(--accent-soft); color: var(--accent-ink); }
  .mbar.has-ot .mb-ot .v { color: var(--ot); }
  .mbar:not(.has-ot) .mb-ot .v { color: var(--muted); font-weight: var(--fw-semibold); }
  .mbar.is-zero .mb-total .v { color: var(--muted); }
  .mbar { transition: transform var(--dur) var(--ease); }
  .mbar.is-tucked { transform: translateY(100%); pointer-events: none; }
}

@media (max-width: 380px) { .mbar .mb-ap { display: none; } }
@media (max-width: 340px) {
  .mbar { flex-wrap: wrap; gap: var(--space-1) var(--space-3); padding-left: max(var(--space-3), var(--safe-l)); }
  .mbar .mb-go { display: none; }
  .mbar .mb-pay { margin-left: 0; }
}

@container widget (max-width: 340px) {
  .settings, .more-body { grid-template-columns: minmax(0, 1fr); }
  .settings > *, .more, .more[open], .f-fmt, .f-name { grid-column: 1 / -1; }
  .layout { padding: var(--space-2); }
  .row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "day" "res" "in" "out" "brk"; padding: var(--space-2); }
  .row.warn, .row.err, .row.hint { grid-template-areas: "day" "res" "in" "out" "brk" "msg"; }
  .bt-on > .cell.brk { display: grid; grid-template-columns: minmax(0, 1fr); }
  .bt-on > .cell.brk > .ml, .bt-on .bt > .time-field:first-child, .bt-on .bt > .time-field:last-child, .bt-on .tg.btn-quiet { grid-column: 1; grid-row: auto; }
  .bt-on .tg.btn-quiet { justify-self: start; margin: 0; }
  .bt-on .bt-sep { display: none; }
  .more-body { margin-left: 0; width: auto; }
  .sum-o { display: block; }
  .row > .res { justify-content: flex-start; }
  .row > .cell.brk { flex-direction: column; align-items: stretch; gap: var(--space-1); }
  .cell.brk > .ml { width: auto; font-size: var(--fs-xs); }
  .tf, .bw { flex-wrap: wrap; }
  .tf input { min-width: 4.5em; }
  .tf.input-group { height: auto; flex-wrap: wrap; }
  .tf.input-group > input { flex: 1 1 100%; height: var(--tap); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
  .tf.input-group > select { flex: 1 1 100%; height: var(--tap); border-left: 0; border-top: var(--border-w) solid var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
  .m24 .tf.input-group > input { border-radius: var(--radius-sm); }
  .bm { flex-basis: 5em; }
  .tg { flex: 1 1 auto; }
  .ex-t { flex-basis: 100%; }
  .example { flex-wrap: wrap; padding: var(--space-2); }
  .lines dd { grid-template-columns: auto; gap: 0; }
  .lines > div { flex-wrap: wrap; }
  .actions { grid-template-columns: minmax(0, 1fr); }
  .actions .btn { white-space: normal; }
}

.settings .more { background: none; border: 0; border-radius: 0; }
@container widget (max-width: 340px) {
  .seg { height: auto; flex-wrap: wrap; }
  .bt { flex-direction: column; }
  .bt-on .bt input { flex: none; }
  .seg > button { min-width: 0; padding: 0 var(--space-2); }
}

.adorn { position: relative; min-width: 0; }
.adorn-s { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-variant-numeric: tabular-nums; }
input.has-pre { padding-left: calc(var(--space-3) + 1.1em); }
#rate::placeholder, #name::placeholder { font-style: italic; font-weight: var(--fw-regular); }
