@font-face {
  font-family: Inter;
  src: url("inter.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("inter-ext.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4;
}
:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --page: #f2f5fa;
  --surface: #fff;
  --surface-subtle: #f6f8fc;
  --price-surface: #edf4ff;
  --price-border: #d9e7fc;
  --text: #152540;
  --muted: #53647c;
  --subtle: #63748b;
  --outline: #e0e7f1;
  --field-border: #d7e0ec;
  --blue: #1758cf;
  --blue-ink: #164bad;
  --blue-subtle: #e9f1ff;
  --button: #1557ce;
  --button-hover: #1247ad;
  --sidebar: #0d1d35;
  --sidebar-active: #1d355b;
  --sidebar-muted: #becbe0;
  --shadow: 0 2px 5px #1e407109;
  --radius: 16px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #101827;
  --surface: #182337;
  --surface-subtle: #1d2c42;
  --price-surface: #182f51;
  --price-border: #29446f;
  --text: #edf3ff;
  --muted: #b1bfd4;
  --subtle: #aabbd3;
  --outline: #2c3a52;
  --field-border: #40516b;
  --blue: #9bbdff;
  --blue-ink: #b4cdff;
  --blue-subtle: #223c63;
  --button: #1b60dc;
  --button-hover: #2468e3;
  --sidebar: #0a1323;
  --sidebar-active: #1d355b;
  --shadow: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: var(--page); line-height: 1.45; }
