/* Components shared by the storefront and the back office. */

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--border-strong); --btn-bg-h: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-block-size: var(--control-h); padding: 0 var(--s-4); border: 1px solid var(--btn-bd); border-radius: var(--r-md);
  background: var(--btn-bg); color: var(--btn-fg); font-weight: 500; font-size: var(--fs-sm); line-height: 1; cursor: pointer;
  text-decoration: none; white-space: nowrap; user-select: none; box-shadow: var(--shadow-xs);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:hover { background: var(--btn-bg-h); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn .i { inline-size: 1.05em; block-size: 1.05em; }
.btn-primary { --btn-bg: var(--accent); --btn-fg: var(--accent-fg); --btn-bd: var(--accent); --btn-bg-h: var(--accent-hover);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .12), var(--shadow-sm); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-bg-h: var(--surface-2); box-shadow: none; }
.btn-danger { --btn-bg: var(--surface); --btn-fg: var(--danger); --btn-bd: color-mix(in srgb, var(--danger) 30%, var(--border)); --btn-bg-h: var(--danger-soft); }
.btn-solid-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-bd: var(--danger); --btn-bg-h: color-mix(in srgb, var(--danger) 88%, #000); }
.btn-sm { min-block-size: var(--control-h-sm); padding: 0 var(--s-3); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-xs { min-block-size: 26px; padding: 0 var(--s-2); font-size: var(--fs-xs); border-radius: var(--r-sm); gap: var(--s-1); }
.btn-lg { min-block-size: 48px; padding: 0 var(--s-6); font-size: var(--fs-md); border-radius: var(--r-md); }
.btn-block { inline-size: 100%; }
.btn-icon { padding: 0; inline-size: var(--control-h); }
.btn-icon.btn-sm { inline-size: var(--control-h-sm); }
.icon-btn {
  inline-size: 36px; block-size: 36px; display: inline-grid; place-items: center; position: relative; flex: none;
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--text-2); cursor: pointer; text-decoration: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.badge-dot { position: absolute; inset-block-start: 2px; inset-inline-end: 0; min-inline-size: 17px; block-size: 17px; padding: 0 4px; border-radius: var(--r-full);
  background: var(--accent); color: var(--accent-fg); font-size: 10px; font-weight: 650; display: grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px var(--bg); }
.btn-group { display: inline-flex; }
.btn-group > .btn { border-radius: 0; margin-inline-start: -1px; }
.btn-group > .btn:first-child { border-start-start-radius: var(--r-md); border-end-start-radius: var(--r-md); margin-inline-start: 0; }
.btn-group > .btn:last-child { border-start-end-radius: var(--r-md); border-end-end-radius: var(--r-md); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-inline-size: 0; }
.field > label, .label { font-size: var(--fs-sm); font-weight: 500; color: var(--text); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2); }
.hint { font-size: var(--fs-xs); color: var(--text-3); font-weight: 400; line-height: 1.45; }
.error { font-size: var(--fs-xs); color: var(--danger); display: flex; gap: var(--s-1); align-items: center; }
.input, .select, .textarea {
  inline-size: 100%; min-block-size: var(--control-h); padding: 0 var(--s-3); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); font-size: var(--fs-sm); box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.textarea { min-block-size: 110px; padding-block: var(--s-2); resize: vertical; line-height: var(--lh-body); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--text-3) 70%, var(--border-strong)); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input[aria-invalid="true"], .field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.input[readonly] { background: var(--surface-2); }
