/* icons */
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon.s { width: 16px; height: 16px; }
.icon.l { width: 24px; height: 24px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 40px; padding: 0 var(--space-4);
  border-radius: var(--radius-m); border: 1px solid transparent; font-size: var(--fs-s); font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  position: relative; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.s { min-height: 32px; padding: 0 var(--space-3); font-size: var(--fs-xs); }
.btn.l { min-height: 48px; padding: 0 var(--space-5); font-size: var(--fs-m); }
.btn.block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-1); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 16%, var(--bad-soft)); }
.btn[data-busy="true"] { pointer-events: none; }
.btn[data-busy="true"] > :not(.spinner) { opacity: .0; }
.btn .spinner { position: absolute; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-m); border: 1px solid transparent; background: transparent; color: var(--text-2); position: relative; transition: background var(--dur) var(--ease); }
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.icon-btn.s { width: 32px; height: 32px; }
.icon-btn.outlined { border-color: var(--border-strong); background: var(--surface); }
.icon-btn[aria-pressed="true"] { color: var(--accent-text); }
.icon-btn[aria-pressed="true"] .icon { fill: currentColor; }
.icon-btn:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 599px) {
  .btn { min-height: 44px; } .btn.s { min-height: 44px; }
  .tap-link { display: inline-flex; align-items: center; min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; } .icon-btn.s { width: 44px; height: 44px; }
  .nav-item { min-height: 44px; }
}
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* form fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: var(--fs-s); font-weight: 600; color: var(--text); }
.field .hint { font-size: var(--fs-xs); color: var(--muted); }
.field .error { font-size: var(--fs-xs); color: var(--bad); font-weight: 500; }
.field.invalid .input, .field.invalid .textarea, .field.invalid .select { border-color: var(--bad); }
.input, .textarea, .select {
  width: 100%; min-height: 42px; padding: 0 var(--space-3); border-radius: var(--radius-m); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: var(--fs-m); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.textarea { padding: var(--space-3); min-height: 96px; line-height: 1.5; resize: vertical; }
.textarea.autosize { resize: none; overflow: hidden; }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6253' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .8; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--muted); }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent); }
.input:disabled, .textarea:disabled, .select:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
@media (max-width: 599px) { .input, .select { min-height: 46px; font-size: 16px; } .textarea { font-size: 16px; } }
.counter { align-self: flex-end; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--bad); font-weight: 600; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.input-group > .input { padding-left: 38px; }

/* toggle, slider, colour */
.toggle { position: relative; display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; min-height: 32px; font-size: var(--fs-s); }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { width: 40px; height: 24px; border-radius: 12px; background: var(--border-strong); position: relative; transition: background var(--dur) var(--ease); flex: none; }
.toggle .track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform var(--dur) var(--ease); }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(16px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }
.toggle input:disabled + .track { opacity: .5; }
.check { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; min-height: 32px; font-size: var(--fs-s); }
.check input { width: 18px; height: 18px; accent-color: var(--accent-text); margin: 0; }
.slider { display: flex; align-items: center; gap: var(--space-3); }
.slider input[type=range] { flex: 1; accent-color: var(--accent-text); height: 28px; }
.slider output { min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; font-size: var(--fs-s); color: var(--text-2); }
.color-input { display: inline-flex; align-items: center; gap: var(--space-2); }
.color-input .swatch { width: 40px; height: 40px; border-radius: var(--radius-m); border: 1px solid var(--border-strong); padding: 0; background: none; cursor: pointer; overflow: hidden; }
.color-input .swatch::-webkit-color-swatch-wrapper { padding: 0; } .color-input .swatch::-webkit-color-swatch { border: 0; }
.color-input .swatch::-moz-color-swatch { border: 0; }
.color-input .input { width: 104px; font-family: var(--mono); text-transform: uppercase; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: var(--radius-m); gap: 2px; }
.seg button { border: 0; background: none; padding: 0 var(--space-3); min-height: 32px; border-radius: 8px; font-size: var(--fs-s); font-weight: 500; color: var(--text-2); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); font-weight: 600; }

/* file drop */
.filedrop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); text-align: center; padding: var(--space-5);
  border: 2px dashed var(--border-strong); border-radius: var(--radius-l); background: var(--surface); color: var(--text-2); cursor: pointer; min-height: 120px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.filedrop:hover, .filedrop.over { border-color: var(--accent); background: var(--accent-soft); }
