/* LastStop redesign: account area styles (stage 4: People, Access, Company, Modules, Audit log, Sync, Export, Companies,
   Your settings). Uses only the role tokens from tokens.css and the components from components.css; never restyles a
   component, only lays out the account screens' own classes (acct-*) and the older admin markup they still carry. */

/* ---------- the app's account screens' head (public/assets/app.js: Your settings, Sync, Export): the title or the hero with its
   actions; the server pages' list heads are the core .lh since stage 6 ---------- */
.ls-shell .pane-list > .acct-head { position: relative; z-index: auto; display: flex; align-items: center; justify-content: flex-start; gap: 12px 14px; flex-wrap: wrap; padding: 28px 16px 18px; border: 0; box-shadow: none; background: transparent; }
@media (min-width: 1024px) { .ls-shell .pane-list > .acct-head { padding: 48px 6px 22px; } }
.acct-head > .acct-title { flex: 1 1 auto; min-width: 0; }
.acct-word { font-size: var(--fs-5); }
.acct-title { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .14em; font-family: var(--font-head); font-weight: 600; font-size: var(--fs-5); line-height: 1.05; letter-spacing: -.02em; color: var(--heading); min-width: 0; }
.acct-title .hero-figure { margin-right: .06em; font-size: 64px; } /* the same hero size as every list head (.lh, stage 6) */
@media (max-width: 759px) { .acct-title .hero-figure { font-size: 52px; } }
.acct-title .acct-word { font-size: var(--fs-4); font-weight: 600; }
.acct-title .hero-figure .fig { position: relative; z-index: 1; }
.acct-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ls-shell .pane-list > .list-body { padding: 0 8px; }
.acct-rows { margin: 0; }
.acct-rows > li { list-style: none; }
.acct-row .pill { margin-left: auto; }
.acct-row.is-inactive .row-name { color: var(--muted); }
/* paging links show only once every row shows (ls-ui.js trims the list until "Show all"; without JavaScript nothing is trimmed) */
.acct-after { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 12px 8px 0; }
[data-ls-list]:not(.is-all):has(> .is-over) ~ .acct-after { display: none; }
.acct-after .showall { width: auto; padding: 0 20px; margin: 0; }
@media (min-width: 1024px) {
  .ls-shell .pane-list > .list-body { padding: 0; }
}

