/* TAI Solutions — shared app design layer (graphite + lime). Source of truth: shared/tai.css
 * (copied into each app by tools/sync_shared.sh — edit here, not in the copies). */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(../fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(../fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16181D; --surface: #1C1F26; --surface-2: #232730; --surface-3: #2A2F3A;
  --text: #F4F5F7; --text-2: #B4BAC6; --text-3: #8C94A3;
  --line: #313743; --line-strong: #6B7384;
  --action: #C6F432; --action-text: #16181D; --action-hover: #D4FA5C;
  --product: #7AA2FF; --accent-text: #C6F432;
  --ok: #8BE08B; --ok-bg: rgba(139, 224, 139, .12);
  --warn: #C9D1DE; --warn-bg: rgba(201, 209, 222, .10);   /* cool neutral — no amber/orange/gold (TAI colour rule) */
  --bad: #FF8A7A; --bad-bg: rgba(255, 138, 122, .12);
  --info: #7AA2FF; --info-bg: rgba(122, 162, 255, .12);
  --shadow: 0 8px 28px rgba(0, 0, 0, .35);
  --focus: #C6F432;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F3F4F6; --surface: #FFFFFF; --surface-2: #F7F8FA; --surface-3: #ECEEF2;
  --text: #16181D; --text-2: #4A5160; --text-3: #626A7A;
  --line: #DCDFE5; --line-strong: #7D8595;
  --action: #C6F432; --action-text: #16181D; --action-hover: #B8E62A;
  --product: #2F5BD3; --accent-text: #3F5200;
  --ok: #1E7A34; --ok-bg: rgba(30, 122, 52, .10);
  --warn: #414A5A; --warn-bg: rgba(65, 74, 90, .08);
  --bad: #B3261E; --bad-bg: rgba(179, 38, 30, .09);
  --info: #2F5BD3; --info-bg: rgba(47, 91, 211, .09);
  --shadow: 0 8px 28px rgba(22, 24, 29, .12);
  --focus: #3F5200;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum' 1, 'cv11' 1;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 24px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0; }
a { color: var(--product); }
.muted { color: var(--text-2); } .small { font-size: 14px; } .tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* buttons — flat, 44px, no transform on hover */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text); font: 600 15px/1.2 inherit; font-family: inherit;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--action); color: var(--action-text); border-color: var(--action); }
.btn.primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.icon-btn { min-width: 44px; padding: 0 10px; }

/* form controls — 16px text so iOS does not zoom */
label.field { display: grid; gap: 6px; font-size: 14px; color: var(--text-2); font-weight: 500; }
input[type=text], input[type=number], input[type=email], input[type=tel], input[type=search], input[type=date], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font: 400 16px/1.3 inherit; font-family: inherit;
}
textarea { min-height: 88px; resize: vertical; }
select { appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 1px var(--focus); }
input[type=range] { width: 100%; accent-color: var(--action); min-height: 44px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 15px; color: var(--text); }
.check input { width: 20px; height: 20px; accent-color: var(--action); flex: none; margin: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text); font: 500 14px inherit; font-family: inherit; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--action); color: var(--action-text); border-color: var(--action); }
.chip .count { font-variant-numeric: tabular-nums; opacity: .8; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-ok { color: var(--ok); background: var(--ok-bg); }
.b-warn { color: var(--warn); background: var(--warn-bg); box-shadow: inset 0 0 0 1px currentColor; }
.b-bad { color: var(--bad); background: var(--bad-bg); }
.b-info { color: var(--info); background: var(--info-bg); }

.notice { padding: 12px 14px; border-radius: 10px; font-size: 14px; border: 1px solid; }
.notice.bad { color: var(--bad); background: var(--bad-bg); border-color: currentColor; }
.notice.warn { color: var(--warn); background: var(--warn-bg); border-color: currentColor; }
.notice.info { color: var(--info); background: var(--info-bg); border-color: currentColor; }

dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); padding: 24px; max-width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 11, 14, .6); }
dialog h2 { margin-bottom: 12px; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--surface-3); color: var(--text);
  border: 1px solid var(--line-strong); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 100; font-size: 15px; max-width: calc(100vw - 32px); }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .01em; }
.brand .mark { width: 32px; height: 32px; border-radius: 8px; background: var(--action); color: var(--action-text); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.brand .name small { display: block; font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
