/* Instructed Intelligence — shared app component layer (pure CSS, framework-agnostic).
 * Pairs with tokens.css: every value comes from a var(--token), so this drops into
 * any tool (Tailwind or not) and themes automatically. For a Tailwind tool, you can
 * also add preset.ts for theme-aware utilities. See styleguide.html for the visuals.
 */

.ii-app { font-family: var(--font-sans); color: var(--ink); background: var(--ground); }

/* ---- brand mark (a flat keystone square; brand teal in both themes) ---- */
.mark {
  display: inline-block; width: 26px; height: 26px; border-radius: 5px;
  background: #0e8c86; position: relative; flex: none;
}
.mark::after {
  content: ""; position: absolute; inset: 7px; border-radius: 1px;
  border: 2px solid rgba(255,255,255,.9);
  border-bottom-color: rgba(255,255,255,.4); border-right-color: rgba(255,255,255,.4);
}

/* ---- labels ---- */
.eyebrow {
  font-family: var(--font-mono); text-transform: uppercase;
  letter-spacing: .12em; font-size: 11px; font-weight: 500; color: var(--faint);
}

/* ---- card ---- */
.card {
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  padding: 16px 18px; box-shadow: var(--shadow);
  transition: box-shadow .15s, border-color .15s;
}
.card-link:hover { box-shadow: var(--shadow-lift); border-color: var(--line-strong); }

/* ---- chip ---- */
.chip {
  display: inline-flex; align-items: center; border-radius: 6px;
  border: 1px solid var(--line); padding: 2px 8px; font-size: 12px; color: var(--muted);
}

/* ---- type indicator: an 8px square dot + uppercase mono-ish label ---- */
.type-label {
  display: inline-flex; align-items: center; gap: 6px;
  text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; font-weight: 700; color: var(--muted);
}
.type-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--tc, var(--muted)); }

/* ---- semantic state pills (colour separate from the accent) ---- */
.state {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 3px 9px; font-size: 11px; font-weight: 650;
}
.state-ok { color: var(--ok); background: var(--ok-tint); }
.state-warn { color: var(--warn); background: var(--warn-tint); }
.state-restrict { color: var(--restrict); background: var(--restrict-tint); }
.state-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 7px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-soft); font: inherit; font-size: 14px; font-weight: 500;
  padding: 7px 14px; cursor: pointer; transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-accent { border: 0; background: var(--primary); color: var(--on-primary); font-weight: 600; }
.btn-accent:hover { background: var(--primary-hover); border: 0; }

/* ---- nav links ---- */
.navlink {
  border-radius: 7px; padding: 7px 12px; font-size: 14px; font-weight: 500;
  color: var(--muted); text-decoration: none; transition: color .15s, background .15s;
}
.navlink:hover { color: var(--ink); background: var(--surface-2); }
.navlink-active { color: var(--primary); background: var(--primary-tint); }

/* ---- search bar ---- */
.searchbar {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 10px; padding: 6px 6px 6px 16px; box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.searchbar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint), var(--shadow); }

/* ---- inputs ---- */
.input {
  width: 100%; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 15px;
  padding: 9px 12px; outline: 0; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }

/* ---- data table ---- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-family: var(--font-mono); text-transform: uppercase;
  letter-spacing: .06em; font-size: 11px; font-weight: 500; color: var(--faint);
  padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }

/* ---- readable keyboard focus everywhere ---- */
.ii-app :where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) { .ii-app * { transition: none !important; } }
