/*
 * Shared look for the account, company and operations pages.
 *
 * One spacing scale and one button rule for every page, so actions never
 * crowd each other or the text beside them (the builder's earlier crowded
 * buttons are the thing this prevents). Colors come from a small set of
 * variables shared with the company editor; meaning is never carried by color
 * alone — badges and messages always have words and a shape.
 */
@import url('./brand.css');
:root {
  --gap-1: 4px; --gap-2: 8px; --gap-3: 12px; --gap-4: 16px; --gap-5: 24px; --gap-6: 32px;
  --radius: 0;
}
* { box-sizing: border-box; }
html { font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--page); color: var(--ink); }
body { margin: 0; min-height: 100vh; background: var(--workspace-gradient) fixed; }
h1 { font-size: clamp(1.6rem, 2.5vw, 2.2rem); letter-spacing: -.035em; margin: 0 0 var(--gap-3); }
h2 { font-size: 1.2rem; margin: 0 0 var(--gap-3); }
h3 { font-size: 1rem; margin: 0 0 var(--gap-2); }
p { margin: 0 0 var(--gap-3); }
a { color: var(--accent); }
.muted, .hint { color: var(--muted); }
.hint { font-size: .875rem; margin: var(--gap-1) 0 0; }

/* Keyboard focus is always visible, on every control. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.site-header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-3) var(--gap-4); padding: var(--gap-3) var(--gap-5); background: #202627; border-bottom: 1px solid var(--line); }
.site-header .brand { display: flex; align-items: center; gap: 24px; text-decoration: none; color: var(--ink); margin-right: auto; }
.site-header .brand img { display: block; width: 200px; height: 56px; object-fit: contain; }
.site-header .brand span { border-left: 1px solid var(--line); padding-left: 24px; color: var(--muted); font-size: .875rem; font-weight: 500; }
@media (max-width: 40rem) { .site-header .brand { gap: 14px; } .site-header .brand img { width: 156px; height: 44px; } .site-header .brand span { padding-left: 14px; font-size: .8rem; } }
.environment { font-size: .8125rem; font-weight: 600; padding: 2px var(--gap-2); border-radius: 0; border: 1px solid var(--line); background: var(--neutral-bg); }
.environment[data-environment="Production"] { background: var(--neutral-bg); color: var(--ink); border-color: var(--line); }
main { max-width: 68rem; margin: 0 auto; padding: var(--gap-5); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 0; padding: var(--gap-5); margin: 0 0 var(--gap-5); }
.stack > * + * { margin-top: var(--gap-4); }

/* Buttons: 44px touch targets, and rows of actions always spaced apart. */
button, .button { font: inherit; min-height: 44px; padding: var(--gap-2) var(--gap-4); border-radius: 0; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--gap-2); }
button.primary, .button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--bad); border-color: currentColor; }
button.quiet { border-color: transparent; background: transparent; }
button:not(:disabled):hover, .button:hover { background: var(--surface-raised); border-color: var(--accent); }
button.primary:not(:disabled):hover, .button.primary:hover { background: #f1ca88; color: var(--accent-ink); }
button:disabled { opacity: .6; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: var(--gap-3); margin-top: var(--gap-4); align-items: center; }
.actions + p, p + .actions { margin-top: var(--gap-4); }

.field { display: grid; gap: var(--gap-1); margin: 0 0 var(--gap-4); max-width: 28rem; }
.field label { font-weight: 600; }
input, select, textarea { font: inherit; min-height: 44px; padding: var(--gap-2) var(--gap-3); border: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink); width: 100%; }
textarea { min-height: 6rem; }

.error { background: var(--bad-bg); color: var(--bad); border: 1px solid currentColor; border-radius: 0; padding: var(--gap-3); }
.notice { background: var(--warn-bg); color: var(--warn); border: 1px solid currentColor; border-radius: 0; padding: var(--gap-3); }
.badge { display: inline-flex; align-items: center; gap: var(--gap-1); font-size: .875rem; font-weight: 600; padding: 2px var(--gap-2); border-radius: 0; border: 1px solid currentColor; white-space: nowrap; }
.badge[data-tone="good"] { color: var(--good); background: var(--good-bg); }
.badge[data-tone="warn"] { color: var(--warn); background: var(--warn-bg); }
.badge[data-tone="bad"] { color: var(--bad); background: var(--bad-bg); }
.badge[data-tone="muted"] { color: var(--neutral); background: var(--neutral-bg); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: var(--gap-2) var(--gap-3); border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .875rem; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }

