/* BidCheck design tokens + component layer (dark, Linear/Vercel-grade).
   Tailwind handles layout; this file owns the look. */

:root {
  --bg: #0a0a0b;
  --surface: #131316;
  --surface-2: #1a1a1e;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --input-bg: #1c1c20;
  --input-border: rgba(255, 255, 255, 0.45);
  --text: #e4e4e7;
  --heading: #fafafa;
  --muted: #8b8b93;
  --accent: #00e676;
  --accent-btn: #00e676;
  --accent-dim: rgba(0, 230, 118, 0.12);
  --red: #ff5c5c;
  --red-dim: rgba(255, 92, 92, 0.12);
  --amber: #ffb224;
  --amber-dim: rgba(255, 178, 36, 0.12);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme: same structure, inverted neutrals; accent darkened to keep
   WCAG AA contrast on white (bright #00E676 on white is ~1.9:1). */
:root[data-theme="light"] {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #efeff1;
  --border: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.16);
  --input-bg: #ffffff;
  --input-border: rgba(0, 0, 0, 0.38);
  --text: #18181b;
  --heading: #09090b;
  --muted: #565661;
  --accent: #00873f;
  --accent-btn: #00e676;
  --accent-dim: rgba(0, 135, 63, 0.1);
  --red: #c92a2a;
  --red-dim: rgba(201, 42, 42, 0.08);
  --amber: #9a6200;
  --amber-dim: rgba(154, 98, 0, 0.08);
}

body { background: var(--bg); color: var(--text); }

/* Never let a wide nav/card stretch the page on small screens */
html, body { overflow-x: clip; }

@media (max-width: 640px) {
  header div[class*="max-w-6xl"] { flex-wrap: wrap; row-gap: 0.5rem; }
}

/* Landing Tailwind utilities remapped to tokens in light mode */
:root[data-theme="light"] .bg-bg { background-color: var(--bg) !important; }
:root[data-theme="light"] .bg-bg\/85 { background-color: rgba(247, 247, 248, 0.85) !important; }
:root[data-theme="light"] .bg-surface { background-color: var(--surface) !important; }
:root[data-theme="light"] .text-zinc-50 { color: #09090b !important; }
:root[data-theme="light"] .text-zinc-100 { color: #18181b !important; }
:root[data-theme="light"] .text-zinc-200 { color: #27272a !important; }
:root[data-theme="light"] .text-zinc-300 { color: #3f3f46 !important; }
:root[data-theme="light"] .text-zinc-400 { color: #565661 !important; }
:root[data-theme="light"] .text-zinc-500 { color: #62626d !important; }
:root[data-theme="light"] .text-accent { color: var(--accent) !important; }
:root[data-theme="light"] .border-white\/\[0\.07\],
:root[data-theme="light"] .border-white\/\[0\.09\] { border-color: var(--border) !important; }
:root[data-theme="light"] .divide-white\/\[0\.06\] > * + * { border-color: var(--border) !important; }
:root[data-theme="light"] .bg-white\/\[0\.08\] { background-color: rgba(0, 0, 0, 0.06) !important; }
:root[data-theme="light"] .hero-bg::before {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}
:root[data-theme="light"] .skeleton {
  background: linear-gradient(90deg,
    rgba(0, 0, 0, 0.06) 25%,
    rgba(0, 0, 0, 0.11) 50%,
    rgba(0, 0, 0, 0.06) 75%);
  background-size: 200% 100%;
}

/* --- Brand --- */

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.18s var(--ease);
}

.brand:hover { color: var(--accent); }
.brand-mark { border-radius: 4px; }

/* --- Theme toggle --- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: 0.35rem;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: none; }

::selection { background: var(--accent-dim); }

/* --- Motion: one subtle fade-up on load, quick hovers, nothing else --- */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fade-up 0.3s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  .fade-up { animation: none; }
  * { transition: none !important; }
}

/* --- Nav --- */

.nav-link {
  padding: 0.4rem 0.75rem;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}

.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* --- Hero background: fine grid + soft radial glow --- */

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 30%, transparent 75%);
}

.hero-bg::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -20%;
  width: 700px;
  height: 500px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0, 230, 118, 0.07), transparent);
}

/* --- App layout primitives --- */