.filedrop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.filedrop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.filedrop .icon { width: 28px; height: 28px; color: var(--muted); }

/* cards, chips */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: var(--space-4); box-shadow: var(--shadow-1); min-width: 0; }
.card.flat { box-shadow: none; }
.card.flush { padding: 0; overflow: hidden; }
.card.interactive { transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease); cursor: pointer; }
.card.interactive:hover { box-shadow: var(--shadow-2); border-color: var(--border-strong); transform: translateY(-1px); }
.card-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.card-head h3 { flex: 1 1 auto; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0 var(--space-2); border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; line-height: 1; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip .icon { width: 14px; height: 14px; }
.chip.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.clickable { cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface); min-height: 32px; padding: 0 var(--space-3); font-size: var(--fs-s); font-weight: 500; color: var(--text-2); }
.chip.clickable[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; }
.score { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; font-weight: 700; font-size: var(--fs-xs); padding: 3px 8px; border-radius: 999px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.score.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.score.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.score.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: var(--fs-xs); flex: none; overflow: hidden; }
.avatar.l { width: 44px; height: 44px; font-size: var(--fs-s); } .avatar.s { width: 24px; height: 24px; font-size: 10px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
kbd.kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface); color: var(--text-2); font-size: 11px; text-align: center; }

/* progress */
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress .track { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress .fill { height: 100%; width: 0; border-radius: 4px; background: var(--accent); transition: width 400ms var(--ease); }
.progress.indeterminate .fill { width: 40% !important; animation: slide 1.4s var(--ease) infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.progress .label { font-size: var(--fs-s); color: var(--text-2); display: flex; justify-content: space-between; gap: var(--space-3); }
.progress.ok .fill { background: var(--ok); } .progress.bad .fill { background: var(--bad); } .progress.warn .fill { background: var(--warn); }
.job-progress { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius-m); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.job-progress.failed { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.job-progress.waiting { background: var(--surface-2); border-color: var(--border); }
.job-progress .words { font-weight: 600; font-size: var(--fs-s); display: flex; align-items: center; gap: var(--space-2); }
.job-progress .meta { font-size: var(--fs-xs); color: var(--text-2); }
.job-progress.compact { padding: var(--space-2) var(--space-3); }
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter .figures { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); font-variant-numeric: tabular-nums; }
.meter .figures strong { font-size: var(--fs-l); }
.meter .track { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.meter .fill { height: 100%; border-radius: 5px; background: var(--ok); transition: width 400ms var(--ease); }
.meter.warn .fill { background: var(--warn); } .meter.bad .fill { background: var(--bad); }

/* check list */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.checklist li { display: flex; flex-direction: column; gap: 4px; }
.checklist .head { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-s); font-weight: 500; }
.checklist .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ok-soft); color: var(--ok); }
.checklist .mark .icon { width: 14px; height: 14px; stroke-width: 2.5; }
.checklist li.fail .mark { background: var(--bad-soft); color: var(--bad); }
.checklist li.secondary:not(.fail) .head { color: var(--muted); }
.checklist li.secondary.fail .mark { background: var(--warn-soft); color: var(--warn); }
.checklist .plain { margin: 0 0 0 30px; font-size: var(--fs-xs); color: var(--text-2); }

/* thumbs, frames */
.aspect { position: relative; width: 100%; background: repeating-conic-gradient(var(--checker-a) 0 25%, var(--checker-b) 0 50%) 0 0 / 16px 16px; border-radius: var(--radius-m); overflow: hidden; }
.aspect > img, .aspect > .fill, .aspect > svg.overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.aspect > img { object-fit: contain; background: transparent; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--radius-s); min-height: 16px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.aspect .skeleton { position: absolute; inset: 0; border-radius: 0; }
.thumb { display: flex; flex-direction: column; gap: var(--space-2); text-align: left; background: none; border: 0; padding: 0; color: inherit; min-width: 0; }
.thumb .frame { border: 1px solid var(--border); border-radius: var(--radius-m); overflow: hidden; background: var(--surface); transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease); position: relative; }
.thumb:hover .frame { box-shadow: var(--shadow-2); border-color: var(--border-strong); transform: translateY(-1px); }
.thumb .frame .aspect { border-radius: 0; }
.thumb .tags { position: absolute; left: var(--space-2); top: var(--space-2); display: flex; gap: 4px; z-index: 1; }
.thumb .fav { position: absolute; right: 6px; top: 6px; z-index: 1; background: color-mix(in srgb, var(--surface) 85%, transparent); border-radius: 50%; }
.thumb .cap { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; }
.thumb .cap .name { font-size: var(--fs-s); font-weight: 600; }
.thumb .cap .sub { font-size: var(--fs-xs); color: var(--muted); }
.safezone-guide { stroke: var(--accent); fill: none; stroke-width: 2; stroke-dasharray: 8 6; vector-effect: non-scaling-stroke; }
.safezone-shade { fill: rgb(179 38 30 / .18); }

