:root {
  --header: #1c2430;
  --header-ink: #f4f6f8;
  --accent: #2f6fad;
  --accent-ink: #f4f6f8;
  --page: #f4f6f8;
  --ink: #1c2430;
  --muted: #c5ced6;
  --heading-font: Georgia, serif;
  --body-font: "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  font-family: var(--body-font);
  line-height: 1.45;
}
body { margin: 0; }
header {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  align-items: center;
  justify-content: flex-start;
  height: 5rem;
  min-height: 5rem;
  max-height: 5rem;
  padding: 0 1.2rem;
  background: var(--header);
  color: var(--header-ink);
  position: relative;
  z-index: 20;
  overflow: visible;
}
.brand { color: inherit; font-weight: 700; text-decoration: none; display: flex; gap: 0.75rem; align-items: center; height: 5rem; min-width: 0; flex: 0 1 auto; max-width: 24rem; font-family: var(--heading-font); }
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand > span:not(.brand-name) { background: var(--accent); color: var(--accent-ink); width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 4px; }
.brand img { height: 5rem; width: auto; max-width: 16rem; object-fit: contain; object-position: left center; padding: 0.4rem 0; box-sizing: border-box; }
.page-title { flex: 1 1 auto; min-width: 0; text-align: center; }
.current-page { margin: 0; font-family: var(--heading-font); font-size: 1.35rem; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-name { margin: 0; font-size: 0.85rem; font-weight: 600; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
nav { display: flex; flex-wrap: nowrap; gap: 0.75rem; align-items: center; flex: 0 0 auto; overflow: visible; }
.menu-toggle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.menu-button { display: none; font-weight: 700; text-decoration: none; color: var(--header-ink); }
.site-links { display: flex; flex-wrap: nowrap; gap: 0.55rem; align-items: center; }
.site-links > a, nav details.menu summary, nav details.menu a { font-weight: 700; text-decoration: none; }
.site-links > a:hover, .site-links > a:focus, .site-links > a:visited, nav details.menu summary:hover, nav details.menu summary:focus, nav details.menu a:hover, nav details.menu a:focus, nav details.menu a:visited { text-decoration: none; }
.site-links > a { color: var(--header-ink); }
.site-links > a[aria-current="page"], nav details.menu summary[aria-current="page"] { background: rgba(255, 255, 255, 0.28); border-radius: 4px; padding: 0.35rem 0.55rem; text-decoration: none; }
nav details.menu a[aria-current="page"] { background: #e7eef5; text-decoration: none; }
nav details.menu { position: relative; }
nav details.menu summary { list-style: none; cursor: pointer; color: var(--header-ink); }
nav details.menu summary::-webkit-details-marker { display: none; }
nav details.menu summary::after { content: " ▾"; font-size: 0.75em; }
nav details.menu > div { position: absolute; top: calc(100% + 0.55rem); right: 0; min-width: 12.5rem; background: white; border-radius: 4px; padding: 0.3rem 0; z-index: 30; box-shadow: 0 8px 24px rgba(28, 25, 21, 0.28); }
nav details.menu a { display: block; color: var(--ink); text-decoration: none; padding: 0.55rem 0.9rem; white-space: nowrap; }
nav details.menu a:hover { background: #e7eef5; }
nav button, button, .button {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 4px;
  padding: 0.55rem 0.8rem;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}
button:disabled { background: var(--muted); color: #5c6770; cursor: not-allowed; }
main { padding: 1.2rem; }
main a { color: #6d28d9; text-decoration: none; }
main a:hover, main a:focus, main a:visited { color: #6d28d9; text-decoration: none; }
.record-search { max-width: 28rem; margin: 0.6rem 0; }
.record-search input { width: 100%; }
table.record-table tbody tr { cursor: pointer; }
h1, h2 { font-family: var(--heading-font); }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.6rem 0; }
.company-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem 1.2rem; max-width: 52rem; align-items: start; }
.company-form .wide, .company-form button { grid-column: 1 / -1; }
.company-form button { justify-self: start; }
.font-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem 1.2rem; max-width: 40rem; }
.font-choices small, .swatch small { display: block; line-height: 1.35; }
.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; align-items: stretch; }
.swatch { display: grid; grid-template-rows: auto auto 5.5rem auto; gap: 0.4rem; margin: 0; }
.swatch-name { font-weight: 600; }
.colour-block { position: relative; display: block; height: 5.5rem; }
.colour-block input[type="color"] { appearance: none; -webkit-appearance: none; width: 100%; height: 100%; margin: 0; padding: 0; border: 1px solid rgba(28, 36, 48, 0.28); border-radius: 4px; background: transparent; cursor: pointer; box-sizing: border-box; }
.colour-block input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.colour-block input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 3px; }
.colour-hint { position: absolute; left: 0.4rem; right: 0.4rem; bottom: 0.4rem; text-align: center; font-size: 0.78rem; line-height: 1.2; padding: 0.2rem 0.3rem; border-radius: 3px; background: rgba(255, 255, 255, 0.92); color: #1c2430; pointer-events: none; }
.swatches input.hex { width: 100%; box-sizing: border-box; }
#logo-preview, #favicon-preview { background: white; border-radius: 4px; }
#logo-preview { max-height: 4.5rem; }
#favicon-preview { width: 2.4rem; height: 2.4rem; object-fit: contain; }
.notice { background: #e7eef5; border: 1px solid var(--muted); padding: 0.7rem; }
label { display: grid; gap: 0.25rem; margin: 0.6rem 0; }
input, select, textarea { font: inherit; font-size: 1rem; padding: 0.45rem; border: 1px solid var(--muted); border-radius: 4px; background: white; width: 100%; box-sizing: border-box; }
.table-wrap { overflow: auto; }
.stock-scroll { max-height: calc(100vh - 16rem); }
.stock-scroll table { width: max-content; min-width: 100%; }
.stock-scroll thead th { position: sticky; top: 0; background: white; z-index: 3; }
.stock-scroll .freeze { position: sticky; background: white; z-index: 2; }
.stock-scroll thead .freeze { z-index: 4; }
.stock-scroll .pick { left: 0; width: 2.6rem; min-width: 2.6rem; max-width: 2.6rem; box-sizing: border-box; }
.stock-scroll .sku { left: 2.6rem; width: calc(10ch + 0.9rem); min-width: calc(10ch + 0.9rem); max-width: calc(10ch + 0.9rem); box-sizing: border-box; }
.stock-scroll .item-name { left: calc(2.6rem + 10ch + 0.9rem); width: max-content; max-width: 30vw; box-sizing: border-box; box-shadow: 4px 0 6px -4px rgba(28, 36, 48, 0.45); }
.order-scroll { max-height: calc(100vh - 16rem); }
.order-scroll table { width: max-content; min-width: 0; }
.order-scroll thead th { position: sticky; top: 0; background: white; z-index: 3; }
.order-scroll .freeze { position: sticky; background: white; z-index: 2; }
.order-scroll thead .freeze { z-index: 4; }
.order-scroll .code { left: 0; width: calc(10ch + 0.9rem); min-width: calc(10ch + 0.9rem); max-width: calc(10ch + 0.9rem); box-sizing: border-box; }
.order-scroll .item-name { left: calc(10ch + 0.9rem); width: max-content; max-width: 30vw; box-sizing: border-box; overflow: hidden; box-shadow: 4px 0 6px -4px rgba(28, 36, 48, 0.45); }
.order-scroll td.item-name span { display: inline-block; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.order-scroll .amount { text-align: center; }
.order-scroll input { width: 6rem; text-align: center; }
main a.button, main a.button:hover, main a.button:focus, main a.button:visited { color: var(--accent-ink); text-decoration: none; }
.stock-scroll tr.selected .freeze { background: #e7eef5; }
.stock-scroll .amount { text-align: center; }
.sync-progress { margin: 0; padding: 0.45rem 1rem 0.55rem; text-align: center; background: #e7eef5; font-weight: 700; }
.sync-progress[hidden] { display: none; }
.sync-progress.is-fault { background: #f8e6e6; }
.sync-progress.is-running::after { content: ""; display: block; height: 0.25rem; margin: 0.35rem auto 0; width: min(18rem, 70%); border-radius: 999px; background: linear-gradient(90deg, transparent, #1c2430, transparent); background-size: 45% 100%; background-repeat: no-repeat; animation: sync-slide 1.1s linear infinite; }
@keyframes sync-slide { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.sync-actions { display: flex; flex-wrap: wrap; justify-content: space-evenly; align-items: start; gap: 1.5rem; margin: 0.6rem 0; width: 100%; }
.sync-actions button:disabled { opacity: 0.45; }
.sync-actions form { display: grid; gap: 0.35rem; justify-items: center; margin: 0; width: calc(31ch + 1.6rem); }
.sync-actions button { width: 100%; box-sizing: border-box; text-align: center; }
.sync-actions.sync-one { justify-content: flex-start; }
.sync-run, .sync-fault { margin: 0; font-size: 0.75rem; text-align: center; }
.sync-fault:empty { display: none; }
.stock-scroll td.item-name span { display: inline-block; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
table { width: 100%; border-collapse: collapse; background: white; margin-top: 1rem; }
th, td { text-align: left; padding: 0.45rem; border-bottom: 1px solid #e4e9ee; vertical-align: top; white-space: nowrap; }
tr.selected td { background: #e7eef5; }
.scan { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; }
.scan label { flex: 1 1 12rem; margin: 0; }
pre { white-space: pre-wrap; background: white; padding: 0.8rem; border: 1px solid var(--muted); }
dialog.record-dialog { border: 0; border-radius: 6px; padding: 1.2rem 1.3rem 1.4rem; width: min(64rem, calc(100vw - 2rem)); background: var(--page); }
#app-busy-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(28, 36, 48, 0.45); }
#app-busy[open] { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 81; width: min(22rem, calc(100vw - 2rem)); margin: 0; }
#error-dialog { width: min(32rem, calc(100vw - 2rem)); }
dialog.record-dialog::backdrop { background: rgba(28, 36, 48, 0.45); }
dialog.record-dialog .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem 1.2rem; align-items: end; }
dialog.record-dialog.order-dialog { width: min(28rem, calc(100vw - 2rem)); }
.order-fields { display: grid; }
.order-fields > label, .order-pair label { margin: 0.35rem 0; }
.order-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; align-items: end; }
dialog.record-dialog .actions { margin-top: 0.8rem; }
@media (max-width: 800px) {
  .company-form, .font-choices, .swatches, dialog.record-dialog .form-grid { grid-template-columns: 1fr 1fr; }
}
.setup-note { background: white; border-radius: 4px; padding: 0.8rem 1rem 0.2rem; margin: 0.8rem 0 1rem; }
.setup-note ol { margin: 0.4rem 0 0.8rem; padding-left: 1.2rem; }
.setup-note a { color: inherit; }
.screen-tools { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.screen-tools h1 { margin: 0; }
.home-tools { margin-left: auto; align-items: center; }
.home-tools span { font-weight: 700; }
@media (display-mode: standalone) { .home-tools { display: none; } }
.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.6rem; }
.figures article { background: white; border: 1px solid var(--muted); padding: 0.65rem 0.75rem; }
.figures strong { display: block; font-size: 1.35rem; line-height: 1.2; color: inherit; }
.figures span { display: block; font-size: 0.85rem; }
.phone-field { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.phone-field select { width: 6.5rem; flex: 0 0 auto; }
.phone-field input { min-width: 12rem; flex: 1 1 16rem; }
.matches { display: grid; gap: 0.25rem; margin-top: 0.35rem; }
.matches button { text-align: left; background: white; color: var(--ink); }
.show-password { display: flex; align-items: center; gap: 0.4rem; font-weight: 400; }
.ticks { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 1rem; }
.ticks label { display: flex; align-items: center; gap: 0.4rem; margin: 0; }
th .sort { display: inline-flex; flex-direction: column; margin-left: 0.2rem; vertical-align: middle; }
th .sort button { background: transparent; color: inherit; padding: 0; font-size: 0.7rem; line-height: 0.85; }
th .sort button.on { color: var(--accent); }
#roles-backdrop { display: none; }
#roles-backdrop.is-open { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(28, 36, 48, 0.45); }
#roles-pop { display: none; }
#roles-pop.is-open { display: block; position: fixed; z-index: 41; top: 4rem; left: 50%; transform: translateX(-50%); width: min(40rem, calc(100vw - 2rem)); background: var(--page); border-radius: 6px; padding: 1rem 1.2rem; }
@media (max-width: 1024px) {
  button, .button, input:not([type=checkbox]):not([type=radio]):not([type=color]), select { min-height: 2.8rem; }
}
@media (max-width: 700px) {
  .menu-button { display: inline-block; }
  .site-links { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 40; flex-direction: column; align-items: stretch; background: var(--header); padding: 0.4rem 0.9rem 0.8rem; }
  .menu-toggle:checked ~ .site-links { display: flex; }
  nav details.menu > div { position: static; box-shadow: none; background: transparent; }
  nav details.menu a { color: var(--header-ink); }
  .company-form, .font-choices, .swatches, dialog.record-dialog .form-grid, .ticks, .order-pair, .figures { grid-template-columns: 1fr; }
  .screen-tools { align-items: stretch; }
  .home-tools { margin-left: 0; }
}

a.simple-mark { display: inline-flex; align-items: center; flex: 0 0 auto; line-height: 0; text-decoration: none; }
a.simple-mark img { height: 3.2rem; width: auto; max-width: 9rem; object-fit: contain; background: #fff; border-radius: 3px; }
header form { margin: 0; }