/* ---------- the detail (the panel on desktop, the sheet on a phone) ---------- */
body.is-admin .ls-shell[data-pane="detail"] .pane-detail .detail-inner { padding: 4px 20px 32px; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1024px) {
  body.is-admin .ls-shell[data-pane="detail"] .pane-detail .detail-inner { padding: 4px 28px 40px; }
  body.is-admin[data-section="admin.access"] .ls-shell { --panel-w: 640px; }
}
.acct-dtop { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 12px; }
.acct-dhead { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.acct-dtitle { margin: 0; overflow-wrap: anywhere; }
.acct-dmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.acct-dsub { font-size: 13.5px; color: var(--muted); }
.acct-dacts { flex: none; gap: 10px; }
/* with a primary action the actions take their own line under the title; "..." alone sits beside the title */
.acct-dacts:has(> .is-primary) { flex: 1 1 100%; }
.acct-dacts > .is-primary { flex: 1 1 auto; max-width: 340px; }
.acct-reveal:not(:has(.reveal, .form-notice, .form-error:not([hidden]))) { display: none; }
.acct-reveal { display: flex; flex-direction: column; gap: 10px; }
.reveal-slot:empty { display: none; }
.acct-note { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }

/* label and value facts */
.acct-facts { display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 10px 16px; margin: 0; padding: 14px 16px; border-radius: var(--r-3); background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.acct-facts dt { margin: 0; color: var(--muted); font-size: 13px; }
.acct-facts dd { margin: 0; min-width: 0; color: var(--ink); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.acct-facts dd .chips-inline { display: inline-flex; flex-wrap: wrap; gap: 4px; }
@media (max-width: 759px) {
  .acct-facts { grid-template-columns: 1fr; gap: 2px; }
  .acct-facts dd + dt { margin-top: 10px; }
}
.signin-panel { display: flex; flex-direction: column; gap: 12px; }
.access-signin { margin: 4px 0 14px; }
.access-signin a { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.signin-panel .form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 759px) { .signin-panel .form-actions .btn { flex: 1 1 100%; justify-content: center; } }

/* sections */
.acct-folds { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.acct-fold .fold-title { margin: 0; }
.acct-fold .fold-b { padding: 4px 6px 22px; }
.acct-fold.is-open .fold-h .t { color: var(--accent-text); }

/* forms inside the account screens: the older field markup on the theme */
.acct-form { display: flex; flex-direction: column; gap: 14px; }
.acct-form .form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acct-form .segments { background: var(--surface-2); border: 1px solid var(--line); }
.acct-form .segment.is-active { background: var(--surface); color: var(--heading); box-shadow: 0 0 0 1px var(--line-2); }
.acct-form .check-row { color: var(--ink); }
.acct-form .check-row small { display: block; color: var(--muted); font-size: 12.5px; }
.acct-form .scope-list { display: flex; flex-direction: column; padding: 4px 0 0 4px; }
.acct-form .scope-list[hidden] { display: none; }
.acct-form fieldset { border: 0; padding: 0; margin: 0; }
.acct-form legend { padding: 0; margin-bottom: 6px; }

/* the older admin markup still carried inside the account screens */
.is-admin .pane-detail .form-notice { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.btn.is-danger-text, .menu .mi.is-danger-text { color: var(--bad); }
html[data-theme="dark"] .btn.is-danger-text, html[data-theme="dark"] .menu .mi.is-danger-text { color: #ff6b5f; }

/* ---------- Access: one section per module, each page's none / view / edit control inside ---------- */
.access-matrix .access-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.access-matrix .access-row { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.access-matrix .access-row:first-child { border-top: 0; }
.access-matrix .access-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 180px; }
.access-matrix .access-label { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--heading); }
.access-matrix .access-default { font-size: 12.5px; color: var(--muted); }
.access-matrix .access-default b { color: var(--ink-2); font-weight: 600; }
.access-matrix .access-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.access-matrix .segments { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.access-matrix .segment { border-radius: 999px; min-height: 34px; padding: 0 12px; color: var(--ink-2); font-family: var(--font-head); font-weight: 600; font-size: 13px; background: none; border: 0; cursor: pointer; }
.access-matrix .segment:disabled { cursor: default; opacity: .45; }
.access-matrix .segment.is-active { background: var(--accent-fill); color: var(--accent-ink); opacity: 1; box-shadow: none; }
html[data-theme="dark"] .access-matrix .segment.is-active { box-shadow: 0 0 16px -4px var(--accent-glow); }
.access-matrix .has-override .segment.is-active { background: var(--rev); color: #1a1d14; }
.access-matrix .custom-mark { color: var(--rev); font-family: var(--font-head); }
.access-matrix .reset-cell { color: var(--accent-text); font-family: var(--font-head); font-weight: 600; font-size: 13px; background: none; border: 0; cursor: pointer; }
.access-group.is-off .fold-h .t { color: var(--muted); }

/* ---------- a screen that is one page (Company, Your settings): the head, then the sections ---------- */
body.is-admin .ls-shell[data-pane="page"] .pane-detail .detail-inner, .ls-shell[data-ctx="settings"][data-pane="page"] .pane-detail .detail-inner { display: flex; flex-direction: column; gap: 18px; padding: 24px 16px 32px; max-width: var(--col); }
@media (min-width: 1024px) {
  body.is-admin .ls-shell[data-pane="page"] .pane-detail .detail-inner, .ls-shell[data-ctx="settings"][data-pane="page"] .pane-detail .detail-inner { padding: 20px 6px 40px; margin: 0 auto; }
}
.acct-phead { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.acct-phead .acct-title { flex: 0 1 auto; }
.acct-phead .acct-acts { margin-left: auto; }

/* the Company form: Save shows once a field changed (app.js marks the form is-clean until then; without JavaScript it shows) */
.company-form.is-clean [data-save-bar] { display: none; }
.acct-savebar { position: sticky; bottom: 12px; z-index: 3; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: ls-slide-down var(--t) var(--ease); }
@media (max-width: 1023px) { .acct-savebar { bottom: calc(var(--dock-h) + var(--sab) + 12px); } }
.company-form .color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.company-form .color-field { display: flex; flex-direction: column; gap: 6px; }
.company-form .color-inputs { display: flex; align-items: center; gap: 8px; }
.company-form input[type="color"] { width: 46px; height: 46px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-2); background: none; cursor: pointer; flex: none; }
.company-form .contrast-line { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border-radius: var(--r-2); font-size: 14px; }
.company-form .contrast-line.is-ok { background: var(--ok-soft); color: var(--ok); }
.company-form .contrast-line.is-bad { background: var(--bad-soft); color: var(--bad); }
.company-form .logo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.company-form .logo-text { display: flex; flex-direction: column; gap: 10px; flex: 1 1 200px; }
.company-form .theme-segments { align-self: flex-start; }
.company-form .brand-preview { border-radius: var(--r-3); overflow: hidden; }
.acct-lead { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); max-width: 62ch; }
.acct-fold .flat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.acct-fold .flat-list > li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.acct-fold .flat-list > li:first-child { border-top: 0; }
.acct-fold .flat-title { font-family: var(--font-head); font-weight: 600; font-size: 14.5px; color: var(--heading); }
.acct-fold .flat-sub { font-size: 13px; color: var(--muted); line-height: 1.4; }
.acct-block { display: flex; flex-direction: column; gap: 10px; }
.acct-h2 { margin: 0; font-family: var(--font-head); font-size: 16px; font-weight: 600; color: var(--heading); }
.acct-block .kv { display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.acct-block .kv dt { color: var(--muted); }
.acct-block .kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.acct-facts code, .acct-block code { font-size: 13px; color: var(--ink-2); }
.acct-fold .module-toggle-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.acct-fold .module-toggle-row .flat-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* J70: a company's Locations on Admin > Companies: one row per location, Rename opens its form below the row. */
.acct-fold .loc-row { display: block; }
.acct-fold .loc-row.is-archived, .acct-fold .loc-edit > summary { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.acct-fold .loc-edit > summary { list-style: none; cursor: pointer; }
.acct-fold .loc-edit > summary::-webkit-details-marker { display: none; }
.acct-fold .loc-row .flat-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.acct-fold .loc-row.is-inactive .flat-title { color: var(--muted); }
.acct-fold .loc-edit[open] > summary .btn { visibility: hidden; }
.acct-fold .loc-edit > form { margin-top: 12px; }
.acct-fold .loc-add { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.acct-foot { margin: 24px 16px 0; font-size: 13px; color: var(--muted); }
.acct-foot a { color: var(--accent-text); }

/* ---------- the app's account screens (public/assets/app.js): Your settings, Sync, Export ---------- */
.ls-shell[data-ctx="sync"][data-pane="detail"] .pane-detail .detail-inner, .ls-shell[data-ctx="export"][data-pane="detail"] .pane-detail .detail-inner { padding: 4px 20px 32px; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1024px) {
  .ls-shell[data-ctx="sync"][data-pane="detail"] .pane-detail .detail-inner, .ls-shell[data-ctx="export"][data-pane="detail"] .pane-detail .detail-inner { padding: 4px 28px 40px; }
  .ls-shell[data-ctx="sync"], .ls-shell[data-ctx="export"] { --panel-w: 680px; }
}
.ls-shell .pane-list > .acct-head .tabsel { order: 3; }
.ls-shell .pane-list > .acct-head .acct-acts { order: 4; }
.ls-shell .pane-list > .acct-head .tabsel > summary { min-height: 44px; }
.menu .mi .mi-l { flex: 1; min-width: 0; }
/* the older panels inside these details, on the theme */
.ls-shell[data-ctx="sync"] .pane-detail .panel, .ls-shell[data-ctx="export"] .pane-detail .panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: none; }
.ls-shell .pane-detail .acct-facts.kv { display: grid; }

/* Sync's overview */
.sync-stop-block { margin: 0 0 14px; }
.sync-stop-block .btn.is-stop { width: 100%; min-height: 52px; background: var(--bad); border-color: var(--bad); color: #fff; font-size: 16px; }
html[data-theme="dark"] .sync-stop-block .btn.is-stop { background: #d92d20; border-color: #d92d20; box-shadow: 0 0 0 1px rgba(228, 55, 43, .25), 0 10px 30px -8px rgba(228, 55, 43, .55); }
.sync-stopped { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-3); background: var(--bad-soft); color: var(--bad); font-size: 14px; line-height: 1.45; }
.sync-stopped .icon { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.sync-stopped b { color: inherit; }
.sync-stopped .form-actions { margin-top: 8px; }
.sync-runner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin: 0 0 6px; border-radius: var(--r-3); background: var(--surface-2); border: 1px solid var(--line); }
.sync-runner.is-stale { border-color: var(--bad); }
.sync-runner-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sync-runner-t { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--heading); }
.sync-runner-s { font-size: 13px; color: var(--muted); }
.sync-sub { margin: 18px 6px 6px; }
.sync-note { margin: 8px 6px; }
.acct-row.is-static { cursor: default; }
.acct-row.is-static:hover { background: none; }
.sync-mode-block { display: flex; flex-direction: column; gap: 8px; }
.sync-mode-block .segments { display: flex; width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.sync-mode-block .segment { flex: 1; border-radius: 999px; min-height: 40px; background: none; border: 0; color: var(--ink-2); font-family: var(--font-head); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.sync-mode-block .segment.is-active { background: var(--accent-fill); color: var(--accent-ink); }
.sync-mode-block .segment:disabled:not(.is-active) { opacity: .45; cursor: default; }
.sync-filter-fold { margin: 0 0 8px; }
.sync-filter-fold .sync-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; background: none; padding: 0; position: static; }
.acct-fold .allow-list, .acct-fold .tab-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* Export */
.acct-fold .export-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.acct-fold .export-part { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.acct-fold .export-part:first-child { border-top: 0; }
.acct-fold .export-part .ep-name { font-family: var(--font-head); font-weight: 600; color: var(--heading); overflow-wrap: anywhere; }
.acct-fold .export-part .ep-rows { color: var(--ink-2); }
.acct-fold .export-part .ep-sha { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.acct-fold .export-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.acct-fold .panel-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; color: var(--ink-2); }
.acct-fold .panel-note, .acct-fold .panel-text { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.acct-fold .mode-help, .acct-fold .trip-help { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--ink-2); }
.acct-fold .trip-help li { display: flex; flex-direction: column; gap: 2px; }
.acct-fold .trip-help b { color: var(--heading); }
.export-progress { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--r-3); background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.export-progress .export-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.export-progress .export-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width var(--t) var(--ease); }
html[data-theme="dark"] .export-progress .export-bar-fill { box-shadow: 0 0 12px var(--accent-glow); }
.export-progress.is-done .export-bar-fill { background: var(--ok); }
.export-progress.is-error { border-color: var(--bad); color: var(--bad); }

/* Your settings */
.acct-settings .acct-phead .acct-title { font-size: var(--fs-5); }
@media (max-width: 759px) { .acct-head .acct-acts { margin-left: 0; } }
@media (max-width: 759px) { .acct-phead .acct-acts { margin-left: 0; } }