/* tabs, menu */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs [role=tab] { border: 0; background: none; padding: 0 var(--space-4); min-height: 44px; font-size: var(--fs-s); font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs [role=tab]:hover { color: var(--text); }
.tabs [role=tab][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 650; }
.menu-wrap { position: relative; display: inline-block; }
.menu { position: fixed; z-index: 200; min-width: 200px; max-width: min(320px, calc(100vw - 16px)); padding: var(--space-1); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-m); box-shadow: var(--shadow-2); display: flex; flex-direction: column; }
.menu [role^=menuitem] { display: flex; align-items: center; gap: var(--space-3); min-height: 38px; padding: 0 var(--space-3); border: 0; background: none; border-radius: var(--radius-s); font-size: var(--fs-s); text-align: left; color: var(--text); text-decoration: none; }
.menu [role^=menuitem]:hover, .menu [role^=menuitem]:focus-visible { background: var(--surface-2); outline: none; }
.menu [role^=menuitem].danger { color: var(--bad); }
.menu [role^=menuitem][aria-checked="true"]::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.menu hr { margin: var(--space-1) 0; }
.menu .menu-label { padding: var(--space-2) var(--space-3) var(--space-1); font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
@media (max-width: 599px) { .menu [role^=menuitem] { min-height: 46px; } }

/* overlays: modal, drawer, sheet (native dialog) */
dialog.overlay { padding: 0; border: 0; background: transparent; color: var(--text); max-width: 100vw; max-height: 100dvh; overflow: visible; }
dialog.overlay::backdrop { background: var(--overlay); animation: fade var(--dur) var(--ease); }
dialog.overlay .panel { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-3); display: flex; flex-direction: column; max-height: min(88dvh, 880px); overflow: hidden; border: 1px solid var(--border); }
dialog.overlay.modal .panel { width: min(520px, calc(100vw - 32px)); animation: pop 200ms var(--ease); }
dialog.overlay.modal.wide .panel { width: min(860px, calc(100vw - 32px)); }
dialog.overlay.modal[open] { margin: auto; }
dialog.overlay.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; }
dialog.overlay.drawer .panel { width: min(440px, 100vw); height: 100dvh; max-height: 100dvh; border-radius: var(--radius-l) 0 0 var(--radius-l); animation: slide-in 220ms var(--ease); }
dialog.overlay.sheet { margin: auto auto 0; width: 100vw; }
dialog.overlay.sheet .panel { width: 100vw; border-radius: var(--radius-l) var(--radius-l) 0 0; max-height: 90dvh; padding-bottom: env(safe-area-inset-bottom); animation: sheet-up 240ms var(--ease); }
.panel-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-4) var(--space-3) var(--space-5); }
.panel-head h2 { flex: 1 1 auto; font-size: var(--fs-l); }
.panel-body { padding: 0 var(--space-5) var(--space-4); overflow-y: auto; flex: 1 1 auto; overscroll-behavior: contain; }
.panel-foot { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-5) var(--space-4); border-top: 1px solid var(--border); flex-wrap: wrap; }
.grab { display: none; width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: var(--space-2) auto 0; }
dialog.overlay.sheet .grab { display: block; }
@media (max-width: 599px) {
  dialog.overlay.modal { margin: auto auto 0; width: 100vw; }
  dialog.overlay.modal .panel, dialog.overlay.modal.wide .panel { width: 100vw; border-radius: var(--radius-l) var(--radius-l) 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); animation: sheet-up 240ms var(--ease); }
  .panel-head, .panel-body, .panel-foot { padding-left: var(--space-4); padding-right: var(--space-4); }
  .panel-foot .btn { flex: 1 1 auto; }
  dialog.overlay.drawer .panel { width: 100vw; border-radius: 0; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* toasts */
.toasts { position: fixed; z-index: 300; right: var(--space-4); bottom: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-end; pointer-events: none; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--text); color: var(--bg); border-radius: var(--radius-m); box-shadow: var(--shadow-2); font-size: var(--fs-s); max-width: 420px; animation: pop 200ms var(--ease); }
.toast.ok .icon { color: var(--ok); } .toast.bad .icon { color: var(--bad); } .toast.warn .icon { color: var(--warn); }
:root[data-theme="dark"] .toast { background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); }
.toast .toast-action { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 6px; margin: -6px -6px -6px 0; }
:root:not([data-theme="dark"]) .toast .toast-action { color: var(--accent); }
.toast.leaving { opacity: 0; transform: translateY(8px); transition: opacity 160ms, transform 160ms; }
@media (max-width: 599px) { .toasts { left: var(--space-4); right: var(--space-4); align-items: stretch; bottom: calc(var(--tabbar-h) + var(--space-3) + env(safe-area-inset-bottom)); } }

