
:root {
  color-scheme: light;
  --ink: #172019;
  --muted: #687069;
  --paper: #f5f5ef;
  --card: rgba(255, 255, 251, 0.92);
  --line: #dedfd5;
  --green: #256f46;
  --green-dark: #16472d;
  --lime: #d8ee82;
  --yellow: #ffe600;
  --danger: #b43838;
  --shadow: 0 24px 70px rgba(26, 43, 31, 0.09);
  --surface: #fff;
  --soft: #f4f5ef;
  --raised: #fafaf6;
  --hover: #edf7ee;
  --green-soft: #edf7ee;
  --subtle-button: rgba(255,255,255,.65);
  --summary-bg: #172019;
  --summary-muted: #b8c0ba;
  --summary-ink: #c9d1cb;
  --focus-ring: rgba(37,111,70,.1);
  --backdrop: rgba(23,32,25,.6);
  --warning-bg: #fff5d8;
  --warning-ink: #795100;
  --paused-bg: #fff8e9;
  --paused-line: #d99b2f;
  --paused-ink: #82510b;
  --paused-badge: #ffebbf;
  --toast-bg: #172019;
  --toast-ink: #fff;
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f5f5;
  --muted: #b2b2b2;
  --paper: #090909;
  --card: #171717;
  --line: #343434;
  --green: #ffe600;
  --green-dark: #ffe973;
  --lime: #ffe600;
  --danger: #ffaaa5;
  --shadow: 0 24px 70px rgba(0,0,0,.4);
  --surface: #111111;
  --soft: #222222;
  --raised: #1c1c1c;
  --hover: #2c2c2c;
  --green-soft: #262626;
  --subtle-button: #202020;
  --summary-bg: #141414;
  --summary-muted: #b2b2b2;
  --summary-ink: #d4d4d4;
  --focus-ring: rgba(255,230,0,.16);
  --backdrop: rgba(0,0,0,.78);
  --warning-bg: #3b3019;
  --warning-ink: #ffd884;
  --paused-bg: #2e281b;
  --paused-line: #d1a348;
  --paused-ink: #ffdda3;
  --paused-badge: #4e3c1d;
  --toast-bg: #ededed;
  --toast-ink: #111111;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  isolation: isolate;
  color: var(--ink);
  background: var(--paper);
  /* Suppress the native touch flash; keep :focus-visible and our press animation. */
  -webkit-tap-highlight-color: transparent;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button { color: var(--ink); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
input::placeholder { color: var(--muted); opacity: .9; }
.hidden { display: none !important; }
.page-glow { position: fixed; border-radius: 999px; filter: blur(1px); pointer-events: none; z-index: -1; }
.glow-a { width: 520px; height: 520px; background: rgba(216, 238, 130, .42); top: -270px; right: -120px; }
.glow-b { width: 360px; height: 360px; background: rgba(255, 230, 0, .12); left: -180px; bottom: 10%; }
:root[data-theme="dark"] .page-glow { opacity: 0; }
.app-shell { width: min(1400px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 48px; }
.topbar, .section-head, .preview-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar { margin-bottom: 38px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { width: 68px; height: 68px; flex-shrink: 0; object-fit: contain; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 27px; letter-spacing: -.035em; }
h2 { margin-bottom: 9px; font-size: clamp(25px, 3vw, 38px); letter-spacing: -.045em; line-height: 1.05; }
h3 { margin-bottom: 6px; }
.eyebrow { margin-bottom: 6px; color: var(--green); font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.muted { color: var(--muted); line-height: 1.55; }
.top-actions { display: flex; align-items: center; gap: 18px; flex-shrink: 0; justify-content: flex-end; }
.appearance-actions { display: flex; align-items: center; gap: 10px; }
.help-button { flex-shrink: 0; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--green-dark); font-size: 21px; font-weight: 800; }
.help-button:hover { background: var(--hover); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--subtle-button); color: var(--ink); }
.theme-track { position: relative; display: block; width: 64px; height: 32px; overflow: hidden; border-radius: 999px; background: #dce8be; box-shadow: inset 0 1px 4px rgba(0,0,0,.12); transition: background-color .35s ease; }
.theme-thumb { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fffdf4; color: #916313; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .4s cubic-bezier(.34,1.35,.5,1), color .3s ease; }
.theme-thumb svg { position: absolute; inset: 5px; width: 16px; height: 16px; transition: opacity .25s ease, transform .4s var(--motion-ease); }
.theme-moon { opacity: 0; transform: rotate(-90deg) scale(.5); }
.theme-stars { position: absolute; left: 14px; top: 10px; width: 3px; height: 3px; border-radius: 50%; background: #e1e9f8; box-shadow: 10px 9px 0 -1px #e1e9f8, 15px -2px 0 -1px #e1e9f8; opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .4s var(--motion-ease); }
.theme-toggle[aria-checked="true"] .theme-track { background: #273e5b; }
.theme-toggle[aria-checked="true"] .theme-thumb { transform: translateX(32px); color: #273e5b; }
.theme-toggle[aria-checked="true"] .theme-sun { opacity: 0; transform: rotate(90deg) scale(.5); }
.theme-toggle[aria-checked="true"] .theme-moon { opacity: 1; transform: rotate(0) scale(1); }
.theme-toggle[aria-checked="true"] .theme-stars { opacity: 1; transform: translateY(0); }
.help-dialog { width: min(760px, calc(100% - 32px)); max-height: 85dvh; padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); overflow-y: auto; }
.code-dialog { width: min(480px, calc(100% - 32px)); padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.code-dialog h2 { font-size: 25px; }
.code-dialog p { line-height: 1.5; }
.edit-dialog { width: min(540px, calc(100% - 32px)); max-height: 85dvh; overflow-y: auto; }
.product-dialog { width: min(610px, calc(100% - 32px)); max-height: 88dvh; overflow-y: auto; }
.product-dialog .help-header { position: sticky; top: 0; z-index: 2; margin-bottom: 16px; padding-bottom: 8px; background: var(--paper); }
.product-dialog .help-header h2 { font-size: 26px; }
.product-detail-body { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: start; }
.product-detail-body .product-image { width: 96px; height: 96px; }
.product-detail-body h3 { margin: 0 0 8px; font-size: 19px; line-height: 1.35; overflow-wrap: anywhere; }
.product-detail-body .product-code { margin: 0 0 12px; }
.product-detail-price { margin-top: 16px; }
.product-dialog .product-detail-price strong { font-size: clamp(20px, 6vw, 26px); }
.product-detail-review { margin: 16px 0; color: var(--muted); font-size: 12px; }
.product-detail-status { margin: 18px 0 12px; }
.product-detail-status .pause-badge { margin: 0 0 8px; }
.product-detail-error { margin: 12px 0; padding: 12px; border-radius: 10px; background: var(--warning-bg); color: var(--danger); font-size: 13px; overflow-wrap: anywhere; }
.product-detail-label { margin: 18px 0 8px; font-size: 12px; font-weight: 800; }
.product-action-feedback { margin: 16px 0 0; padding: 12px; border-radius: 10px; background: var(--green-soft); color: var(--green-dark); font-size: 13px; }
.product-action-feedback.error { background: var(--warning-bg); color: var(--danger); }
.edit-product-name { color: var(--muted); margin: 10px 0 22px; overflow-wrap: anywhere; }
.edit-actions { margin-top: 24px; }
.edit-error { color: var(--danger); margin: 12px 0 0; font-size: 13px; }
.publication-info-values { margin: 0 0 16px; padding: 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.publication-info-values code { padding: 0; background: transparent; font-size: 14px; line-height: 1.6; user-select: all; }
.publication-info-hint { margin: 0; font-size: 12px; color: var(--muted); }
.duplicate-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.help-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.help-header .icon-button { flex-shrink: 0; }
.help-header h2 { font-size: 30px; }
.help-content { font-size: 14px; line-height: 1.65; }
.help-intro { margin: 12px 0 20px; padding: 16px; background: var(--green-soft); border-radius: 12px; }
.help-content details { margin: 10px 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.help-content summary { cursor: pointer; font-weight: 800; line-height: 1.4; }
.help-content details[open] summary { margin-bottom: 14px; }
.help-content li { margin: 7px 0; }
.help-content p:last-child { margin-bottom: 0; }
.help-content dt { font-weight: 800; }
.help-content dd { margin: 3px 0 12px; }
.code-warning { margin: 9px 0 0; color: var(--warning-ink); background: var(--warning-bg); padding: 9px 11px; border-radius: 9px; font-size: 12px; line-height: 1.5; }
.button { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 800; transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease; }
.button:disabled { opacity: .52; cursor: wait; transform: none; }
.button.primary { background: var(--yellow); color: #2b2900; box-shadow: 0 10px 24px rgba(203, 181, 0, .19); }
.button.dark { background: var(--summary-bg); color: white; }
.button.ghost { background: var(--subtle-button); color: var(--ink); border: 1px solid var(--line); }
.button.danger { background: var(--warning-bg); color: var(--danger); }
.button.wide { width: 100%; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 800; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9aa099; }
.status-pill.online { color: var(--green-dark); background: var(--green-soft); }
.status-pill.online::before { background: #33a35d; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr); gap: 18px; }
.add-card, .summary-card, .preview-panel, .product-card, .login-card { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.add-card { padding: 34px; border-radius: 26px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 38px; align-items: end; }
.summary-card { padding: 27px; border-radius: 26px; background: var(--summary-bg); color: white; }
.summary-card .eyebrow { color: var(--lime); }
.summary-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 25px 0; }
.summary-numbers div { display: flex; flex-direction: column; gap: 4px; }
.summary-numbers strong { font-size: 29px; letter-spacing: -.05em; }
.summary-numbers span { color: var(--summary-muted); font-size: 11px; }
.connection-line { margin: 0; color: var(--summary-ink); font-size: 13px; }
.summary-connection { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.summary-test { flex-shrink: 0; padding: 8px 10px; border: 1px solid rgba(255,255,255,.22); border-radius: 9px; background: rgba(255,255,255,.06); color: white; font-size: 11px; }
.next-review { margin: 9px 0 0; color: var(--summary-ink); font-size: 12px; line-height: 1.45; }
.app-settings-button { margin-top: 16px; width: 100%; min-height: 40px; }
.app-settings-dialog { width: min(640px, calc(100% - 32px)); }
.app-settings-dialog .help-header h2 { font-size: clamp(23px, 5vw, 30px); }
.app-settings-dialog .help-header { position: sticky; top: 0; z-index: 2; padding-bottom: 10px; background: var(--paper); }
.app-settings-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.app-settings-section h3 { margin: 0 0 10px; font-size: 18px; }
.app-settings-section p { line-height: 1.55; }
.app-settings-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.push-status { padding: 12px 14px; border-radius: 12px; background: var(--soft); color: var(--ink); }
.app-settings-dialog .help-intro { margin-top: 20px; }
label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 850; }
.input-row { display: flex; gap: 9px; }
.input-row input { min-width: 0; flex: 1; }
.input-row .button { flex-shrink: 0; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; background: var(--surface); color: var(--ink); outline: none; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--focus-ring); }
.input-help { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
code { background: var(--soft); padding: 2px 5px; border-radius: 5px; }
.preview-panel { margin-top: 18px; padding: 28px; border-radius: 24px; }
.icon-button { border: 0; background: var(--soft); width: 36px; height: 36px; border-radius: 50%; font-size: 23px; color: var(--ink); }
.preview-body { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px; align-items: start; }
.preview-image { width: 180px; aspect-ratio: 1; object-fit: contain; background: white; border: 1px solid var(--line); border-radius: 18px; }
.preview-title { font-size: 23px; line-height: 1.2; margin-bottom: 16px; }
.price-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.price-pair.single-price { grid-template-columns: minmax(0, 1fr); }
.price-box { border: 1px solid var(--line); background: var(--raised); padding: 14px; border-radius: 14px; }
.price-box span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.price-box strong { font-size: 20px; }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 13px 0 18px; }
.mode-option { position: relative; }
.mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.mode-option label { height: 100%; margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.mode-option input:checked + label { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.mode-option input:disabled + label { opacity: .45; cursor: not-allowed; }
.mode-option b, .mode-option small { display: block; }
.mode-option small { color: var(--muted); margin-top: 3px; line-height: 1.35; }
.preview-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.list-section { margin-top: 42px; }
.section-head { margin-bottom: 17px; }
.section-head h2 { font-size: 28px; margin: 0; }
.list-hint { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.section-tools { display: flex; align-items: center; gap: 10px; }
.product-search { width: min(260px, 32vw); padding: 10px 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.product-card { border-radius: 20px; padding: 20px; display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 17px; position: relative; overflow: hidden; cursor: pointer; }
.product-card-open { position: absolute; inset: 0; z-index: 1; width: 100%; padding: 0; border: 0; border-radius: inherit; background: transparent; }
.product-card-open:focus-visible { outline: 3px solid var(--green); outline-offset: -4px; }
.product-card-open:active { transform: none !important; }
.product-card.inactive { opacity: 1; background: var(--paused-bg); border-color: var(--paused-line); box-shadow: inset 5px 0 0 var(--paused-line), var(--shadow); }
.product-card.inactive .product-image { filter: grayscale(1); opacity: .75; }
.pause-badge { display: inline-flex; align-items: center; flex-shrink: 0; gap: 6px; padding: 5px 9px; border-radius: 7px; background: var(--paused-badge); color: var(--paused-ink); font-size: 11px; font-weight: 850; }
.pause-note { grid-column: 1 / -1; margin: 0; font-size: 12px; color: var(--paused-ink); line-height: 1.5; }
.product-image { width: 88px; height: 88px; object-fit: contain; border-radius: 14px; background: white; border: 1px solid var(--line); }
.product-meta { min-width: 0; }
.product-meta h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.product-details { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.product-code { flex: 1; min-width: 0; color: var(--green); font-size: 14px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.card-prices { display: flex; }
.card-price { width: fit-content; min-width: min(180px, 100%); max-width: 100%; background: var(--soft); border-radius: 10px; padding: 10px 14px; }
.card-price strong { display: block; font-size: 22px; font-weight: 850; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.card-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.card-state { flex: 1; min-width: 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.card-state.error { color: var(--danger); }
.card-buttons { display: flex; flex-shrink: 0; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
.card-buttons button, .card-buttons a { white-space: nowrap; }
.card-buttons button { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 7px 9px; font-size: 11px; font-weight: 800; }
.card-buttons a { display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 7px 9px; font-size: 11px; font-weight: 800; text-decoration: none; }
.card-buttons a:hover, .card-buttons button:hover { background: var(--hover); }
.card-buttons button.reactivate { background: var(--green-soft); color: var(--green-dark); border-color: var(--green); }
.card-buttons button.delete { color: var(--danger); }
.product-dialog-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 22px; }
.product-dialog-actions button, .product-dialog-actions a { min-height: 44px; justify-content: center; padding: 11px 10px; font-size: 13px; }
.product-dialog-actions .publication-link { grid-column: 1 / -1; background: var(--yellow); border-color: var(--yellow); color: #2b2900; }
.product-dialog-actions button:disabled { opacity: .52; cursor: wait; transform: none; }
.empty-state { padding: 58px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 20px; color: var(--muted); }
.empty-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; background: var(--lime); color: #172019; font-size: 23px; }
.empty-state h3 { color: var(--ink); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 34px; border-radius: 24px; }
.login-card input { margin-bottom: 12px; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: min(420px, calc(100% - 44px)); background: var(--toast-bg); color: var(--toast-ink); padding: 13px 16px; border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.2); font-size: 13px; z-index: 20; }
.toast.error { background: #8f2727; color: white; }
footer { margin-top: 34px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
footer button { border: 0; background: transparent; color: var(--muted); text-decoration: underline; }

/* Change the whole palette atomically; animate complete themes, not mismatched colors. */
:root.theme-changing, :root.theme-changing *, :root.theme-changing *::before, :root.theme-changing *::after {
  transition-property: transform, opacity, filter !important;
}
::view-transition { pointer-events: none; }
::view-transition-group(root) { animation-duration: .8s; }
::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: theme-reveal .8s ease-out both; mix-blend-mode: normal; }
@keyframes theme-reveal {
  from { clip-path: circle(0 at var(--theme-origin-x, 50%) var(--theme-origin-y, 0)); }
  to { clip-path: circle(150vmax at var(--theme-origin-x, 50%) var(--theme-origin-y, 0)); }
}

/* Short transitions; no continuous decorative animation or timer effects. */
body { transition: background-color .35s ease, color .35s ease; }
.add-card, .summary-card, .login-card, .product-card, .card-price, .price-box, .pause-badge, .status-pill, .help-content details, .help-intro, .theme-toggle {
  transition: background-color .35s ease, color .35s ease, border-color .3s ease, box-shadow .25s ease, transform .22s var(--motion-ease);
}
input, select { transition: background-color .35s ease, color .35s ease, border-color .2s ease, box-shadow .2s ease; }
.button, .card-buttons button, .card-buttons a, .help-button, .icon-button, footer button {
  transition: transform .18s var(--motion-ease), background-color .3s ease, color .3s ease, border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.button.primary { position: relative; overflow: hidden; isolation: isolate; }
.button.primary::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 25%, rgba(255,255,255,.35) 50%, transparent 75%); transform: translateX(-130%); transition: transform .5s ease; }
button:not(:disabled):active, .card-buttons a:active { transform: scale(.97); }
.external-arrow { display: inline-block; transition: transform .2s var(--motion-ease); }
.card-buttons a { gap: 4px; }
.topbar { animation: enter-up .45s var(--motion-ease) backwards; }
.add-card { animation: enter-up .5s .06s var(--motion-ease) backwards; }
.summary-card { animation: enter-up .5s .12s var(--motion-ease) backwards; }
.section-head { animation: enter-up .5s .16s var(--motion-ease) backwards; }
.login-card { animation: enter-up .45s var(--motion-ease) backwards; }
.product-card.reveal { animation: enter-up .45s var(--motion-ease) backwards; }
.product-card.reveal:nth-child(2) { animation-delay: .04s; }
.product-card.reveal:nth-child(3) { animation-delay: .08s; }
.product-card.reveal:nth-child(4) { animation-delay: .12s; }
.product-card.reveal:nth-child(5) { animation-delay: .16s; }
.product-card.reveal:nth-child(n+6) { animation-delay: .2s; }
.product-card.just-updated { animation: update-feedback .45s var(--motion-ease); }
.product-image { transition: transform .25s var(--motion-ease), opacity .3s ease, filter .3s ease; }
.code-warning:not(.hidden), .edit-error:not(.hidden) { animation: enter-up .22s var(--motion-ease); }
.help-content details[open] > :not(summary) { animation: enter-up .24s var(--motion-ease); }
button[aria-busy="true"]::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 6px; vertical-align: -1px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: loading-spin .7s linear infinite; }
.preview-panel, .toast { opacity: 1; transform: translateY(0); transition: opacity .2s ease, transform .25s var(--motion-ease), background-color .35s ease; }
.preview-panel.hidden, .toast.hidden { opacity: 0; transform: translateY(10px); }
dialog { opacity: 0; transform: translateY(12px) scale(.97); transition: opacity .18s ease, transform .25s var(--motion-ease), background-color .35s ease, color .35s ease; }
dialog[open] { opacity: 1; transform: translateY(0) scale(1); }
dialog::backdrop { background-color: transparent; transition: background-color .2s ease; }
dialog[open]::backdrop { background-color: var(--backdrop); }
@supports (transition-behavior: allow-discrete) {
  dialog, dialog::backdrop { transition-property: opacity, transform, background-color, color, display, overlay; transition-duration: .2s; transition-behavior: allow-discrete; }
  .preview-panel, .toast { transition-property: opacity, transform, background-color, display; transition-duration: .2s; transition-behavior: allow-discrete; }
}
@starting-style {
  dialog[open] { opacity: 0; transform: translateY(12px) scale(.97); }
  dialog[open]::backdrop { background-color: transparent; }
  .preview-panel:not(.hidden), .toast:not(.hidden) { opacity: 0; transform: translateY(10px); }
}
@keyframes enter-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes update-feedback { from { opacity: .6; } to { opacity: 1; } }
@keyframes loading-spin { to { transform: rotate(360deg); } }
@media (hover: hover) and (pointer: fine) {
  .product-card:hover { transform: translateY(-3px); border-color: var(--green); }
  .product-card.inactive:hover { border-color: var(--paused-line); }
  .product-card:hover .product-image { transform: scale(1.035); }
  .button:not(:disabled):hover, .card-buttons button:not(:disabled):hover, .card-buttons a:hover, .theme-toggle:hover { transform: translateY(-2px); }
  .button.primary:not(:disabled):hover::before { transform: translateX(130%); }
  .card-buttons a:hover .external-arrow { transform: translate(2px,-2px); }
  .help-button:hover, .icon-button:not(:disabled):hover { transform: rotate(8deg); }
  .summary-test:not(:disabled):hover { background: rgba(255,255,255,.14); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .product-card:hover, .product-card:hover .product-image, .button:hover, button:not(:disabled):active, .card-buttons button:hover, .card-buttons a:hover, .card-buttons a:active, .theme-toggle:hover, .help-button:hover, .icon-button:hover, .card-buttons a:hover .external-arrow { transform: none !important; }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .add-card { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 1240px) {
  .product-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .app-shell { width: min(100% - 24px, 1180px); padding-top: 20px; }
  .topbar, .section-head { align-items: flex-start; flex-direction: column; }
  .topbar { gap: 18px; margin-bottom: 26px; }
  .brand { gap: 12px; width: 100%; }
  .brand-logo { width: 60px; height: 60px; }
  h1 { font-size: clamp(19px, 5.2vw, 24px); line-height: 1.25; }
  h1 span { display: block; }
  .top-actions { width: 100%; justify-content: space-between; }
  .section-tools { width: 100%; }
  .product-search { width: auto; flex: 1; min-width: 0; }
  .add-card, .summary-card, .preview-panel { padding: 22px; border-radius: 19px; }
  .input-row { flex-direction: column; }
  .preview-body { grid-template-columns: 1fr; }
  .preview-image { width: 130px; }
  .mode-grid { grid-template-columns: 1fr; }
  .preview-actions { grid-template-columns: 1fr; }
  .product-card { grid-template-columns: 70px minmax(0, 1fr); padding: 15px; gap: 13px; }
  .product-image { width: 70px; height: 70px; }
  .product-meta h3 { font-size: 15px; }
  .product-code { font-size: 13px; }
  .card-price { min-width: 0; padding: 9px 11px; }
  .card-price strong { font-size: clamp(18px, 5.3vw, 22px); }
  .card-footer { padding-top: 12px; }
  .product-dialog { padding: 20px; }
  .product-detail-body { grid-template-columns: 70px minmax(0, 1fr); gap: 13px; }
  .product-detail-body .product-image { width: 70px; height: 70px; }
  .product-detail-body h3 { font-size: 16px; }
  .product-dialog-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .help-dialog { padding: 20px; }
}