.tabs { display: flex; flex-wrap: wrap; gap: var(--gap-2); margin: 0 0 var(--gap-5); padding: 0; list-style: none; }
.tabs a, .tabs button { min-height: 44px; }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); background: var(--surface-raised); color: var(--accent); font-weight: 600; }

.dialog { border: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink); padding: 0; width: min(34rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); }
.dialog::backdrop { background: rgb(0 0 0 / .45); }
.dialog-head { display: flex; align-items: center; gap: var(--gap-3); padding: var(--gap-4) var(--gap-5); border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0 auto 0 0; }
.dialog-body { padding: var(--gap-5); overflow: auto; }

/* Keep the provider's native compact widget intact. Scroll long messages on
 * short screens while keeping Close reachable, including with larger text. */
.dialog.security-check { width: min(26rem, calc(100vw - 1.5rem)); max-height: calc(100vh - 1.5rem); max-height: calc(100dvh - 1.5rem); overflow: hidden; }
.security-check[open] { display: flex; flex-direction: column; }
.security-check .dialog-head { padding: var(--gap-4); flex: none; }
.security-check .dialog-head h2 { min-width: 0; overflow-wrap: anywhere; }
.security-check .dialog-head button { flex: none; min-width: 44px; }
.security-check .dialog-body { min-height: 0; padding: var(--gap-4); overflow-wrap: anywhere; }
.security-check-widget { width: 150px; margin-inline: auto; }
.security-check .actions > span { min-width: 0; max-width: 100%; }
.security-check .actions button { max-width: 100%; }

.status-line { position: fixed; left: 50%; bottom: var(--gap-5); transform: translateX(-50%); max-width: calc(100vw - 2rem); background: var(--ink); color: var(--page); padding: var(--gap-2) var(--gap-4); border-radius: 0; z-index: 50; }
.status-line:empty { display: none; }
.status-line[data-kind="error"] { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad); }

@media (max-width: 40rem) {
  main { padding: var(--gap-4); }
  .card { padding: var(--gap-4); }
  .actions > button, .actions > .button { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Quotes print their issued document without account navigation or actions. */
@media print {
  body:has(.issued-quote) { background: #fff; --ink: #111; --muted: #444; --line: #bbb; --surface: #fff; }
  body:has(.issued-quote) .site-header,
  body:has(.issued-quote) nav,
  body:has(.issued-quote) button,
  body:has(.issued-quote) .status-line,
  body:has(.issued-quote) a,
  body:has(.issued-quote) .optional-quote-account { display: none !important; }
  .issued-quote { color: #111; background: #fff; border: 0; box-shadow: none; }
  .issued-quote table { width: 100%; border-collapse: collapse; }
  .issued-quote th, .issued-quote td { border-bottom: 1px solid #bbb; padding: 0.5rem; text-align: left; }
  .issued-quote tr { break-inside: avoid; }
}

/* "Trouble signing in?" (shared by the account and owner sign-in screens) */
.sign-in-help{margin-top:22px;padding-top:14px;border-top:1px solid rgba(128,128,128,.35)}
.sign-in-help>summary{cursor:pointer;font-weight:600}
.sign-in-help ul{list-style:none;margin:12px 0 0;padding:0;display:grid;gap:14px}
.sign-in-help li{display:grid;gap:4px;justify-items:start}
.sign-in-help li span{opacity:.85;font-size:.92rem;line-height:1.45}
.sign-in-help li :is(button,.button){margin-top:4px;min-height:40px;padding:8px 14px;font-size:.9rem}

/*
 * Compact controls with a mouse (Jason, 2026-11-22: "buttons too big"). The 44px height used all
 * over these pages is a touch-screen size; with a mouse or trackpad every button, field and
 * drop-down is 34px. One rule for the account, company and Operations pages, so no page can
 * forget it; `!important` because some thirty page rules set the touch size on their own controls.
 * A one-line typed box or drop-down takes its font's own line height (`normal`), not the pages'
 * reading line (1.65): with that line its text, 4px above and below and its border came to 34.75px
 * at 15px and 36.4px at a phone-width window's 16px (account.css), taller than the 34px buttons
 * beside it (a page rule's `font: inherit` brings the reading line back, hence `!important` here
 * too). A text area keeps the reading line; its lines are read.
 */
@media (pointer: fine) {
  :is(button, .button, a.button, select, input:not([type=checkbox], [type=radio], [type=range], [type=color], [type=file])) { min-height: 34px !important; }
  :is(button, .button, a.button) { padding-block: 4px !important; font-size: .875rem; }
  :is(select, input:not([type=checkbox], [type=radio], [type=range], [type=color], [type=file])) { padding-block: 4px !important; line-height: normal !important; }
  .tabs :is(a, button) { min-height: 34px !important; }
}