/* empty, banners */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: var(--space-7) var(--space-5); color: var(--text-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-l); background: var(--surface); }
.empty .art { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; }
.empty .art .icon { width: 28px; height: 28px; }
.empty h3 { font-size: var(--fs-l); color: var(--text); }
.empty p { max-width: 44ch; font-size: var(--fs-s); }
.banner { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-m); font-size: var(--fs-s); background: var(--info-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent); }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.banner.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.banner.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.banner .icon { margin-top: 1px; }

/* lists and tables */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); min-width: 0; }
.list > li:last-child { border-bottom: 0; }
.table-wrap { position: relative; max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-s); font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; padding: var(--space-2) var(--space-4); background: var(--surface-2); white-space: nowrap; }
.table td { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); }
.table td.num, .table th.num { text-align: right; }

/* calendar */
.cal { border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--surface); overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-head div { padding: var(--space-2); text-align: center; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-day { min-height: 104px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; background: var(--surface); text-align: left; border-top: 0; border-left: 0; color: inherit; position: relative; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.out { background: var(--surface-2); color: var(--muted); }
.cal-day:hover { background: var(--accent-soft); }
.cal-day .num { font-size: var(--fs-xs); font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 0; background: none; color: inherit; cursor: pointer; font-family: inherit; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-event { font-size: 11px; font-weight: 650; line-height: 1.25; padding: 2px 6px; border-radius: 4px; background: var(--warn-soft); color: var(--warn); border: 0; text-align: left; width: 100%; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.cal-day.has-event { background: color-mix(in srgb, var(--warn-soft) 45%, var(--surface)); }
.cal-day.today .num { background: var(--accent); color: var(--accent-ink); }
.cal-entry { font-size: 11px; line-height: 1.25; padding: 2px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--text); border: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.cal-entry.ok { background: var(--ok-soft); } .cal-entry.warn { background: var(--warn-soft); } .cal-entry.info { background: var(--info-soft); }
.cal-more { font-size: 11px; color: var(--muted); }
@media (max-width: 599px) {
  .cal-day { min-height: 56px; align-items: center; padding: 4px 2px; }
  .cal-entry { width: 8px; height: 8px; padding: 0; border-radius: 50%; font-size: 0; background: var(--accent); display: inline-block; }
  .cal-event { font-size: 0; width: 8px; height: 8px; padding: 0; border-radius: 2px; background: var(--warn); }
  .cal-day .entries { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
  .cal-more { display: none; }
}

/* horizontal scroll rows (phone review) */
.snap-row { display: flex; gap: var(--space-3); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--space-2); scrollbar-width: none; }
.snap-row > * { scroll-snap-align: center; flex: 0 0 min(86%, 420px); }
.divider-label { display: flex; align-items: center; gap: var(--space-3); color: var(--muted); font-size: var(--fs-xs); }
.divider-label::before, .divider-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* thumbs: hit target and overlays */
.thumb-hit { position: absolute; inset: 0; z-index: 1; background: none; border: 0; padding: 0; cursor: pointer; border-radius: inherit; }
.thumb-hit:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.thumb .tags { pointer-events: none; flex-wrap: wrap; right: 44px; }
.thumb .fav { z-index: 2; }
.thumb .fav .icon { width: 18px; height: 18px; }
.thumb:focus-within .frame { border-color: var(--border-strong); }