.select { appearance: none; padding-inline-end: var(--s-8); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
html[dir="rtl"] .select { background-position: left 10px center; }
.select-sm, .input-sm { min-block-size: var(--control-h-sm); font-size: var(--fs-sm); }
.input-group { display: flex; gap: var(--s-2); }
.input-group .input { flex: 1; }
.affix { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-xs); overflow: hidden; }
.affix:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.affix > span { display: grid; place-items: center; padding: 0 var(--s-3); color: var(--text-3); font-size: var(--fs-sm); background: var(--surface-2); white-space: nowrap; }
.affix .input { border: 0; box-shadow: none; border-radius: 0; }
.affix .input:focus { box-shadow: none; }
.check { display: flex; align-items: flex-start; gap: var(--s-2); cursor: pointer; font-size: var(--fs-sm); line-height: 1.45; }
.check input { inline-size: 16px; block-size: 16px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check small { display: block; color: var(--text-3); font-size: var(--fs-xs); }
.cb { inline-size: 16px; block-size: 16px; accent-color: var(--accent); margin: 0; cursor: pointer; vertical-align: middle; }
/* Switch (checkbox styled as a toggle) */
.switch { display: flex; align-items: flex-start; gap: var(--s-3); cursor: pointer; font-size: var(--fs-sm); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { inline-size: 34px; block-size: 20px; border-radius: var(--r-full); background: var(--surface-3); position: relative; transition: background var(--t-fast); flex: none; margin-block-start: 1px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .04); }
.switch .track::after { content: ""; position: absolute; inset-block-start: 2px; inset-inline-start: 2px; inline-size: 16px; block-size: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform var(--t-fast) var(--ease); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
html[dir="rtl"] .switch input:checked + .track::after { transform: translateX(-14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch small { display: block; color: var(--text-3); font-size: var(--fs-xs); margin-block-start: 2px; }
/* Quantity stepper */
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.stepper button { inline-size: 38px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--text-2); }
.stepper button:hover { background: var(--surface-2); color: var(--text); }
.stepper input { inline-size: 44px; border: 0; text-align: center; background: transparent; font-weight: 500; -moz-appearance: textfield; appearance: textfield; min-block-size: 40px; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { appearance: none; margin: 0; }
.stepper input:focus { outline: none; background: var(--accent-soft); }
.stepper.sm button { inline-size: 30px; } .stepper.sm input { inline-size: 36px; min-block-size: 32px; }
/* Pill radio group (variants, shipping options) */
.pills { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pill span { display: inline-flex; align-items: center; min-block-size: 40px; padding: 0 var(--s-4); border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); font-weight: 500; font-size: var(--fs-sm); transition: all var(--t-fast) var(--ease); }
.pill input:hover + span { border-color: var(--text-3); }
.pill input:checked + span { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill input:disabled + span { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
/* Option cards (shipping and payment choices) */
.options { display: flex; flex-direction: column; border: 1px solid var(--border-strong); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.option { position: relative; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4); cursor: pointer; transition: background var(--t-fast); }
.option + .option { border-block-start: 1px solid var(--border); }
.option:hover { background: var(--surface-2); }
.option input { accent-color: var(--accent); inline-size: 16px; block-size: 16px; margin: 0; flex: none; }
.option:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.option .opt-body { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: 2px; }
.option .opt-body strong { font-size: var(--fs-sm); font-weight: 550; }
.option .opt-body span { font-size: var(--fs-xs); color: var(--text-2); }
.option .opt-price { font-weight: 600; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.card-pad { padding: var(--s-5); }
.card-hover { transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease); }
.card-hover:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-title { font-size: var(--fs-md); font-weight: 600; }
.divider { border: 0; border-block-start: 1px solid var(--border); margin: 0; }
.panel { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); min-inline-size: 0; }
.panel h2 { font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.01em; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-block-size: 24px; }
.panel-head h2 { font-size: var(--fs-md); font-weight: 600; }
.panel-head .sub { font-size: var(--fs-xs); color: var(--text-3); }
.panel-foot { margin: 0 calc(-1 * var(--s-5)) calc(-1 * var(--s-5)); padding: var(--s-3) var(--s-5); border-block-start: 1px solid var(--border); background: var(--surface-2); border-end-start-radius: var(--r-lg); border-end-end-radius: var(--r-lg); display: flex; gap: var(--s-2); justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.section-card + .section-card { margin-block-start: var(--s-4); }
address { font-style: normal; display: flex; flex-direction: column; gap: 2px; line-height: 1.5; }

/* ---------- Badges, chips, alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 550; line-height: 1.5;
  background: var(--surface-2); color: var(--text-2); white-space: nowrap; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 14%, transparent); }
.badge::before { content: ""; inline-size: 6px; block-size: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-accent { background: var(--accent-soft-2); color: var(--accent-text); }
.badge-outline { background: transparent; }
.badge .i { inline-size: 12px; block-size: 12px; }
.chip { display: inline-flex; align-items: center; gap: var(--s-2); min-block-size: 34px; padding: 0 var(--s-4); border: 1px solid var(--border-strong); border-radius: var(--r-full); background: var(--surface); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; color: var(--text); transition: all var(--t-fast) var(--ease); }
.chip:hover { border-color: var(--text-3); text-decoration: none; }
.chip[aria-current="true"], .chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.tagpill { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); font-weight: 500; }
.alert { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--info) 22%, transparent); font-size: var(--fs-sm); background: var(--info-soft); color: var(--text); }
.alert > .i { color: var(--info); margin-block-start: 2px; }
.alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 22%, transparent); } .alert-success > .i { color: var(--success); }
.alert-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 25%, transparent); } .alert-warning > .i { color: var(--warning); }
.alert-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); } .alert-danger > .i { color: var(--danger); }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; }
.alert .alert-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.alert .alert-body strong { font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.table { font-size: var(--fs-sm); }
.table th { text-align: start; font-weight: 500; font-size: var(--fs-xs); color: var(--text-3); background: var(--surface-2); padding: 9px var(--s-4); white-space: nowrap; border-block-end: 1px solid var(--border); }
.table th a { color: inherit; } .table th a:hover { color: var(--text); text-decoration: none; }
.table td { padding: 11px var(--s-4); border-block-start: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:first-child td { border-block-start: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table tr.is-selected { background: var(--accent-soft); }
.table .end { text-align: end; }
.table .center { text-align: center; }
.table .w-1 { inline-size: 1%; white-space: nowrap; }
.table a.row-link { color: var(--text); font-weight: 550; text-decoration: none; }
.table a.row-link:hover { color: var(--accent-text); text-decoration: underline; }
.table tr[data-href] { cursor: pointer; }
.table-compact td { padding-block: 8px; }
.table-plain td, .table-plain th { padding-inline: 0; } .table-plain th { background: transparent; }
.thumb { inline-size: 40px; block-size: 40px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-2); flex: none; border: 1px solid var(--border); display: inline-grid; place-items: center; color: var(--text-3); }
.thumb-sm { inline-size: 32px; block-size: 32px; }
.thumb-lg { inline-size: 56px; block-size: 56px; border-radius: var(--r-md); }
.cell-main { display: flex; align-items: center; gap: var(--s-3); min-inline-size: 0; }
.cell-main > div { min-inline-size: 0; display: flex; flex-direction: column; gap: 1px; }

/* ---------- Menus, tabs, breadcrumb, pagination ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + 6px); min-inline-size: 210px; z-index: 50; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 5px; animation: pop var(--t-med) var(--ease); }
.menu-panel.start { inset-inline-end: auto; inset-inline-start: 0; }
.menu-panel a, .menu-panel button { display: flex; align-items: center; gap: var(--s-2); inline-size: 100%; padding: 7px var(--s-3); border: 0; background: none; border-radius: var(--r-sm); color: var(--text); text-decoration: none; cursor: pointer; font-size: var(--fs-sm); text-align: start; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); text-decoration: none; }
.menu-panel a[aria-current="true"] { font-weight: 600; }
.menu-panel a[aria-current="true"]::after { content: "✓"; margin-inline-start: auto; color: var(--accent-text); }
.menu-panel .danger { color: var(--danger); }
.menu-panel hr { margin: 5px 0; }
.menu-label { padding: var(--s-2) var(--s-3) var(--s-1); font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1); font-size: var(--fs-sm); color: var(--text-3); list-style: none; }
.breadcrumb a { color: var(--text-2); text-decoration: none; } .breadcrumb a:hover { color: var(--text); }
.breadcrumb li + li::before { content: "/"; margin-inline-end: var(--s-1); color: var(--border-strong); }
.tabs { display: flex; gap: var(--s-1); border-block-end: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; display: inline-flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3) 10px; color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--text); }
.tabs a[aria-current="page"]::after { content: ""; position: absolute; inset-inline: var(--s-2); inset-block-end: -1px; block-size: 2px; border-radius: 2px; background: var(--text); }
.tabs .count { font-size: var(--fs-2xs); font-weight: 600; padding: 0 6px; border-radius: var(--r-full); background: var(--surface-2); color: var(--text-2); line-height: 18px; }
.tabs a[aria-current="page"] .count { background: var(--text); color: var(--bg); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: var(--r-md); border: 1px solid var(--border); }
.seg a, .seg button { padding: 4px 10px; border-radius: var(--r-sm); font-size: var(--fs-xs); font-weight: 550; color: var(--text-2); text-decoration: none; border: 0; background: none; cursor: pointer; }
.seg a:hover { color: var(--text); text-decoration: none; }
.seg [aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.pagination { display: flex; gap: var(--s-2); justify-content: center; align-items: center; margin-block-start: var(--s-8); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-block-start: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-2); }

/* ---------- Progress, timeline, feed ---------- */
.steps { display: flex; gap: var(--s-2); list-style: none; font-size: var(--fs-sm); color: var(--text-3); flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: var(--s-2); }
.steps li + li::before { content: ""; inline-size: 24px; block-size: 1px; background: var(--border-strong); }
.steps .n { inline-size: 22px; block-size: 22px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.steps .on { color: var(--text); font-weight: 550; } .steps .on .n { background: var(--text); color: var(--bg); }
.steps .done .n { background: var(--accent-soft-2); color: var(--accent-text); }
.timeline { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); position: relative; list-style: none; }
.timeline.cols-2 { --cols: 2; } .timeline.cols-3 { --cols: 3; } .timeline.cols-4 { --cols: 4; } .timeline.cols-5 { --cols: 5; }
.timeline li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-2); position: relative; font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); padding-inline: var(--s-1); }
.timeline li::before { content: ""; position: absolute; inset-block-start: 13px; inset-inline-start: -50%; inline-size: 100%; block-size: 2px; background: var(--border); z-index: 0; }
.timeline li:first-child::before { display: none; }
.timeline .dot { inline-size: 28px; block-size: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border-strong); color: var(--text-3); position: relative; z-index: 1; }
.timeline .dot .i { inline-size: 13px; block-size: 13px; }
.timeline .done { color: var(--text); } .timeline .done .dot { background: var(--text); border-color: var(--text); color: var(--bg); } .timeline .done::before { background: var(--text); }
.timeline .now { color: var(--text); } .timeline .now .dot { border-color: var(--text); color: var(--text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--text) 10%, transparent); }
.timeline .bad .dot { background: var(--danger); border-color: var(--danger); color: #fff; } .timeline .bad { color: var(--danger); }
/* Vertical activity feed */
.feed { list-style: none; display: flex; flex-direction: column; position: relative; }
.feed li { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--s-3); padding-block-end: var(--s-4); }
.feed li:not(:last-child)::before { content: ""; position: absolute; inset-inline-start: 11.5px; inset-block: 24px 0; inline-size: 1px; background: var(--border); }
.feed .ico { inline-size: 24px; block-size: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); z-index: 1; }
.feed .ico .i { inline-size: 12px; block-size: 12px; }
.feed .ico.ok { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.feed .ico.warn { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.feed .ico.bad { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.feed .ico.accent { background: var(--text); color: var(--bg); border-color: var(--text); }
.feed .body { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; font-size: var(--fs-sm); padding-block-start: 2px; }
.feed .meta { font-size: var(--fs-xs); color: var(--text-3); }
.feed .note { margin-block-start: var(--s-1); padding: var(--s-2) var(--s-3); background: var(--surface-2); border-radius: var(--r-md); white-space: pre-wrap; word-break: break-word; }
.feed .day { grid-column: 1 / -1; font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); padding-block: var(--s-1) 0; }
.feed li.day-row { grid-template-columns: 1fr; padding-block-end: var(--s-2); }
.feed li.day-row::before { display: none; }

/* ---------- Misc ---------- */
.empty { text-align: center; padding: var(--s-16) var(--s-6); color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: var(--s-2); }
.empty .ico { inline-size: 48px; block-size: 48px; border-radius: var(--r-lg); background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; margin-block-end: var(--s-2); border: 1px solid var(--border); }
.empty .ico .i { inline-size: 22px; block-size: 22px; }
.empty h2 { font-size: var(--fs-lg); color: var(--text); }
.empty p { max-inline-size: 42ch; font-size: var(--fs-sm); }
.empty .btn { margin-block-start: var(--s-3); }
.price { font-variant-numeric: tabular-nums; font-weight: 600; }
.price s { color: var(--text-3); font-weight: 400; margin-inline-start: var(--s-2); font-size: .88em; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--s-2) var(--s-6); font-size: var(--fs-sm); }
.kv dt { color: var(--text-2); } .kv dd { margin: 0; }
.line { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); padding-block: 6px; font-size: var(--fs-sm); }
.line.total { border-block-start: 1px solid var(--border); margin-block-start: var(--s-2); padding-block-start: var(--s-3); font-weight: 600; font-size: var(--fs-md); }
.line .discount { color: var(--success); }
.skeleton { background: var(--surface-2); animation: pulse 1.4s infinite ease-in-out; border-radius: var(--r-sm); }
@keyframes pulse { 50% { background: var(--surface-3); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.rise { animation: rise var(--t-slow) var(--ease) both; }
.text-accent { color: var(--accent-text); }
a.row-link { color: var(--text); font-weight: 550; text-decoration: none; }
a.row-link:hover { color: var(--accent-text); text-decoration: underline; }
.avatar { inline-size: 32px; block-size: 32px; border-radius: 50%; background: var(--surface-3); color: var(--text); display: inline-grid; place-items: center; font-weight: 600; font-size: var(--fs-xs); flex: none; }
.avatar-lg { inline-size: 48px; block-size: 48px; font-size: var(--fs-md); }
.meter { block-size: 6px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; block-size: 100%; border-radius: inherit; background: var(--text); }
.copy-field { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-3); border: 1px dashed var(--border-strong); border-radius: var(--r-md); background: var(--surface-2); font-family: var(--font-mono); font-size: var(--fs-sm); direction: ltr; }
.copy-field code { background: none; padding: 0; flex: 1; word-break: break-all; }
.dot-sep::before { content: "·"; margin-inline: var(--s-2); color: var(--text-3); }
.status-dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--text-3); display: inline-block; flex: none; }
.status-dot.ok { background: var(--success); } .status-dot.warn { background: var(--warning); } .status-dot.bad { background: var(--danger); }

/* Flash messages (toasts) */
.flash-stack { position: fixed; inset-block-end: var(--s-6); inset-inline-start: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: var(--s-2); pointer-events: none; }
html[dir="rtl"] .flash-stack { transform: translateX(50%); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--s-3); padding: 10px var(--s-4); border-radius: var(--r-md); background: var(--text); color: var(--bg); font-size: var(--fs-sm); font-weight: 500; box-shadow: var(--shadow-lg); animation: toast-in var(--t-slow) var(--ease) both, toast-out var(--t-slow) var(--ease) 4.5s forwards; }
.toast .i { color: color-mix(in srgb, var(--success) 70%, var(--bg)); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); visibility: hidden; } }

/* Dialog (native <dialog>) */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-xl); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); inline-size: min(520px, calc(100vw - 32px)); max-block-size: calc(100vh - 48px); }
dialog.modal::backdrop { background: var(--overlay); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop var(--t-med) var(--ease); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-5) var(--s-5) 0; }
.modal-head h2 { font-size: var(--fs-lg); }
.modal-body { padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }
.modal-foot { padding: var(--s-3) var(--s-5) var(--s-5); display: flex; justify-content: flex-end; gap: var(--s-2); }
