@import url("./tokens.css");
/* Shared foundations for the company app, platform and offline field interface. */
:root {
  --font: "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --text-title: 28px;
  --text-section: 18px;
  --text-body: 14px;
  --text-small: 12px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --r: 8px;
  --r-sm: 5px;
  --r-round: 50%;
  --control-height: 38px;
  --touch-height: 44px;
  --sidebar: 236px;
  --topbar: 64px;
}
* { box-sizing: border-box; }
html { font-family: var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; font-synthesis: none; }
body { margin: 0; min-height: 100vh; font-size: var(--text-body); line-height: 1.45; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:where(button, a, input, textarea, select, summary, [tabindex]):focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
:where(input[type="checkbox"], input[type="radio"]) { accent-color: var(--brand); }
:where(input, textarea)::placeholder { color: var(--quiet); opacity: 1; }
.hidden, [hidden] { display: none !important; }
.muted, .help { color: var(--muted); }
.help { font-size: var(--text-small); line-height: 1.5; }
.field { display: grid; gap: 6px; margin: 0 0 var(--space-4); min-width: 0; }
.field label { color: var(--ink); font-size: var(--text-small); font-weight: 600; }
.input, .select, .textarea, .field :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
.commerce-form :where(input:not([type="checkbox"]), select, textarea),
.subscription-page :where(input:not([type="checkbox"]), textarea), .terrain textarea {
  width: 100%; min-width: 0; min-height: var(--control-height); border: 1px solid var(--control-line);
  border-radius: var(--r-sm); padding: 8px 11px; background: var(--surface); color: var(--ink);
  font-size: var(--text-body); font-weight: 400; transition: border-color .12s ease;
}
.textarea, .commerce-form textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus, .field :where(input, select, textarea):focus { border-color: var(--brand); outline: 2px solid var(--brand); outline-offset: 2px; }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--quiet); cursor: not-allowed; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-height); border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 8px 13px; background: transparent; color: var(--ink); font-size: 13px;
  font-weight: 600; line-height: 1.35; text-align: center; transition: background-color .12s ease, border-color .12s ease;
}
.btn-primary { background: var(--brand); color: var(--surface); border-color: var(--brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-secondary { background: var(--button-secondary-bg); border-color: var(--control-line); color: var(--button-secondary-ink); }
.btn-secondary:hover:not(:disabled), .btn-secondary:active:not(:disabled) { background: var(--button-secondary-hover); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { color: var(--muted); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: var(--surface); }
.btn-success { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.btn-block { width: 100%; }
.btn-icon { width: var(--control-height); height: var(--control-height); padding: 0; flex: none; }
.btn-small { min-height: 32px; padding: 5px 9px; font-size: var(--text-small); }
.btn-lg, .btn-large { min-height: var(--touch-height); padding: 10px 16px; font-size: var(--text-body); }
.btn:disabled { background: var(--surface-2); color: var(--quiet); border-color: var(--line); cursor: not-allowed; box-shadow: none; }
.brand-mark { width: 34px; height: 34px; object-fit: contain; flex: none; }
.brand-wordmark { display: block; width: 150px; max-width: 100%; height: auto; object-fit: contain; }
.mf-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.pwa-notice { padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
#pwaNotices { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: 16px; max-width: calc(100vw - 32px); }
@media (max-width: 600px) {
  .btn, .input, .select, .field :where(input:not([type="checkbox"]):not([type="radio"]), select), .commerce-form :where(input:not([type="checkbox"]), select), .subscription-page input:not([type="checkbox"]) { min-height: var(--touch-height); }
  .btn-icon { width: var(--touch-height); height: var(--touch-height); }
  .input, .select, .textarea, .field :where(input, select, textarea), .commerce-form :where(input, select, textarea), .subscription-page :where(input, textarea), .terrain textarea { font-size: 16px; }
  #pwaNotices { position: static; margin: 12px 12px calc(92px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 24px); }
  .pwa-notice { padding: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
