:root {
  color-scheme: light;
  --brand: #00a761;
  /* Darker brand shades keep small white button labels and links readable. */
  --accent: #00854d;
  --accent-hover: #006f40;
  --ink: #1a1a1a;
  --heading: #232323;
  --muted: #6c6c6c;
  --border: #e6e6e6;
  --input-border: #8a8a8a;
  --surface: #ffffff;
  --mint: #eaf8f1;
  --mint-ink: #00683c;
  --mint-border: #b7e2cd;
  --row-hover: #f5fbf8;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--surface); font-size: 14px;
}
.account-panel { max-width: 640px; padding: 24px; border: 1px solid var(--border); border-radius: 9px; }
.account-form { display: grid; gap: 18px; }
.account-form input[type=submit] { justify-self: start; }
.account-pagination { align-items: center; padding: 20px 0; }
.temporary-password { overflow-wrap: anywhere; padding: 16px; background: var(--mint); font-size: 20px; }
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
input[type=checkbox] { accent-color: var(--accent); }
button, .button, input[type=submit] { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 15px; border: 1px solid transparent; border-radius: 8px; background: var(--accent); color: white; cursor: pointer; font-weight: 600; text-decoration: none; }
button:hover, .button:hover, input[type=submit]:hover { background: var(--accent-hover); }
button:disabled, input:disabled { opacity: .6; cursor: wait; }
.secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
.secondary:hover, .button.secondary:hover { background: var(--mint); border-color: var(--mint-border); }
.small { min-height: 32px; padding: 5px 10px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.app-header { background: var(--surface); border-top: 3px solid var(--brand); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 36px; padding: 0 32px; min-height: 76px; flex-wrap: wrap; }
.brand { color: var(--heading); font-size: 17px; font-weight: 750; white-space: nowrap; }
.brand span { display: block; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin-top: 3px; }
nav { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
nav a { padding: 12px; text-decoration: none; color: var(--muted); border-radius: 8px; font-weight: 600; }
nav a:hover { background: var(--row-hover); color: var(--mint-ink); }
nav a[aria-current=page] { background: var(--mint); color: var(--mint-ink); }
main { max-width: 1800px; margin: 0 auto; padding: 32px; }
h1, h2, h3 { color: var(--heading); }
h1 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.035em; margin: 4px 0 8px; }
h2 { font-size: 17px; }
p { line-height: 1.6; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 700; color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.page-heading p { margin-bottom: 0; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; padding: 20px; background: white; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 150px; }
.field label, .field > div > label { display: block; font-size: 12px; font-weight: 650; margin-bottom: 4px; }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; border: 1px solid var(--input-border); border-radius: 8px; padding: 9px 10px; background: var(--surface); color: var(--ink); min-height: 38px; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.field input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.search-field { min-width: 220px; flex: 1; }
.filter-actions { min-height: 38px; }
.table-tools { display: flex; justify-content: space-between; align-items: center; padding: 4px 0 14px; gap: 16px; font-size: 12px; }
.columns-menu { position: relative; }
.columns-menu summary { cursor: pointer; background: white; border: 1px solid var(--border); border-radius: 5px; padding: 8px 12px; }
.column-options { position: absolute; right: 0; min-width: 220px; max-width: min(360px, 90vw); max-height: 65vh; overflow-y: auto; background: white; border: 1px solid var(--border); padding: 12px; z-index: 6; box-shadow: 0 8px 24px rgb(26 26 26 / 10%); border-radius: 8px; }
.column-options label { display: block; padding: 6px; }
.table-scroll { overflow: auto; max-height: 65vh; background: white; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th { position: sticky; top: 0; background: var(--mint); z-index: 2; text-align: left; white-space: nowrap; padding: 13px 12px; border-bottom: 1px solid var(--mint-border); }
th a { color: var(--ink); text-decoration: none; }
td { padding: 5px 8px; border-bottom: 1px solid var(--border); vertical-align: top; min-width: 140px; max-width: 420px; }
td:first-child { min-width: 104px; padding: 15px 12px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--row-hover); }
.cell-button { display: block; background: transparent; color: var(--ink); padding: 8px 4px; min-height: 34px; text-align: left; font-weight: 400; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.cell-button:hover { background: var(--mint); }
.cell-text { display: block; padding: 9px 4px; white-space: nowrap; }
.cell-status { display: block; white-space: normal; overflow-wrap: anywhere; max-width: 360px; line-height: 1.5; color: #934019; font-size: 12px; }
.cell-status:empty { display: none; }
.inline-cell.is-editing { min-width: 0; }
td:has(.inline-cell.is-editing) { background: var(--mint); box-shadow: inset 0 0 0 2px var(--accent); }
.inline-form .field { min-width: 0; gap: 0; }
.inline-form .field label {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.inline-form .field input:not([type=checkbox]), .inline-form .field select, .inline-form .field textarea {
  min-width: 0; min-height: 34px; padding: 6px 4px; border-color: transparent;
  border-radius: 2px; font-size: 13px; background: white;
}
.inline-form .field input[type=checkbox] { margin: 7px 4px; }
.inline-form .field textarea { resize: vertical; }
.inline-form .field :focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.inline-actions { display: flex; justify-content: flex-end; gap: 4px; padding-top: 3px; }
.inline-actions button, .inline-actions input[type=submit] { min-height: 24px; padding: 2px 7px; font-size: 11px; border-radius: 3px; }
.inline-form .lookup-options { font-size: 12px; }
.inline-form .lookup-options li { padding: 6px; }
.inline-form .related-context { display: none; }
.inline-form .input-status { font-size: 11px; }
.list-more { padding: 20px; text-align: center; }
.status-line { text-align: center; min-height: 22px; }
.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); }
.notice { padding: 14px 18px; background: var(--mint); border: 1px solid var(--mint-border); border-radius: 8px; margin-bottom: 20px; line-height: 1.6; }
.notice.error { background: #fff4ee; border-color: #e6bcaa; color: #7d321e; }
.notice h2 { margin-top: 0; }
.import-notice-dismissible { position: relative; padding-right: 54px; }
.import-dismiss { position: absolute; top: 10px; right: 10px; width: 32px; min-height: 32px; padding: 0; background: transparent; color: inherit; font-size: 24px; font-weight: 400; line-height: 1; }
.import-dismiss:hover { background: rgb(0 0 0 / 6%); }
.back-link { display: inline-block; margin-bottom: 20px; }
.record-modal { width: min(1100px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 28px; border: 1px solid var(--border); border-radius: 10px; background: white; color: var(--ink); overflow: auto; }
.record-modal::backdrop { background: rgb(26 26 26 / 45%); }
body:has(.record-modal[open]) { overflow: hidden; }
.record-modal .modal-close { position: sticky; top: 0; float: right; width: 38px; padding: 0; font-size: 25px; z-index: 2; }
.record-modal h1 { overflow-wrap: anywhere; }
.record-modal .record-form, .record-modal .record-details { max-width: none; }
.record-form, .record-details { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 24px; max-width: 1050px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin: 24px 0; }
.record-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
dt { color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 5px; }
dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.lookup-input { position: relative; }
.lookup-input::after { content: "▾"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.field .lookup-input input, .inline-form .field .lookup-input input { width: 100%; min-width: 0; padding-right: 28px; }
.lookup-options { position: fixed; inset: auto; list-style: none; max-height: 240px; overflow: auto; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: white; color: var(--ink); box-shadow: 0 6px 18px rgb(26 26 26 / 15%); }
.lookup-options li { padding: 10px; cursor: pointer; white-space: normal; }
.lookup-options li:hover, .lookup-options li[aria-selected=true] { background: var(--mint); color: var(--mint-ink); }
.lookup-options .lookup-message { color: var(--muted); cursor: default; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.input-status, .related-context { font-size: 12px; color: var(--muted); white-space: normal; }
.related-context:empty, .input-status:empty { display: none; }
/* Dedicated, locally branded sign-in layout; business-list pages stay unchanged. */
.auth-layout { display: grid; grid-template-columns: minmax(0, 43fr) minmax(0, 57fr); gap: 24px; min-height: 100svh; max-width: none; padding: 16px; }
.auth-panel { min-width: 0; padding: 32px clamp(20px, 4vw, 60px) 48px; }
.auth-logo { display: block; width: 223px; max-width: 100%; height: auto; margin-bottom: clamp(64px, 10vh, 106px); }
.sign-in { max-width: 480px; margin: 0; }
.sign-in h1 { font-size: 34px; line-height: 1.5; letter-spacing: -.025em; margin: 0 0 10px; }
.sign-in-description { color: var(--muted); font-size: 18px; line-height: 1.6; margin: 0 0 32px; }
.sign-in .field { min-width: 0; margin: 0 0 24px; }
.sign-in .field label { font-size: 14px; font-weight: 500; }
.sign-in .field input { min-height: 52px; padding: 14px; font-size: 16px; }
.sign-in .sign-in-submit { width: 100%; min-height: 48px; font-size: 16px; margin-top: 8px; }
.sign-in-help { color: var(--muted); font-size: 14px; margin: 24px 0 0; }
.auth-artwork { position: relative; min-height: 600px; border-radius: 24px; overflow: hidden; background: var(--mint); }
.auth-artwork-image { position: absolute; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) {
  .auth-page .auth-layout { display: block; padding: 24px; }
  .auth-panel { max-width: 560px; margin: 0 auto; padding: 24px 16px; }
  .auth-logo { margin-bottom: 64px; }
  .sign-in { max-width: none; }
  .auth-artwork { display: none; }
}
@media (max-width: 480px) {
  .auth-page .auth-layout { padding: 20px; }
  .auth-panel { padding: 12px 0; }
  .auth-logo { margin-bottom: 48px; }
  .sign-in h1 { font-size: 30px; }
  .sign-in-description { font-size: 16px; }
}
.skip-link { position: fixed; left: 10px; top: -60px; z-index: 10; padding: 10px; background: white; }
.skip-link:focus { top: 10px; }
@media (max-width: 720px) {
  main { padding: 20px 12px; }
  .app-header { padding: 16px; gap: 16px; }
  nav { order: 3; flex-basis: 100%; gap: 0; }
  nav a { padding: 10px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .form-grid, .record-details { grid-template-columns: 1fr; }
  .filters .field { flex: 1 1 180px; }
  .table-tools { align-items: flex-start; }
}
/* Source-field forms remain grouped and usable on narrow screens. */
.field-group { border: 1px solid var(--border); border-radius: 8px; margin: 1rem 0; padding: 1rem; min-width: 0; }
.field-group legend { font-weight: 600; padding: 0 .4rem; }
.source-warning { background: #fff8e6; border: 1px solid #e6cc83; padding: 1rem; border-radius: 6px; margin: 1rem 0; }
.source-warning ul { margin-bottom: 0; }
.import-upload { margin-top: 24px; }
.import-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.import-counts dd { font-size: 22px; font-weight: 600; }
.import-headers { max-height: 260px; overflow: auto; overflow-wrap: anywhere; }