.container { max-width: 64rem; margin: 0 auto; padding: 0 1.5rem; }
main .container { padding-top: 2.25rem; padding-bottom: 5rem; }

h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; color: var(--heading); margin: 0 0 1.25rem; }
h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; color: var(--heading); margin: 0 0 1rem; }
h3 { font-size: 0.95rem; }

/* Small screens: tighten nav so it doesn't crowd the brand */
@media (max-width: 640px) {
  .nav-link { padding: 0.35rem 0.5rem; font-size: 0.8rem; }
  .container, .container-wide { padding-left: 1rem; padding-right: 1rem; }
}

a { color: var(--accent); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* --- Buttons --- */

.button,
button.button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-btn);
  color: #06130c;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  margin-top: 1rem;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.button:hover { background: #2bf193; }
:root[data-theme="light"] .button:hover { background: #00c864; }
.button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Consistent styled focus ring everywhere (replaces browser defaults) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Horizontal scroll for wide tables on small screens */
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 640px; }

.button.button-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.button.button-secondary:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.25); }

.button-link {
  background: none;
  border: none;
  padding: 0;
  margin-right: 0.8rem;
  color: var(--accent);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s var(--ease);
}

.button-link:hover { color: #2bf193; }
.button-link:disabled { color: var(--muted); cursor: default; }
.button-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* --- Forms --- */

.form label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  margin: 1.1rem 0 0.35rem;
}

.form label:first-child { margin-top: 0; }

