:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #fafbfc;
  --text: #19202a;
  --muted: #667085;
  --line: #e2e6ed;
  --red: #c7252c;
  --red-dark: #9e151b;
  --teal: #007c89;
  --blue: #235789;
  --green: #2f7d57;
  --shadow: 0 14px 36px rgba(17, 24, 39, 0.07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #171b22;
  color: #f7f8fa;
  padding: 16px 24px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #b8c0cc;
  font-size: 12px;
  margin-top: 3px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  color: #c9d0da;
  border-radius: 7px;
  padding: 11px 12px;
  font-size: 14px;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.nav-item.muted {
  opacity: 0.55;
}

.workspace {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
  display: grid;
  gap: 18px;
  align-content: start;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.15;
}

.topbar p {
  color: var(--muted);
  margin-top: 6px;
}

.primary-action,
.secondary-action,
.search-row button {
  border: 0;
  border-radius: 7px;
  background: var(--red);
  color: #fff;
  padding: 11px 14px;
  font-weight: 700;
}

.primary-action:hover,
.search-row button:hover {
  background: var(--red-dark);
}

.secondary-action {
  display: inline-block;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--line);
}

.secondary-action:hover {
  border-color: rgba(35, 87, 137, 0.34);
  color: var(--blue);
}

.eyebrow {
  display: block;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.assistant-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(420px, 0.72fr);
  gap: 24px;
  align-items: stretch;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.assistant-hero h1 {
  max-width: 760px;
  font-size: 34px;
  line-height: 1.12;
}

.assistant-hero p {
  max-width: 720px;
  margin-top: 12px;
  color: #4a5566;
  font-size: 16px;
  line-height: 1.55;
}

.hero-question-form {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.hero-question-form label,
.chat-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hero-question-form textarea,
.chat-form textarea {
  min-height: 128px;
  line-height: 1.45;
}

.hero-question-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.hero-question-actions button {
  border: 0;
  border-radius: 7px;
  background: var(--red);
  color: #fff;
  padding: 11px 14px;
  font-weight: 800;
}

.hero-question-actions button:hover {
  background: var(--red-dark);
}

.assistant-prompts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.assistant-prompts a {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #344054;
  font-size: 13px;
  font-weight: 750;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.04);
}

.assistant-prompts a:hover {
  border-color: rgba(0, 124, 137, 0.42);
  color: var(--teal);
}

.assistant-trust article:nth-child(1) span {
  color: var(--blue);
}

.assistant-trust article:nth-child(2) span {
  color: var(--green);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric-grid article,
.panel,
.search-area {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-grid article {
  padding: 16px;
}

.metric-grid span,
.panel-heading span,
.requirement-topline span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 750;
}

.metric-grid strong {
  display: block;
  font-size: 30px;
  margin: 8px 0 4px;
}

.metric-grid p,
.list-row p,
.requirement-card p,
.empty p {
  color: var(--muted);
  line-height: 1.45;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
  align-items: start;
}

.panel {
  overflow: hidden;
}

.panel-heading {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading h2,
.requirement-card h2 {
  font-size: 17px;
}

.list {
  display: grid;
}

.list-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row strong {
  display: block;
  font-size: 14px;
}

.list-row p {
  margin-top: 6px;
  font-size: 13px;
}

.list-row span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.search-area {
  padding: 16px;
}

.search-area label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
}

textarea {
  resize: vertical;
}

.requirements-list {
  display: grid;
  gap: 14px;
}

.requirement-card {
  padding: 18px;
}

.requirement-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.requirement-card > p {
  margin-top: 8px;
}

.fact-grid,
.split-area {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.fact-grid strong,
.split-area h3,
.action-area h3 {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}

ul {
  margin: 0;
  padding-left: 18px;
}

li {
  margin-bottom: 8px;
  color: #3c4654;
  line-height: 1.45;
}

.action-area {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.empty {
  padding: 18px;
}

.notice {
  padding: 12px 14px;
  border: 1px solid rgba(0, 124, 137, 0.28);
  border-radius: 8px;
  background: rgba(0, 124, 137, 0.08);
  color: var(--teal);
  font-weight: 750;
}

.review-board {
  display: grid;
  gap: 14px;
}

.review-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.review-card-main,
.review-card-side {
  padding: 18px;
}

.review-card-main {
  border-right: 1px solid var(--line);
}

.review-card h2 {
  font-size: 18px;
  line-height: 1.25;
}

.review-card-main > p,
.muted-text {
  color: var(--muted);
  line-height: 1.5;
}

.review-card-main > p {
  margin-top: 9px;
}

.review-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.review-meta strong,
.review-card-side h3 {
  display: block;
  font-size: 13px;
  margin-bottom: 7px;
}

.review-meta span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.review-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.review-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.review-form label span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 7px;
}

.review-form button {
  justify-self: start;
  border: 0;
  border-radius: 7px;
  background: #171b22;
  color: #fff;
  padding: 10px 13px;
  font-weight: 750;
}

.review-form button:hover {
  background: #2b313c;
}

.review-card-side {
  display: grid;
  gap: 18px;
  align-content: start;
  background: var(--surface-soft);
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-list a {
  display: block;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.compact-list a:hover {
  border-color: rgba(0, 124, 137, 0.38);
}

.compact-list strong,
.action-list strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.compact-list span,
.action-list span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.action-list {
  padding-left: 0;
  list-style: none;
}

.action-list li {
  margin-bottom: 9px;
  padding-left: 12px;
  border-left: 3px solid var(--teal);
}

.history-list {
  display: grid;
  gap: 9px;
}

.history-list div {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.history-list strong {
  display: block;
  font-size: 13px;
}

.history-list span,
.history-list p {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.measures-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.measure-list {
  display: grid;
}

.measure-item {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.measure-item:last-child {
  border-bottom: 0;
}

.measure-item h3 {
  font-size: 16px;
  line-height: 1.3;
}

.measure-item > p {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.45;
}

.measure-context {
  margin-top: 13px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.measure-context strong,
.measure-context span {
  display: block;
  font-size: 13px;
}

.measure-context span {
  margin-top: 5px;
  color: var(--muted);
}

.measure-form {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(150px, 1fr) minmax(132px, 0.75fr) minmax(110px, 0.6fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.measure-form label span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 7px;
}

.measure-form button {
  border: 0;
  border-radius: 7px;
  background: #171b22;
  color: #fff;
  padding: 11px 13px;
  font-weight: 750;
  white-space: nowrap;
}

.measure-form button:hover {
  background: #2b313c;
}

.chat-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.45fr);
  gap: 14px;
  align-items: start;
}

.assistant-question-header {
  max-width: 820px;
}

.assistant-question-header h1 {
  font-size: 38px;
  line-height: 1.08;
}

.assistant-question-header p {
  margin-top: 12px;
  color: #4a5566;
  font-size: 17px;
  line-height: 1.55;
}

.qa-shell {
  display: grid;
  gap: 18px;
}

.question-form {
  gap: 14px;
  padding: 22px;
}

.question-form textarea {
  min-height: 178px;
  font-size: 17px;
}

.question-form button {
  justify-self: start;
  min-width: 210px;
  border: 0;
  border-radius: 7px;
  background: var(--red);
  color: #fff;
  padding: 13px 16px;
  font-weight: 800;
}

.question-form button:hover {
  background: var(--red-dark);
}

.chat-main,
.chat-context {
  overflow: hidden;
}

.chat-form {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.chat-form label span,
.chat-context h3 {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 7px;
}

.chat-controls {
  display: grid;
  grid-template-columns: minmax(220px, 0.36fr) auto;
  gap: 10px;
  align-items: end;
}

.chat-controls button {
  border: 0;
  border-radius: 7px;
  background: var(--red);
  color: #fff;
  padding: 11px 14px;
  font-weight: 750;
  white-space: nowrap;
}

.chat-controls button:hover {
  background: var(--red-dark);
}

.chat-main {
  border-top: 4px solid var(--teal);
}

.chat-context {
  background: var(--surface-soft);
}

.answer-card {
  padding: 24px;
}

.answer-label {
  display: block;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.answer-card h2 {
  font-size: 22px;
  line-height: 1.35;
}

.answer-card > p {
  margin-top: 10px;
  color: #3c4654;
  line-height: 1.55;
}

.legal-basis-box,
.plain-language-box {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.legal-basis-box h3,
.plain-language-box h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.legal-basis-box div {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  margin-bottom: 8px;
}

.legal-basis-box div:last-child {
  margin-bottom: 0;
}

.legal-basis-box strong,
.legal-basis-box span,
.legal-basis-box p {
  display: block;
}

.legal-basis-box strong {
  font-size: 13px;
  line-height: 1.35;
}

.legal-basis-box span,
.legal-basis-box p,
.plain-language-box p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.plain-language-box.secondary {
  background: #fff;
}

.source-details {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.source-details summary {
  cursor: pointer;
  padding: 13px 14px;
  color: var(--blue);
  font-weight: 800;
}

.source-details section {
  padding: 0 14px 14px;
}

.source-details h3 {
  font-size: 14px;
  margin: 12px 0 8px;
}

.source-details p {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.answer-grid h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.answer-disclaimer {
  margin-top: 16px;
  padding: 11px 12px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.context-stack {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.context-link {
  display: block;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  margin-bottom: 8px;
}

.context-link strong,
.context-link span {
  display: block;
  font-size: 13px;
}

.context-link span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.history-panel {
  padding: 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.history-panel h3 {
  font-size: 14px;
  margin-bottom: 10px;
}

.history-chat-row {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  margin-bottom: 8px;
}

.history-chat-row strong,
.history-chat-row span,
.history-chat-row p {
  display: block;
}

.history-chat-row p {
  display: none;
}

.history-chat-row strong {
  font-size: 13px;
  line-height: 1.35;
}

.history-chat-row span,
.history-chat-row p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.report-actions button.primary-action {
  cursor: pointer;
}

.report-cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 20px;
  align-items: start;
}

.report-cover span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 750;
}

.report-cover h2 {
  margin-top: 8px;
  font-size: 22px;
  line-height: 1.25;
}

.report-cover p {
  margin-top: 12px;
  color: #3c4654;
  line-height: 1.55;
}

.report-cover dl {
  display: grid;
  gap: 10px;
  min-width: 220px;
  margin: 0;
}

.report-cover dt,
.report-cover dd {
  margin: 0;
}

.report-cover dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.report-cover dd {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 750;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: flex;
    gap: 18px;
    align-items: center;
    overflow-x: auto;
  }

  .brand {
    margin-bottom: 0;
    min-width: max-content;
  }

  .nav-list {
    display: flex;
    min-width: max-content;
  }

  .content-grid,
  .metric-grid,
  .assistant-hero,
  .assistant-prompts,
  .fact-grid,
  .split-area,
  .review-card,
  .review-meta,
  .review-form-grid,
  .measures-layout,
  .measure-form,
  .chat-shell,
  .qa-shell,
  .answer-grid,
  .report-cover,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .review-card-main {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media print {
  body {
    background: #fff;
  }

  .app-shell {
    display: block;
  }

  .sidebar,
  .report-actions button {
    display: none;
  }

  .workspace {
    padding: 0;
  }

  .panel,
  .metric-grid article,
  .search-area {
    box-shadow: none;
    break-inside: avoid;
  }

  .metric-grid,
  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .list-row {
    break-inside: avoid;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 16px;
    width: 100%;
  }

  .sidebar {
    padding: 14px 16px;
  }

  .assistant-question-header h1 {
    font-size: 30px;
  }

  .topbar,
  .search-row,
  .chat-controls,
  .hero-question-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .assistant-hero {
    padding: 18px;
  }

  .assistant-hero h1 {
    font-size: 28px;
  }
}
