:root {
  color-scheme: light;
  --page: #f1f4f8;
  --surface: #fff;
  --quiet: #f6f8fc;
  --raised: #fff;
  --ink: #15223a;
  --secondary: #455672;
  --muted: #526581;
  --line: #dce4ef;
  --strong-line: #c9d5e5;
  --primary: #4641cc;
  --primary-hover: #3832b3;
  --primary-text: #fff;
  --primary-soft: #ececfe;
  --primary-ink: #3d38bb;
  --green: #08795b;
  --green-hover: #06674e;
  --green-soft: #e2f6ee;
  --green-ink: #066548;
  --amber-soft: #fff3d8;
  --amber-ink: #7a4c09;
  --red-soft: #ffe9ec;
  --red-ink: #b02541;
  --rail: #13213b;
  --rail-line: #263652;
  --rail-ink: #becbe0;
  --rail-active: #283863;
  --rail-mark: #8e8af7;
  --shadow: 0 1px 2px #1b32540b;
  --dialog-shadow: 0 24px 84px #0c162d46;
  --header-height: 70px;
  --rail-width: 84px;
  --footer-height: 34px;
  --radius: 12px;
  --product-icon-bg: #e8edfb;
  --product-icon-fg: #41568c;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-synthesis: none;
  font-weight: 400;
  font-size: 16px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #101725;
  --surface: #182337;
  --quiet: #202c42;
  --raised: #1c283d;
  --ink: #f1f4fc;
  --secondary: #c9d4e7;
  --muted: #adc0d8;
  --line: #35435b;
  --strong-line: #465776;
  --primary: #8b86f8;
  --primary-hover: #a09bff;
  --primary-text: #12122d;
  --primary-soft: #343062;
  --primary-ink: #d3d0ff;
  --green: #39c197;
  --green-hover: #68d6b4;
  --green-soft: #1c493e;
  --green-ink: #b6f4e1;
  --amber-soft: #4b3820;
  --amber-ink: #ffe2a0;
  --red-soft: #4b2939;
  --red-ink: #ffb9c5;
  --rail: #0a1222;
  --rail-line: #22324c;
  --rail-ink: #bcc9e0;
  --rail-active: #25365e;
  --rail-mark: #a8a6ff;
  --shadow: 0 1px 3px #0000001c;
  --dialog-shadow: 0 28px 88px #0009;
  --product-icon-bg: #354061;
  --product-icon-fg: #d3e0ff;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--page); }
body { margin: 0; min-width: 320px; color: var(--ink); }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .57; }
button, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
a { color: var(--primary-ink); }
svg { display: block; flex: 0 0 auto; width: 1.25em; height: 1.25em; }
[data-icon] { display: inline-grid; flex: 0 0 auto; place-items: center; }
small { font-size: .8125rem; }
kbd {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--quiet);
  color: var(--muted);
  font: 600 .6875rem/1.2 'Segoe UI', system-ui, sans-serif;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding: 0 24px;
  gap: 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.wordmark { display: flex; align-items: center; flex: 0 0 auto; gap: 11px; }
.wordmark img { display: block; width: 110px; height: auto; }
.wordmark span { color: var(--ink); font-size: 1.25rem; font-weight: 700; letter-spacing: -.03em; }
.register {
  display: flex;
  align-items: center;
  min-height: 38px;
  gap: 10px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}
