/* ==========================================================================
   Fynex Network Design Tokens — aligned with Tiosan Support Copilot UI/UX
   Self-hosted Inter + clean emerald/mint-slate surface hierarchy
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/inter-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 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 {
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Crisp Tiosan Surfaces */
  --bg-main: #ffffff;
  --bg-subtle: #f4f6f5;
  --bg-thread: #f5f7f6;
  --bg-hover: #edf1ef;
  --bg-user-bubble: #eef2f0;
  --bg-composer: #ffffff;
  --bg-popover: #ffffff;

  /* Borders & Dividers */
  --border: #dde3e0;
  --border-focus: #b9c6c1;

  /* Typography (WCAG AA on white and tinted surfaces) */
  --text-primary: #12211b;
  --text-secondary: #43524c;
  --text-muted: #5a6963;

  /* Emerald Brand Accent */
  --brand: #0b6e4f;
  --brand-strong: #075e42;
  --brand-soft: #e7f4ee;
  --brand-border: #bfe3d3;

  /* Amber (Warnings / Retakes / Review) */
  --kb-accent: #7a4f00;
  --kb-soft: #fff7e0;
  --kb-border: #ecd28f;

  /* Danger (Errors / Blocking Flags) */
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --danger-border: #fecdca;

  /* Blue / Slate (Collecting / Active) */
  --slate: #1a47a0;
  --slate-soft: #e8f0fe;
  --slate-line: #c5d6fa;

  /* Semantic Aliases for Shared Components */
  --paper: var(--bg-subtle);
  --paper-subtle: var(--bg-hover);
  --card: var(--bg-main);
  --ink: var(--text-primary);
  --ink-soft: var(--text-secondary);
  --muted: var(--text-muted);
  --line: var(--border);
  --line-strong: var(--border-focus);
  --accent: var(--brand);
  --accent-deep: var(--brand-strong);
  --accent-soft: var(--brand-soft);
  --sage: var(--brand);
  --sage-soft: var(--brand-soft);
  --sage-line: var(--brand-border);
  --amber: var(--kb-accent);
  --amber-soft: var(--kb-soft);
  --amber-line: var(--kb-border);
  --danger-line: var(--danger-border);
  --overlay: rgba(10, 20, 16, 0.48);

  /* Radii & Shadows */
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius: 14px;
  --radius-card: 14px;
  --shadow-sm: 0 1px 4px rgba(18, 33, 27, 0.05);
  --shadow-md: 0 6px 24px rgba(18, 33, 27, 0.08);
  --shadow-lg: 0 16px 48px rgba(18, 33, 27, 0.18);
  --shadow-composer: 0 2px 12px rgba(18, 33, 27, 0.06);
  --shadow-popover: 0 8px 30px rgba(18, 33, 27, 0.14);

  --max-col-width: 720px;
  --hdr-h: 58px;

  /* v5.9 SOTA layer */
  --brand-grad: linear-gradient(135deg, #0e7d57 0%, #0b6e4f 55%, #075e42 100%);
  --hero-grad: linear-gradient(135deg, #eef7f2 0%, #ffffff 58%, #f2f8f5 100%);
  --thread-grad: radial-gradient(1200px 500px at 50% -10%, rgba(11,110,79,.07), transparent 60%), linear-gradient(180deg, #f7faf8 0%, #f3f6f4 100%);
  --radius-xl: 20px;
  --shadow-bubble: 0 1px 2px rgba(18,33,27,.05), 0 8px 24px rgba(18,33,27,.05);
  --shadow-float: 0 4px 14px rgba(18,33,27,.08), 0 16px 40px rgba(11,110,79,.12);
  --touch: 44px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
::selection { background: rgba(11, 110, 79, 0.2); }
html { scroll-behavior: smooth; }
button, a, input, select, textarea, .doc-item, .kpi-card { touch-action: manipulation; }
* { scrollbar-width: thin; scrollbar-color: #c3d2cb transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: #c3d2cb; border-radius: 99px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
:focus-visible { outline: 3px solid rgba(11, 110, 79, 0.5); outline-offset: 2px; }
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
