:root { color: var(--ink, #1c1917); background: var(--page, #f4f7f5); font-family: var(--body-font, "Segoe UI", sans-serif); line-height: 1.45; }
body { margin: 0; }
a { color: #6d28d9; text-decoration: none; }
a:hover, a:focus, a:visited { text-decoration: none; }
[hidden] { display: none !important; }
header { display: flex; flex-wrap: nowrap; gap: 1rem; align-items: center; height: 5rem; min-height: 5rem; max-height: 5rem; padding: 0 1.2rem; background: var(--header, #12382c); color: var(--header-ink, #f4f7f5); position: relative; z-index: 20; overflow: visible; }
body > header { position: sticky; top: 0; }
.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 16rem; max-width: 16rem; }
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand img { height: 5rem; width: auto; max-width: 16rem; object-fit: contain; object-position: left center; padding: 0.4rem; background: #fff; 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, "Segoe UI", sans-serif); font-size: clamp(1rem, 1.5vw, 1.35rem); font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-name { margin: 0; font-size: 0.75rem; line-height: 1.1; font-weight: 700; }
nav { display: flex; align-items: center; gap: 0.7rem; flex: 0 0 auto; }
.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: inherit; }
.site-links { display: flex; gap: 0.7rem; align-items: center; }
button.download-app { order: 2; margin: 0; background: none; color: var(--header-ink, #f4f7f5); border: 0; border-radius: 0; padding: 0; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
button.download-app:hover, button.download-app:focus { background: none; color: var(--header-ink, #f4f7f5); text-decoration: none; }
nav .site-links { order: 1; }
@media (display-mode: standalone) { #download-app { display: none; } }
button.copy { padding: 0.2rem 0.55rem; }
.site-links > a, nav details.menu summary, .menu-button { color: var(--header-ink, #f4f7f5); 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, .menu-button:hover, .menu-button:focus { color: var(--header-ink, #f4f7f5); text-decoration: none; }
.site-links > a[aria-current="page"], nav details.menu summary[aria-current="page"] { background: rgba(255, 255, 255, 0.16); border-radius: 4px; padding: 0.15rem 0.4rem; text-decoration: none; }
nav details.menu { position: relative; }
nav details.menu summary { list-style: none; cursor: pointer; }
nav details.menu summary::-webkit-details-marker { display: none; }
nav details.menu summary::after { content: " ▾"; }
nav details.menu > div { position: absolute; top: calc(100% + 0.55rem); right: 0; min-width: 16rem; background: white; color: #1c1917; 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: #1c1917; font-weight: 700; text-decoration: none; padding: 0.55rem 0.9rem; }
nav details.menu a:hover, nav details.menu a:focus, nav details.menu a:visited { text-decoration: none; background: #eef4f1; }
nav details.menu a[aria-current="page"] { background: #eef4f1; text-decoration: none; }
button, .button { background: var(--accent, #111); color: var(--accent-ink, white); border: 0; border-radius: 4px; padding: 0.55rem 0.8rem; font: inherit; font-weight: 700; cursor: pointer; }
button:disabled { background: #d6d3d1; color: #57534e; cursor: not-allowed; }
main { padding: 1.2rem; max-width: 1100px; }
h1, h2, h3 { font-family: var(--heading-font, "Segoe UI", sans-serif); }
label { display: grid; gap: 0.25rem; margin: 0.6rem 0; }
label.phone-field { grid-template-columns: 6.5rem minmax(14rem, 1fr); }
label.phone-field > span { grid-column: 1 / -1; }
label.phone-field input { min-width: 14rem; }
input, select, textarea { font: inherit; padding: 0.45rem; border: 1px solid var(--muted, #d6d3d1); border-radius: 4px; background: white; width: 100%; box-sizing: border-box; }
textarea { min-height: 5rem; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { text-align: left; padding: 0.45rem; border-bottom: 1px solid var(--muted, #d6d3d1); vertical-align: top; }
.notice { background: #fff4d6; border: 1px solid #d6d3d1; padding: 0.7rem; }
.actions, .row-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.row-actions form { margin: 0; }
.screen-tools { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.screen-tools h1 { margin: 0.2rem 0; }
.actions.home-tools { margin: 0 0 0 auto; flex-wrap: nowrap; justify-content: flex-end; }
.home-tools span { white-space: nowrap; }
.home-tools button { width: auto; }
@media (display-mode: standalone) { .home-tools { display: none; } }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.7rem; margin: 0; }
.facts div { background: white; border-radius: 4px; padding: 0.7rem 0.8rem; }
.facts dt { margin: 0; font-size: 0.85rem; }
.facts dd { margin: 0.15rem 0 0; font-size: 1.35rem; font-weight: 700; }
.company-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem 1rem; align-items: end; }
.wide, .company-form > button, .swatches, .authority-list { grid-column: 1 / -1; }
.authority-list { border: 1px solid var(--muted, #d6d3d1); border-radius: 4px; padding: 0.8rem 1rem; background: white; display: grid; gap: 0.6rem; }
.authority-card { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.7rem; align-items: start; margin: 0; padding: 0.55rem 0.6rem; border: 1px solid var(--muted, #d6d3d1); border-radius: 4px; }
.authority-card input { margin-top: 0.35rem; }
.authority-card strong { grid-column: 2; }
.authority-card span { grid-column: 2; font-size: 0.92rem; }
.authority-guide { grid-column: 1 / -1; }
.authority-guide .scope-list { margin: 0.4rem 0 0.6rem 1.1rem; padding: 0; }
.authority-guide .scope-list code { font-size: 0.9rem; }
.setup-note, fieldset { background: white; border: 1px solid var(--muted, #d6d3d1); border-radius: 4px; padding: 0.8rem 1rem; margin: 0.8rem 0; }
.integration-block { background: white; border: 2px solid var(--muted, #d6d3d1); border-radius: 6px; padding: 1rem 1.1rem 1.2rem; margin: 1.2rem 0; }
.integration-block > h2 { margin: 0 0 0.45rem; font-size: 1.35rem; }
.integration-block > .block-status { margin: 0 0 0.8rem; font-weight: 700; }
.integration-block .setup-note { margin-top: 0; }
.integration-block .setup-note h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.integration-block .actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 0.8rem; }
.integration-block a.button { display: inline-block; padding: 0.45rem 0.9rem; border: 1px solid var(--accent, #12382c); color: var(--accent, #12382c); text-decoration: none; border-radius: 4px; font-weight: 700; }
.show-password, .tick { display: flex; align-items: center; gap: 0.4rem; margin: 0.2rem 0; }
.show-password input, .tick input { width: auto; }
.ticks { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.3rem 0.8rem; }
.record-search { max-width: 28rem; }
.record-search input { width: 100%; }
tr.selected { background: #fff4d6; }
table.record-table tbody tr { cursor: pointer; }
.table-scroll { overflow-x: auto; }
body.list-page { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.list-page main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; max-width: none; width: 100%; box-sizing: border-box; }
body.list-page main > :not(.table-scroll) { flex: 0 0 auto; }
body.list-page .table-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; margin-top: 1rem; }
body.list-page .table-scroll table { margin-top: 0; border-collapse: separate; border-spacing: 0; }
body.list-page .table-scroll thead th { position: sticky; top: 0; z-index: 2; background: #fff; box-shadow: inset 0 -1px 0 var(--muted, #d6d3d1); }
.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-done { background: #e5f0e4; }
.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: flex-start; align-items: start; gap: 1.5rem; margin: 0; }
.sync-actions.sync-one { justify-content: flex-start; }
.sync-actions form { display: grid; gap: 0.35rem; justify-items: center; margin: 0; width: calc(14rem + 1.6rem); }
.sync-actions button { width: 100%; box-sizing: border-box; text-align: center; }
.sync-actions button:disabled { opacity: 0.45; }
.sync-run, .sync-fault { margin: 0; font-size: 0.75rem; text-align: center; }
.sync-fault:empty { display: none; }
button.sync-blocked { text-decoration: line-through; text-decoration-color: #111; text-decoration-thickness: 2px; }
button.category-pick { width: 100%; text-align: left; background: white; color: #1c1917; border: 1px solid var(--muted, #d6d3d1); font-weight: 400; }
.tick-list { display: grid; gap: 0.35rem; margin: 0.8rem 0; max-height: min(24rem, 50vh); overflow: auto; }
.tick-row { display: flex; align-items: center; gap: 0.55rem; margin: 0; font-weight: 400; }
.tick-row input[type="checkbox"] { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
dialog.record-dialog { border: 0; border-radius: 6px; padding: 1.2rem; width: min(40rem, calc(100vw - 1rem)); max-height: calc(100vh - 1rem); overflow: auto; background: #ffffff; color: #1c1917; opacity: 1; box-shadow: 0 12px 40px rgba(28, 25, 21, 0.35); }
dialog.record-dialog[open] { position: fixed; z-index: 10050; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; opacity: 1; }
#app-busy-backdrop { position: fixed; inset: 0; z-index: 10040; background: rgba(28, 25, 21, 0.55); }
#app-busy.record-dialog[open] { z-index: 10050; width: min(22rem, calc(100vw - 2rem)); opacity: 1; }
dialog.record-dialog::backdrop, #roles-backdrop.is-open { background: rgba(28, 25, 21, 0.55); }
#roles-backdrop { display: none; }
#roles-backdrop.is-open { display: block !important; position: fixed; inset: 0; z-index: 10040; }
#roles-dialog.record-dialog[open] { z-index: 10050; width: min(36rem, calc(100vw - 1.5rem)); }
#role-form-dialog.record-dialog[open] { z-index: 10060; width: min(36rem, calc(100vw - 1.5rem)); }
.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
.colour-block { position: relative; display: block; height: 5.5rem; }
.colour-block input[type="color"] { height: 100%; padding: 0; }
.colour-hint { position: absolute; left: 0.4rem; right: 0.4rem; bottom: 0.4rem; text-align: center; font-size: 0.78rem; background: rgba(255,255,255,0.92); pointer-events: none; }
.font-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.take-end { margin: 0 0 0.8rem; }
a.button, a.button:hover, a.button:focus, a.button:visited { display: inline-block; color: var(--accent-ink, white); text-decoration: none; }
.count-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; background: white; padding: 0.6rem; border: 1px solid var(--muted, #d6d3d1); border-radius: 4px; }
.count-bar input { flex: 1 1 12rem; min-height: 2.8rem; font-size: 1.05rem; }
.count-bar button { flex: 0 0 auto; }
#camera-view { width: 100%; max-height: 55vh; object-fit: cover; background: #111; border-radius: 4px; }
#pop-matches { display: grid; gap: 0.4rem; margin: 0.6rem 0; }
pre { white-space: pre-wrap; background: white; padding: 0.7rem; }
@media (max-width: 1024px) {
  .menu-button { display: inline; }
  .site-links { display: none; position: absolute; top: 5rem; right: 0.6rem; left: 0.6rem; background: white; color: #1c1917; padding: 0.4rem; border-radius: 4px; flex-direction: column; align-items: stretch; }
  .menu-toggle:checked ~ .site-links { display: flex; }
  .site-links > a, nav details.menu summary, nav details.menu a { color: #1c1917; }
  .site-links > a[aria-current="page"], nav details.menu summary[aria-current="page"] { background: #eef4f1; color: #1c1917; text-decoration: none; }
  nav details.menu > div { position: static; box-shadow: none; min-width: 0; }
  button, .button, input:not([type=checkbox]):not([type=radio]):not([type=color]), select { min-height: 2.8rem; }
  header { padding: 0 0.7rem; gap: 0.4rem; }
  main { padding: 0.8rem; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .company-form, .swatches, .font-choices, .facts { grid-template-columns: 1fr; }
  .screen-tools { flex-wrap: wrap; }
  .actions.home-tools { flex: 1 0 100%; margin-left: auto; justify-content: flex-end; }
}

a.simple-mark { display: inline-flex; align-items: center; justify-content: center; align-self: center; flex: 0 0 9rem; width: 9rem; height: 3.2rem; min-width: 9rem; max-width: 9rem; max-height: 3.2rem; overflow: hidden; line-height: 0; text-decoration: none; }
a.simple-mark img { display: block; width: 9rem; height: 3.2rem; max-width: 9rem; max-height: 3.2rem; object-fit: contain; object-position: center; background: #fff; border-radius: 3px; }
header form { margin: 0; }