.register-icon, .customer-icon {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.register strong, .register small { display: block; white-space: nowrap; }
.register strong { font-size: .875rem; line-height: 1.35; }
.register small { color: var(--muted); font-size: .75rem; }
.top-actions { display: flex; align-items: center; gap: 11px; margin-left: auto; }
.tool-button, .icon-button, .primary, .status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--secondary);
  font-weight: 650;
  font-size: .875rem;
  line-height: 1.15;
}
.tool-button:hover:not(:disabled), .icon-button:hover:not(:disabled) {
  border-color: var(--strong-line);
  background: var(--quiet);
  color: var(--ink);
}
.tool-button > [data-icon], .icon-button > svg { color: currentColor; }
.icon-button { flex: 0 0 44px; width: 44px; padding: 0; }
.primary { min-height: 48px; border-color: var(--primary); background: var(--primary); color: var(--primary-text); }
.primary:hover:not(:disabled) { border-color: var(--primary-hover); background: var(--primary-hover); }
.status-pill { flex: 0 0 auto; gap: 7px; border: 0; background: var(--amber-soft); color: var(--amber-ink); }
.status-pill > span:first-child, .work-footer i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill:hover { filter: brightness(.97); }
.install-button { white-space: nowrap; }
.theme-switch {
  display: flex;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--quiet);
}
.theme-switch button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}
:root[data-theme="light"] .theme-switch [data-value="light"],
:root[data-theme="dark"] .theme-switch [data-value="dark"] {
  border-color: var(--line);
  background: var(--surface);
  color: var(--primary-ink);
  box-shadow: var(--shadow);
}

.login { display: grid; place-items: center; min-height: calc(100dvh - var(--header-height)); padding: 28px 16px; }
.login-card {
  width: min(100%, 408px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 10px 32px #1526430e;
}
.login-icon { width: 52px; height: 52px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-ink); font-size: 1.35rem; }
.login-card h1 { margin-top: 17px; font-size: 1.75rem; line-height: 1.2; letter-spacing: -.03em; }
.login-card p { margin: 8px 0 24px; color: var(--muted); font-size: .9375rem; line-height: 1.5; }
.login-actions { display: grid; gap: 10px; }
.login-actions a { text-decoration: none; }
.login-actions .primary { color: var(--primary-text); }
.status-pill[data-status="online"] { background: var(--green-soft); color: var(--green-ink); }

.workstation {
  display: grid;
  grid-template: minmax(0, 1fr) var(--footer-height) / var(--rail-width) minmax(0, 1fr);
  height: calc(100dvh - var(--header-height));
  min-height: 580px;
}
.rail {
  grid-area: 1 / 1 / 3 / 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 9px 10px;
  gap: 14px;
  background: var(--rail);
}
.main-nav, .secondary-nav { display: grid; gap: 6px; }
.secondary-nav { padding-top: 9px; border-top: 1px solid var(--rail-line); }
.rail button {
  position: relative;
  display: grid;
  place-content: center;
  place-items: center;
  gap: 5px;
  min-height: 58px;
  width: 100%;
  padding: 5px 2px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--rail-ink);
  font-size: .6875rem;
  font-weight: 650;
  line-height: 1.15;
}
.rail button svg { width: 21px; height: 21px; }
.rail button:hover, .rail button[aria-current="page"] { background: var(--rail-active); color: #fff; }
.rail button[aria-current="page"]::before {
  content: '';
  position: absolute;
  inset: 12px auto 12px -9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--rail-mark);
}
.rail b {
  position: absolute;
  top: 4px;
  right: 5px;
  min-width: 16px;
  padding: 1px 4px;
  border-radius: 12px;
  background: #cfccff;
  color: #231d5f;
  font-size: .625rem;
}
.work-area { grid-area: 1 / 2; min-width: 0; min-height: 0; }
.work-footer {
  grid-area: 2 / 2;
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  padding: 0 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 550;
  white-space: nowrap;
}
.work-footer span { display: flex; align-items: center; gap: 6px; }
.work-footer i { flex: 0 0 auto; width: 6px; height: 6px; color: var(--green); }
.work-footer i:is([data-status="pending"], [data-status="unconfigured"], [data-status="unknown"]) { color: var(--amber-ink); }
.work-footer i[data-status="offline"] { color: var(--red-ink); }
.work-footer time { margin-left: auto; font-variant-numeric: tabular-nums; }

