/* Telemerk design system: shared tokens, font and base components.
   Pages link this file first and then layer their own styles on top. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  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;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  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: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-wght-italic.woff2") format("woff2-variations");
  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 {
  /* Brand and text */
  --ink: #13104a;
  --ink-2: #1b1464;
  --ink-strong: #070221;
  --ink-hover: #221c6e;
  --text: #0e0b2e;
  --muted: #5b5878;
  --faint: #6f6d8a;
  --lime: #c9e52a;
  --red: #e5202a;
  --blue: #5a84f7;
  --blue-text: #3d5fd6;

  /* Surfaces */
  --bg: #fafbf8;
  --card: #ffffff;
  --fill: #f4f4f8;
  --hover: #f7f6fc;
  --lavender: #f1eff9;
  --lavender-2: #eeecf4;
  --line: #ebebf1;
  --line-strong: #dedee8;
  --field-line: #d6d6e2;
  --radius: 16px;
  --radius-btn: 10px;
  --radius-field: 8px;
  --shadow: 0 1px 2px rgba(19, 16, 74, .03);

  /* States */
  --ok: #b9d63d;      --ok-soft: #e6f0b8;      --ok-text: #3a5200;
  --mid: #13104a;     --mid-soft: #e6e8f7;     --mid-text: #13104a;
  --bad: #e5202a;     --bad-soft: #fce4e5;     --bad-text: #b3121a;

  /* Scores 1 to 5 */
  --score-1: #e5202a; --score-1-text: #ffffff;
  --score-2: #f2767c; --score-2-text: #3d0508;
  --score-3: #13104a; --score-3-text: #ffffff;
  --score-4: #d3e57a; --score-4-text: #26330a;
  --score-5: #b9d63d; --score-5-text: #1f2d00;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t: .14s var(--ease);
  --maxw: 1400px;
  --gutter: 32px;
}
@media (max-width: 640px) { :root { --gutter: 16px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
img { max-width: 100%; }
table, .num, [data-num] { font-variant-numeric: tabular-nums; }

/* Keyboard focus always visible */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Skip link */
.tm-skip {
  position: absolute; left: 12px; top: -60px; z-index: 1000;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 14px; text-decoration: none; transition: top var(--t);
}
.tm-skip:focus { top: 12px; }

/* Layout */
.tm-wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* App header */
.tm-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.tm-header-in {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
  height: 68px; display: flex; align-items: center; gap: 24px;
}
.tm-logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.tm-logo img { height: 26px; width: auto; display: block; }
.tm-nav {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity; flex: 1; min-width: 0;
}
.tm-nav::-webkit-scrollbar { display: none; }
.tm-nav a {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  min-height: 38px; padding: 0 14px; border-radius: 999px;
  color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background var(--t), color var(--t); scroll-snap-align: center;
}
.tm-nav a:hover { background: var(--hover); color: var(--ink); }
.tm-nav a[aria-current="page"] { background: var(--lavender); color: var(--ink); font-weight: 600; }
.tm-nav svg { width: 18px; height: 18px; }
.tm-header-end { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }

/* Page head */
.tm-pagehead {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 40px 0 24px;
}
.tm-eyebrow {
  margin: 0 0 10px; font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .16em; color: var(--muted);
}
.tm-title {
  margin: 0; color: var(--ink-strong); font-weight: 800;
  font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.035em; line-height: 1.05;
  text-wrap: balance;
}
.tm-title::after { content: "."; color: var(--lime); }
.tm-lede { margin: 12px 0 0; font-size: 15.5px; color: var(--muted); max-width: 64ch; }
.tm-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Cards */
.tm-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.tm-card-title { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 16px; font-weight: 700; color: var(--ink-strong); }
.tm-ico {
  width: 36px; height: 36px; border-radius: 10px; background: var(--lavender); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tm-ico svg { width: 20px; height: 20px; }
svg.i { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons */
.tm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 16px; border-radius: var(--radius-btn);
  font: 600 14px/1 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t);
}
.tm-btn:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.tm-btn:active { transform: translateY(1px); }
.tm-btn:disabled, .tm-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.tm-btn-2 { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.tm-btn-2:hover { background: var(--hover); border-color: var(--line-strong); color: var(--ink); }
.tm-btn-danger { background: #fff; color: var(--bad-text); border-color: var(--bad); }
.tm-btn-danger:hover { background: var(--bad-soft); color: var(--bad-text); border-color: var(--bad); }

/* Fields */
.tm-label {
  display: block; margin: 0 0 6px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
}
.tm-help { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.tm-input {
  width: 100%; min-height: 38px; padding: 0 12px; border-radius: var(--radius-field);
  border: 1px solid var(--field-line); background: #fff; color: var(--text);
  font: 400 14px/1.4 var(--font); transition: border-color var(--t), box-shadow var(--t);
}
.tm-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(90, 132, 247, .18); }

/* Status pills */
.tm-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.5; background: var(--mid-soft); color: var(--mid-text);
}
.tm-pill.ok { background: var(--ok-soft); color: var(--ok-text); }
.tm-pill.bad { background: var(--bad-soft); color: var(--bad-text); }
.tm-pill.line { background: #fff; border: 1px solid var(--line-strong); color: var(--ink); }

/* Notices */
.tm-note {
  border-radius: var(--radius-btn); padding: 12px 14px; font-size: 14px;
  background: var(--mid-soft); color: var(--mid-text); border: 1px solid #d6d9f0;
}
.tm-note.bad { background: var(--bad-soft); color: var(--bad-text); border-color: #f6c3c6; }

/* Tables */
.tm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tm-table th {
  text-align: left; padding: 12px 18px; font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--line); background: #fff;
}
.tm-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.tm-table tbody tr { transition: background var(--t); }
.tm-table tbody tr:hover { background: var(--hover); }

/* Loading and empty */
.tm-skel {
  display: block; border-radius: 8px; min-height: 14px;
  background: linear-gradient(90deg, var(--fill) 0%, #fbfbfd 50%, var(--fill) 100%);
  background-size: 200% 100%; animation: tm-shimmer 1.4s linear infinite;
}
@keyframes tm-shimmer { to { background-position: -200% 0; } }
.tm-empty {
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #fff;
  padding: 32px 20px; text-align: center; color: var(--muted);
}

/* Footer */
.tm-footer { border-top: 1px solid var(--line); padding: 24px var(--gutter); text-align: center; font-size: 13px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