.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="number"],
.form input[type="tel"],
.form input[type="url"],
.form input[type="search"],
.form textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--input-border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--input-bg);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.form input[type="text"]:focus,
.form input[type="email"]:focus,
.form input[type="password"]:focus,
.form input[type="number"]:focus,
.form input[type="tel"]:focus,
.form input[type="url"]:focus,
.form input[type="search"]:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form input[type="text"]::placeholder,
.form input[type="email"]::placeholder,
.form input[type="password"]::placeholder,
.form input[type="number"]::placeholder,
.form input[type="tel"]::placeholder,
.form input[type="url"]::placeholder,
.form input[type="search"]::placeholder,
.form textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.form input[type="file"] {
  display: block;
  width: 100%;
  padding: 1.75rem;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.form input[type="file"]:hover { border-color: var(--accent); background: var(--accent-dim); }

/* --- Alerts --- */

.notice,
.error {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.notice { background: var(--accent-dim); border: 1px solid rgba(0, 230, 118, 0.25); color: var(--accent); }
.error { background: var(--red-dim); border: 1px solid rgba(255, 92, 92, 0.3); color: var(--red); }

/* --- Spinner --- */

.spinner {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  border: 2px solid rgba(0, 230, 118, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Tables --- */

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

th {
  text-align: left;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--border-strong);
}

td {
  padding: 0.65rem 0.75rem 0.65rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr { transition: background 0.15s var(--ease); }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

/* Compliance checklist: fixed layout so long text doesn't crush meta columns */
.checklist { table-layout: fixed; }
.checklist th:nth-child(1) { width: 58%; }
.checklist th:nth-child(2) { width: 12%; }
.checklist th:nth-child(3) { width: 12%; }
.checklist th:nth-child(4) { width: 9%; }
.checklist th:nth-child(5) { width: 9%; }
.checklist td { overflow-wrap: break-word; }

/* --- Badges --- */

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.badge-ok { background: var(--accent-dim); color: var(--accent); border-color: rgba(0, 230, 118, 0.3); }
.badge-mandatory, .badge-error { background: var(--red-dim); color: var(--red); border-color: rgba(255, 92, 92, 0.3); }
.badge-desirable, .badge-running { background: var(--amber-dim); color: var(--amber); border-color: rgba(255, 178, 36, 0.3); }

/* --- Drafts --- */

.draft { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; }
.draft:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.draft h3 { font-size: 0.92rem; font-weight: 600; color: var(--text); margin: 0 0 0.5rem; }
.draft-text { white-space: pre-wrap; font-size: 0.9rem; color: #c9c9cf; }
.draft .muted { font-size: 0.8rem; }
.draft-actions { margin: 0.4rem 0 0; }

.draft-editor {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.draft-editor:focus { outline: none; }

.evidence-needed {
  display: block;
  background: var(--amber-dim);
  border: 1px solid rgba(255, 178, 36, 0.3);
  border-left: 3px solid var(--amber);
  color: var(--amber);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.88rem;
  white-space: pre-wrap;
}

/* --- Readiness --- */

.readiness {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
}

.readiness-meter {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 0.6rem 0 1.25rem;
}

.readiness-meter > div { height: 100%; border-radius: 999px; background: var(--accent); }
.readiness-meter.low > div { background: var(--red); }
.readiness-meter.mid > div { background: var(--amber); }
.readiness-meter.high > div { background: var(--accent); }

/* --- Misc --- */

.muted { color: var(--muted); }
.upper { text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.05em; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

.extracted {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: #b5b5bd;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin: 0;
  max-height: 480px;
  overflow: auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header .meta { margin-top: 0.25rem; font-size: 0.85rem; }
.page-header .actions { display: flex; gap: 0.6rem; align-items: center; }
.page-header .actions .button { margin-top: 0; }

/* --- Tender detail: instrument workbench --- */

.container-wide { max-width: 76rem; margin: 0 auto; padding: 1.75rem 1.5rem 5rem; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.topbar h1 { margin: 0.15rem 0 0.35rem; font-size: 1.35rem; }
.topbar .meta { font-size: 0.82rem; }
.topbar-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0;
}
.topbar-actions { display: flex; gap: 0.6rem; align-items: center; }
.topbar-actions .button { margin-top: 0; }

/* Readiness ring */
.ring {
  --p: 0;
  --ring-color: var(--accent);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--ring-color) calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0);
  position: relative;
  flex-shrink: 0;
}

.ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--bg);
}

.ring span { position: relative; font-size: 0.72rem; font-weight: 600; color: var(--ring-color); }

/* Two-column workbench */
.workbench {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .workbench { grid-template-columns: 1fr; }
}

.checklist-panel,
.editor-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
}

.editor-panel { padding: 1.25rem; position: sticky; top: 76px; }

.editor-panel h2 { font-size: 0.95rem; line-height: 1.45; margin: 0.4rem 0 0.9rem; }
.editor-panel .draft-editor { margin-bottom: 0.75rem; }
.editor-footer { display: flex; align-items: center; gap: 0.75rem; }
.editor-footer .button { margin-top: 0; }
.editor-footer span { font-size: 0.82rem; }
#ed-sources { margin: 0.75rem 0 0; font-size: 0.78rem; }
#ed-flag { margin-bottom: 0.75rem; }

/* Requirement rows */
.req-row {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: 0.25rem 0.75rem;
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.req-row:hover { background: rgba(255, 255, 255, 0.03); }
.req-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.req-row[aria-selected="true"] {
  background: var(--accent-dim);
  border-color: rgba(0, 230, 118, 0.35);
}

.req-id { font-size: 0.72rem; color: var(--muted); padding-top: 0.15rem; }
.req-row[aria-selected="true"] .req-id { color: var(--accent); }
.req-text { font-size: 0.86rem; line-height: 1.45; }
.req-meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }

.req-chip {
  font-size: 0.68rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
}

/* Category badges: outline style */
.badge { background: transparent; }
.badge-mandatory { background: transparent; color: var(--red); border-color: rgba(255, 92, 92, 0.5); }
.badge-desirable { background: transparent; color: var(--amber); border-color: rgba(255, 178, 36, 0.5); }
.badge-informational { background: transparent; color: var(--muted); border-color: var(--border-strong); }

/* --- Skeleton loaders --- */

.skeleton {
  border-radius: 6px;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.skeleton-row { padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--border); }
.skeleton-text { height: 0.8rem; }
.skeleton-block { height: 12rem; margin: 1rem 0; }

/* Success flash after analysis completes */
.success-flash { transition: opacity 0.4s var(--ease); }

/* Collapsible extracted text */
.extracted-wrap summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.extracted-wrap summary:hover { color: var(--accent); }
.extracted-wrap .extracted { margin-top: 1rem; }

/* --- Upload: drag-and-drop zone --- */

.dropzone {
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.dropzone:hover,
.dropzone.dragover { border-color: var(--accent); background: var(--accent-dim); }

.dropzone p { margin: 0.3rem 0; }
.dropzone .dz-title { font-weight: 600; color: var(--text); }
.dropzone .dz-hint { font-size: 0.82rem; color: var(--muted); }
.dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.dropzone:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Hover overlays that assume a dark canvas — light-theme equivalents */
:root[data-theme="light"] .nav-link:hover { background: rgba(0, 0, 0, 0.05); }
:root[data-theme="light"] tbody tr:hover { background: rgba(0, 0, 0, 0.025); }
:root[data-theme="light"] .req-row:hover { background: rgba(0, 0, 0, 0.03); }
:root[data-theme="light"] .button.button-secondary:hover { background: rgba(0, 0, 0, 0.05); border-color: rgba(0, 0, 0, 0.3); }
:root[data-theme="light"] .badge { background: rgba(0, 0, 0, 0.05); }

/* Requirement filters */
.req-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.req-filter-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.req-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.req-tag {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.req-tag:hover {
  border-color: var(--muted);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.req-tag:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.req-tag.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.req-clear {
  appearance: none;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.4rem 0.2rem;
  transition: color 0.15s var(--ease);
}

.req-clear:hover {
  color: var(--text);
}

:root[data-theme="light"] .req-tag:hover {
  background: rgba(0, 0, 0, 0.04);
}

.req-empty {
  text-align: center;
  padding: 2.5rem 1rem;
}

.req-empty-title {
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.35rem;
}

.req-empty .button {
  margin-top: 0.75rem;
}

/* Tender chat */
.chat-history {
  max-height: 18rem;
  overflow-y: auto;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-message {
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 85%;
}

.chat-user {
  background: var(--accent-dim);
  color: var(--accent);
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.chat-assistant {
  background: var(--surface-2);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.chat-form {
  display: flex;
  gap: 0.5rem;
}

.chat-form input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--input-border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--input-bg);
}

.chat-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.chat-form .button {
  margin-top: 0;
}

/* Comments */
.comments-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.comments-section h3 {
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  max-height: 16rem;
  overflow-y: auto;
}

.comment {
  padding: 0.6rem 0.75rem;
  background: var(--surface-2);
  border-radius: 8px;
}

.comment-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.comment-text {
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0;
}

.comment-actions {
  margin-left: 0.5rem;
}

.comment-action {
  appearance: none;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  margin-left: 0.5rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.comment-action:hover {
  color: var(--text);
}

.comment-form {
  display: flex;
  gap: 0.5rem;
}

.comment-form input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--input-border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--input-bg);
}

.comment-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.comment-form .button {
  margin-top: 0;
  padding: 0.5rem 0.9rem;
}

/* Activity feed */
.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.activity-list li {
  font-size: 0.88rem;
  color: var(--text);
}

.activity-list .muted {
  font-size: 0.8rem;
  margin-left: 0.25rem;
}

@media (max-width: 640px) {
  .req-filter-bar {
    gap: 0.6rem;
  }
}
:root[data-theme="light"] .ring,
:root[data-theme="light"] .mini-ring {
  background: conic-gradient(var(--ring-color) calc(var(--p) * 1%), rgba(0, 0, 0, 0.09) 0);
}
:root[data-theme="light"] .readiness-meter { background: rgba(0, 0, 0, 0.09); }
:root[data-theme="light"] .req-row[aria-selected="true"] { border-color: rgba(0, 135, 63, 0.4); }
.dropzone .dz-file {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  color: var(--accent);
}

/* --- Dashboard: status pills, mini readiness ring, empty state --- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-analysed { color: var(--accent); border-color: rgba(0, 230, 118, 0.4); }
.pill-running { color: var(--amber); border-color: rgba(255, 178, 36, 0.4); }
.pill-error { color: var(--red); border-color: rgba(255, 92, 92, 0.4); }
.pill-uploaded { color: var(--muted); }

.mini-ring {
  --p: 0;
  --ring-color: var(--accent);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: conic-gradient(var(--ring-color) calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0);
  position: relative;
}

.mini-ring::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--surface);
}

.mini-ring span { position: relative; font-size: 0.62rem; font-weight: 600; color: var(--ring-color); }

.empty-state { text-align: center; padding: 2.5rem 1rem; }
.empty-title { font-weight: 600; color: var(--text); margin: 0 0 0.35rem; }
