/* The pages that belong to no company: the product home, the platform console and the page shown for a wrong or
   closed company address. Colours, type sizes and spacing come from crm-tokens.css, and the controls are the
   company app's, so a person moving from here into their company's pages sees the same book. */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: var(--t-md); line-height: var(--lh-ui); text-spacing-trim: normal; -webkit-font-smoothing: antialiased; }
main { flex: 1; }
h1, h2, h3, p, figure { margin: 0; }
/* A paragraph never ends on a lone character where the browser can help it. */
p, li { text-wrap: pretty; }
h1, h2, h3 { font-weight: var(--bold); line-height: var(--lh-head); }
b, strong { font-weight: var(--bold); }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
::selection { background: var(--accent-soft); }
.muted { color: var(--muted); }
.small { font-size: var(--t-sm); }
.nb { display: inline-block; }
.figure { font-family: var(--figure); font-weight: 700; font-variant-numeric: tabular-nums lining-nums; letter-spacing: .01em; line-height: var(--lh-fig); }
.shell { width: min(1120px, calc(100% - 2 * var(--s5))); margin: 0 auto; }

/* ---------- header and footer ---------- */
.site-top { display: flex; align-items: center; gap: var(--s3) var(--s5); min-height: 64px; border-bottom: 1px solid var(--rule); }
.brand { display: inline-flex; align-items: center; gap: var(--s3); min-width: 0; color: var(--ink); font-weight: var(--bold); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-mark rect { fill: var(--accent); }
.brand-pill { padding-left: var(--s3); border-left: 1px solid var(--rule-strong); color: var(--muted); font-size: var(--t-xs); font-weight: var(--regular); }
.site-nav { display: flex; align-items: center; gap: var(--s5); margin-left: auto; font-size: var(--t-sm); white-space: nowrap; }
.site-nav a { color: var(--ink-2); }
.site-nav a:hover { color: var(--ink); }
.brand + .theme-switch { margin-left: auto; }
.theme-switch { display: inline-flex; flex: none; padding: var(--s1); gap: var(--s1); background: var(--sunken); border-radius: var(--r); }
.theme-switch button { display: inline-flex; align-items: center; gap: var(--s1); padding: var(--s1) var(--s3); border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-2); font-size: var(--t-xs); }
.theme-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-switch button[aria-pressed="true"] { background: var(--sheet); color: var(--ink); font-weight: var(--bold); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.site-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s1) var(--s5); padding: var(--s5) 0 var(--s6); border-top: 1px solid var(--rule); color: var(--muted); font-size: var(--t-xs); }

/* ---------- sheets, fields and buttons, as in the company app ---------- */
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: var(--s5); min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 40px; padding: 0 var(--s4); border-radius: var(--r-sm); border: 1px solid var(--rule-strong); background: var(--sheet); color: var(--ink); font-size: var(--t-md); white-space: nowrap; text-decoration: none; transition: background-color .15s, border-color .15s; }
.btn:hover { background: var(--sheet-2); border-color: var(--muted); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--debt); }
.btn-sm { min-height: 32px; padding: 0 var(--s3); font-size: var(--t-sm); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { display: inline-flex; align-items: center; min-height: 32px; padding: 0; border: 0; background: none; color: var(--accent-text); font-size: var(--t-sm); white-space: nowrap; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link:disabled { opacity: .45; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.field > span { font-size: var(--t-sm); color: var(--ink-2); }
.field small { color: var(--muted); font-size: var(--t-xs); line-height: var(--lh-ui); }
.input { width: 100%; min-height: 44px; padding: var(--s2) var(--s3); border: 1px solid var(--rule-strong); border-radius: var(--r-sm); background: var(--sheet); color: var(--ink); font-size: var(--t-md); transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--muted); opacity: .8; }
.pill { display: inline-flex; align-items: center; padding: 0 var(--s2); border-radius: var(--r-xs); font-size: var(--t-xs); line-height: 24px; white-space: nowrap; }
.pill-good { background: var(--good-bg); color: var(--good); }
.pill-neutral { background: var(--sunken); color: var(--ink-2); }
.error-text { padding: var(--s3); border-radius: var(--r-sm); background: var(--debt-bg); color: var(--debt); font-size: var(--t-sm); line-height: var(--lh-text); }

/* ---------- the way into a company: the one used last on this browser, or its address ---------- */
.entry { display: flex; flex-direction: column; gap: var(--s4); }
.entry h2 { font-size: var(--t-lg); }
.entry-last { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s1) var(--s4); padding: var(--s4); border: 1px solid var(--accent); border-radius: var(--r); background: var(--accent-soft); color: var(--ink); }
.entry-last:hover { text-decoration: none; background: color-mix(in srgb, var(--accent-soft) 70%, var(--sheet)); }
.entry-last-label { grid-column: 1; font-size: var(--t-sm); color: var(--ink-2); }
.entry-last b { grid-column: 1; font-size: var(--t-lg); overflow-wrap: anywhere; }
.entry-last-addr { grid-column: 1; font-size: var(--t-sm); font-weight: var(--regular); color: var(--muted); overflow-wrap: anywhere; }
.entry-last-go { grid-column: 2; grid-row: 1 / 4; display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s4); border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); font-size: var(--t-md); white-space: nowrap; }
.entry-form { display: flex; flex-direction: column; gap: var(--s3); }
.entry-form > label { font-size: var(--t-sm); color: var(--ink-2); }
.addr { display: flex; align-items: stretch; min-height: 44px; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); background: var(--sheet); transition: border-color .15s, box-shadow .15s; }
.addr:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.addr-host { display: flex; align-items: center; flex: none; color: var(--muted); font-family: var(--figure); font-size: var(--t-md); white-space: nowrap; }
.addr-host { padding-left: var(--s3); }
.addr input { flex: 1; min-width: 0; padding: var(--s2) var(--s3) var(--s2) var(--s1); border: 0; background: none; color: var(--ink); font-family: var(--figure); font-size: var(--t-md); }
.addr input:focus { outline: none; }
.addr input::placeholder { color: var(--muted); opacity: .8; font-family: var(--font); }
.entry-form .btn { min-height: 44px; }
.entry-note { font-size: var(--t-sm); color: var(--muted); line-height: var(--lh-text); }
.entry-note .figure { font-weight: var(--regular); color: var(--ink-2); }

@media (max-width: 560px) {
  .shell { width: calc(100% - 2 * var(--s4)); }
  .site-nav { gap: var(--s4); }
  .site-nav .wide-only { display: none; }
  .theme-switch button { padding: var(--s1) var(--s2); }
  .theme-switch span { display: none; }
  .sheet { padding: var(--s4); border-radius: var(--r); }
  .entry-last { grid-template-columns: minmax(0, 1fr); }
  .entry-last-go { grid-column: 1; grid-row: auto; justify-content: center; margin-top: var(--s2); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