body, input, select, button { font: inherit; }
button, input, select { color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
h1, h2 { line-height: 1.18; letter-spacing: -.035em; }
:focus-visible { outline: 3px solid #77a7ff; outline-offset: 2px; }
noscript { display: block; padding: 24px; }

.icon {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  vertical-align: middle;
  background: currentColor;
  mask: var(--glyph) center / contain no-repeat;
}
.button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 2.75rem;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.15;
}
.button { padding: .68rem .95rem; }
.icon-button { width: 2.75rem; padding: 0; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--surface-subtle); color: var(--text); }
.primary { background: var(--button); color: #fff; }
.primary:hover { background: var(--button-hover); }
.secondary { background: var(--surface); color: var(--blue); border-color: var(--field-border); }
.secondary:hover { background: var(--blue-subtle); }
.danger { background: #b42318; color: #fff; }
.danger:hover { background: #962119; }
.danger-text { color: #ba3629; }
[data-theme="dark"] .danger-text { color: #ffada8; }

.workspace { min-height: 100dvh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  height: 100dvh;
  background: var(--sidebar);
  color: #fff;
  padding: 25px 17px 18px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 1.26rem; font-weight: 780; letter-spacing: -.045em; line-height: 1.05; }
.brand img { width: 42px; height: 42px; flex: 0 0 auto; }
.brand strong { font-weight: 600; }
.brand small { display: block; margin-top: 6px; color: var(--sidebar-muted); font-weight: 500; font-size: .76rem; letter-spacing: 0; }
.sidebar > .brand { align-self: flex-start; margin-left: 8px; }
.sidebar nav { margin-top: 42px; display: grid; gap: 7px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  background: transparent;
  color: var(--sidebar-muted);
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: .875rem;
  font-weight: 570;
}
.nav-item:hover, .nav-item[aria-current="page"] { background: var(--sidebar-active); color: #fff; }
.nav-item[aria-current="page"] { box-shadow: inset 3px 0 #659bff; }
.sidebar-bottom { margin-top: auto; }
.profile {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 15px;
  margin-top: 13px;
  border-top: 1px solid #2a3a52;
}
.profile .avatar { display: grid; place-items: center; flex: 0 0 35px; height: 35px; background: #254674; color: #e5efff; border-radius: 10px; font-size: .75rem; font-weight: 750; }
.profile div { min-width: 0; }
.profile strong, .profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile strong { font-size: .77rem; font-weight: 660; }
.profile small { margin-top: 2px; font-size: .73rem; color: var(--sidebar-muted); }
.profile .logout { margin-left: auto; flex: 0 0 40px; color: var(--sidebar-muted); }
.profile .logout:hover { background: var(--sidebar-active); color: #fff; }
.main-shell { min-width: 0; }
.topbar {
  min-height: 73px;
  background: var(--surface);
  border-bottom: 1px solid var(--outline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(20px, 2.6vw, 40px);
}
.mobile-brand, .mobile-nav { display: none; }
.search { position: relative; width: min(100%, 407px); }
.search-input {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 0 12px;
  height: 42px;
  border: 1px solid var(--outline);
  border-radius: 9px;
  color: var(--subtle);
  background: var(--surface-subtle);
}
.search-input:focus-within { border-color: #6698f0; box-shadow: 0 0 0 2px #4385f429; }
.search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  height: 100%;
  background: transparent;
  border: 0;
  font-size: .875rem;
  outline: none;
}
.search input::placeholder { color: var(--subtle); }
.search kbd { white-space: nowrap; font: 600 .71rem Inter, sans-serif; padding: 2px 5px; border: 1px solid var(--outline); background: var(--surface); border-radius: 4px; }
.search-results {
  position: absolute;
  z-index: 4;
  inset: calc(100% + 7px) 0 auto;
  max-height: min(60vh, 430px);
  overflow: auto;
  padding: 5px;
  border: 1px solid var(--outline);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 26px #0d1d352b;
}
.search-results button { width: 100%; padding: 10px; border: 0; border-radius: 7px; text-align: left; background: var(--surface); }
.search-results button:hover, .search-results button:focus-visible { background: var(--blue-subtle); }
.search-results strong, .search-results span { display: block; }
.search-results strong { font-size: .875rem; }
.search-results span, .search-results p { color: var(--muted); font-size: .81rem; }
.search-results p { padding: 10px; }
.top-actions { display: flex; gap: 12px; align-items: center; }
.demo-badge { display: inline-flex; gap: 6px; align-items: center; background: #fff2d8; color: #735016; padding: 6px 9px; border-radius: 7px; font-size: .75rem; font-weight: 660; white-space: nowrap; }
.demo-badge .icon { width: 15px; height: 15px; }
[data-theme="dark"] .demo-badge { background: #46351b; color: #ffe1a3; }
.theme-toggle { border: 1px solid var(--outline); }

.main { width: min(100%, 1500px); margin: 0 auto; padding: 28px clamp(20px, 2.6vw, 40px) 36px; }
.page-heading { margin-bottom: 23px; }
.page-heading h1 { font-size: clamp(1.75rem, 2.45vw, 2.3rem); font-weight: 785; }
.page-heading p { margin-top: 7px; color: var(--muted); font-size: .945rem; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1.29fr) minmax(375px, 1fr); gap: 22px; align-items: start; }
.catalog-column { min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-heading h2 { font-size: 1.16rem; font-weight: 755; }
.section-heading > span { color: var(--subtle); font-size: .82rem; white-space: nowrap; }
.section-heading p { color: var(--muted); margin-top: 5px; font-size: .875rem; }
.category-grid { display: grid; gap: 9px; }
.category-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(68px, 40%) 38px;
  align-items: center;
  min-width: 0;
  min-height: 72px;
  padding: 0;
  overflow: hidden;
  text-align: left;
  border: 1px solid #346fcb;
  border-radius: 11px;
  background: linear-gradient(103deg, #174b9f 2%, #1b62c0 72%, #2a70cf);
  color: #fff;
  box-shadow: var(--shadow);
}
.category-card:hover { border-color: #9abef7; background: linear-gradient(103deg, #1754ac, #2676d2); }
.category-card[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #538ff0; }
.category-card > strong {
  padding: 11px 0 11px 17px;
  position: relative;
  z-index: 1;
  font-weight: 740;
  font-size: 1rem;
  line-height: 1.16;
  overflow-wrap: anywhere;
}
.category-card > .icon {
  width: 15px;
  height: 15px;
  justify-self: center;
  z-index: 1;
  color: #fff;
}
.category-artwork {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 3%;
  height: 100%;
  padding: 3px 0 3px 8%;
}
.category-artwork.has-photos {
  background: linear-gradient(90deg, transparent, #eaf3fe 24%, #d5e6fc 100%);
  padding: 4px 4% 4px 12%;
  position: relative;
}
.category-artwork.has-photos::after {
  content: "";
  position: absolute;
  width: 38px;
  height: 100%;
  left: 100%;
  background: linear-gradient(90deg, #d5e6fc, transparent);
  opacity: .38;
  pointer-events: none;
}
.category-photo {
  flex: 1 1 auto;
  display: block;
  width: 0;
  min-width: 0;
  max-width: 100%;
  height: 62px;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: multiply;
}
.category-emblem { display: grid; place-items: center; width: 47px; height: 47px; background: #ffffff24; color: #fff; border-radius: 12px; }
.category-emblem .icon { width: 27px; height: 27px; }
.empty-catalog { grid-column: 1 / -1; padding: 14px; color: var(--muted); }

.calculator-panel {
  scroll-margin: 14px 0 80px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.calculator-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.calculator-emblem { display: grid; flex: 0 0 43px; place-items: center; height: 43px; border-radius: 10px; color: var(--blue); background: var(--blue-subtle); }
.calculator-emblem .icon { width: 23px; height: 23px; }
.calculator-heading h2 { font-size: 1.18rem; font-weight: 770; }
.calculator-heading p { margin-top: 3px; color: var(--muted); font-size: .81rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-subtle); border: 1px solid var(--outline); border-radius: 10px; margin-bottom: 13px; }
.tab { min-height: 36px; padding: 5px; display: inline-flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: 7px; font-size: .875rem; font-weight: 670; }
.tab { text-transform: uppercase; letter-spacing: .02em; }
.tab:hover { color: var(--blue); }
.tab[aria-selected="true"] { color: var(--blue-ink); background: var(--surface); border-color: var(--outline); box-shadow: var(--shadow); }
.tab .icon { width: 16px; height: 16px; }
.tab .lock { width: 13px; height: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 5px; font-size: .875rem; line-height: 1.25; font-weight: 600; min-width: 0; }
input:not([type="checkbox"]), select {
  border: 1px solid var(--field-border);
  height: 42px;
  padding: 0 .65rem;
  border-radius: 8px;
  background-color: var(--surface);
  color: var(--text);
  font-size: .925rem;
  min-width: 0;
}
.search input:not([type="checkbox"]) { width: 100%; padding: 0; border: 0; background-color: transparent; height: 100%; font-size: .875rem; }
label small { color: var(--muted); font-size: .79rem; font-weight: 450; }
select {
  appearance: none;
  padding-right: 26px;
  text-overflow: ellipsis;
  background: var(--surface) url("glyphs/down-dark.png") right 8px center / 14px no-repeat;
}
[data-theme="dark"] select { background-image: url("glyphs/down.png"); }
.quantity-field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(55px, auto); }
.quantity-field input:not([type="checkbox"]) { border-radius: 8px 0 0 8px; }
.quantity-field select { border-radius: 0 8px 8px 0; border-left: 0; padding-left: 7px; background-color: var(--surface-subtle); }
.sale-price-row {
  min-height: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 9px 0 11px;
  padding: 6px 9px;
  background: var(--surface-subtle);
  border-radius: 7px;
  color: var(--muted);
  font-size: .85rem;
}
.sale-price-row strong { font-size: .91rem; color: var(--text); white-space: nowrap; }
.sale-price-row small { font-size: .77rem; }
.sale-price-row.base-price { margin-top: -7px; }
.input-suffix { position: relative; }
.input-suffix input { width: 100%; padding-right: 25px; }
.input-suffix span { position: absolute; right: .65rem; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.advanced { margin: 9px 0 0; color: var(--blue-ink); }
.advanced summary { cursor: pointer; width: fit-content; min-height: 30px; padding: 6px 2px; font-size: .82rem; font-weight: 630; }
.advanced-body { display: grid; gap: 7px; padding: 4px 0; color: var(--muted); font-size: .79rem; }
.checkbox { display: flex; align-items: center; gap: 8px; color: var(--text); cursor: pointer; min-height: 29px; }
.checkbox input { width: 18px; height: 18px; margin: 0; accent-color: var(--button); flex: 0 0 auto; }
.delivery-row { margin: 5px 0 9px; padding: 8px 0; border-top: 1px solid var(--outline); color: var(--muted); font-size: .83rem; }
.delivery-row > div:first-child { display: flex; align-items: center; justify-content: space-between; }
.delivery-row strong { color: var(--text); font-size: .96rem; }
.delivery-detail { display: flex; flex-wrap: wrap; gap: 4px 12px; padding-top: 3px; font-size: .77rem; }
.delivery-detail span:last-child { color: var(--blue-ink); }
.price-card { padding: 13px; border: 1px solid var(--price-border); border-radius: 12px; background: var(--price-surface); }
.price-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--blue-ink); }
.price-heading > span { font-size: .81rem; font-weight: 680; }
.tax-switch { display: flex; flex-shrink: 0; border: 1px solid var(--price-border); border-radius: 6px; padding: 2px; background: var(--surface); }
.tax-switch button { padding: 5px 6px; min-height: 29px; background: transparent; color: var(--muted); border: 0; border-radius: 4px; font-size: .73rem; font-weight: 620; white-space: nowrap; }
.tax-switch button[aria-pressed="true"] { color: #fff; background: var(--button); }
.price-amount { display: grid; gap: 2px; padding: 5px 0 10px; font-variant-numeric: tabular-nums; }
.price-amount strong { color: var(--blue-ink); font-size: clamp(1.7rem, 2.7vw, 2.22rem); font-weight: 785; line-height: 1.2; letter-spacing: -.05em; overflow-wrap: anywhere; }
.price-unit { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; }
.price-unit > span { white-space: nowrap; }
.price-amount span { font-size: .76rem; color: var(--muted); }
.price-footer { display: flex; justify-content: space-between; align-items: center; gap: 7px; padding-top: 10px; border-top: 1px solid var(--price-border); }
.price-footer div { min-width: 0; overflow-wrap: anywhere; }
.price-footer div span { display: block; font-size: .75rem; color: var(--muted); }
.price-footer div strong { font-size: .9rem; }
.price-footer div small { font-size: .74rem; color: var(--muted); }
.copy-button { white-space: nowrap; font-size: .81rem; padding-inline: .73rem; }
.copy-button .icon { width: 16px; height: 16px; }
.copy-field { position: fixed; inset: 0 auto auto -500px; }
.purchase-costs, .profit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.statistic { display: flex; flex-direction: column; justify-content: space-between; background: var(--surface-subtle); border-radius: 8px; padding: 9px; overflow-wrap: anywhere; }
.statistic span { font-size: .79rem; color: var(--muted); }
.statistic strong { margin-top: 4px; font-size: 1rem; }
.profit { padding: 8px; border-radius: 12px; background: var(--price-surface); border: 1px solid var(--price-border); }
.profit .statistic { background: transparent; }
.profit .statistic:first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--price-border); border-radius: 0; }
.profit .statistic:first-child strong { color: var(--blue-ink); font-size: 1.5rem; }
.purchase-history table { color: var(--text); }
.purchase-history :is(th, td) { padding: 7px 2px; font-size: .79rem; }
.empty-state { display: grid; justify-items: center; text-align: center; gap: 5px; padding: 20px 10px; color: var(--muted); }
.empty-state .icon { color: var(--blue); width: 30px; height: 30px; margin-bottom: 5px; }
.empty-state strong { color: var(--text); font-size: .95rem; }
.empty-state p { font-size: .84rem; }
.result-loading { padding: 14px 0 4px; font-size: .875rem; color: var(--muted); }
.feedback { margin-top: 8px; padding: 8px 10px; border-radius: 7px; font-size: .84rem; }
.error { color: #982d27; background: #fff0ef; }
[data-theme="dark"] .error { color: #ffd2cc; background: #4e2529; }

.admin-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.admin-tabs button { color: var(--muted); border-color: var(--outline); background: var(--surface); }
.admin-tabs button:hover, .admin-tabs button[aria-pressed="true"] { color: var(--blue-ink); background: var(--blue-subtle); border-color: var(--price-border); }
.content-card { min-width: 0; padding: 18px; border: 1px solid var(--outline); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.content-card h2 { font-size: 1.16rem; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
th, td { padding: 8px 9px; border-bottom: 1px solid var(--outline); }
thead th { background: var(--surface-subtle); color: var(--muted); font-weight: 630; white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 650; }
.row-actions { display: flex; }
.row-actions .icon-button { flex: 0 0 40px; }
.status-label { display: inline-block; white-space: nowrap; padding: 4px 7px; border-radius: 5px; background: var(--surface-subtle); color: var(--muted); font-size: .76rem; }
.status-label.active { color: #176745; background: #e3f7ee; }
.price-editor-card { max-width: 720px; }
.current-prices { display: flex; gap: 8px 18px; flex-wrap: wrap; padding: 9px; border-radius: 8px; color: var(--muted); background: var(--surface-subtle); font-size: .84rem; }
.current-prices strong { color: var(--text); }
dialog { max-width: min(490px, calc(100vw - 24px)); width: 100%; border: 1px solid var(--outline); border-radius: 16px; padding: 20px; color: var(--text); background: var(--surface); box-shadow: 0 20px 65px #0b172a4d; }
dialog::backdrop { background: #0d1d358c; }
dialog p { margin: 8px 0; color: var(--muted); font-size: .93rem; }
.dialog-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.dialog-heading h2 { font-size: 1.3rem; }
.dialog-actions { justify-content: flex-end; margin: 6px 0 0; }
.toast { position: fixed; z-index: 6; bottom: max(18px, env(safe-area-inset-bottom)); right: 22px; max-width: calc(100% - 44px); padding: 12px 17px; border-radius: 10px; color: #fff; background: #172b4a; box-shadow: 0 6px 24px #0e152e36; font-size: .875rem; }

.login-view { display: grid; grid-template-columns: 1fr 1fr; min-height: 100dvh; background: var(--surface); }
.login-visual {
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: clamp(28px, 6vw, 84px);
  background: radial-gradient(120% 94% at 110% 10%, #1d69d8 0%, transparent 61%), linear-gradient(138deg, #0d1d35 0%, #15386f 100%);
}
.login-visual h2 { font-size: clamp(2rem, 4.2vw, 4.1rem); }
.login-visual p { margin-top: 14px; color: #dce9ff; font-size: 1rem; }
.login-content { display: grid; place-items: center; padding: 30px 24px; }
.login-card { width: min(100%, 380px); }
.login-brand { display: none; }
.login-card h1 { font-size: 2rem; }
.login-card > p { color: var(--muted); margin: 8px 0 24px; }
#login-form { display: grid; gap: 13px; }
#login-form .primary { margin-top: 3px; }
.demo-login { padding-top: 16px; margin-top: 22px; border-top: 1px solid var(--outline); color: var(--muted); font-size: .875rem; }
.demo-login div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.initial-state, .offline-page { min-height: 100dvh; display: grid; place-items: center; color: var(--muted); padding: 20px; }
.offline-card { max-width: 400px; text-align: center; }
.offline-card > * { margin-bottom: 14px; }

@media (max-width: 1200px) {
  .workspace { grid-template-columns: 195px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .dashboard { gap: 16px; }
  .main { padding-inline: 23px; }
  .topbar { padding-inline: 23px; }
}
@media (max-width: 1010px) {
  .workspace { grid-template-columns: 155px minmax(0, 1fr); }
  .sidebar { padding-inline: 9px; }
  .sidebar .brand { margin-left: 0; gap: 6px; font-size: 1.11rem; }
  .sidebar .brand img { width: 34px; height: 34px; }
  .sidebar .brand small { font-size: .7rem; }
  .sidebar .nav-item { gap: 7px; padding-inline: 8px; }
  .dashboard { grid-template-columns: minmax(0, 1fr) minmax(330px, 1fr); }
  .main, .topbar { padding-inline: 16px; }
}
@media (max-width: 780px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { gap: 9px 5px; padding: 11px 15px; flex-wrap: wrap; }
  .mobile-brand { display: inline-flex; font-size: 1.12rem; gap: 7px; }
  .mobile-brand img { width: 32px; height: 32px; }
  .topbar .icon-button { min-height: 41px; width: 41px; }
  .top-actions { gap: 6px; }
  .search { order: 3; width: 100%; }
  .search kbd { display: none; }
  .main { padding: 15px 15px calc(74px + env(safe-area-inset-bottom)); }
  .mobile-nav {
    position: fixed;
    z-index: 3;
    inset: auto 0 0;
    display: flex;
    justify-content: space-evenly;
    align-items: stretch;
    gap: 1px;
    min-height: 56px;
    padding: 3px 6px max(4px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--outline);
    background: var(--surface);
  }
  .mobile-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; gap: 4px; padding: 6px 2px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .76rem; font-weight: 620; }
  .mobile-nav button[aria-current="page"] { background: var(--blue-subtle); color: var(--blue-ink); }
  .toast { bottom: calc(70px + env(safe-area-inset-bottom)); right: 12px; }
}
@media (max-width: 630px) {
  .dashboard { grid-template-columns: minmax(0, 1fr); gap: 19px; }
  .page-heading { margin-bottom: 16px; }
  .category-grid { gap: 8px; }
  .category-card { min-height: 58px; grid-template-columns: minmax(0, 1fr) minmax(55px, 41%) 28px; }
  .category-emblem { width: 33px; height: 33px; }
  .category-emblem .icon { width: 19px; height: 19px; }
  .category-card > strong { font-size: .93rem; padding-inline-start: 11px; }
  .category-photo { height: 50px; }
  .category-artwork.has-photos::after { width: 28px; }
  .category-card > .icon { width: 12px; height: 12px; }
  .calculator-panel { padding: 14px; }
  .calculator-panel input:not([type="checkbox"]), .calculator-panel select, .login-card input:not([type="checkbox"]) { font-size: 1rem; }
  .advanced summary, .tab, .tax-switch button { min-height: 39px; }
  .login-view { grid-template-columns: minmax(0, 1fr); }
  .login-visual { display: none; }
  .login-brand { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px; font-size: 1.1rem; font-weight: 770; }
  .login-brand img { width: 34px; height: 34px; }
  .content-card { padding: 12px; }
  .content-card .section-heading { align-items: flex-start; flex-wrap: wrap; }
}
@media (max-width: 360px) {
  .main, .topbar { padding-inline: 10px; }
  .topbar .icon-button { width: 38px; }
  .demo-badge { padding-inline: 5px; font-size: .68rem; }
  .demo-badge .icon { display: none; }
  .price-card { padding: 9px; }
}
.beaker { --glyph: url("glyphs/beaker.png"); }
.box { --glyph: url("glyphs/box.png"); }
.calculator { --glyph: url("glyphs/calculator.png"); }
.cart { --glyph: url("glyphs/cart.png"); }
.chevron { --glyph: url("glyphs/chevron.png"); }
.clips { --glyph: url("glyphs/clips.png"); }
.close { --glyph: url("glyphs/close.png"); }
.copy { --glyph: url("glyphs/copy.png"); }
.corner { --glyph: url("glyphs/corner.png"); }
.down { --glyph: url("glyphs/down.png"); }
.download { --glyph: url("glyphs/download.png"); }
.edit { --glyph: url("glyphs/edit.png"); }
.fan { --glyph: url("glyphs/fan.png"); }
.grid { --glyph: url("glyphs/grid.png"); }
.layers { --glyph: url("glyphs/layers.png"); }
.lock { --glyph: url("glyphs/lock.png"); }
.logout-icon { --glyph: url("glyphs/logout-icon.png"); }
.moon { --glyph: url("glyphs/moon.png"); }
.pipe { --glyph: url("glyphs/pipe.png"); }
.plus { --glyph: url("glyphs/plus.png"); }
.rail { --glyph: url("glyphs/rail.png"); }
.search-icon { --glyph: url("glyphs/search-icon.png"); }
.settings { --glyph: url("glyphs/settings.png"); }
.sheet { --glyph: url("glyphs/sheet.png"); }
.sun { --glyph: url("glyphs/sun.png"); }
.tag { --glyph: url("glyphs/tag.png"); }
.tape { --glyph: url("glyphs/tape.png"); }
.trash { --glyph: url("glyphs/trash.png"); }
.wind { --glyph: url("glyphs/wind.png"); }

.calc-output[aria-busy="true"] { opacity: .6; }

@media (max-width: 780px) {
  .workspace[data-view="calculator"] .search { display: none; }
  .workspace[data-view="calculator"] .topbar { min-height: 62px; }
  .dashboard { grid-template-columns: minmax(0, 1fr); }
  .workspace[data-view="home"] .calculator-panel { display: none; }
  .workspace[data-view="calculator"] :is(.catalog-column, #home > .page-heading) { display: none; }
  .workspace[data-view="calculator"] .calculator-panel { max-width: 530px; width: 100%; margin: 0 auto; }
}


.setup-fields + .setup-fields { margin-top: 9px; }
.measure-fields.with-thickness { grid-template-columns: minmax(75px, .75fr) minmax(0, 1.2fr) minmax(100px, 1fr); }
.discount-fields { gap: 6px 11px; }
.discount-fields > input[type="range"] {
  width: 100%;
  margin: 0;
  height: 27px;
  background: transparent;
  border: 0;
  padding: 0;
  display: block;
  accent-color: var(--button);
}
.discount-presets { display: flex; gap: 5px; flex-wrap: wrap; }
.discount-presets button {
  min-height: 32px;
  padding: 3px 9px;
  border: 1px solid var(--outline);
  border-radius: 20px;
  background: var(--surface-subtle);
  color: var(--text);
  font-size: .79rem;
  font-weight: 650;
  white-space: nowrap;
}
.discount-presets button:is(:hover, [aria-pressed="true"]) {
  background: var(--blue-subtle);
  color: var(--blue-ink);
  border-color: var(--blue);
}
.measurement-note { margin-top: 9px; color: var(--muted); font-size: .78rem; }
.measure-summary { margin-top: 4px; color: var(--muted); font-size: .78rem; }
.advanced-body label:not(.checkbox) { width: min(100%, 200px); }
.reference-link { width: fit-content; }
.unpriced-state {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 12px;
  margin-top: 7px;
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: .88rem;
}
.purchase-scenario { margin-top: 11px; padding: 9px; border: 1px solid var(--outline); border-radius: 9px; }
.purchase-scenario label { margin-bottom: 6px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.category-back { display: none; }
.category-back .icon { transform: rotate(180deg); }
#fan-tools { margin-bottom: 12px; }
@media (max-width: 780px) {
  .workspace[data-view="calculator"] .category-back { display: inline-flex; }
  .workspace[data-view="calculator"] .calculator-emblem { display: none; }
}
@media (max-width: 630px) {
  .calculator-panel { padding: 11px; }
  .calculator-heading { margin-bottom: 8px; }
  .calculator-panel .tabs { margin-bottom: 8px; }
  .calculator-panel .form-grid { gap: 7px; }
  .measure-fields.with-thickness { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .measure-fields.with-thickness .order-quantity { grid-column: 1 / -1; }
  .calculator-panel .setup-fields + .setup-fields { margin-top: 7px; }
  .calculator-panel .setup-fields input:not([type="checkbox"]), .calculator-panel .setup-fields select,
  .calculator-panel .discount-fields input[type="text"] { height: 39px; }
  .calculator-panel .sale-price-row { margin: 6px 0 8px; min-height: 35px; }
  .calculator-panel .sale-price-row.base-price { margin-top: -4px; }
}