.sale-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(355px, 29vw, 440px); height: 100%; }
.catalog {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  padding: 20px 22px 15px;
}
.screen-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 35px; }
.screen-heading h1 { font-size: 1.75rem; font-weight: 750; letter-spacing: -.035em; line-height: 1.15; }
.employee { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .8125rem; font-weight: 625; white-space: nowrap; }
.employee svg { width: 16px; height: 16px; }
.search-row { display: flex; align-items: stretch; gap: 9px; min-width: 0; }
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  flex: 1 1 auto;
  padding: 0 12px;
  border: 1px solid var(--strong-line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
}
.search-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); color: var(--primary-ink); }
.search-field input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0;
  outline: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: .9375rem;
}
.search-field input:focus-visible { outline: none; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.scanner-key { min-height: 48px; flex: 0 0 auto; }
.categories { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-x: auto; padding: 3px; margin: -3px; scrollbar-width: thin; }
.category-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 7px;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--secondary);
  font-size: .8125rem;
  font-weight: 675;
  white-space: nowrap;
}
.category-button:hover { border-color: var(--strong-line); background: var(--quiet); }
.category-button:is([aria-pressed="true"], [aria-selected="true"], [aria-current="true"], .active, .selected) {
  border-color: var(--primary-soft);
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.category-button svg { width: 16px; height: 16px; }
.catalog-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 1px; }
.catalog-heading h2 { font-size: 1rem; font-weight: 750; }
.catalog-heading span { color: var(--muted); font-size: .8125rem; }
.product-grid {
  align-self: stretch;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 4px;
  margin: -4px;
  scrollbar-width: thin;
}
.product {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-width: 0;
  min-height: 123px;
  padding: 12px 12px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--raised);
  box-shadow: var(--shadow);
  text-align: left;
}
.product:hover { border-color: var(--primary); }
.product:active { background: var(--primary-soft); }
.product-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 9px;
  background: var(--product-icon-bg);
  color: var(--product-icon-fg);
  font-size: 1rem;
}
.product-icon svg { width: 23px; height: 23px; }
.product[data-category="beverages"] { --product-icon-bg: #e5f0fd; --product-icon-fg: #23629b; }
.product[data-category="breakfast"] { --product-icon-bg: #edebff; --product-icon-fg: #5147a9; }
.product[data-category="pantry"] { --product-icon-bg: #fff0d9; --product-icon-fg: #855516; }
.product[data-category="snacks"] { --product-icon-bg: #fbe9f1; --product-icon-fg: #93395c; }
.product[data-category="produce"] { --product-icon-bg: #e1f4e8; --product-icon-fg: #266647; }
:root[data-theme="dark"] .product[data-category="beverages"] { --product-icon-bg: #243f5d; --product-icon-fg: #a7d5ff; }
:root[data-theme="dark"] .product[data-category="breakfast"] { --product-icon-bg: #3d3465; --product-icon-fg: #dacaff; }
:root[data-theme="dark"] .product[data-category="pantry"] { --product-icon-bg: #493821; --product-icon-fg: #ffd698; }
:root[data-theme="dark"] .product[data-category="snacks"] { --product-icon-bg: #4e2e46; --product-icon-fg: #ffc5df; }
:root[data-theme="dark"] .product[data-category="produce"] { --product-icon-bg: #26483e; --product-icon-fg: #a2e3bc; }
.product-name { display: block; max-width: 100%; margin-top: 7px; color: var(--ink); font-size: .875rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.product-detail { display: block; max-width: 100%; margin: 2px 0 23px; color: var(--muted); font-size: .75rem; line-height: 1.25; }
.product-price { position: absolute; bottom: 10px; left: 12px; color: var(--primary-ink); font-size: .9375rem; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.product .favorite { position: absolute; right: 12px; top: 12px; color: var(--amber-ink); }
.product-grid > .empty-state { grid-column: 1 / -1; min-height: 130px; }

.basket {
  display: grid;
  grid-template-rows: auto auto auto minmax(90px, 1fr) auto;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 15px 17px 16px;
  border-left: 1px solid var(--line);
  background: var(--surface);
}
.basket-title, .basket-title > div { display: flex; align-items: center; gap: 9px; }
.basket-title { justify-content: space-between; }
.basket-title > div > [data-icon] { color: var(--primary-ink); }
.basket-title h2 { font-size: 1.1875rem; font-weight: 750; letter-spacing: -.02em; }
.basket-title b {
  min-width: 24px;
  padding: 4px 6px;
  border-radius: 18px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: .75rem;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.clear-button:not(:disabled):hover { color: var(--red-ink); background: var(--red-soft); border-color: var(--red-soft); }
.customer-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--quiet);
  text-align: left;
}
.customer-button:hover { border-color: var(--primary); }
.customer-button small, .customer-button strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-button small { color: var(--muted); font-size: .6875rem; line-height: 1.4; }
.customer-button strong { font-size: .875rem; }
.customer-icon { width: 35px; height: 35px; }
.customer-chevron { color: var(--muted); }
.cart-head, .cart-row { display: grid; grid-template-columns: minmax(0, 1fr) 136px minmax(108px, auto); align-items: center; gap: 6px; }
.cart-head { min-height: 31px; padding: 0 7px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .75rem; font-weight: 700; }
.cart-head > :nth-child(2) { text-align: center; }
.cart-head > :last-child { text-align: right; }
.cart-items { min-height: 0; overflow: auto; scrollbar-width: thin; }
.cart-items > .empty-state { min-height: 100%; }
.empty-state {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.45;
  text-align: center;
}
.empty-state strong, .empty-state h3 { color: var(--secondary); font-size: .9375rem; font-weight: 700; }
.empty-state > span:first-child, .empty-state > svg, .empty-state .empty-icon {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  margin-bottom: 2px;
  border-radius: 12px;
  background: var(--quiet);
  color: var(--muted);
  font-size: 1.25rem;
}
.cart-row { min-height: 60px; padding: 5px 7px; border-bottom: 1px solid var(--line); }
.cart-product { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-size: .8125rem; font-weight: 650; }
.cart-product :is(strong, small) { display: block; }
.cart-product small { margin-top: 3px; color: var(--muted); font-size: .6875rem; font-weight: 500; }
.cart-product:is(button), .line-price:is(button) { padding: 0; border: 0; background: transparent; text-align: left; }
.qty { display: flex; align-items: center; justify-content: center; gap: 2px; min-width: 0; font-variant-numeric: tabular-nums; }
.qty button {
  display: inline-grid;
  place-items: center;
  flex: 1 1 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--quiet);
  color: var(--primary-ink);
  font-size: .875rem;
  font-weight: 700;
}
.qty button:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); }
.qty [data-action="quantity"] { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; align-content: center; gap: 1px 3px; overflow-wrap: anywhere; font-size: .75rem; }
.qty [data-action="quantity"] small { font-size: .625rem; }
.qty > span, .qty > strong { min-width: 22px; text-align: center; font-size: .75rem; }
.line-price { display: flex; align-items: center; justify-content: flex-end; gap: 1px; min-width: 0; color: var(--ink); font-size: .8125rem; font-weight: 730; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.line-price:is(button) { text-align: right; }
.line-price button { display: grid; place-items: center; flex: 0 0 44px; min-height: 44px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); }
.line-price button:hover { background: var(--red-soft); color: var(--red-ink); }
.basket-footer { display: grid; gap: 12px; }
.basket-tools { display: grid; }
.basket-tools .tool-button { width: 100%; }
.totals { display: grid; gap: 5px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .8125rem; }
.totals-line, .total-due { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.totals-line { min-height: 15px; color: var(--muted); }
.totals-line dd { color: var(--secondary); font-weight: 650; }
.total-due { padding-top: 8px; margin-top: 4px; border-top: 1px dashed var(--line); color: var(--ink); font-size: .9375rem; font-weight: 750; }
.total-due dd { color: var(--primary-ink); font-size: 1.625rem; font-weight: 800; letter-spacing: -.045em; white-space: nowrap; }
.payment-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.payment {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 51px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: .875rem;
  font-weight: 750;
}
.payment.cash { background: var(--green); color: var(--primary-text); }
.payment.cash:hover:not(:disabled) { background: var(--green-hover); }
.payment.card { background: var(--primary); color: var(--primary-text); }
.payment.card:hover:not(:disabled) { background: var(--primary-hover); }
.payment.more { border-color: var(--line); background: var(--quiet); color: var(--secondary); }
.payment.more:hover:not(:disabled) { border-color: var(--primary); }
.payment:disabled { opacity: 1; background: var(--quiet); color: var(--muted); border-color: var(--line); }

.records { height: 100%; min-width: 0; overflow: auto; padding: 22px; }
.records .record-search { max-width: 540px; margin: 16px 0; }
.record-list { min-width: 0; }
.record-list > .empty-state { min-height: 220px; }
.records-table {
  width: 100%;
  min-width: max-content;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  font-size: .875rem;
}
.table-scroll { overflow-x: auto; }
.records-table th, .records-table td { padding: 11px 14px; min-height: 45px; border-bottom: 1px solid var(--line); text-align: left; }
.records-table th { background: var(--quiet); color: var(--muted); font-size: .8125rem; font-weight: 700; }
.records-table tr:last-child td { border-bottom: 0; }
.records-table td :is(strong,small) { display: block; }
.records-table td small { margin-top: 3px; color: var(--muted); }
.records-table .tool-button { white-space: nowrap; }
.row-list, .data-list { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.row-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 51px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}
.row-button:hover { border-color: var(--primary); background: var(--quiet); }
.row-button :is(small, svg) { color: var(--muted); }
.row-button > span:first-child { display: grid; place-items: center; height: 34px; border-radius: 8px; background: var(--primary-soft); }
.row-button > span:first-child > svg { color: var(--primary-ink); }
.row-button small { display: block; margin-top: 2px; }

dialog {
  width: min(calc(100% - 28px), 510px);
  max-height: calc(100dvh - 34px);
  padding: 17px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--dialog-shadow);
  overscroll-behavior: contain;
}
dialog::backdrop { background: #101a31a0; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.dialog-heading h2 { font-size: 1.25rem; font-weight: 750; letter-spacing: -.025em; }
#dialog-content { display: grid; gap: 12px; }
#dialog-content p { color: var(--secondary); font-size: .875rem; line-height: 1.45; }
.modal-form { display: grid; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.modal-actions > :is(button, a) { min-width: 96px; }
#dialog-content .form-error { padding: 8px 10px; border-radius: 7px; background: var(--red-soft); color: var(--red-ink); }
.install-steps { display: grid; gap: 10px; padding-left: 23px; margin: 0; color: var(--secondary); font-size: .875rem; line-height: 1.45; }
.field { display: grid; gap: 6px; color: var(--secondary); font-size: .875rem; font-weight: 650; }
.field :is(input, select, textarea), #dialog-content > input {
  width: 100%;
  min-height: 47px;
  padding: 10px 12px;
  border: 1px solid var(--strong-line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}
.numpad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.numpad button {
  display: inline-grid;
  place-items: center;
  min-height: 49px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--quiet);
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 700;
}
.numpad button:hover { border-color: var(--primary); background: var(--primary-soft); }
.payment-methods { display: flex; align-items: stretch; gap: 8px; }
.payment-methods > * { flex: 1 1 0; }
.payment-methods [aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.summary { display: grid; gap: 7px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--quiet); color: var(--secondary); font-size: .875rem; }
.summary:has(> span + strong) { display: flex; align-items: center; justify-content: space-between; }
.summary > strong { color: var(--primary-ink); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.summary > div, .data-list > :is(div, li) { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 7px 12px; }
.summary dd { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.data-list > :is(div, li) { min-height: 44px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.data-list dd { color: var(--muted); }
.notice { padding: 10px 12px; border-radius: 8px; background: var(--amber-soft); color: var(--amber-ink); font-size: .8125rem; line-height: 1.4; }
#dialog-content p.notice { color: var(--amber-ink); }
.toast {
  position: fixed;
  z-index: 5;
  right: 19px;
  bottom: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(calc(100% - 38px), 450px);
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--strong-line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--dialog-shadow);
  font-size: .875rem;
  font-weight: 650;
}

@media (min-width: 1580px) {
  .catalog { padding: 24px 26px 17px; gap: 17px; }
  .product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
  .product { min-height: 133px; }
  .basket { padding: 18px 20px; }
}

@media (max-width: 1179px) {
  .catalog { gap: 12px; padding-inline: 17px; }
  .basket { padding-inline: 13px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 970px) {
  :root { --rail-width: 72px; }
  .catalog { padding-inline: 13px; }
  .sale-layout { grid-template-columns: minmax(0, 1fr) 329px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .basket { gap: 9px; }
  .cart-head, .cart-row { grid-template-columns: minmax(0, 1fr) auto; }
  .cart-head > :nth-child(2) { display: none; }
  .cart-row { grid-template-areas: 'product price' 'quantity price'; }
  .cart-product { grid-area: product; }
  .qty { grid-area: quantity; justify-self: start; width: 136px; }
  .line-price { grid-area: price; }
  .payment { font-size: .8125rem; }
  .work-footer { gap: 12px; padding-inline: 13px; }
}

@media (max-width: 820px) {
  :root { --header-height: 64px; --rail-width: 66px; }
  .topbar { gap: 12px; padding-inline: 13px; }
  .register { padding-left: 12px; }
  .wordmark { gap: 7px; }
  .wordmark img { width: 94px; }
  .wordmark span { font-size: 1.125rem; }
  .top-actions { gap: 6px; }
  .sale-layout { grid-template-columns: minmax(0, 1fr) 302px; }
  .catalog { padding: 13px 10px 11px; }
  .screen-heading h1 { font-size: 1.4375rem; }
  .employee { display: none; }
  .search-field kbd, .scanner-key > :last-child { display: none; }
  .scanner-key { width: 44px; padding: 0; }
  .product-grid { gap: 7px; }
  .product { padding-inline: 9px; }
  .product-price { left: 9px; }
  .basket { padding: 11px 10px 12px; }
  .payment-actions { gap: 5px; }
}

@media (max-width: 680px) {
  :root { --header-height: 62px; --footer-height: 32px; }
  .register { display: none; }
  .workstation { display: grid; grid-template: auto minmax(0, 1fr) var(--footer-height) / minmax(0, 1fr); height: auto; min-height: calc(100dvh - var(--header-height)); }
  .rail { grid-area: 1 / 1; flex-direction: row; justify-content: flex-start; gap: 2px; overflow-x: auto; padding: 5px 7px; scrollbar-width: thin; }
  .main-nav, .secondary-nav { display: flex; gap: 3px; }
  .secondary-nav { border: 0; padding: 0; }
  .rail button { width: 62px; min-height: 49px; gap: 3px; }
  .rail button svg { width: 18px; height: 18px; }
  .rail button[aria-current="page"]::before { inset: auto 15px -3px; width: auto; height: 2px; border-radius: 2px; }
  .work-area { grid-area: 2 / 1; }
  .work-footer { grid-area: 3 / 1; overflow-x: auto; scrollbar-width: none; }
  .sale-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  .catalog { grid-template-rows: repeat(5, auto); padding-top: 15px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 420px; }
  .basket { min-height: 410px; border-top: 1px solid var(--line); border-left: 0; padding: 13px; }
  .cart-items { max-height: 310px; }
  .records { padding: 14px; }
  .records .screen-heading { align-items: flex-start; }
}

@media (max-width: 475px) {
  .topbar { gap: 6px; padding-inline: 8px; }
  .wordmark { gap: 4px; }
  .wordmark img { width: 78px; }
  .wordmark span { font-size: 1rem; }
  .status-pill { font-size: .6875rem; gap: 4px; padding: 0 6px; }
  .status-pill > span:first-child { width: 5px; height: 5px; }
  .status-pill { min-width: 44px; }
  .status-pill #status-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .install-button { width: 44px; padding: 0; }
  .install-button > :last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .theme-switch { padding: 1px; }
  .theme-switch button { width: 44px; height: 44px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payment-methods { flex-direction: column; }
  .login-card { padding: 23px; }
}

@media (max-width: 350px) {
  .wordmark img { width: 61px; }
  .wordmark span { font-size: .875rem; }
}
