/* SPDX-License-Identifier: EUPL-1.2 */
/* SPDX-FileCopyrightText: 2026 AI Act SME Compliance Engine contributors */
:root {
  --bg: #f7f7f5; --fg: #1b1b1b; --muted: #565656; --line: #d4d4d0;
  --accent: #123a5e; --ok: #1a6b34; --bad: #9a2020; --warn: #8a5a00;
  --card: #ffffff; --na: #4a4a4a;
}
* { box-sizing: border-box; }
body {
  margin: 0; font: 16px/1.55 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--fg); background: var(--bg);
}
#app { max-width: 760px; margin: 0 auto; padding: 1.5rem 1.1rem 4rem; }
h1 { font-size: 1.4rem; margin: .2rem 0 1rem; color: var(--accent); }
h2 { font-size: 1.12rem; margin: 1.6rem 0 .6rem; }
.screen[hidden] { display: none; }

.ai-disclosure { background: #eef3f8; border: 1px solid #cdd9e6; border-radius: 6px;
  padding: .7rem .9rem; font-size: .92rem; color: var(--accent); }
.disclaimer { white-space: pre-wrap; background: #fff8e6; border: 2px solid var(--warn);
  border-radius: 6px; padding: .8rem 1rem; font-size: .82rem; overflow-x: auto; }
#results .disclaimer { position: sticky; top: 0; z-index: 5; }

.boot-status { color: var(--muted); }
.progress { height: 8px; background: #e3e3df; border-radius: 4px; overflow: hidden; margin: .6rem 0; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .25s; }
.fail-closed { background: #fbeaea; border: 2px solid var(--bad); border-radius: 6px;
  padding: 1rem; color: var(--bad); white-space: pre-wrap; }

/* toolbar / lang toggle */
.toolbar { display: flex; gap: .5rem; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; flex-wrap: wrap; }
.lang-toggle button { border: 1px solid var(--line); background: #fff; padding: .3rem .7rem;
  cursor: pointer; border-radius: 4px; }
.lang-toggle button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }

/* wizard */
.q-prompt { font-size: 1.15rem; margin: 1rem 0 1.2rem; }
.answers { display: flex; flex-direction: column; gap: .55rem; }
.answers button { text-align: left; padding: .75rem .9rem; border: 1px solid var(--line);
  background: #fff; border-radius: 6px; cursor: pointer; font-size: 1rem; }
.answers button:hover { border-color: var(--accent); }
/* 'Non so' is first-class (fail-closed by design), visually prominent, not a footnote */
.answers button.unknown { border-style: dashed; border-color: var(--accent); font-weight: 600;
  background: #eef3f8; }
.answers button.selected { border-color: var(--accent); border-width: 2px; background: #dfeaf5; }
.nav { display: flex; justify-content: space-between; margin-top: 1.4rem; }
.nav button { padding: .5rem 1rem; border: 1px solid var(--line); background: #fff;
  border-radius: 5px; cursor: pointer; }
.nav button:disabled { opacity: .4; cursor: default; }

/* results */
.provisional { background: #fff8e6; border: 1px solid var(--warn); border-left: 5px solid var(--warn);
  border-radius: 5px; padding: .7rem .9rem; margin: 1rem 0; color: var(--warn); font-weight: 600; }
.deadlines { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: .3rem .9rem; }
.deadlines li { margin: .35rem 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 7px;
  padding: .9rem 1rem; margin: .8rem 0; }
.card-head { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.badge { font-size: .78rem; font-weight: 700; padding: .18rem .5rem; border-radius: 4px; color: #fff; white-space: nowrap; }
.badge.COMPLIANT { background: var(--ok); }
.badge.NON_COMPLIANT { background: var(--bad); }
.badge.UNDETERMINED { background: var(--warn); }
.badge.NOT_APPLICABLE { background: var(--na); }
.cite { color: var(--muted); font-size: .85rem; }
.rationale { margin: .5rem 0; }
.unknowns { font-size: .85rem; color: var(--warn); }
details.explain { margin-top: .4rem; }
details.explain pre { white-space: pre-wrap; font-size: .82rem; background: #f2f2ef;
  padding: .5rem .7rem; border-radius: 5px; overflow-x: auto; }
.actions { display: flex; gap: .6rem; margin: 1.2rem 0; flex-wrap: wrap; }
.actions button { padding: .55rem 1rem; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; border-radius: 5px; cursor: pointer; }
.actions button.secondary { background: #fff; color: var(--accent); }
footer.meta { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line);
  font-size: .8rem; color: var(--muted); }
/* mobile (hunt F2): long unbreakable tokens (bundle sha, corpus_version,
   citations) must wrap, not force horizontal scroll on a 375px viewport. */
footer.meta, .cite, .deadlines li, #print-meta { overflow-wrap: anywhere; }
footer.meta a { color: var(--accent); }

@media print {
  .toolbar, .lang-toggle, .actions, .nav, details.explain summary { display: none !important; }
  #results .disclaimer { position: static; }
  details.explain[open] pre { display: block; }
  .card { break-inside: avoid; }
  /* the print footer (as_of + corpus_version + version/sha) is always rendered
     by app.js into #print-meta; ensure it shows on paper. */
  #print-meta { display: block !important; }
  body { background: #fff; }
}
#print-meta { display: none; font-size: .78rem; color: var(--muted); margin-top: 1rem;
  border-top: 1px dashed var(--line); padding-top: .6rem; }
