: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; }
.brand { color: inherit; font-weight: 700; text-decoration: none; display: flex; gap: 0.75rem; align-items: center; height: 5rem; min-width: 0; max-width: 24rem; }
.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 0; box-sizing: border-box; }
.app-name { margin: 0; flex: 1 1 auto; min-width: 0; text-align: center; font-family: var(--heading-font, "Segoe UI", sans-serif); font-size: clamp(1rem, 1.5vw, 1.6rem); font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
nav { display: flex; align-items: center; }
.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; }
.sync-menu { margin: 0; }
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; }
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; }
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; }
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 { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.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 { grid-column: 1 / -1; }
.setup-note, fieldset { background: white; border: 1px solid var(--muted, #d6d3d1); border-radius: 4px; padding: 0.8rem 1rem; margin: 0.8rem 0; }
.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; }
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: var(--page, #f4f7f5); }
dialog.record-dialog::backdrop, #roles-backdrop.is-open { background: rgba(28, 25, 21, 0.45); }
#roles-backdrop { display: none; }
#roles-backdrop.is-open { display: block !important; position: fixed; inset: 0; z-index: 9998; }
#roles-pop { display: none; }
#roles-pop.is-open { display: block !important; position: fixed; z-index: 9999; top: 4.25rem; left: 50%; transform: translateX(-50%); width: min(32rem, calc(100vw - 1.5rem)); max-height: calc(100vh - 5.5rem); overflow: auto; padding: 0.9rem 1rem; border-radius: 4px; background: white; }
.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; }
.count-bar { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr auto auto; gap: 0.4rem; align-items: center; background: white; padding: 0.6rem; border: 1px solid var(--muted, #d6d3d1); border-radius: 4px; }
.count-bar input { min-height: 2.8rem; font-size: 1.05rem; }
#camera-view { width: 100%; max-height: 16rem; background: #111; border-radius: 4px; }
pre { white-space: pre-wrap; background: white; padding: 0.7rem; }
@media (max-width: 800px) {
  .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; }
  nav details.menu > div { position: static; box-shadow: none; min-width: 0; }
  .company-form, .swatches, .font-choices, .count-bar { grid-template-columns: 1fr; }
  header { padding: 0 0.7rem; gap: 0.4rem; }
  main { padding: 0.8rem; }
}
