@font-face {
  font-family: Vazirmatn;
  src: url("/static/fonts/Vazirmatn-UI-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url("/static/fonts/Vazirmatn-UI-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-strong: #f1f5f9;
  --border: #d9dee8;
  --border-soft: #e8ecf3;
  --text: #111827;
  --muted: #647083;
  --faint: #8a94a6;
  --blue: #3b63df;
  --blue-dark: #284dbf;
  --blue-soft: #eaf0ff;
  --green: #1f9d55;
  --green-soft: #dff6e7;
  --red: #d94242;
  --amber: #b67813;
  --shadow-soft: 0 16px 50px rgba(31, 41, 55, 0.06);
  --sidebar: 320px;
  font-family: Vazirmatn, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(59, 99, 223, 0.08), rgba(31, 157, 85, 0.08)),
    #f8fafc;
}

.login-card {
  position: relative;
  display: grid;
  width: min(390px, 100%);
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 26px;
  box-shadow: var(--shadow-soft);
}

.login-heading {
  padding-inline-end: 58px;
}

.language-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 74px;
  min-height: 44px;
  height: 44px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-weight: 800;
}

.language-button:hover {
  background: var(--surface-strong);
}

.finance-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  border: 1px solid #cbd7f7;
  border-radius: 8px;
  background: #f6f8ff;
  padding: 0 12px;
  color: #234fc7;
  font-weight: 700;
}

.finance-button:hover {
  background: #eaf0ff;
}

.login-language {
  position: absolute;
  top: 24px;
  right: 24px;
}

.login-card > .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.login-card h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.login-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.login-card label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-weight: 700;
}

.login-card label span {
  font-size: 12px;
}

.login-card input {
  min-height: 42px;
  border: 1px solid #cbd3df;
  border-radius: 8px;
  color: #111827;
  padding: 0 12px;
  outline: 0;
}

.login-card input:focus {
  border-color: #8aa2f4;
  box-shadow: 0 0 0 4px rgba(59, 99, 223, 0.1);
}

.login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.login-button:hover {
  background: var(--blue-dark);
}

.login-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.login-error {
  min-height: 18px;
  color: var(--red) !important;
  font-size: 12px;
}

.sidebar {
  display: flex;
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #fbfcff;
}

.sidebar-backdrop {
  display: none;
}

.filter-backdrop {
  position: fixed;
  inset: 0 0 0 var(--sidebar);
  z-index: 70;
  display: block;
  pointer-events: none;
  background: rgba(15, 23, 42, 0);
  transition: background 160ms ease;
}

.filter-backdrop.is-visible {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.18);
}

[dir="rtl"] .filter-backdrop {
  inset: 0 var(--sidebar) 0 0;
}

.brand-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.brand-mark,
.assistant-mark {
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #5678ef, #284fc8);
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(59, 99, 223, 0.22);
}

.brand-mark {
  width: 36px;
  height: 36px;
  font-size: 20px;
}

.brand-row h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.new-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 18px 10px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  font-weight: 600;
}

.new-chat:hover,
.prompt-card:hover,
.history-item:hover,
.plain-action:hover,
.clear-button:hover,
.icon-button:hover {
  background: var(--surface-strong);
}

.history-search {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0 18px 6px;
  min-height: 38px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 0 10px;
}

.history-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.history-search input::placeholder {
  color: #8893a5;
}

.history-search:focus-within {
  border-color: #8aa2f4;
  box-shadow: 0 0 0 3px rgba(59, 99, 223, 0.08);
}

.history {
  flex: 1;
  overflow-y: auto;
  overflow-x: clip;
  padding: 12px 14px 18px;
}

.history section + section {
  margin-top: 22px;
}

.history h2 {
  margin: 0 8px 9px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.empty-history {
  margin: 10px 8px;
  color: var(--muted);
  font-size: 13px;
}

.history-state {
  margin: 10px 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.history-loading::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-end: 8px;
  border-radius: 999px;
  background: var(--blue);
  animation: pulse 1.2s ease-in-out infinite;
}

.history-error {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #f1d2a2;
  border-radius: 10px;
  background: #fff9ef;
  color: #7a4a08;
}

.history-error button {
  justify-self: start;
  min-height: 32px;
  border: 1px solid #e8bd7b;
  border-radius: 8px;
  padding-inline: 10px;
  background: #fff;
  color: #7a4a08;
  font-weight: 700;
}

.history-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #2d3748;
  text-align: left;
}

.history-item-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 4px;
}

.history-menu-wrap {
  position: relative;
  opacity: 0;
  transition: opacity 120ms ease;
}

.history-item-wrap:hover .history-menu-wrap,
.history-item-wrap:focus-within .history-menu-wrap {
  opacity: 1;
}

.history-menu-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

.history-menu-button:hover,
.history-menu-button[aria-expanded="true"] {
  background: var(--surface-strong);
  color: var(--blue-dark);
}

.history-menu {
  position: fixed;
  top: var(--history-menu-top, 0);
  left: var(--history-menu-left, 0);
  z-index: 120;
  display: grid;
  width: 176px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.13);
}

.history-menu button {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  border: 0;
  background: #fff;
  color: #334155;
  padding: 0 10px;
  text-align: left;
}

.history-menu button:hover {
  background: var(--surface-strong);
}

.history-item.is-active {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.history-item-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.history-item-copy strong,
.history-item-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-copy strong {
  font-size: 13px;
  font-weight: 700;
}

.history-item-copy small {
  color: var(--muted);
  font-size: 11px;
}

.history-count {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.history-item time {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border-soft);
}

.clear-button,
.plain-action,
.icon-button,
.profile-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #435064;
}

[dir="rtl"] .login-language {
  right: auto;
  left: 24px;
}

[dir="rtl"] .login-heading {
  padding-inline-end: 0;
  padding-inline-start: 58px;
}

[dir="rtl"] .sidebar {
  border-right: 0;
  border-left: 1px solid var(--border);
}

[dir="rtl"] .history-item,
[dir="rtl"] .history-menu button,
[dir="rtl"] .prompt-card,
[dir="rtl"] .search-result-card,
[dir="rtl"] .source-card {
  text-align: right;
}

[dir="rtl"] .history-count {
  margin-left: 0;
  margin-right: 6px;
}

[dir="rtl"] .message.user {
  justify-items: start;
}

[dir="rtl"] .record-table th,
[dir="rtl"] .record-table td,
[dir="rtl"] .record-table caption {
  text-align: right;
}

[dir="rtl"] .record-table .number {
  text-align: left;
}

[dir="rtl"] .sortable::after {
  margin-left: 0;
  margin-right: 5px;
}

.clear-button {
  gap: 10px;
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  border-radius: 8px;
}

.clear-confirm {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.clear-confirm p {
  margin: 0;
  color: #475569;
  font-size: 12px;
}

.clear-confirm div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.clear-confirm button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-weight: 700;
}

.clear-confirm button[data-clear-confirm-delete] {
  border-color: #f1b5b5;
  background: #fff5f5;
  color: var(--red);
}

.clear-confirm button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.clear-confirm span {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  grid-template-rows: 68px minmax(0, 1fr);
  background: #fff;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-soft);
}

.connection {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: #647083;
  font-size: 13px;
  min-width: 0;
}

.health-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.health-badge[data-health="ready"],
.health-badge[data-health="configured"] {
  border-color: #b7e2c7;
  background: #f0fbf3;
  color: #177642;
}

.health-badge[data-health="unavailable"],
.health-badge[data-health="unknown"] {
  border-color: #f1d2a2;
  background: #fff9ef;
  color: #8a5a10;
}

.report-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.report-catalog-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-strong);
}

.report-catalog-card h4 {
  margin: 5px 0 7px;
}

.report-catalog-card p,
.report-catalog-meta {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.report-catalog-meta {
  display: grid;
  gap: 4px;
}

.report-domain {
  margin-top: 20px;
}

.report-domain h3 {
  margin-bottom: 10px;
  text-transform: capitalize;
}

.trust-blockers {
  border-color: #f0c7c7;
  background: #fff7f7;
}

.trust-blockers span {
  color: #9a3333;
}

.connection strong {
  font: inherit;
  font-weight: 600;
}

.connection span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #49b86d;
}

.top-actions {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 18px;
}

.menu-button {
  grid-column: 1;
}

.plain-action {
  gap: 7px;
  min-height: 44px;
  min-width: 44px;
  border-radius: 8px;
  padding: 0 10px;
}

.profile-button {
  gap: 9px;
  min-height: 44px;
  min-width: 44px;
  border-radius: 8px;
  padding: 0 10px 0 8px;
}

.profile-button span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  background: #dde7ff;
  color: var(--blue-dark);
  font-weight: 700;
}

.profile-button .logout-label {
  display: inline;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.menu-button,
.mobile-close {
  display: none;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.chat-panel {
  display: grid;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
}

.chat-scroll {
  overflow-y: auto;
  padding: 30px 32px 170px;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scroll-padding-bottom: 210px;
}

.filter-panel {
  position: fixed;
  z-index: 90;
  right: 0;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}

.filter-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fbfcff;
  color: #334155;
  padding: 0 10px;
  font-weight: 700;
}

.filter-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.filter-chips {
  display: none;
  min-height: 28px;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.filter-bar {
  position: fixed;
  right: auto;
  bottom: 104px;
  left: var(--filter-popover-center, 50%);
  z-index: 95;
  display: grid;
  width: min(var(--filter-popover-width, 720px), calc(100vw - 40px));
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 14px;
  border: 1px solid #c9d4e5;
  border-radius: 14px;
  background: #ffffff;
  padding: 14px 16px 16px;
  pointer-events: auto;
  transform: translateX(-50%);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}

.filter-bar::after {
  position: absolute;
  bottom: -8px;
  left: 50%;
  width: 14px;
  height: 14px;
  border-right: 1px solid #c9d4e5;
  border-bottom: 1px solid #c9d4e5;
  background: #fff;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.filter-sheet-head {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 10px;
}

.filter-sheet-head strong {
  color: #1f2a3a;
  font-size: 13px;
}

.filter-bar label {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.filter-bar span {
  color: #536176;
  font-size: 11px;
  font-weight: 700;
}

.filter-bar input,
.filter-bar select {
  min-width: 0;
  width: 100%;
  height: 42px;
  border: 1px solid #d7dee9;
  border-radius: 9px;
  background: #fbfcff;
  color: var(--text);
  padding: 0 11px;
  outline: 0;
  text-overflow: ellipsis;
}

.filter-bar option {
  font-family: inherit;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: #8aa2f4;
  box-shadow: 0 0 0 3px rgba(59, 99, 223, 0.09);
}

.filter-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.filter-actions button {
  min-width: 92px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-weight: 700;
}

.filter-actions button:first-child {
  border-color: #b8c7fb;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.welcome-row {
  width: min(780px, 100%);
  margin: 0 auto;
}

/* Let report results consume the chat container's available width. The
 * conversation prose remains deliberately narrow for comfortable reading,
 * while decision summaries and tables are sized by the viewport/container.
 * Wide tables still scroll inside their own shell when their columns truly
 * need it; no fixed desktop width is imposed on the conversation. */
.message-stack {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.welcome-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: center;
}

.assistant-mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  font-size: 23px;
}

.welcome-row h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.welcome-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.prompt-grid {
  display: grid;
  width: min(780px, 100%);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 24px auto 28px;
}

.prompt-card {
  display: grid;
  min-height: 116px;
  align-content: start;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 16px 14px;
  color: #1f2937;
  text-align: left;
}

.prompt-card i,
.new-chat i,
.history-item i,
.clear-button i,
.plain-action i {
  width: 18px;
  height: 18px;
}

.prompt-card i {
  color: var(--blue);
}

.prompt-card strong {
  font-size: 13px;
}

.prompt-card span {
  color: #5c6677;
  font-size: 13px;
  unicode-bidi: plaintext;
}

.prompt-card span > strong,
.prompt-card span > small {
  display: block;
}

.prompt-card span > strong {
  margin-bottom: 5px;
  color: var(--text);
}

.prompt-card span > small {
  color: var(--muted);
  line-height: 1.65;
}

.prompt-card.is-promoted {
  border-color: color-mix(in srgb, var(--blue) 38%, var(--border));
  background: color-mix(in srgb, var(--blue) 5%, var(--surface));
}

.message-stack {
  display: grid;
  gap: 22px;
}

.message {
  display: grid;
  gap: 8px;
}

.message.user {
  justify-items: end;
}

.bubble {
  max-width: min(620px, 88%);
  border-radius: 8px;
  padding: 11px 14px;
  color: #1e293b;
  unicode-bidi: plaintext;
}

.user .bubble {
  background: #e7edff;
}

.assistant .bubble {
  width: 100%;
  max-width: 100%;
  padding: 0;
}

.message-meta {
  color: var(--faint);
  font-size: 12px;
}

.assistant-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.assistant-head .assistant-mark {
  width: 36px;
  height: 36px;
  border-radius: 13px;
  font-size: 19px;
}

.assistant .bubble,
.message.assistant,
.data-block {
  min-width: 0;
}

.answer-text {
  margin: 0;
  max-width: 68ch;
  color: #263244;
  font-size: clamp(15px, 1vw, 17px);
  line-height: 1.8;
  white-space: pre-wrap;
  unicode-bidi: plaintext;
}

.answer-text[dir="rtl"],
.user .bubble[dir="rtl"] {
  direction: rtl;
  text-align: right;
  unicode-bidi: isolate;
}

.answer-text[dir="ltr"],
.user .bubble[dir="ltr"] {
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}

.answer-text bdi,
.bubble bdi {
  unicode-bidi: isolate;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.choice-row button {
  min-height: 34px;
  border: 1px solid #b8c7fb;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  padding: 0 11px;
  font-weight: 700;
}

.trace-panel {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.trace-panel summary {
  cursor: pointer;
  font-weight: 700;
}

.trace-panel dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  margin: 8px 0 0;
}

.trace-panel dt {
  color: #475569;
  font-weight: 700;
}

.trace-panel dd {
  margin: 0;
}

.data-block {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.data-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, #fbfcff, #f7f9fd);
  font-weight: 700;
}

.data-title > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-title-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.data-title-actions button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

.data-title-actions button:hover {
  background: var(--surface-strong);
  color: var(--blue-dark);
}

.tool-pill {
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.record-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.entity-data-note {
  margin: 0 0 10px;
  border: 1px solid #f1d7a1;
  border-radius: 8px;
  background: #fff9eb;
  color: #7a5315;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.6;
}

.search-result-cards {
  display: none;
  gap: 6px;
  padding: 8px;
}

.search-result-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 3px 8px;
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fff;
  color: #263244;
  padding: 8px 9px;
  text-align: left;
}

.search-result-card:hover {
  background: #f8fbff;
}

.search-result-card strong,
.search-result-card span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.search-result-card strong {
  grid-column: 2 / 3;
  align-self: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-card > span:not(.result-rank) {
  grid-column: 2 / 4;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-card em,
.result-rank {
  color: var(--blue-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.record-table caption {
  caption-side: bottom;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.record-table th,
.record-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: top;
}

.record-table th {
  color: #647083;
  font-size: 12px;
  font-weight: 700;
}

.record-table th.is-inspected {
  color: var(--primary, #315de8);
  box-shadow: inset 0 -2px 0 var(--primary, #315de8);
}

.record-table td.is-inspected {
  background: color-mix(in srgb, var(--primary, #315de8) 6%, transparent);
  font-weight: 650;
}

.record-table tr:last-child td {
  border-bottom: 0;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover,
.clickable-row:focus {
  background: #f8fbff;
  outline: 0;
}

.sortable {
  cursor: pointer;
}

.sortable::after {
  content: "↕";
  margin-left: 5px;
  color: var(--faint);
  font-size: 10px;
}

.table-more {
  margin: 10px 12px 0;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--blue-dark);
  padding: 0 10px;
  font-weight: 700;
}

.record-table .number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.negative {
  color: var(--red);
}

.status {
  display: inline-flex;
  min-width: 52px;
  justify-content: center;
  border-radius: 6px;
  background: var(--green-soft);
  color: #20713f;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

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

.source-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 46px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--blue-dark);
  text-align: left;
  cursor: pointer;
}

button.source-card {
  font: inherit;
  background: #fff;
}

.source-card i {
  color: var(--blue);
}

.source-card strong,
.source-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-card strong {
  font-size: 12px;
}

.source-card span {
  color: var(--muted);
  font-size: 11px;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 48px;
  color: var(--muted);
}

.action-row button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.action-row button:hover {
  background: var(--surface-strong);
}

.loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--blue);
  animation: pulse 1s infinite ease-in-out;
}

.dot:nth-child(2) {
  animation-delay: 0.12s;
}

.dot:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.composer-wrap {
  position: relative;
  padding: 14px 32px 14px;
  border-top: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.03);
}

.composer-filter-strip {
  display: flex;
  grid-column: 1 / -1;
  width: 100%;
  align-items: center;
  gap: 8px;
  margin: 0 0 2px;
}

.composer-filter-strip.is-empty {
  position: static;
  grid-column: 1;
  grid-row: 1;
  z-index: auto;
  width: 42px;
  justify-content: center;
  margin: 0;
}

.composer-filter-strip.is-empty .composer-filter-chips,
.composer-filter-strip.is-empty [data-composer-filter-count],
.composer-filter-strip.is-empty .composer-filter-button span:first-of-type {
  display: none;
}

.composer-filter-strip.is-empty .composer-filter-button {
  min-width: 42px;
  width: 42px;
  min-height: 42px;
  padding: 0;
}

.composer-filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid #d8e0ee;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.composer-filter-button:hover,
.composer-filter-button.is-open {
  border-color: #b9c8f6;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.composer-filter-button span:last-child {
  color: var(--muted);
  font-weight: 600;
}

.composer-filter-chips {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.35);
  padding: 18px;
}

.modal {
  display: grid;
  width: min(760px, 100%);
  max-height: min(760px, 92vh);
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.modal > header {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
  padding: 0 16px;
}

.modal h2 {
  margin: 0;
  font-size: 16px;
}

.modal-body {
  overflow: auto;
  padding: 16px;
}

.modal:has(.finance-workspace) {
  width: min(1180px, 100%);
  max-height: 94vh;
}

.modal:has(.finance-workspace) .modal-body {
  padding: 20px;
}

.finance-workspace {
  display: grid;
  gap: 18px;
}

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

.finance-status {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px 14px;
}

.finance-status.is-certified {
  border-color: #bbf7d0;
  background: #f7fdf9;
}

.finance-status > div,
.finance-metric {
  display: grid;
  gap: 5px;
}

.finance-status > div {
  min-width: 0;
}

.finance-status strong {
  color: #475569;
  font-size: 11px;
}

.finance-status span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #172033;
  font-weight: 700;
}

.finance-status span,
.finance-metric span,
.finding-meta,
.proposal-card > div:last-child {
  color: var(--muted);
  font-size: 12px;
}

.finance-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.finance-metric {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #fff;
  padding: 13px 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.finance-metric:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.finance-metric-value {
  display: block;
  color: #172033;
  font-family: Vazirmatn, Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.15rem, 1.55vw, 1.35rem);
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: end;
}

.finance-metric-value bdi {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
}

.finance-tabs,
.statement-actions,
.workspace-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.finance-tabs {
  min-height: 46px;
  border-bottom: 1px solid var(--border-soft);
}

.finance-tabs button,
.statement-actions button,
.workspace-toolbar button,
.finding-card button,
.proposal-card button {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  padding: 0 11px;
  color: #334155;
  font-weight: 700;
}

.finance-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 46px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}

.finance-tabs button.is-active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.statement-actions button.is-active {
  border-color: #9bb0f3;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.finance-tabs button:focus-visible,
.statement-actions button:focus-visible,
.statement-export-actions button:focus-visible,
.workspace-toolbar button:focus-visible,
.finding-card button:focus-visible,
.proposal-card button:focus-visible {
  outline: 3px solid rgba(59, 99, 223, 0.22);
  outline-offset: 2px;
}

.finance-tabs button span {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-strong);
  padding: 0 6px;
  color: #475569;
  font-size: 11px;
}

.finance-tabs button.is-active span {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.workspace-toolbar {
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface);
  padding: 12px 14px;
}

.workspace-toolbar > div {
  min-width: 0;
}

.workspace-toolbar strong {
  color: #172033;
  font-size: 14px;
}

.workspace-toolbar p {
  color: var(--muted);
  font-size: 12px;
}

.statement-result,
[data-findings-list],
[data-proposals-list] {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.statement-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  min-width: 0;
  border-bottom: 1px solid var(--border-soft);
  padding: 2px 0 12px;
}

.statement-heading {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.statement-kicker,
.card-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.statement-title-row,
.card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.statement-title-row h3 {
  margin: 0;
  color: #172033;
  font-size: 18px;
}

.coverage-note {
  color: #475569;
  font-size: 12px;
}

.statement-export-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  justify-self: end;
}

.statement-export-actions > span {
  margin-inline-end: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.statement-export-actions button {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  padding: 0 8px;
  color: #334155;
  font-weight: 700;
}

.statement-period-context {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(220px, 0.9fr);
  gap: 8px;
}

.period-card,
.statement-period-context > p {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 4px;
  margin: 0;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: #fff;
  padding: 11px 12px;
}

.period-card {
  border-inline-start-width: 4px;
}

.period-card.is-current {
  border-inline-start-color: var(--blue);
  background: #f7f9ff;
}

.period-card.is-comparison {
  border-inline-start-color: #94a3b8;
  background: #f8fafc;
}

.period-card span,
.statement-period-context > p strong {
  color: var(--muted);
  font-size: 11px;
}

.period-card strong {
  color: #172033;
  font-size: 14px;
}

.statement-period-context > p span {
  color: #334155;
  font-size: 12px;
  line-height: 1.6;
}

.statement-trust {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface);
  padding: 12px;
}

.report-provenance {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fbfcff;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
}

.report-provenance > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-width: 0;
}

.report-provenance span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.55;
}

.report-provenance details {
  margin-top: 2px;
}

.statement-metric-grid,
.statement-evidence-grid {
  display: grid;
  gap: 8px;
}

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

.statement-evidence-grid {
  grid-template-columns: minmax(170px, 0.8fr) minmax(240px, 1.15fr) minmax(280px, 1.55fr);
  border-top: 1px solid var(--border-soft);
  padding-top: 11px;
}

.statement-metric-grid > div,
.statement-evidence-grid > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  text-align: start;
}

.statement-metric-grid > div {
  min-height: 70px;
  align-content: center;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fff;
  padding: 10px 11px;
}

.statement-evidence-grid > div {
  padding: 2px 10px;
  border-inline-end: 1px solid var(--border-soft);
}

.statement-evidence-grid > div:last-child {
  border-inline-end: 0;
}

.statement-metric-grid span,
.statement-evidence-grid strong {
  color: var(--muted);
  font-size: 11px;
}

.statement-metric-grid strong,
.statement-evidence-grid span {
  overflow-wrap: anywhere;
  text-align: inherit;
}

.statement-metric-grid strong {
  color: #172033;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.statement-evidence-grid span {
  color: #334155;
  font-size: 12px;
  line-height: 1.65;
}

.statement-trust details {
  color: var(--muted);
  font-size: 12px;
}

.statement-technical-details {
  border-top: 1px solid var(--border-soft);
  padding-top: 10px;
}

.statement-trust summary,
.finding-card summary {
  cursor: pointer;
  color: #234fc7;
  font-weight: 700;
}

.statement-trust ul {
  margin: 7px 0 0;
  padding-inline-start: 20px;
}

@media print {
  body * {
    visibility: hidden;
  }

  .modal:has(.finance-workspace),
  .modal:has(.finance-workspace) * {
    visibility: visible;
  }

  .modal:has(.finance-workspace) {
    position: absolute;
    inset: 0;
    width: 100%;
    max-height: none;
    box-shadow: none;
  }

  .finance-tabs,
  .statement-actions,
  .statement-export-actions,
  .modal header button {
    display: none;
  }
}

.report-certification {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border-soft);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
}

.report-certification .certified,
.report-certification .provisional {
  border-radius: 999px;
  padding: 3px 7px;
  background: #dcfce7;
  color: #166534;
  font-weight: 800;
}

.report-certification .provisional {
  background: #ffedd5;
  color: #9a3412;
}

.statement-summary .certified,
.statement-summary .provisional,
.severity-pill,
.status-pill {
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 11px;
  font-weight: 800;
}

.statement-summary .certified {
  background: #dcfce7;
  color: #166534;
}

.finding-card,
.proposal-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  border: 1px solid var(--border-soft);
  border-inline-start: 4px solid #f59e0b;
  border-radius: 10px;
  background: #fff;
  padding: 14px;
}

.finding-card.severity-critical,
.finding-card.severity-error {
  border-inline-start-color: #dc2626;
}

.finding-card p,
.proposal-card p,
.workspace-toolbar p {
  margin: 5px 0 0;
}

.finding-card p,
.proposal-card p {
  max-width: 78ch;
  color: #475569;
  line-height: 1.7;
}

.card-title-row > strong {
  color: #172033;
}

.finding-card details {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.finding-evidence {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.finding-meta,
.proposal-actions {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 7px;
}

.finding-meta > div {
  display: grid;
  gap: 2px;
  text-align: end;
}

.finding-meta small {
  color: var(--muted);
  font-size: 10px;
}

.finding-meta strong {
  color: #172033;
  font-size: 13px;
}

.review-actions {
  display: flex;
  gap: 6px;
}

.finance-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.statement-result {
  min-width: 0;
  overflow: visible;
}

.statement-table {
  min-width: 780px;
}

.finance-table-shell {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #fff;
  overscroll-behavior-inline: contain;
  scrollbar-color: #cbd5e1 transparent;
  scrollbar-width: thin;
}

.table-scroll-hint {
  display: none;
}

.finance-table th,
.finance-table td {
  box-sizing: border-box;
  vertical-align: middle;
  line-height: 1.55;
  overflow-wrap: anywhere;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-soft);
  border-inline-end: 1px solid #f0f2f6;
}

.finance-table th.primary-column,
.finance-table td.primary-column {
  position: sticky;
  right: 0;
  z-index: 1;
  background: #fff;
  box-shadow: -1px 0 0 var(--border-soft), -8px 0 12px -12px rgba(15, 23, 42, 0.42);
}

[dir="ltr"] .finance-table th.primary-column,
[dir="ltr"] .finance-table td.primary-column {
  right: auto;
  left: 0;
  box-shadow: 1px 0 0 var(--border-soft), 8px 0 12px -12px rgba(15, 23, 42, 0.42);
}

.finance-table thead th.primary-column {
  z-index: 2;
}

.finance-table th:last-child,
.finance-table td:last-child {
  border-inline-end: 0;
}

.finance-table thead th {
  background: var(--surface);
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.table-header-label,
.table-header-detail {
  display: block;
  overflow-wrap: anywhere;
}

.table-header-detail {
  margin-top: 4px;
  color: #7b8798;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.45;
  white-space: normal;
}

.finance-table tbody tr:nth-child(even) td {
  background: #fbfcfe;
}

.finance-table tbody tr:nth-child(odd) td {
  background: #fff;
}

.finance-table tbody tr:hover td {
  background: #f4f7ff;
}

.finance-table tbody tr:last-child td {
  border-bottom: 0;
}

.finance-table th.text-column,
.finance-table td.text-column {
  text-align: start;
}

.finance-table th.numeric-column {
  text-align: right;
  white-space: normal;
}

.finance-table td.numeric-column,
.finance-table .money-value {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

[dir="rtl"] .finance-table td.numeric-column {
  text-align: right;
}

.finance-table td.numeric-column bdi,
.money-value bdi {
  unicode-bidi: isolate;
}

[dir="rtl"] .statement-table th.text-column,
[dir="rtl"] .statement-table td.text-column {
  position: sticky;
  right: 0;
  z-index: 1;
  box-shadow: -1px 0 0 var(--border-soft);
}

[dir="rtl"] .statement-table thead th.text-column {
  z-index: 2;
}

[dir="ltr"] .statement-table th.text-column,
[dir="ltr"] .statement-table td.text-column {
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: 1px 0 0 var(--border-soft);
}

[dir="ltr"] .statement-table thead th.text-column {
  z-index: 2;
}

[dir="rtl"] .statement-heading,
[dir="rtl"] .finance-status,
[dir="rtl"] .finance-metrics {
  text-align: right;
}

[dir="rtl"] .statement-export-actions {
  justify-self: end;
}

[dir="rtl"] .statement-metric-grid > div,
[dir="rtl"] .statement-evidence-grid > div {
  text-align: right;
}

.workspace-empty {
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.inline-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.inline-loading::before {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-soft);
  border-top-color: var(--blue);
  border-radius: 50%;
  content: "";
  animation: rahkaran-spin 760ms linear infinite;
}

.role-home {
  display: grid;
  gap: 14px;
  margin: 0 0 22px;
}
.demo-banner { border: 1px solid color-mix(in srgb, var(--warning) 55%, var(--line)); border-radius: 12px; padding: 12px 14px; background: color-mix(in srgb, var(--warning) 10%, var(--surface)); color: var(--warning-ink, var(--text)); font-weight: 700; }
.role-home-header,
.finance-route-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.role-home-header h3,
.finance-route-header h2 { margin: 0; }
.role-home-header p,
.role-home-card p { margin: 4px 0 0; color: var(--muted); }
.role-home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.role-home-card,
.role-home-list {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 16px;
}
.role-home-card strong { display: block; font-size: 1.35rem; margin-top: 6px; }
.role-home-card .card-kicker { color: var(--muted); }
.role-home-card.is-alert { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.role-home-list ul { margin: 12px 0 0; padding-inline-start: 20px; }
.role-home-list li { margin: 8px 0; }
.role-home-list a { color: inherit; }
.finance-route { height: 100%; overflow: auto; padding: 20px clamp(16px, 3vw, 40px) 48px; background: var(--surface-soft); }
.finance-route-header { max-width: 1280px; margin: 0 auto 18px; }
.finance-route-header > div { flex: 1; }
.finance-route-back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--accent); cursor: pointer; font: inherit; }
.finance-route-back span:first-child { font-size: 1.6rem; line-height: 1; }
.route-kicker { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.route-scope-badge { max-width: min(62vw, 760px); overflow: visible; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; padding: 7px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.finance-route > #financeRouteContent > .finance-workspace { max-width: 1280px; margin: 0 auto; }
.report-route > #reportRouteContent > .report-browser { max-width: 1280px; margin: 0 auto; }
.icon-missing { color: var(--danger); }
.report-browser-controls { display: grid; grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr); gap: 10px; margin: 14px 0 18px; }
.report-browser-summary { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); }
.report-browser-summary span { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: var(--surface); }
.report-browser-controls input,
.report-browser-controls select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: inherit; padding: 0 12px; font: inherit; }
.report-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.report-card-actions button { min-height: 36px; }
.scope-period-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.notification-list { display: grid; gap: 10px; }
.notification-item { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.notification-item.is-read { opacity: .7; }
.notification-item p { margin: 5px 0; color: var(--muted); }
.close-loop-summary { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 12px 0; background: var(--surface); }
.close-loop-summary span { color: var(--muted); line-height: 1.7; }
.close-task-list { display: grid; gap: 10px; margin-bottom: 14px; }
.close-task-card { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface); }
.close-task-card p { margin: 5px 0 0; color: var(--muted); }
.management-loop-steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; }
.management-loop-steps span { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; color: var(--muted); background: var(--surface); }

@media (max-width: 980px) {
  .role-home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-route { padding-inline: 12px; }
}
@media (max-width: 560px) {
  .report-browser-controls { grid-template-columns: 1fr; }
  .role-home-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .role-home-card { padding: 12px; }
  .role-home-card strong { font-size: 1.1rem; }
  .close-task-card { display: grid; }
}

/* Final responsive shell overrides: the mobile layout has a real navigation
 * surface instead of compressing every desktop control into the top bar. */
html,
body,
.app-shell,
.workspace,
.finance-route {
  max-width: 100%;
  overflow-x: hidden;
}

.workspace { position: relative; }
.mobile-menu-button,
.mobile-nav { display: none; }

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 8px;
    padding-inline: 10px;
  }
  .connection { min-width: 0; gap: 6px; overflow: hidden; }
  .connection strong { max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .connection .health-badge { max-width: 86px; overflow: hidden; text-overflow: ellipsis; }
  .connection #plannerHealth,
  .connection #buildHealth { display: none; }
  .top-actions { gap: 4px; }
  .top-actions > .finance-button,
  .top-actions > [data-notifications] { display: none; }
  .top-actions > .mobile-menu-button { display: inline-flex; }
  .mobile-nav {
    position: absolute;
    top: 64px;
    right: 10px;
    z-index: 150;
    display: grid;
    width: min(280px, calc(100vw - 20px));
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
  }
  [dir="rtl"] .mobile-nav { right: auto; left: 10px; }
  .mobile-nav button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    padding: 0 12px;
    text-align: start;
    font-weight: 700;
  }
  .mobile-nav button:hover,
  .mobile-nav button:focus-visible { background: var(--surface-strong); }
  .profile-button .logout-label { display: none; }
  .finance-route-header { position: sticky; top: -20px; z-index: 5; padding: 10px 0 12px; background: var(--surface-soft); }
  .route-scope-badge { max-width: 100%; overflow: visible; white-space: normal; }
  .finance-tabs { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
}

@media (max-width: 430px) {
  .workspace { grid-template-rows: 58px minmax(0, 1fr); }
  .topbar { min-height: 58px; }
  .connection { justify-self: stretch; }
  .connection strong { display: none; }
  .connection #sourceHealth { max-width: 100%; }
  .language-button { min-width: 40px; width: 40px; padding: 0; }
  .language-button span { display: none; }
  .top-actions { min-width: 88px; }
  .chat-scroll { padding-inline: 10px; padding-bottom: 18px; scroll-padding-bottom: 18px; }
  .composer-wrap { position: static; padding-inline: 8px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .composer { width: 100%; min-width: 0; grid-template-columns: 38px minmax(0, 1fr) 40px; gap: 5px; }
  .composer textarea { min-width: 0; max-width: 100%; }
  .filter-bar { max-height: min(74dvh, 520px); padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .finance-route { padding: 12px 10px calc(28px + env(safe-area-inset-bottom)); }
  .finance-route-header { top: -12px; }
  .finance-route-header h2 { font-size: 18px; }
  .finance-tabs button { padding-inline: 8px; font-size: 12px; }
  .statement-table { min-width: 620px; }
}

/* Account-classification resolution: explain, act, approve, verify. */
.blocked-mapping-summary {
  display: grid;
  gap: 12px;
  margin-block: 14px;
  padding: 14px;
  border: 1px solid #f0d39d;
  border-radius: 12px;
  background: #fffaf1;
}

.blocked-mapping-summary p { margin: 0; color: var(--text); font-weight: 700; }
.blocked-mapping-summary dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.blocked-mapping-summary dl > div { display: grid; gap: 3px; padding: 9px 11px; border-radius: 9px; background: #fff; }
.blocked-mapping-summary dt { color: var(--muted); font-size: 11px; }
.blocked-mapping-summary dd { margin: 0; font-size: 13px; font-weight: 800; }
.blocked-mapping-summary button { justify-self: start; }
.blocked-mapping-summary.is-error { border-color: #e8b8b8; background: #fff5f5; }

.mapping-resolution-workspace { display: grid; gap: 18px; min-width: 0; }
.mapping-resolution-loading { display: grid; justify-items: center; gap: 10px; min-height: 280px; align-content: center; text-align: center; }
.mapping-resolution-loading p { max-width: 560px; margin: 0; color: var(--muted); }

.mapping-resolution-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border: 1px solid #ebc77d;
  border-radius: 16px;
  background: linear-gradient(135deg, #fffaf0, #fff 72%);
}
.mapping-resolution-hero > div { display: grid; gap: 7px; }
.mapping-resolution-hero h3 { margin: 0; color: var(--text); font-size: clamp(19px, 2vw, 26px); }
.mapping-resolution-hero p { max-width: 850px; margin: 0; color: #667287; line-height: 1.9; }
.status-pill.is-ready { border-color: #a9d8c1; background: #effaf4; color: #176b47; }

.mapping-resolution-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--border-soft);
}
.mapping-resolution-steps span { display: flex; align-items: center; gap: 9px; min-height: 54px; padding: 10px 14px; background: #fff; color: #657086; font-size: 13px; font-weight: 750; }
.mapping-resolution-steps b { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; background: #eef1f6; }
.mapping-resolution-steps .is-current { background: #f4f7ff; color: var(--blue-dark); }
.mapping-resolution-steps .is-current b { background: var(--blue-dark); color: #fff; }
.mapping-resolution-steps .is-complete b { background: #e5f6ed; color: #176b47; }

.mapping-resolution-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.mapping-resolution-summary > div { display: grid; gap: 5px; min-width: 0; padding: 14px; border: 1px solid var(--border-soft); border-radius: 12px; background: #fff; }
.mapping-resolution-summary span { color: var(--muted); font-size: 12px; }
.mapping-resolution-summary strong { color: var(--text); font-size: 15px; overflow-wrap: anywhere; }

.mapping-resolution-queue { display: grid; gap: 14px; }
.mapping-resolution-filters { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(180px, 260px) auto; align-items: end; gap: 10px; padding: 14px; border: 1px solid var(--border-soft); border-radius: 12px; background: #f8f9fc; }
.mapping-resolution-filters label,
.mapping-resolution-actionbar label,
.mapping-target-control label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.mapping-resolution-filters input,
.mapping-resolution-filters select,
.mapping-resolution-actionbar input,
.mapping-target-control select { min-width: 0; min-height: 42px; padding: 8px 11px; border: 1px solid #ccd3df; border-radius: 9px; background: #fff; color: var(--text); font: inherit; }

.mapping-account-list { display: grid; gap: 10px; }
.mapping-account-row {
  display: grid;
  grid-template-columns: 34px minmax(220px, 1fr) minmax(320px, 1.35fr) minmax(250px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  background: #fff;
}
.mapping-account-row:focus-within { border-color: #9cb1f2; box-shadow: 0 0 0 3px rgba(53, 89, 224, .09); }
.mapping-account-row.status-returned { border-color: #e4b5b5; background: #fffafa; }
.mapping-account-row.status-review_required { border-color: #e8cf96; background: #fffdf8; }
.mapping-account-row.status-approved { background: #f7fcf9; }
.mapping-row-select { display: grid; place-items: center; }
.mapping-row-select input { width: 18px; height: 18px; accent-color: var(--blue-dark); }
.mapping-account-identity { display: grid; gap: 5px; min-width: 0; }
.mapping-account-identity small { color: var(--muted); }
.mapping-account-identity strong { overflow-wrap: anywhere; }
.mapping-account-identity .status-pill { justify-self: start; }
.mapping-review-note { margin: 3px 0 0; color: #8b4b4b; font-size: 12px; }
.mapping-account-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; }
.mapping-account-metrics > div { display: grid; gap: 3px; min-width: 0; padding: 8px; border-radius: 8px; background: #f7f8fb; }
.mapping-account-metrics dt { color: var(--muted); font-size: 10px; }
.mapping-account-metrics dd { margin: 0; font-size: 12px; font-weight: 750; overflow-wrap: anywhere; }
.mapping-target-control { display: grid; gap: 7px; min-width: 0; }
.mapping-target-control > small { color: var(--muted); line-height: 1.55; }
.mapping-recommendation { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; border-radius: 8px; background: #f1f5ff; color: var(--blue-dark); font-size: 11px; }
.mapping-recommendation button { min-height: 30px; white-space: nowrap; font-size: 11px; }

.mapping-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 12px; }
.mapping-resolution-actionbar {
  position: sticky;
  z-index: 4;
  bottom: 10px;
  display: grid;
  grid-template-columns: minmax(190px, .8fr) minmax(240px, 1fr) minmax(0, 1.5fr);
  gap: 12px;
  align-items: end;
  padding: 15px;
  border: 1px solid #bec9e8;
  border-radius: 13px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 12px 35px rgba(32, 45, 74, .16);
  backdrop-filter: blur(10px);
}
.mapping-resolution-actionbar > div:first-child { display: grid; gap: 4px; }
.mapping-resolution-actionbar > div:first-child span { color: var(--muted); font-size: 11px; }
.mapping-resolution-actionbar .modal-status { grid-column: 1 / -1; margin: 0; color: #9a3f3f; }
.mapping-action-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.mapping-resolution-success { display: grid; gap: 8px; padding: 22px; border: 1px solid #a9d8c1; border-radius: 14px; background: #f1fbf6; }
.mapping-resolution-success p { margin: 0; color: #4f6d5d; }
.mapping-resolution-evidence { padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: 10px; color: var(--muted); }
.mapping-resolution-evidence p { line-height: 1.8; }

@media (max-width: 1120px) {
  .mapping-account-row { grid-template-columns: 34px minmax(220px, .8fr) minmax(0, 1.2fr); }
  .mapping-target-control { grid-column: 2 / -1; }
  .mapping-resolution-actionbar { grid-template-columns: 1fr 1fr; }
  .mapping-action-buttons { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .blocked-mapping-summary dl,
  .mapping-resolution-summary { grid-template-columns: 1fr 1fr; }
  .mapping-resolution-hero { flex-direction: column; padding: 17px; }
  .mapping-resolution-steps { grid-template-columns: 1fr 1fr; }
  .mapping-resolution-filters { grid-template-columns: 1fr; }
  .mapping-account-row { grid-template-columns: 30px minmax(0, 1fr); align-items: start; }
  .mapping-account-identity { grid-column: 2; }
  .mapping-account-metrics,
  .mapping-target-control { grid-column: 1 / -1; }
  .mapping-account-metrics { grid-template-columns: 1fr 1fr; }
  .mapping-resolution-actionbar { grid-template-columns: 1fr; bottom: 6px; }
  .mapping-action-buttons { grid-column: auto; justify-content: stretch; }
  .mapping-action-buttons button { flex: 1 1 100%; }
}

@media (max-width: 430px) {
  .blocked-mapping-summary dl,
  .mapping-resolution-summary,
  .mapping-resolution-steps { grid-template-columns: 1fr; }
  .mapping-account-metrics { grid-template-columns: 1fr; }
  .mapping-pagination { align-items: stretch; flex-direction: column; text-align: center; }
}

@media (min-width: 821px) {
  .app-shell.finance-mode { grid-template-columns: 1fr; }
  .app-shell.finance-mode .sidebar { display: none; }
  .app-shell.finance-mode .top-actions > .finance-button:not(.work-button),
  .app-shell.finance-mode .top-actions > [data-notifications] { display: none; }
  .app-shell.finance-mode .topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
}

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

/* Audit remediation: keep trust, ownership, and recovery states readable at a glance. */
.scope-segment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.scope-segment-grid span {
  display: block;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface, #fff) 86%, var(--blue, #315bdc));
}

.scope-segment-grid small {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
}

.technical-scope-label {
  display: block;
  margin-top: 6px;
  color: var(--faint);
  direction: ltr;
  font-size: 10px;
}

.blocked-state-card,
.scope-period-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 20px;
  margin-top: 10px;
  padding: 18px 20px;
  border: 1px solid #ead7a5;
  border-radius: 14px;
  background: #fffaf0;
}

.blocked-state-card p,
.scope-period-callout p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.blocked-state-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.blocked-state-kicker {
  display: block;
  margin-bottom: 5px;
  color: #8a6518;
  font-size: 11px;
  font-weight: 700;
}

.blocked-state-header strong {
  display: block;
  color: #382b12;
  font-size: 16px;
  line-height: 1.55;
}

.blocked-state-card .status-pill {
  flex: 0 0 auto;
  border-color: #edcaca;
  background: #fff0f0;
  color: #a22b2b;
}

.blocked-state-reasons {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 13px 15px;
  border: 1px solid #f0dfb7;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
}

.blocked-state-reasons > strong {
  color: #5e4615;
  font-size: 12px;
}

.blocked-state-reasons ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-inline-start: 20px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.75;
}

.blocked-state-reasons li::marker {
  color: #c48a18;
}

.blocked-state-meta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.blocked-state-meta > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #f0dfb7;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.58);
}

.blocked-state-meta span {
  color: #8a6518;
  font-size: 11px;
  font-weight: 700;
}

.blocked-state-meta strong {
  color: #4b5563;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.blocked-state-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.blocked-state-actions button,
.scope-period-callout button {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  padding: 0 16px;
  background: var(--blue, #315bdc);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.blocked-state-actions button:hover {
  background: var(--blue-dark, #284dbf);
}

.blocked-state-actions button:focus-visible,
.blocked-state-technical summary:focus-visible {
  outline: 3px solid rgba(49, 91, 220, 0.28);
  outline-offset: 3px;
}

.blocked-state-technical {
  grid-column: 1 / -1;
  border-top: 1px solid #ead7a5;
  padding-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.blocked-state-technical summary {
  width: fit-content;
  cursor: pointer;
  color: #6b7280;
  font-weight: 700;
}

.blocked-state-technical ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.blocked-state-technical li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}

.blocked-state-technical code {
  color: #4b5563;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}

.blocked-resolution-panel {
  display: grid;
  gap: 14px;
}

.blocked-resolution-intro,
.blocked-resolution-aftercare p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.blocked-resolution-scope {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface-soft, #f8fafc);
}

.blocked-resolution-scope span,
.blocked-resolution-steps small {
  color: var(--muted);
  font-size: 11px;
}

.blocked-resolution-scope strong {
  line-height: 1.7;
}

.blocked-resolution-steps {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: resolution-step;
}

.blocked-resolution-steps li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #fff;
}

.blocked-resolution-step-number {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
}

.blocked-resolution-steps strong {
  display: block;
  color: var(--text);
  line-height: 1.6;
}

.blocked-resolution-steps p {
  margin: 2px 0 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.blocked-resolution-steps button {
  min-height: 34px;
  border: 1px solid #b8c7fb;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.blocked-resolution-steps button:hover,
.blocked-resolution-steps button:focus-visible {
  background: #dfe7ff;
}

.blocked-resolution-aftercare {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #c8d5fb;
  border-radius: 10px;
  background: #f7f9ff;
}

.blocked-resolution-aftercare strong {
  color: var(--blue-dark);
}

.blocked-resolution-aftercare .modal-actions {
  justify-content: flex-start;
  margin-top: 5px;
}

.blocked-resolution-panel .blocked-state-technical {
  margin-top: 2px;
}

.route-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.route-quick-action {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 10px;
  background: var(--surface, #fff);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.finance-metric-unit {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.tab-count {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-inline-start: 5px;
  padding: 0 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue, #315bdc) 10%, var(--surface, #fff));
  color: var(--blue, #315bdc);
  font-size: 11px;
  font-weight: 700;
}

.my-work-views {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 10px;
  border-bottom: 1px solid var(--line);
}

.my-work-views button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface, #fff);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.my-work-views button.is-active {
  border-color: color-mix(in srgb, var(--blue, #315bdc) 45%, var(--line));
  background: color-mix(in srgb, var(--blue, #315bdc) 9%, var(--surface, #fff));
  color: var(--blue, #315bdc);
  font-weight: 700;
}

.my-work-item-meta button {
  border: 0;
  background: transparent;
  color: var(--blue, #315bdc);
  font: inherit;
  cursor: pointer;
}

.work-item-detail-panel header h3 {
  margin: 0;
}

.work-item-next-step,
.filter-builder-context-note,
.filter-active-summary,
.failure-request-summary {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--blue, #315bdc) 7%, var(--surface, #fff));
  color: var(--muted);
  line-height: 1.7;
}

.filter-active-summary {
  border-inline-start: 3px solid var(--blue, #315bdc);
}

.planner-failure-card {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid #edc5c5;
  border-inline-start: 4px solid #c24141;
  border-radius: 12px;
  background: #fffafa;
  color: var(--text, #17212f);
}

.planner-failure-card > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.planner-failure-heading {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.planner-failure-heading > i {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: #b42318;
}

.planner-failure-heading strong,
.planner-failure-heading small {
  display: block;
}

.planner-failure-heading small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.planner-failure-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.planner-failure-actions > button,
.failure-more-actions > summary,
.failure-more-actions button {
  min-height: 36px;
  border: 1px solid var(--border, #d9dee8);
  border-radius: 9px;
  background: var(--surface, #fff);
  color: var(--text, #17212f);
  padding: 0 11px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.planner-failure-actions > button:disabled {
  cursor: wait;
  opacity: .72;
}

.failure-technical {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.failure-technical blockquote {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-inline-start: 3px solid var(--line);
  overflow-wrap: anywhere;
  color: var(--muted);
}

.planner-failure-actions .primary-action {
  border-color: var(--blue, #315bdc);
  background: var(--blue, #315bdc);
  color: #fff;
}

.failure-more-actions {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}

.failure-more-actions > summary {
  display: inline-flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 6px;
  list-style: none;
  line-height: 1;
  white-space: nowrap;
}

.failure-more-actions > summary::-webkit-details-marker {
  display: none;
}

.failure-more-actions > summary svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 160ms ease;
}

.failure-more-actions[open] > summary svg {
  transform: rotate(180deg);
}

.failure-more-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.failure-more-actions button {
  min-height: 32px;
  padding-inline: 9px;
  font-size: 12px;
}

.mobile-nav-context {
  margin: 0;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.enterprise-auth-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.secondary-auth-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: var(--surface, #fff);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.enterprise-auth-row span {
  color: var(--muted);
  font-size: 11px;
}

.enterprise-auth-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.enterprise-auth-status-grid span {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft, #f8fafc);
}

.enterprise-auth-status-grid strong { font-size: 11px; }
.enterprise-auth-status-grid small { color: var(--muted); font-size: 10px; line-height: 1.5; }

.profile-summary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.profile-account-actions,
.profile-support-actions {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.profile-account-actions strong,
.profile-support-actions strong { color: var(--muted); font-size: 11px; }

@media (max-width: 680px) {
  .scope-segment-grid { grid-template-columns: 1fr; }
  .route-header-actions { width: 100%; justify-content: flex-start; }
  .route-scope-badge { flex: 1 1 100%; order: -1; }
  .blocked-state-card,
  .scope-period-callout { grid-template-columns: 1fr; }
  .blocked-state-meta { grid-template-columns: 1fr; }
  .blocked-state-actions button,
  .scope-period-callout button { width: 100%; }
  .enterprise-auth-row { align-items: stretch; flex-direction: column; }
  .enterprise-auth-status-grid,
  .profile-summary-actions { grid-template-columns: 1fr; }
}

.notification-filter { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.notification-filter select { min-height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: inherit; padding: 0 8px; font: inherit; }

.json-view {
  margin: 0;
  overflow: auto;
  color: #1f2937;
  font-size: 12px;
  white-space: pre-wrap;
}

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

.detail-section {
  display: grid;
  gap: 10px;
}

.detail-section h3,
.related-card h4 {
  margin: 0;
  color: #1f2937;
  font-size: 14px;
}

.related-card {
  display: grid;
  gap: 8px;
}

.modal-form,
.confirm-panel {
  display: grid;
  gap: 14px;
}

.modal-form label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-weight: 700;
}

.modal-form input {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-actions button {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  padding: 0 13px;
  font-weight: 700;
}

.modal-actions button[type="submit"],
.modal-actions [data-confirm-delete] {
  border-color: #b8c7fb;
  background: var(--blue);
  color: #fff;
}

.modal-actions [data-confirm-delete] {
  border-color: #f1b5b5;
  background: var(--red);
}

.modal-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.audit-timeline {
  display: grid;
  gap: 12px;
}

.audit-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 12px;
}

.audit-item i {
  color: var(--green);
}

.audit-item strong,
.audit-item span {
  display: block;
}

.audit-item span,
.audit-item p,
.empty-state span {
  color: var(--muted);
  font-size: 12px;
}

.audit-item p,
.empty-state p {
  margin: 4px 0 0;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
}

.empty-state i {
  color: var(--blue);
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: grid;
  gap: 8px;
}

.toast {
  border: 1px solid #bfe8cc;
  border-radius: 8px;
  background: #f0fff4;
  color: #17643a;
  padding: 10px 12px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.13);
  font-weight: 700;
}

.toast.is-error {
  border-color: #f1b5b5;
  background: #fff5f5;
  color: var(--red);
}

.composer-wrap p {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

.composer {
  display: grid;
  width: min(940px, 100%);
  min-height: 58px;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  border: 1px solid #cad5e6;
  border-radius: 16px;
  background: #fff;
  padding: 7px 9px;
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.07);
}

.composer:focus-within {
  border-color: #8aa2f4;
  box-shadow: 0 0 0 4px rgba(59, 99, 223, 0.1);
}

.composer textarea {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  min-height: 42px;
  max-height: 130px;
  resize: none;
  border: 0;
  outline: 0;
  color: #1f2937;
  line-height: 1.5;
  padding: 10px 0;
  font-size: 14px;
}

.composer textarea::placeholder {
  color: transparent;
  opacity: 0;
  -webkit-text-fill-color: transparent;
}

/* Keep the composer text origin stable across WebKit and Chromium. WebKit can
   resolve the placeholder's bidi alignment independently from the textarea. */
.composer textarea[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

.composer textarea[dir="rtl"]::placeholder {
  direction: rtl;
  text-align: right;
}

.composer textarea[dir="ltr"] {
  direction: ltr;
  text-align: left;
}

.composer textarea[dir="ltr"]::placeholder {
  direction: ltr;
  text-align: left;
}

.composer-placeholder {
  position: absolute;
  z-index: 1;
  inset-inline-start: 62px;
  top: 18px;
  max-width: calc(100% - 124px);
  overflow: hidden;
  color: #7b8495;
  font-size: 15px;
  line-height: 1.8;
  pointer-events: none;
  text-align: start;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer textarea:not(:placeholder-shown) + .composer-placeholder {
  opacity: 0;
}

.send-button {
  display: grid;
  grid-column: 3;
  grid-row: 2;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 20px rgba(59, 99, 223, 0.22);
}

.composer-filter-strip.is-empty ~ textarea,
.composer-filter-strip.is-empty ~ .send-button {
  grid-row: 1;
}

.send-button:hover {
  background: var(--blue-dark);
}

.send-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

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

  .sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    width: min(var(--sidebar), 88vw);
    transform: translateX(-100%);
    transition: transform 160ms ease;
    box-shadow: 20px 0 60px rgba(15, 23, 42, 0.12);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: block;
    pointer-events: none;
    background: rgba(15, 23, 42, 0);
    transition: background 160ms ease;
  }

  .sidebar-backdrop.is-visible {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.28);
  }

  .filter-backdrop.is-visible {
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .menu-button,
  .mobile-close {
    display: inline-flex;
  }

  .topbar {
    grid-template-columns: auto 1fr auto;
    padding: 0 16px;
  }

  .connection {
    justify-content: flex-start;
    margin-left: 8px;
  }

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

  .filter-bar {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 680px) {
  .modal-backdrop:has(.finance-workspace) {
    padding: 0;
  }

  .modal:has(.finance-workspace) {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .modal:has(.finance-workspace) .modal-body {
    padding: 12px;
  }

  .finance-workspace {
    gap: 13px;
  }

  .topbar {
    gap: 6px;
    padding-inline: 10px;
  }

  .connection {
    display: inline-flex;
    justify-self: center;
    max-width: 132px;
    margin: 0;
    gap: 6px;
    overflow: hidden;
    font-size: 10px;
  }

  .connection strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-actions {
    gap: 4px;
  }

  .profile-button .logout-label {
    display: none;
  }

  .profile-button {
    padding-inline: 4px;
  }

  .finance-button span {
    display: none;
  }

  .finance-status {
    grid-template-columns: 1fr;
    gap: 0;
    padding-block: 4px;
  }

  .finance-status > div {
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    border-bottom: 1px solid var(--border-soft);
    padding: 8px 0;
  }

  .finance-status > div:last-child {
    border-bottom: 0;
  }

  .finance-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .finance-metric {
    min-height: 76px;
    padding: 10px;
  }

  .finance-metric-value {
    font-size: 1.08rem;
  }

  .finance-tabs,
  .statement-actions {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .finance-tabs::-webkit-scrollbar,
  .statement-actions::-webkit-scrollbar {
    display: none;
  }

  .finance-tabs button,
  .statement-actions button {
    flex: 0 0 auto;
  }

  .statement-summary {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .statement-title-row h3 {
    font-size: 16px;
  }

  .statement-period-context {
    grid-template-columns: 1fr;
  }

  .period-card,
  .statement-period-context > p {
    min-height: 64px;
  }

  .statement-metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .statement-evidence-grid {
    grid-template-columns: 1fr;
  }

  .statement-evidence-grid > div {
    border-inline-end: 0;
    border-bottom: 1px solid var(--border-soft);
    padding: 8px 2px;
  }

  .statement-evidence-grid > div:last-child {
    border-bottom: 0;
  }

  .statement-export-actions,
  [dir="rtl"] .statement-export-actions {
    justify-self: stretch;
  }

  .statement-export-actions > span {
    flex-basis: 100%;
  }

  .statement-export-actions button {
    flex: 1;
  }

  .finance-table-shell {
    margin-inline: -1px;
  }

  .data-title {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 7px;
    min-height: 0;
    padding: 9px 10px;
  }

  .data-title > span:first-child {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .data-title-actions {
    justify-content: flex-start;
  }

  .report-provenance > div {
    grid-template-columns: 1fr;
    gap: 3px;
    padding-block: 3px;
  }

  .report-provenance > div strong {
    color: #475569;
  }

  .report-provenance > div span {
    line-height: 1.65;
  }

  .table-scroll-hint {
    display: block;
    margin: 0;
    border-bottom: 1px solid var(--border-soft);
    background: #f8fafc;
    padding: 8px 10px;
    color: var(--muted);
    font-size: 11px;
    text-align: start;
  }

  .statement-table {
    min-width: 720px;
  }

  .finding-card,
  .proposal-card {
    grid-template-columns: 1fr;
  }

  .finding-meta,
  .proposal-actions {
    align-items: stretch;
    border-top: 1px solid var(--border-soft);
    padding-top: 10px;
  }

  .finding-meta > div {
    text-align: start;
  }

  .review-actions button {
    flex: 1;
  }

  .workspace-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-toolbar button {
    width: 100%;
  }
  body {
    font-size: 13px;
  }

  .workspace {
    grid-template-rows: 58px minmax(0, 1fr);
  }

  .topbar {
    min-height: 58px;
  }

  .plain-action span {
    display: none;
  }

  .chat-scroll {
    padding: 22px 16px 230px;
    scroll-padding-bottom: 260px;
  }

  .welcome-row {
    grid-template-columns: 38px 1fr;
  }

  .assistant-mark {
    width: 38px;
    height: 38px;
  }

  .welcome-row h2 {
    font-size: 16px;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 95;
    width: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(68vh, 420px);
    overflow-y: auto;
    border-radius: 12px 12px 0 0;
    padding: 14px;
    transform: none;
  }

  .filter-bar::after {
    display: none;
  }

  .filter-actions {
    grid-template-columns: 1fr 1fr;
    display: grid;
    justify-content: stretch;
  }

  .filter-actions button {
    min-width: 0;
  }

  .prompt-grid,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .prompt-card {
    min-height: 86px;
  }

  .bubble {
    max-width: 100%;
  }

  .assistant-head {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .assistant-head .assistant-mark {
    width: 32px;
    height: 32px;
  }

  .action-row {
    margin-left: 44px;
  }

  .composer-wrap {
    padding: 8px 12px 10px;
  }

  .composer-wrap p {
    display: none;
  }

  .composer-filter-strip {
    align-items: center;
  }

  .composer-filter-strip.is-empty {
    width: 40px;
  }

  .composer-filter-chips {
    max-height: 42px;
    overflow-y: auto;
  }

  .composer {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 8px;
    border-radius: 14px;
  }

  .composer-filter-strip.is-empty .composer-filter-button,
  .send-button {
    min-width: 40px;
    min-height: 40px;
    width: 40px;
    height: 40px;
  }

  .search-results-block .record-table {
    display: none;
  }

  .search-result-cards {
    display: grid;
  }

  .search-results-block .table-more {
    margin-top: 0;
  }

  .data-title-actions button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }
}

/* Audit remediation: compact, recoverable, and evidence-first surfaces. */
.build-health {
  display: none !important;
}

/* Technical source/planner health belongs in diagnostics and the trust card;
 * keeping it out of the primary header prevents overlapping status pills. */
.connection .health-badge {
  display: none !important;
}

.connection strong {
  min-width: 0;
  max-width: min(34vw, 280px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions .report-browser-button,
.top-actions .scope-button,
.top-actions .profile-info-button {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted, #667085);
  font-weight: 600;
}

.top-actions .finance-button[data-finance-workspace] {
  border-color: #9db1f5;
  background: #eef2ff;
  color: #234fc7;
  box-shadow: 0 2px 8px rgba(35, 79, 199, .08);
}

.top-actions .profile-info-button {
  display: inline-flex;
}

.mobile-nav[hidden] {
  display: none;
}

.login-context {
  margin: 0 !important;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--muted) !important;
  font-size: 12px;
  line-height: 1.7;
}

.login-help-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-inline-end: 44px !important;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: inline-grid;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

[dir="rtl"] .password-toggle { right: auto; left: 7px; }

.planner-degraded-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 auto 8px;
  width: min(900px, 100%);
  padding: 10px 12px;
  border: 1px solid #f1c27d;
  border-radius: 12px;
  background: #fff8eb;
  color: #6b4b16;
}

.planner-degraded-panel p { margin: 2px 0 0; font-size: 12px; }
.planner-degraded-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.planner-degraded-actions button { min-height: 34px; border: 1px solid #d9a54d; border-radius: 8px; background: #fff; color: #744d0b; padding: 0 9px; font-weight: 700; }
.planner-unavailable-note { display: none !important; }
.prompt-grid.planner-unavailable .prompt-card { border-style: dashed; opacity: .88; }
.prompt-grid.planner-unavailable .prompt-card::after { content: "↗"; margin-inline-start: auto; color: var(--blue); font-weight: 800; }
.prompt-card.is-rerouted { cursor: pointer; }

.canonical-trust-header.is-compact {
  gap: 8px;
  margin-bottom: 12px;
  padding: 11px 13px;
}
.canonical-trust-header.is-compact .trust-primary { align-items: center; }
.canonical-trust-header.is-compact .trust-primary strong { font-size: 14px; }
.canonical-trust-header.is-compact .trust-chips span { padding: 3px 7px; font-size: 11px; }
.canonical-trust-header.is-compact .trust-evidence p { margin: 8px 0; color: var(--muted); }

.finance-priority-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-inline-start: 4px solid var(--blue);
  border-radius: 12px;
  background: #f8faff;
}
.finance-priority-banner strong { display: block; margin-top: 3px; }
.finance-priority-banner p { margin: 4px 0 0; color: var(--muted); }
.finance-priority-banner button,
.my-work-inbox button { min-height: 36px; border: 1px solid var(--blue); border-radius: 8px; background: var(--blue); color: #fff; padding: 0 11px; font-weight: 800; }

.close-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}
.close-stepper span { display: grid; gap: 5px; min-height: 52px; padding: 7px; border: 1px solid var(--border-soft); border-radius: 9px; background: #fff; color: var(--muted); font-size: 11px; }
.close-stepper b { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: var(--surface-strong); color: var(--text); }
.close-stepper .is-complete { border-color: #9ed7b8; background: #f1fbf5; color: #176c43; }
.close-stepper .is-current { border-color: #9bb2f4; background: #f2f5ff; color: var(--blue-dark); }
.close-stepper .is-complete b { background: #1f9d55; color: #fff; }
.close-stepper .is-current b { background: var(--blue); color: #fff; }
.close-stepper .is-blocked { border-color: #e7c27d; background: #fffaf0; color: #8a5a08; }
.close-stepper .is-blocked b { background: #d97706; color: #fff; }
.close-stepper .is-unavailable { border-color: #cbd5e1; background: #f8fafc; color: #64748b; }
.close-stepper .is-unavailable b { background: #64748b; color: #fff; }
.close-stepper .is-pending { border-style: dashed; background: #fafafa; color: #64748b; }
.close-stepper small { color: inherit; font-size: 10px; }
.close-state-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.close-state-legend span { border-radius: 999px; padding: 3px 8px; font-size: 10px; font-weight: 700; }
.close-state-legend .is-complete { background: #e8f8ef; color: #176c43; }
.close-state-legend .is-current { background: #edf2ff; color: var(--blue-dark); }
.close-state-legend .is-blocked { background: #fff3dc; color: #8a5a08; }
.close-state-legend .is-unavailable { background: #eef2f7; color: #64748b; }
.close-control-reason { margin: 5px 0 0 !important; color: #8a5a08 !important; font-size: 12px; line-height: 1.6; }
.close-control-reason.is-provisional { color: #7c3aed !important; }

.finance-metric.is-unavailable,
.role-home-card.is-unavailable { border-color: #e7c27d; background: #fffbf3; }
.finance-metric.is-unavailable .finance-metric-value,
.role-home-card.is-unavailable strong { color: #8a5a08; font-size: 1rem; }
.finance-metric.is-unavailable .finance-metric-unit { white-space: normal; border-radius: 8px; line-height: 1.5; }

.report-domain { margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.report-domain > summary { display: flex; justify-content: space-between; gap: 12px; padding: 13px 15px; cursor: pointer; font-weight: 800; }
.report-domain > summary small { color: var(--muted); font-weight: 600; }
.report-domain[open] > summary { border-bottom: 1px solid var(--line); }
.report-domain > .report-catalog-grid { padding: 14px; }

.scope-active-trust { display: grid; gap: 7px; }
.scope-active-trust > strong { color: var(--muted); font-size: 12px; }
.data-entry-dialog label small { color: var(--muted); line-height: 1.5; }
.auth-support-handoff { display: grid; gap: 12px; }
.auth-support-handoff p { margin: 0; line-height: 1.7; }
.auth-support-handoff pre { white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface-soft); font: inherit; font-size: 12px; }
.button-link { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; border-radius: 9px; padding: 0 14px; background: var(--blue); color: #fff; text-decoration: none; font-weight: 700; }
.close-task-card.status-blocked { border-color: #e7a3a3; background: #fffafa; }
.close-task-main { min-width: 0; flex: 1; }
.close-task-main p { max-width: 70ch; }
.close-task-evidence-summary { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.close-task-card .report-catalog-meta { align-items: flex-end; }
.close-task-card .report-catalog-meta button { white-space: nowrap; }

.my-work-inbox { display: grid; gap: 14px; }
.my-work-header { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--border-soft); }
.my-work-header h3 { margin: 3px 0; }
.my-work-header p { margin: 0 0 7px; color: var(--muted); }
.my-work-list { display: grid; gap: 9px; }
.my-work-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px; border: 1px solid var(--border-soft); border-inline-start: 4px solid #f1b54a; border-radius: 11px; background: #fff; }
.my-work-item.severity-critical, .my-work-item.severity-error { border-inline-start-color: #d94242; }
.my-work-item.is-unread { background: #f8faff; }
.my-work-item h4 { margin: 7px 0 3px; }
.my-work-item p { margin: 0; color: var(--muted); }
.my-work-item-meta { display: flex; align-items: flex-end; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; text-align: end; }
.my-work-item-meta button { margin-top: 3px; }

.mobile-nav-backdrop {
  position: absolute;
  inset: 58px 0 0;
  z-index: 140;
  background: rgba(15, 23, 42, .22);
}
.mobile-nav-backdrop.is-visible { display: block; }
.mobile-nav header { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px 8px; border-bottom: 1px solid var(--border-soft); }
.mobile-nav header .icon-button { min-width: 34px; width: 34px; min-height: 34px; height: 34px; }
.mobile-nav button.is-current { background: var(--blue-soft); color: var(--blue-dark); }

@media (max-width: 680px) {
  .planner-degraded-panel { display: grid; align-items: stretch; }
  .planner-degraded-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .planner-degraded-actions button { padding-inline: 5px; font-size: 11px; }
  .planner-failure-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .planner-failure-actions > .primary-action,
  .failure-more-actions { grid-column: 1 / -1; }
  .planner-failure-actions > button,
  .failure-more-actions > summary { width: 100%; }
  .failure-more-actions > div { display: grid; grid-template-columns: 1fr; }
  .failure-more-actions button { width: 100%; }
  .finance-priority-banner { align-items: stretch; flex-direction: column; }
  .finance-priority-banner button { width: 100%; }
  .close-stepper { grid-template-columns: repeat(5, minmax(92px, 1fr)); overflow-x: auto; padding-bottom: 3px; }
  .my-work-item { grid-template-columns: 1fr; }
  .my-work-item-meta { align-items: stretch; text-align: start; border-top: 1px solid var(--border-soft); padding-top: 8px; }
}

.notification-button {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 2px solid var(--surface, #fff);
  border-radius: 999px;
  background: #b42318;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 13px;
  text-align: center;
}

.finance-mode .finance-route {
  min-width: 0;
}

.route-loading,
.route-error {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 180px;
  padding: 36px 20px;
  border: 1px solid var(--border, #d9dee8);
  border-radius: 16px;
  background: var(--surface, #fff);
  color: var(--text-muted, #667085);
  text-align: center;
}

.route-error {
  border-color: color-mix(in srgb, #b42318 28%, var(--border, #d9dee8));
}

.route-error h3,
.route-error strong {
  margin: 0;
  color: var(--text, #17212f);
}

.route-error button,
.actionable-empty button,
.result-summary-actions button,
.notification-actions button,
.notification-toolbar button,
.profile-summary-actions button {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--border, #d9dee8);
  border-radius: 9px;
  background: var(--surface, #fff);
  color: var(--text, #17212f);
  font-weight: 700;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid color-mix(in srgb, var(--accent, #3559e0) 22%, transparent);
  border-top-color: var(--accent, #3559e0);
  border-radius: 50%;
  animation: rahkaran-spin .8s linear infinite;
}

.skeleton {
  width: min(100%, 560px);
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #edf1f7, #dfe7f3, #edf1f7);
  background-size: 200% 100%;
  animation: rahkaran-shimmer 1.5s ease-in-out infinite;
}

.skeleton-card {
  height: 110px;
  border-radius: 14px;
}

.canonical-trust-header {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--border, #d9dee8);
  border-inline-start: 4px solid #c88719;
  border-radius: 14px;
  background: var(--surface, #fff);
}

.canonical-trust-header.is-ready {
  border-inline-start-color: #16845b;
}

.trust-primary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.trust-primary strong {
  display: block;
  margin-top: 3px;
  color: var(--text, #17212f);
}

.trust-primary p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--text-muted, #667085);
  line-height: 1.55;
}

.trust-primary .trust-scope-note {
  margin-top: 8px;
  color: #8a5a13;
  font-size: 12px;
  font-weight: 700;
}

.trust-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.trust-chips span {
  padding: 5px 8px;
  border: 1px solid var(--border, #d9dee8);
  border-radius: 999px;
  color: var(--text-muted, #667085);
  font-size: 12px;
}

.trust-evidence summary,
.technical-report-details summary {
  cursor: pointer;
  color: var(--accent, #3559e0);
  font-size: 12px;
  font-weight: 700;
}

.report-quality-summary-status {
  width: fit-content;
  padding: 5px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.report-quality-summary-status {
  border-color: #f2d2a0;
  background: #fff8eb;
  color: #9a5b0a;
}

.report-scope-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  min-height: 38px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border-soft, #e8edf4);
}

.report-scope-line span {
  color: var(--text-muted, #667085);
  font-size: 12px;
  font-weight: 700;
}

.report-scope-line strong {
  color: var(--text, #17212f);
  font-size: 14px;
}

.report-selected-entity {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border-soft, #e8edf4);
}

.report-selected-entity span {
  color: var(--text-muted, #667085);
  font-size: 12px;
  font-weight: 700;
}

.report-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px 4px;
  border-top: 1px solid var(--border-soft, #e8edf4);
}

.report-pagination-range {
  margin: 0;
  color: var(--text-muted, #667085);
  font-size: 13px;
  font-weight: 700;
}

.report-pagination-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.report-page-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border, #d7deea);
  border-radius: 9px;
  background: var(--surface, #fff);
  color: var(--text, #17212f);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.report-page-button:hover:not(:disabled) {
  border-color: var(--accent, #3559e0);
  color: var(--accent, #3559e0);
}

.report-page-button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.report-page-button svg {
  width: 16px;
  height: 16px;
}

.report-result-footer {
  display: grid;
  gap: 0;
  margin-top: 8px;
  border-top: 1px solid var(--border-soft, #e8edf4);
}

.report-result-footer-totals {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 22px;
  padding: 11px 4px;
}

.report-result-footer-totals div {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}

.report-result-footer-totals span {
  color: var(--text-muted, #667085);
  font-size: 12px;
  font-weight: 700;
}

.report-result-footer-totals strong {
  color: var(--accent, #3559e0);
  font-size: 14px;
}

.report-inline-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 4px;
  border-block: 1px solid #f2d2a0;
  background: #fffaf0;
  color: #7c4a0b;
}

.report-inline-warning strong,
.report-inline-warning p {
  display: block;
}

.report-inline-warning strong {
  font-size: 13px;
}

.report-inline-warning p {
  margin: 3px 0 0;
  color: #8b5e26;
  font-size: 12px;
  line-height: 1.6;
}

.report-inline-warning-link {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #e4b96f;
  border-radius: 8px;
  background: transparent;
  color: #8b5e26;
  font-size: 12px;
  font-weight: 800;
}

.report-secondary-actions {
  border-top: 1px solid var(--border-soft, #e8edf4);
  padding: 11px 4px;
}

.report-secondary-actions > summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent, #3559e0);
  font-size: 12px;
  font-weight: 800;
}

.report-secondary-actions .result-summary-actions {
  margin-top: 9px;
}

.report-secondary-actions .calculation-explanation {
  margin-top: 9px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft, #e8edf4);
  border-radius: 9px;
  background: var(--surface-muted, #f8fafc);
}

.report-secondary-actions .calculation-explanation summary {
  cursor: pointer;
  color: var(--text-muted, #667085);
  font-size: 12px;
  font-weight: 700;
}

.report-secondary-actions .calculation-explanation p {
  margin: 7px 0 0;
  color: var(--text-muted, #667085);
  font-size: 13px;
  line-height: 1.7;
}

.report-trust-disclosure {
  margin-top: 0;
  border-top: 1px solid var(--border-soft, #e8edf4);
  background: transparent;
}

.report-trust-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  cursor: pointer;
  color: var(--accent, #3559e0);
  font-size: 13px;
  font-weight: 800;
  list-style-position: inside;
}

.report-trust-content {
  display: grid;
  gap: 12px;
  padding: 0 4px 14px;
  border-top: 1px solid var(--border-soft, #e8edf4);
}

.report-trust-intro {
  margin: 12px 0 0;
  color: var(--text-muted, #667085);
  font-size: 13px;
  line-height: 1.7;
}

.report-trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 8px;
}

.report-trust-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border-soft, #e8edf4);
  border-radius: 9px;
  background: var(--surface, #fff);
}

.report-trust-grid strong {
  color: var(--text-muted, #667085);
  font-size: 11px;
}

.report-trust-grid span {
  color: var(--text, #17212f);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.report-trust-grid small {
  color: var(--text-muted, #667085);
  font-size: 11px;
  line-height: 1.5;
}

.report-trust-blockers {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-inline-start: 3px solid #d38a18;
  border-radius: 8px;
  background: #fff8eb;
}

.report-trust-blockers strong {
  color: #7c4a0b;
  font-size: 12px;
}

.report-trust-blockers span {
  color: #8b5e26;
  font-size: 12px;
  line-height: 1.65;
}

.report-trust-disclosure .report-technical-details {
  border-top: 1px solid var(--border-soft, #e8edf4);
  padding-top: 10px;
}

/* Approval-gated report-quality sample for master.entity_list. */
.report-quality-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  margin-top: 0;
  padding: 10px 20px;
  border-top: 1px solid #e6eaf1;
  background: #fff;
}

.report-quality-rail-message,
.report-quality-rail-meta,
.report-quality-rail-meta > span {
  display: flex;
  align-items: center;
}

.report-quality-rail-message { min-width: 0; gap: 7px; }
.report-quality-rail-message > svg { flex: 0 0 auto; width: 20px; height: 20px; }
.report-quality-rail-message strong { flex: 0 0 auto; font-size: 13px; font-weight: 850; }
.report-quality-rail-message span {
  min-width: 0;
  overflow: hidden;
  color: #657287;
  font-size: 12px;
  line-height: 1.65;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-quality-rail.is-warning .report-quality-rail-message > svg,
.report-quality-rail.is-warning .report-quality-rail-message strong { color: #9a6109; }
.report-quality-rail.is-ready .report-quality-rail-message > svg,
.report-quality-rail.is-ready .report-quality-rail-message strong { color: #187047; }

.report-quality-rail-meta {
  flex: 0 0 auto;
  gap: 14px;
  color: #657287;
  font-size: 12px;
}

.report-quality-rail-meta > span { gap: 6px; white-space: nowrap; }
.report-quality-rail-meta > span > svg { width: 16px; height: 16px; }
.report-quality-rail-meta button {
  min-height: 34px;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #315bd6;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.report-quality-rail-meta button:hover { background: #f0f4ff; color: #2449bd; }
.report-quality-rail-meta button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent, #3559e0) 34%, transparent);
  outline-offset: 2px;
}

.report-menu-section-start { margin-top: 4px; border-top: 1px solid #e8ebf1 !important; }

dialog.report-info-dialog {
  width: min(730px, calc(100vw - 32px));
  max-width: none;
  max-height: min(90dvh, 790px);
  overflow: hidden;
  margin: auto;
  padding: 0;
  border: 1px solid #e2e6ed;
  border-radius: 14px;
  background: #fff;
  color: #172033;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .24), 0 6px 22px rgba(15, 23, 42, .12);
}

dialog.report-info-dialog:not(.report-info-dialog--compact) {
  height: min(706px, calc(100dvh - 32px));
}

dialog.report-info-dialog::backdrop {
  background: rgba(30, 41, 59, .46);
  backdrop-filter: blur(2px);
}

dialog.report-info-dialog--compact { width: min(520px, calc(100vw - 32px)); }
.report-info-dialog-surface {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  max-height: min(90dvh, 790px);
}

.report-info-dialog-header {
  display: flex;
  direction: ltr;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 12px 22px;
  border-bottom: 1px solid #eef0f4;
}

.report-info-dialog-header h2 {
  min-width: 0;
  margin: 0;
  color: #172033;
  direction: rtl;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.5;
  text-align: right;
}

[dir="ltr"] .report-info-dialog-header h2 { direction: ltr; }
.report-info-dialog-header button {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #5f6b7c;
  cursor: pointer;
}

.report-info-dialog-header button:hover { background: #f3f5f8; color: #172033; }
.report-info-dialog-header button:focus-visible,
.report-quality-dialog-footer button:focus-visible,
.report-calculation-dialog footer button:focus-visible,
.report-quality-technical > summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent, #3559e0) 34%, transparent);
  outline-offset: 2px;
}

.report-info-dialog-header button svg { width: 21px; height: 21px; }
.report-info-dialog-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.report-quality-dialog-content {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 20px 24px 22px;
}
.report-quality-dialog-hero {
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 7px;
  padding: 18px 16px 34px;
  text-align: center;
}

.report-quality-dialog-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.report-quality-dialog-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.report-quality-dialog-icon svg { width: 24px; height: 24px; }
.report-quality-dialog-hero.is-warning .report-quality-dialog-icon { color: #bd7908; }
.report-quality-dialog-hero.is-ready .report-quality-dialog-icon { color: #187047; }
.report-quality-dialog-hero strong { font-size: 20px; font-weight: 900; }
.report-quality-dialog-hero p {
  max-width: 540px;
  margin: 0;
  color: #657287;
  font-size: 14px;
  line-height: 1.8;
}

.report-quality-dialog-facts { margin: 0; border-top: 1px solid #e8ebf1; }
.report-quality-dialog-facts > div {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 18px;
  min-height: 78px;
  padding: 10px 6px;
  border-bottom: 1px solid #e8ebf1;
}

.report-quality-dialog-facts dt {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #344054;
  font-size: 14px;
  font-weight: 850;
}

.report-quality-dialog-facts dt svg { width: 26px; height: 26px; color: #315bd6; }
.report-quality-dialog-facts dd {
  min-width: 0;
  justify-self: left;
  margin: 0;
  color: #344054;
  direction: rtl;
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  text-align: left;
}

[dir="ltr"] .report-quality-dialog-facts dd {
  direction: ltr;
  justify-self: right;
  text-align: right;
}

.report-quality-dialog-limitation {
  margin: 0;
  padding: 28px 6px;
  color: #5f6b7c;
  font-size: 14px;
  line-height: 1.85;
}

.report-quality-technical {
  overflow: hidden;
  border: 1px solid #dfe4ec;
  border-radius: 10px;
  background: #fbfcfe;
}

.report-quality-technical > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 9px 14px;
  color: #536176;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.report-quality-technical > summary::-webkit-details-marker { display: none; }
.report-quality-technical > summary svg { width: 18px; height: 18px; transition: transform .16s ease; }
.report-quality-technical[open] > summary svg { transform: rotate(180deg); }
.report-quality-technical > div { padding: 0 14px 14px; border-top: 1px solid #e8ebf1; }
.report-quality-technical-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
  margin: 0;
}

.report-quality-technical-grid > div {
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid #edf0f4;
}

.report-quality-technical-grid > div.is-wide { grid-column: 1 / -1; }
.report-quality-technical-grid dt { color: #657287; font-size: 11px; font-weight: 800; }
.report-quality-technical-grid dd {
  margin: 5px 0 0;
  color: #344054;
  font-size: 12px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.report-quality-technical-grid ul { display: grid; gap: 4px; margin: 0; padding-inline-start: 18px; }
.report-quality-dialog-footer { display: flex; justify-content: center; padding-top: 40px; }
.report-quality-dialog-footer button,
.report-calculation-dialog footer button {
  min-width: 112px;
  min-height: 46px;
  padding: 7px 16px;
  border: 1px solid #d8deea;
  border-radius: 9px;
  background: #fff;
  color: #263244;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.report-quality-dialog-footer button:hover,
.report-calculation-dialog footer button:hover { border-color: #b9c7f4; background: #f4f7ff; color: #2449bd; }
.report-calculation-dialog { padding: 18px 22px 22px; }
.report-calculation-dialog p { margin: 0; color: #475569; font-size: 14px; line-height: 1.9; }
.report-calculation-dialog footer { display: flex; justify-content: center; padding-top: 20px; }

.report-browser-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
}

.report-browser {
  gap: 10px;
}

.report-browser-hero {
  display: block;
  padding: 4px 0 2px;
}

.report-browser-hero h3 {
  margin: 6px 0 4px;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.report-browser-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.report-catalog-grid {
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 14px;
}

.report-catalog-card {
  min-height: 0;
  gap: 12px;
  padding: 18px;
  border-radius: 14px;
}

.report-card-header {
  display: grid;
  gap: 8px;
}

.report-card-header h4 {
  margin: 0;
  font-size: 1.05rem;
}

.report-domain-chip {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, #3559e0) 10%, var(--surface, #fff));
  color: var(--accent, #3559e0);
  font-size: 11px;
  font-weight: 800;
}

.report-purpose {
  min-height: 0;
  margin: 0 !important;
  color: var(--text, #17212f) !important;
  font-size: .92rem !important;
  line-height: 1.65 !important;
}

.report-card-support {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.report-card-support span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
}

.report-card-actions {
  margin-top: auto;
}

.report-card-actions .report-primary-action {
  border-color: var(--accent, #3559e0);
  background: var(--accent, #3559e0);
  color: #fff;
}

.report-technical-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.report-technical-details summary {
  cursor: pointer;
  color: var(--accent, #3559e0);
  font-size: 12px;
  font-weight: 800;
}

.report-technical-details .report-catalog-meta {
  margin-top: 10px;
  font-size: 11px;
}

.report-save-action {
  width: 100%;
  margin-top: 10px;
}

.report-browser-summary button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--border, #d9dee8);
  border-radius: 999px;
  background: var(--surface, #fff);
  color: var(--text-muted, #667085);
  font-weight: 700;
}

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

.saved-view-item {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--border, #d9dee8);
  border-radius: 10px;
}

.saved-view-item small {
  color: var(--text-muted, #667085);
}

.result-summary-main strong {
  display: block;
  margin-top: 3px;
  color: var(--text, #17212f);
  font-size: clamp(1rem, .35vw + .95rem, 1.15rem);
}

.result-summary-main p {
  margin: 6px 0 0;
  color: var(--text-muted, #667085);
  font-size: clamp(15px, .55vw + 11px, 16px);
  line-height: 1.8;
}

.result-summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.result-summary-stats div {
  padding: 9px;
  border-radius: 9px;
  background: var(--surface, #fff);
}

.result-summary-stats span,
.result-summary-stats strong {
  display: block;
}

.result-summary-stats span {
  color: var(--text-muted, #667085);
  font-size: 11px;
}

.result-summary-actions,
.notification-actions,
.notification-toolbar,
.actionable-empty > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  color: var(--text-muted, #667085);
  font-size: 12px;
  font-weight: 700;
}

.table-toolbar-note {
  font-weight: 500;
}

.notification-toolbar {
  justify-content: space-between;
  margin-bottom: 10px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border, #d9dee8);
}

.notification-item.is-read {
  opacity: .65;
}

.notification-item p {
  margin: 4px 0;
  color: var(--text-muted, #667085);
}

.notification-item small {
  color: var(--text-muted, #667085);
}

.profile-summary-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.profile-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent, #3559e0);
  color: #fff;
  font-weight: 800;
}

.profile-summary h3,
.profile-summary p {
  margin: 0;
}

.profile-summary p,
.profile-summary dd {
  color: var(--text-muted, #667085);
}

.profile-summary dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.profile-summary dl div {
  display: grid;
  grid-template-columns: minmax(100px, .4fr) 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border, #d9dee8);
}

.profile-summary dt {
  font-weight: 700;
}

.profile-summary dd {
  margin: 0;
}

.profile-summary-actions {
  margin-top: 16px;
}

/* Scope editor: make the decision visible before the controls and keep
 * technical identifiers out of the default interaction path. */
.source-context-form {
  gap: 16px;
}

.source-context-form .canonical-trust-header {
  margin: 0;
}

.scope-editor-summary {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent, #3559e0) 5%, var(--surface, #fff));
}

.scope-editor-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.source-context-form > label,
.source-context-form > .scope-period-grid {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.source-context-form select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--text, #17212f);
  padding: 0 10px;
  font: inherit;
}

.source-context-form select[multiple] {
  min-height: 44px;
  height: auto;
  padding: 5px;
}

.source-context-form select[multiple] option {
  padding: 9px 10px;
  border-radius: 7px;
}

.source-context-form details {
  padding: 4px 0;
}

.source-context-form .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 0 -16px -16px;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface, #fff);
}

.source-context-form {
  padding-bottom: 72px;
}

.scope-editor-summary,
.scope-active-trust {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface, #fff);
}

.technical-scope-label {
  display: none;
}

.queue-status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-muted, #f8fafc);
  font-size: 12px;
}

.queue-status-bar.status-failed { border-color: #e7a3a3; background: #fffafa; }
.queue-status-bar.status-loading { border-color: #d8b66a; background: #fffaf0; }
.queue-status-bar span { color: var(--muted); }

.role-home-list li.is-investigable {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  cursor: pointer;
  border-radius: 9px;
  padding: 9px 10px;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.role-home-list li.is-investigable::after {
  content: "←";
  color: var(--accent);
  font-weight: 900;
}

[dir="ltr"] .role-home-list li.is-investigable::after { content: "→"; }
.role-home-list li.is-investigable:hover { background: var(--blue-soft, #eef3ff); }
.role-home-list li.is-investigable:focus-visible { outline: 3px solid rgba(59, 99, 223, 0.22); outline-offset: 2px; }
.role-home-list li.is-investigable small { grid-column: 1; color: var(--accent); font-weight: 700; }

.blocked-reason-list { display: grid; gap: 7px; margin-top: 8px; }
.blocked-reason-item { border: 1px solid #efd8b0; border-radius: 9px; background: rgba(255, 255, 255, .72); }
.blocked-reason-item > summary { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 10px; cursor: pointer; font-weight: 800; }
.blocked-reason-item > summary small { color: #9a5b0a; font-size: 10px; white-space: nowrap; }
.blocked-reason-item > div { padding: 0 10px 10px; border-top: 1px solid #f3e3c8; }
.blocked-reason-item p { margin: 9px 0; }
.blocked-reason-item dl { display: grid; gap: 6px; margin: 0; }
.blocked-reason-item dl > div { display: grid; grid-template-columns: minmax(90px, .45fr) minmax(0, 1.55fr); gap: 8px; }
.blocked-reason-item dt { color: #8a5a10; font-size: 10px; font-weight: 800; }
.blocked-reason-item dd { margin: 0; line-height: 1.6; }

.modal:has(.finding-investigation-panel) {
  width: min(980px, calc(100vw - 32px));
  max-height: min(92dvh, 920px);
}

.finding-investigation-panel {
  display: grid;
  gap: 14px;
  color: var(--text, #17212f);
}

.investigation-hero {
  display: grid;
  gap: 10px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--surface, #fff), var(--surface-muted, #f8fafc));
}

.investigation-hero > div { display: flex; flex-wrap: wrap; gap: 7px; }
.investigation-hero h3 { max-width: 34ch; margin: 0; font-size: clamp(18px, 2.4vw, 25px); line-height: 1.65; text-wrap: balance; }
.investigation-badges { align-items: center; }
.investigation-hero p,
.investigation-risk p,
.investigation-section p { margin: 0; color: var(--muted); line-height: 1.8; }

.investigation-risk {
  padding: 13px 15px;
  border-inline-start: 4px solid #dc2626;
  border-radius: 10px;
  background: #fff6f6;
}

.investigation-risk strong { display: block; margin-bottom: 4px; color: #991b1b; }

.investigation-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.investigation-metrics > div {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface, #fff);
}

.investigation-metrics span { color: var(--muted); font-size: 11px; font-weight: 700; }
.investigation-metrics strong { overflow-wrap: anywhere; font-size: 15px; }
.investigation-metrics small { color: var(--muted); font-size: 10px; line-height: 1.65; }
.investigation-impact.is-partial { border-color: #e7c56f; background: #fffaf0; }
.investigation-impact.is-unavailable { border-color: #e0e5ec; background: #f8fafc; }
.investigation-impact.is-unavailable strong { color: #667085; font-size: 13px; }

.investigation-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface, #fff);
}

.investigation-section > header,
.investigation-section > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.investigation-section > summary { cursor: pointer; font-weight: 850; }
.investigation-section > summary small { color: var(--muted); font-weight: 600; }
.investigation-section > summary + * { margin-top: 12px; }
.investigation-section h4 { margin: 2px 0 0; font-size: 15px; }
.investigation-section ol { margin: 10px 0 0; padding-inline-start: 24px; line-height: 1.9; }
.investigation-scope-warning { margin-top: 9px !important; padding: 8px 10px; border-radius: 8px; background: #fff7e6; color: #8a5a08 !important; font-size: 12px; }

.investigation-evidence-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.investigation-evidence-list article {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface-muted, #f8fafc);
}

.investigation-evidence-list article > header {
  min-height: 0;
  padding: 0;
  border: 0;
}

.investigation-evidence-list article > header { margin-bottom: 7px; color: var(--accent); font-size: 11px; font-weight: 850; }
.investigation-evidence-list dl { display: grid; gap: 5px; margin: 0; }
.investigation-evidence-list dl > div { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(0, 1.3fr); gap: 8px; }
.investigation-evidence-list dt { color: var(--muted); font-size: 11px; }
.investigation-evidence-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-weight: 700; }
.evidence-source-reference { max-width: 100%; color: var(--muted); font-size: 10px; font-weight: 600; }
.evidence-source-reference summary { cursor: pointer; }
.evidence-source-reference code { display: block; max-width: 100%; margin-top: 4px; overflow-x: auto; padding: 5px 7px; border-radius: 6px; background: #eef2f7; color: #334155; font-size: 10px; direction: ltr; text-align: left; white-space: nowrap; }
.evidence-source-code { display: grid; gap: 2px; justify-items: start; }
.evidence-source-code small { color: var(--muted); font-size: 10px; font-weight: 600; }
.investigation-empty { padding: 12px; border-radius: 8px; background: var(--surface-muted, #f8fafc); }

.investigation-next { border-color: #b8c7fb; background: #f7f9ff; }
.investigation-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.investigation-actions button { min-height: 42px; border: 1px solid var(--border); border-radius: 8px; background: #fff; padding: 0 13px; font: inherit; font-weight: 800; cursor: pointer; }
.investigation-actions .primary-action,
.finding-investigate-button { border-color: var(--accent) !important; background: var(--accent) !important; color: #fff !important; }

.investigation-technical {
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
}

.investigation-technical summary { cursor: pointer; font-weight: 800; }
.investigation-technical dl { display: grid; gap: 7px; margin: 12px 0; }
.investigation-technical dl > div { display: grid; grid-template-columns: minmax(130px, .6fr) minmax(0, 1.4fr); gap: 10px; }
.investigation-technical dt { font-size: 11px; }
.investigation-technical dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.investigation-technical pre { max-height: 220px; overflow: auto; margin: 0; padding: 10px; border-radius: 8px; background: #111827; color: #e5e7eb; font-size: 11px; text-align: left; }

@media (max-width: 760px) {
  .investigation-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .investigation-evidence-list { grid-template-columns: 1fr; }
  .investigation-section > header,
  .investigation-section > summary { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
  .modal:has(.finding-investigation-panel) { width: calc(100vw - 12px); max-height: 96dvh; }
  .modal:has(.finding-investigation-panel) .modal-body { padding: 10px; }
  .investigation-metrics { grid-template-columns: 1fr; }
  .investigation-actions { display: grid; }
  .investigation-actions button { width: 100%; }
  .investigation-evidence-list dl > div { grid-template-columns: 1fr; gap: 2px; }
}

@keyframes rahkaran-spin { to { transform: rotate(360deg); } }
@keyframes rahkaran-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 640px) {
  .trust-primary,
  .notification-item {
    align-items: stretch;
    flex-direction: column;
  }

  .trust-primary .status-pill {
    align-self: flex-start;
  }

  .report-result-footer-totals {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .report-pagination-actions,
  .report-page-button {
    flex: 1;
  }

  .report-inline-warning {
    align-items: stretch;
    flex-direction: column;
  }

  .report-inline-warning-link {
    align-self: flex-start;
  }

  .report-trust-disclosure > summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-toolbar-note,
  .table-scroll-hint {
    display: none;
  }

  .notification-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .top-actions .profile-info-button {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner,
  .skeleton {
    animation: none;
  }
}

/* CEO audit remediation: keep status dimensions named, recovery visible, and
 * the Persian shell fluid without letting controls wrap into unreadable pills. */
.canonical-status-dimensions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.canonical-status-dimensions span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--border-soft, #e8edf4);
  border-radius: 9px;
  background: var(--surface-soft, #f8fafc);
}

.canonical-status-dimensions small { color: var(--muted); font-size: 10px; }
.canonical-status-dimensions strong { font-size: 12px; }

.scope-current-state {
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid var(--border-soft, #e8edf4);
  border-radius: 10px;
  background: var(--surface-soft, #f8fafc);
}

.scope-current-state span { color: var(--muted); font-size: 11px; font-weight: 700; }
.scope-current-state strong { line-height: 1.7; }

.async-recovery {
  display: grid;
  gap: 5px;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid #e7c27d;
  border-radius: 10px;
  background: #fffaf0;
  color: #7b5108;
}

.async-recovery p { margin: 0; color: inherit; }
.async-recovery button { width: fit-content; }

.close-blocker-summary {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid #e7c27d;
  border-radius: 10px;
  background: #fffaf0;
  color: #7b5108;
}

.close-blocker-summary ul { display: grid; gap: 6px; margin: 0; padding-inline-start: 18px; }
.close-blocker-summary li { display: grid; gap: 1px; }
.close-blocker-summary small { color: inherit; opacity: .9; }
.close-blocker-summary p { margin: 0; color: inherit; }
.close-actions .primary-action { border-color: var(--accent, #3559e0); background: var(--accent, #3559e0); color: #fff; }
.close-actions .secondary-action { background: var(--surface, #fff); }

.report-results-meta {
  min-height: 24px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface, #fff);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.filter-chip b { color: var(--muted); font-size: 15px; line-height: 1; }
.filter-chip:hover,
.filter-chip:focus-visible { border-color: var(--accent); background: var(--blue-soft, #eef3ff); }

.route-header-actions { min-width: 0; }
.route-quick-action,
.finance-button { white-space: nowrap; }

@media (max-width: 1180px) and (min-width: 821px) {
  .topbar { padding-inline: 14px; }
  .top-actions { gap: 4px; }
  .top-actions .finance-button { padding-inline: 8px; }
  .top-actions .finance-button span { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 680px) {
  .canonical-status-dimensions { grid-template-columns: 1fr; }
  .canonical-status-dimensions span { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .canonical-status-dimensions small { font-size: 11px; }
  .canonical-status-dimensions strong { text-align: end; }
  .blocked-resolution-steps li { grid-template-columns: auto minmax(0, 1fr); }
  .blocked-resolution-steps button { grid-column: 2; justify-self: start; }
  .route-header-actions { gap: 5px; }
  .route-header-actions .route-quick-action { padding-inline: 7px; font-size: 11px; }
  .report-results-meta { margin-top: 2px; }
  .chat-scroll { padding-bottom: max(112px, calc(88px + env(safe-area-inset-bottom))); scroll-padding-bottom: max(112px, calc(88px + env(safe-area-inset-bottom))); }
  .composer-wrap { position: static !important; z-index: auto; }
  .source-context-form { padding-bottom: 96px; }
}
.report-row-action-column {
  inline-size: 6.75rem;
  min-inline-size: 6.75rem;
  text-align: center;
}

.report-row-open {
  min-block-size: 2.5rem;
  padding-inline: 0.875rem;
  border: 1px solid var(--line, #d7deea);
  border-radius: 0.625rem;
  background: var(--surface, #fff);
  color: var(--primary, #3158d8);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.report-row-open:hover,
.report-row-open:focus-visible {
  border-color: currentColor;
  outline: 2px solid color-mix(in srgb, currentColor 28%, transparent);
  outline-offset: 2px;
}

/* R4 report contract: compact Direction 1 tables with catalog-owned columns. */
.meeting-prompts-heading {
  grid-column: 1 / -1;
  display: grid;
  gap: 3px;
  margin-bottom: 2px;
  text-align: start;
}

.meeting-prompts-heading span { color: var(--text); font-size: 15px; font-weight: 850; }
.meeting-prompts-heading small { color: var(--muted); font-size: 12px; }
.prompt-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); width: min(1080px, 100%); }
.prompt-card { min-height: 126px; }

.table-toolbar-actions,
.report-row-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.table-columns-toggle,
.report-row-details-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fff;
  color: #536176;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.table-columns-toggle svg { width: 15px; height: 15px; }
.table-columns-toggle[aria-pressed="true"] { border-color: #aebff5; background: var(--blue-soft); color: var(--blue-dark); }

.table-columns-toggle:focus-visible,
.report-row-details-toggle:focus-visible,
.report-selected-entity button:focus-visible,
.report-inline-warning-link:focus-visible,
.report-secondary-actions > summary:focus-visible,
.report-trust-disclosure > summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent, #3559e0) 36%, transparent);
  outline-offset: 3px;
}

.finance-table col.is-secondary-column,
.finance-table th.is-secondary-column,
.finance-table td.is-secondary-column { display: none; }

.finance-table.show-secondary-columns col.is-secondary-column { display: table-column; }
.finance-table.show-secondary-columns th.is-secondary-column,
.finance-table.show-secondary-columns td.is-secondary-column { display: table-cell; }

.report-row-controls {
  margin-top: 8px;
  align-items: stretch;
}

.report-row-controls button { white-space: nowrap; }
.report-row-open { min-block-size: 34px; font-size: 12px; }
.report-row-details-toggle { min-height: 34px; }

.report-row-details-row td {
  position: static !important;
  padding: 0 !important;
  background: #fbfcff !important;
  box-shadow: none !important;
}

.report-row-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--border-soft);
}

.report-row-details-grid > div { min-width: 0; padding: 11px 14px; background: #fbfcff; }
.report-row-details-grid dt { color: var(--muted); font-size: 11px; font-weight: 750; }
.report-row-details-grid dd { margin: 4px 0 0; color: var(--text); font-size: 13px; overflow-wrap: anywhere; }

/* Approved modern report-table system. Shared report outputs opt into these
 * classes without changing unrelated generic record tables. */
.data-block--modern-report {
  overflow: visible;
  border-color: #e5e9f1;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .025);
}

.data-title--modern {
  position: relative;
  z-index: 5;
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 62px;
  padding: 10px 20px;
  border-bottom: 0;
  background: #fff;
}

.data-title-label--modern {
  min-width: 0;
  overflow: hidden;
  color: #172033;
  direction: rtl;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.55;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-title-overflow {
  position: relative;
  flex: 0 0 auto;
  direction: rtl;
}

.data-title-overflow > summary {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #f6f7f9;
  color: #475569;
  cursor: pointer;
  list-style: none;
}

.data-title-overflow > summary::-webkit-details-marker { display: none; }
.data-title-overflow > summary svg { width: 20px; height: 20px; transform: rotate(90deg); }
.data-title-overflow > summary:hover { background: #eef1f5; color: #172033; }
.data-title-overflow > summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent, #3559e0) 34%, transparent);
  outline-offset: 3px;
}

.data-title-overflow-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 0;
  display: grid;
  width: max-content;
  min-width: 176px;
  overflow: hidden;
  padding: 6px;
  border: 1px solid #e6e9ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .14), 0 3px 10px rgba(15, 23, 42, .07);
}

.data-title-overflow-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #263244;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
}

.data-title-overflow-menu button:hover,
.data-title-overflow-menu button:focus-visible { background: #f4f7ff; color: #2449bd; outline: 0; }
.data-title-overflow-menu button svg { width: 17px; height: 17px; }

.statement-summary--modern {
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 72px;
  padding: 12px 18px;
  border: 1px solid #e5e9f1;
  border-radius: 14px 14px 0 0;
  background: #fff;
}

.statement-summary--modern .statement-heading {
  direction: rtl;
  justify-items: start;
  text-align: right;
}

[dir="ltr"] .statement-summary--modern .statement-heading { direction: ltr; }
.statement-summary--modern .statement-title-row { flex-direction: row; }
.statement-summary--modern .statement-title-row h3 { font-size: 20px; }
.statement-export-overflow { align-self: center; }
.statement-export-overflow .data-title-overflow-menu { inset-inline-start: auto; inset-inline-end: 0; }

.data-block--modern-report > .report-scope-line {
  justify-content: flex-start;
  min-height: 46px;
  padding: 0 20px 12px;
  border-bottom: 1px solid #e6eaf1;
  text-align: right;
}

.data-block--modern-report > .report-scope-line span { color: #6b778c; font-weight: 650; }
.data-block--modern-report > .report-scope-line strong { font-size: 13px; font-weight: 750; }

.report-table-shell--modern {
  overflow-x: auto;
  overflow-y: visible;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.statement-result > .report-table-shell--modern {
  border-inline: 1px solid #e5e9f1;
  border-bottom: 1px solid #e5e9f1;
  border-radius: 0 0 14px 14px;
}

.table-toolbar--modern {
  direction: ltr;
  justify-content: flex-start;
  min-height: 48px;
  margin: 0;
  padding: 7px 20px;
  border-bottom: 1px solid #e6eaf1;
  color: #5f6b7c;
}

.table-toolbar--modern .table-row-count {
  order: -1;
  direction: rtl;
  white-space: nowrap;
}

.table-toolbar--modern .table-toolbar-actions { direction: rtl; flex-wrap: nowrap; }
.table-columns-toggle--modern {
  min-height: 34px;
  padding: 4px 7px;
  border-color: transparent;
  background: transparent;
  color: #315bd6;
  font-size: 13px;
  font-weight: 800;
}

.table-columns-toggle--modern:hover,
.table-columns-toggle--modern:focus-visible,
.table-columns-toggle--modern[aria-pressed="true"] { border-color: transparent; background: #f0f4ff; color: #2449bd; }

.finance-table.finance-table--modern {
  width: 100%;
  min-width: max(100%, var(--report-table-min-width, 100%));
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  color: #243044;
  font-family: "Vazirmatn", system-ui, sans-serif;
}

.finance-table--modern th,
.finance-table--modern td {
  height: 46px;
  padding: 10px 18px;
  border-bottom: 1px solid #e8ebf1;
  border-inline-end: 0;
  line-height: 1.6;
}

.finance-table--modern thead th {
  height: 44px;
  background: #fbfcfe;
  color: #516075;
  font-size: 12px;
  font-weight: 800;
}

.finance-table--modern tbody tr:nth-child(even) td,
.finance-table--modern tbody tr:nth-child(odd) td { background: #fff; }
.finance-table--modern tbody tr[data-report-row]:hover td,
.finance-table--modern tbody tr[data-report-row]:focus-within td,
.finance-table--modern tbody tr[data-report-row].is-expanded td { background: #f5f8ff; }

.finance-table--modern th.primary-column,
.finance-table--modern td.primary-column {
  background: #fff;
  box-shadow: -1px 0 0 #edf0f5, -9px 0 18px -18px rgba(15, 23, 42, .55);
}

[dir="ltr"] .finance-table--modern th.primary-column,
[dir="ltr"] .finance-table--modern td.primary-column {
  box-shadow: 1px 0 0 #edf0f5, 9px 0 18px -18px rgba(15, 23, 42, .55);
}

.finance-table--modern tbody tr[data-report-row]:hover td.primary-column,
.finance-table--modern tbody tr[data-report-row]:focus-within td.primary-column,
.finance-table--modern tbody tr[data-report-row].is-expanded td.primary-column { background: #f5f8ff; }

.finance-table--modern.has-row-interactions th.primary-column,
.finance-table--modern.has-row-interactions td.primary-column { padding-inline-start: 62px; }

.finance-table--modern td.primary-column { position: sticky; }
.finance-table--modern td.primary-column .report-row-controls {
  position: absolute;
  top: 50%;
  inset-inline-start: 14px;
  z-index: 2;
  margin: 0;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity .14s ease;
}

.finance-table--modern tr[data-report-row]:hover .report-row-controls,
.finance-table--modern tr[data-report-row]:focus-within .report-row-controls,
.finance-table--modern tr[data-report-row].is-expanded .report-row-controls { opacity: 1; }

.report-row-details-toggle--modern {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-color: #dfe4ec;
  border-radius: 50%;
  background: #fff;
  color: #315bd6;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .07);
}

.report-row-details-toggle--modern:hover,
.report-row-details-toggle--modern:focus-visible,
.report-row-details-toggle--modern[aria-expanded="true"] { border-color: #c4d1fb; background: #edf3ff; color: #2449bd; }
.report-row-details-toggle--modern svg { width: 18px; height: 18px; }
.report-row-details-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.finance-table--modern .report-row-details-row--modern td {
  padding: 0 !important;
  border-bottom: 1px solid #dfe5f0;
  background: #f8faff !important;
}

.finance-table--modern .report-row-details-grid { background: #e8edf6; }
.finance-table--modern .report-row-details-grid > div { padding: 12px 18px; background: #f8faff; }
.report-row-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 18px 14px;
  border-top: 1px solid #e6ebf4;
  background: #f8faff;
}

.report-row-detail-actions .report-row-open { display: inline-flex; align-items: center; gap: 7px; }
.report-row-detail-actions .report-row-open svg { width: 15px; height: 15px; }

@media (hover: none), (pointer: coarse) {
  .finance-table--modern td.primary-column .report-row-controls { opacity: 1; }
}

.report-selected-entity { justify-content: space-between; align-items: center; }
.report-selected-entity > div { display: grid; gap: 2px; }
.report-selected-entity button {
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fff;
  color: var(--blue-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

@media (max-width: 1180px) {
  .prompt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .prompt-grid { grid-template-columns: 1fr; width: 100%; }
  .prompt-card { min-height: 92px; }
  .chat-scroll { padding-inline: 14px; }
  .assistant-head { grid-template-columns: 28px minmax(0, 1fr); gap: 8px; }
  .assistant-head .assistant-mark { width: 28px; height: 28px; border-radius: 10px; font-size: 15px; }
  .data-block { border-inline: 0; border-radius: 0; }
  .finance-table-shell { overflow: visible; border: 0; border-radius: 0; }
  .finance-table { display: block; width: 100%; min-width: 0 !important; table-layout: auto; }
  .finance-table colgroup,
  .finance-table thead { display: none; }
  .finance-table tbody { display: grid; gap: 10px; }
  .finance-table tr[data-report-row] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: #fff;
  }
  .finance-table tr[data-report-row] td {
    position: static;
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #f0f2f6;
    background: #fff;
    box-shadow: none;
  }
  .finance-table tr[data-report-row] td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
  }
  .finance-table tr[data-report-row] td.primary-column { grid-column: 1 / -1; }
  .finance-table tr[data-report-row] td.is-secondary-column { display: none; }
  .finance-table tr[data-report-row] td.is-mobile-secondary-column { display: none; }
  .finance-table.show-secondary-columns tr[data-report-row] td.is-secondary-column { display: grid; }
  .report-row-details-row { display: block; margin-top: -11px; }
  .report-row-details-row[hidden] { display: none; }
  .report-row-details-row td { display: block; width: 100%; }
  .report-row-details-grid { grid-template-columns: 1fr 1fr; }
  .table-toolbar { align-items: flex-start; }
  .table-toolbar-actions { justify-content: flex-end; }
  .report-selected-entity { align-items: stretch; flex-direction: column; }
  .report-selected-entity button { width: 100%; }
  .data-block--modern-report { border-inline: 0; border-radius: 0; }
  .data-title--modern { align-items: flex-start; min-height: 56px; padding: 9px 14px; }
  .data-title-label--modern { padding-top: 3px; font-size: 18px; white-space: normal; }
  .data-block--modern-report > .report-scope-line { padding: 0 14px 10px; }
  .table-toolbar--modern { align-items: center; padding-inline: 14px; }
  .finance-table--modern.has-row-interactions td.primary-column { padding-inline-start: 12px; }
  .finance-table--modern td.primary-column .report-row-controls {
    position: static;
    grid-column: 1 / -1;
    margin-top: 6px;
    opacity: 1;
    transform: none;
  }
  .finance-table--modern .report-row-details-toggle--modern {
    width: auto;
    min-width: 0;
    padding-inline: 10px;
    border-radius: 8px;
  }
  .finance-table--modern .report-row-details-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
  }
  .finance-table--modern .report-row-details-row--modern { margin-top: -11px; }
  .statement-summary--modern {
    align-items: flex-start;
    min-height: 64px;
    padding: 10px 14px;
    border-inline: 0;
    border-radius: 0;
  }
  .statement-summary--modern .statement-heading { min-width: 0; }
  .statement-summary--modern .statement-title-row h3 { font-size: 18px; }
  .statement-result > .report-table-shell--modern { border-inline: 0; border-radius: 0; }
  .report-quality-rail {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 11px 14px;
  }
  .report-quality-rail-message { align-items: flex-start; }
  .report-quality-rail-message span { overflow: visible; text-overflow: clip; white-space: normal; }
  .report-quality-rail-meta { justify-content: space-between; }
  dialog.report-info-dialog,
  dialog.report-info-dialog--compact {
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    margin: 0;
    border-width: 1px 0 0;
    border-radius: 18px 18px 0 0;
  }
  dialog.report-info-dialog:not(.report-info-dialog--compact) { height: auto; }
  .report-info-dialog-surface { max-height: 92dvh; }
  .report-info-dialog-header { min-height: 58px; padding: 9px 14px; }
  .report-info-dialog-header h2 { font-size: 18px; }
  .report-quality-dialog-content { padding: 16px 14px calc(18px + env(safe-area-inset-bottom)); }
  .report-quality-dialog-facts > div { grid-template-columns: minmax(130px, .75fr) minmax(0, 1.25fr); min-height: 62px; gap: 12px; }
  .report-quality-technical-grid { grid-template-columns: 1fr; }
  .report-quality-technical-grid > div.is-wide { grid-column: auto; }
  .report-calculation-dialog { padding: 16px 14px calc(18px + env(safe-area-inset-bottom)); }
}

@media (max-width: 430px) {
  .finance-table tr[data-report-row] { grid-template-columns: 1fr; }
  .finance-table tr[data-report-row] td.primary-column { grid-column: auto; }
  .report-row-details-grid { grid-template-columns: 1fr; }
  .report-row-controls { flex-direction: column; }
  .report-row-controls button { width: 100%; }
  .report-quality-rail-meta { align-items: flex-start; flex-direction: column; gap: 6px; }
  .report-quality-rail-meta button { width: 100%; min-height: 42px; }
  .report-quality-dialog-facts > div { grid-template-columns: 1fr; gap: 5px; padding-block: 12px; }
  .report-quality-dialog-facts dd { padding-inline-start: 30px; }
}

/* Persian-first calm home: selected "financial summary" direction. */
.app-shell {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.sidebar-expanded {
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.app-shell:not(.sidebar-expanded) > .sidebar {
  display: none;
}

.app-shell.sidebar-expanded > .sidebar {
  display: flex;
}

.app-shell.sidebar-expanded .mobile-close {
  display: inline-flex;
}

.topbar {
  direction: ltr;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  min-height: 68px;
  padding-inline: 24px;
  background: rgba(255, 255, 255, .98);
}

.topbar .connection {
  display: none !important;
}

.topbar .menu-button {
  display: inline-flex;
  grid-column: 1;
  grid-row: 1;
  width: auto;
  min-width: 42px;
  height: 42px;
  gap: 8px;
  padding-inline: 11px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: #fff;
}

.history-button-label {
  color: #334155;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.history-button-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  padding-inline: 5px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
}

.history-button-count[hidden] {
  display: none;
}

.topbar .history-button-count {
  display: none !important;
}

.primary-navigation {
  direction: ltr;
  grid-column: 2;
  grid-row: 1;
  display: inline-flex;
  align-items: stretch;
  justify-content: center;
  justify-self: center;
  min-height: 68px;
  gap: 26px;
}

[dir="rtl"] .primary-navigation,
[dir="rtl"] .top-utilities,
[dir="rtl"] .profile-menu {
  direction: rtl;
}

.primary-navigation .finance-button {
  position: relative;
  min-height: 68px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding-inline: 4px;
  color: #344054;
  font-size: 14px;
  font-weight: 750;
}

.primary-navigation .finance-button i,
.primary-navigation .finance-button svg {
  display: none;
}

.primary-navigation .finance-button:hover,
.primary-navigation .finance-button:focus-visible {
  background: transparent;
  color: var(--blue-dark);
}

.primary-navigation [aria-current="page"] {
  border-bottom: 0;
  color: var(--blue-dark);
}

.top-utilities {
  direction: ltr;
  grid-column: 3;
  grid-row: 1;
  gap: 8px;
}

.top-utilities .scope-button {
  max-width: 250px;
  min-height: 38px;
  border-color: var(--border-soft);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding-inline: 11px;
  font-size: 12px;
}

.top-utilities .scope-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-utilities .notification-button {
  width: 40px;
  height: 40px;
}

.profile-menu-wrap {
  position: relative;
}

.profile-menu-wrap .profile-button {
  min-height: 42px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: #f8fafc;
  padding: 3px 8px 3px 4px;
}

.profile-menu-wrap .profile-button > span {
  width: 34px;
  height: 34px;
  background: #e9eef8;
  color: #17212f;
}

.profile-menu-wrap .profile-button > svg {
  width: 16px;
  height: 16px;
  transition: transform 160ms ease;
}

.profile-menu-wrap .profile-button.is-open > svg {
  transform: rotate(180deg);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 170;
  display: grid;
  width: 220px;
  gap: 4px;
  padding: 7px;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
}

.profile-menu[hidden] {
  display: none;
}

.profile-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  padding-inline: 10px;
  text-align: start;
}

.profile-menu button:hover,
.profile-menu button:focus-visible {
  background: var(--surface-strong);
}

.chat-scroll {
  overflow-x: hidden;
  padding: 30px clamp(18px, 3vw, 44px) 26px;
  scroll-padding-bottom: 28px;
}

.welcome-row {
  display: none !important;
}

.role-home {
  width: min(1360px, 100%);
  margin: 0 auto;
  gap: 0;
}

.home-summary {
  display: grid;
  gap: 12px;
}

.home-summary-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 48px;
}

.home-summary-header h2 {
  margin: 0;
  color: #17212f;
  font-size: clamp(23px, 2.1vw, 29px);
  line-height: 1.25;
}

.home-summary-header p {
  margin: 4px 0 0;
  color: #718096;
  font-size: 14px;
}

.home-preview-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid #b7c6ef;
  border-radius: 10px;
  background: #f5f7ff;
  color: var(--blue-dark);
  padding: 8px 13px;
  font-weight: 800;
  text-decoration: none;
}

.home-preview-link > svg { width: 18px; height: 18px; }

.home-available-now,
.home-featured-reports,
.home-kpi-section,
.home-readiness-section {
  display: grid;
  gap: 8px;
}

.home-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.home-section-heading h3 {
  margin: 3px 0 0;
  color: #17212f;
  font-size: 18px;
}

.home-section-heading > button {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font-weight: 800;
}

.home-available-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.home-available-controls > button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font-weight: 800;
}

.home-activity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #dce3ee;
  border-radius: 14px;
  background: #dce3ee;
  gap: 1px;
}

.home-activity-grid article {
  display: grid;
  min-height: 88px;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  background: #fff;
  padding: 11px 15px;
}

.home-activity-grid article > svg {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eef3ff;
  color: var(--blue);
  padding: 9px;
}

.home-activity-grid article span,
.home-activity-grid article small,
.home-activity-grid article strong,
.home-activity-grid article em { display: block; min-width: 0; }
.home-activity-grid article small { color: #667085; }
.home-activity-grid article strong { margin: 2px 0; color: #17212f; font-size: 21px; }
.home-activity-grid article em { overflow: hidden; color: #8290a3; font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }

.home-coverage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.home-coverage-summary > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
}
.home-coverage-summary .status-ready { background: #edf8f0; color: #197447; }
.home-coverage-summary .status-limited { background: #fff4dd; color: #8a5a08; }
.home-coverage-summary .status-unavailable { background: #fff0f0; color: #a92e2e; }

.home-report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-report-card {
  display: grid;
  min-width: 0;
  min-height: 102px;
  grid-template-columns: 38px minmax(0, 1fr) 16px;
  align-items: start;
  gap: 11px;
  border: 1px solid #dbe3ee;
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  padding: 12px;
  text-align: start;
}

.home-report-card:hover { border-color: #9fb3ec; background: #fbfcff; }
.home-report-card:focus-visible { outline: 3px solid rgba(59, 99, 223, .22); outline-offset: 2px; }
.home-report-card.status-limited { border-color: #ead5aa; background: #fffdf8; }
.home-report-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; background: #eef3ff; color: var(--blue); }
.home-report-icon > svg { width: 19px; height: 19px; }
.home-report-card > span:nth-child(2) { min-width: 0; }
.home-report-card small,
.home-report-card strong,
.home-report-card em { display: block; }
.home-report-card small { color: #23774b; font-size: 10px; font-weight: 800; }
.home-report-card.status-limited small { color: #8a5a08; }
.home-report-card strong { margin: 5px 0 3px; line-height: 1.55; }
.home-report-card em { overflow: hidden; color: #7b8798; font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.home-report-card > svg { width: 15px; height: 15px; color: #8390a2; transform: rotate(90deg); }
[dir="ltr"] .home-report-card > svg { transform: rotate(-90deg); }
.home-reports-empty { display: flex; min-height: 92px; align-items: center; gap: 12px; border: 1px dashed #ccd5e2; border-radius: 12px; color: #667085; padding: 16px; }
.home-reports-empty > svg { width: 24px; height: 24px; }
.home-reports-empty strong,
.home-reports-empty small { display: block; }
.home-reports-empty small { margin-top: 4px; }

.home-trust-strip {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  border: 1px solid #d8e0ed;
  border-radius: 12px;
  background: #fff;
  padding: 8px 14px;
  color: #536176;
  font-size: 12px;
}

.home-trust-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #344054;
  white-space: nowrap;
}

.home-trust-strip.is-blocked .home-trust-status > svg {
  color: #c23b33;
}

.home-trust-strip.is-ready .home-trust-status > svg {
  color: #16845b;
}

.home-trust-divider {
  width: 1px;
  height: 22px;
  background: #d9e0ea;
}

.home-trust-strip > button {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 4px;
  font: inherit;
}

.home-trust-strip [data-home-scope] {
  flex: 1;
}

.home-trust-strip [data-home-scope] span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-trust-strip .home-trust-why {
  margin-inline-start: auto;
  color: var(--blue-dark);
  font-weight: 800;
  white-space: nowrap;
}

.home-source-badge {
  border-radius: 999px;
  background: #fff4dc;
  color: #8a5a08;
  padding: 4px 8px;
  white-space: nowrap;
}

.home-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #dce3ee;
  border-radius: 14px;
  background: #dce3ee;
}

.home-kpi {
  display: grid;
  min-height: 128px;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  background: #fff;
  padding: 18px 22px;
}

.home-kpi-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 12px;
}

.home-kpi.tone-positive .home-kpi-icon { background: #edf8f0; color: #249458; }
.home-kpi.tone-danger .home-kpi-icon { background: #fff0f0; color: #cf3737; }
.home-kpi.tone-warning .home-kpi-icon { background: #fff4e8; color: #d46a12; }

.home-kpi > div:last-child {
  min-width: 0;
}

.home-kpi span,
.home-kpi small {
  display: block;
  color: #667085;
}

.home-kpi strong {
  display: block;
  margin: 7px 0 5px;
  color: #17212f;
  font-size: clamp(19px, 1.8vw, 27px);
  line-height: 1.25;
}

.home-kpi.tone-positive:not(.is-unavailable) strong { color: #239054; }
.home-kpi.tone-danger:not(.is-unavailable) strong { color: #c92d2d; }
.home-kpi.tone-warning:not(.is-unavailable) strong { color: #d2630b; }
.home-kpi.is-unavailable strong { color: #8a5a08; font-size: 16px; }
.home-kpi small { overflow-wrap: anywhere; font-size: 11px; line-height: 1.55; }

.home-kpi-readiness-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.home-kpi-readiness {
  display: grid;
  min-width: 0;
  min-height: 76px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #ead6ad;
  border-radius: 11px;
  background: #fffaf1;
  color: #5e4820;
  padding: 11px 13px;
  text-align: start;
}

.home-kpi-readiness > svg { width: 20px; height: 20px; color: #b67813; }
.home-kpi-readiness span { min-width: 0; }
.home-kpi-readiness strong,
.home-kpi-readiness small { display: block; }
.home-kpi-readiness small { margin-top: 3px; overflow: hidden; color: #806b44; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.home-kpi-readiness em { color: var(--blue-dark); font-size: 10px; font-style: normal; font-weight: 800; white-space: nowrap; }

.home-decision-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr);
  gap: 16px;
}

.home-priority-card,
.home-action-queue {
  min-height: 210px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
}

.home-priority-card {
  display: grid;
  align-content: start;
  border-inline-start: 5px solid var(--blue);
  padding: 20px 24px;
}

.home-priority-card.severity-critical,
.home-priority-card.severity-error {
  border-inline-start-color: #d23d3d;
}

.home-priority-card h3 {
  margin: 8px 0 6px;
  color: #17212f;
  font-size: clamp(20px, 2vw, 27px);
  line-height: 1.35;
}

.home-priority-card > p {
  max-width: 78ch;
  margin: 0;
  color: #667085;
  line-height: 1.75;
}

.home-priority-impact {
  margin-top: 14px;
}

.home-priority-impact > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  border: 1px solid #e2e8f2;
  border-radius: 10px;
  background: #f8faff;
  padding: 8px 12px;
}

.home-priority-impact small { color: #718096; }

.home-priority-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}

.home-priority-footer > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #667085;
  font-size: 12px;
}

.home-priority-footer button {
  min-height: 42px;
  border: 1px solid var(--blue);
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  padding-inline: 18px;
  font-weight: 800;
}

.home-action-queue {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 16px;
}

.home-action-queue > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
}

.home-action-queue > header strong,
.home-action-queue > header span { display: block; }
.home-action-queue > header strong { margin-top: 3px; }
.home-action-queue > header button { border: 0; background: transparent; color: var(--blue-dark); font-size: 12px; font-weight: 800; }
.home-action-queue > div { display: grid; align-content: start; }

.home-queue-item {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-top: 1px solid #e8edf4;
  background: transparent;
  color: var(--text);
  padding: 13px 2px;
  text-align: start;
}

.home-queue-item > span { min-width: 0; }
.home-queue-item strong,
.home-queue-item small { display: block; }
.home-queue-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.home-queue-item small { margin-top: 5px; color: #718096; font-size: 11px; }
.home-queue-item > svg { width: 15px; height: 15px; color: var(--blue); transform: rotate(90deg); }
[dir="rtl"] .home-queue-item > svg { transform: rotate(-90deg); }
.home-queue-item.severity-critical strong,
.home-queue-item.severity-error strong { color: #b42318; }
.home-queue-empty { display: grid; place-items: center; align-content: center !important; color: #667085; text-align: center; }
.home-queue-empty > svg { color: #16845b; }
.home-queue-empty p { margin: 8px 0 0; }

.prompt-grid {
  width: min(1360px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px auto 22px;
}

.meeting-prompts-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 2px;
}

.meeting-prompts-heading > div span,
.meeting-prompts-heading > div small { display: block; }
.meeting-prompts-heading > div small { margin-top: 3px; color: var(--muted); }
.meeting-prompts-heading > button { border: 0; background: transparent; color: var(--blue-dark); font-weight: 800; }

.prompt-card {
  min-height: 84px;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  gap: 4px 12px;
  border-radius: 12px;
  padding: 13px 14px;
}

.prompt-card > svg {
  grid-row: 1 / 3;
  width: 22px;
  height: 22px;
  align-self: center;
  justify-self: center;
}

.prompt-card strong { font-size: 14px; }
.prompt-card span { font-size: 11px; line-height: 1.55; }
.prompt-card:hover,
.prompt-card:focus-visible { border-color: #9eb2ee; background: #f8faff; }

.composer-wrap {
  padding: 10px clamp(14px, 3vw, 36px) 12px;
}

.composer {
  width: min(1360px, 100%);
  min-height: 54px;
  border-radius: 13px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.composer-wrap > p {
  display: none;
}

.home-summary.is-loading { min-height: 560px; }
.home-title-skeleton { width: min(320px, 55vw); height: 30px; }
.home-subtitle-skeleton { width: min(520px, 75vw); margin-top: 10px; }
.home-trust-skeleton { width: 100%; height: 52px; }
.home-priority-skeleton { width: 100%; height: 210px; border-radius: 14px; }
.home-load-error { width: min(720px, 100%); margin: 80px auto; }

.modal-backdrop:has(.home-trust-sheet) {
  align-items: stretch;
  justify-items: end;
  padding: 0;
}

.modal:has(.home-trust-sheet) {
  width: min(540px, 94vw);
  height: 100dvh;
  max-height: none;
  border-radius: 18px 0 0 18px;
}

[dir="rtl"] .modal:has(.home-trust-sheet) {
  border-radius: 0 18px 18px 0;
}

[dir="rtl"] .modal-backdrop:has(.home-trust-sheet) {
  justify-items: start;
}

.home-trust-sheet {
  display: grid;
  gap: 16px;
}

.home-trust-sheet > p { margin: 0; color: var(--muted); line-height: 1.8; }
.home-trust-sheet-scope { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--border-soft); border-radius: 10px; background: #f8fafc; }
.home-trust-sheet-scope span { color: var(--muted); font-size: 11px; }
.home-trust-reasons { display: grid; gap: 9px; }
.home-trust-reasons article { padding: 12px; border: 1px solid #efd8b0; border-radius: 10px; background: #fffaf0; }
.home-trust-reasons article p { margin: 6px 0; color: #6f4b12; line-height: 1.7; }
.home-trust-reasons article small { color: #8a5a10; }

.home-trust-strip button:focus-visible,
.home-priority-footer button:focus-visible,
.home-action-queue button:focus-visible,
.profile-menu-wrap button:focus-visible,
.primary-navigation button:focus-visible {
  outline: 3px solid rgba(59, 99, 223, .25);
  outline-offset: 3px;
}

@media (max-width: 1180px) {
  .top-utilities .scope-button { max-width: 190px; }
  .primary-navigation { gap: 16px; }
  .home-kpi { padding-inline: 16px; }
  .home-activity-grid,
  .home-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .app-shell.sidebar-expanded { grid-template-columns: minmax(0, 1fr); }
  .sidebar:not([hidden]) {
    display: flex !important;
    left: 0;
    right: auto;
  }
  .sidebar[hidden] { display: none !important; }
  [dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
    box-shadow: -20px 0 60px rgba(15, 23, 42, .12);
  }
  [dir="rtl"] .sidebar.is-open { transform: translateX(0); }
  .home-decision-grid { grid-template-columns: minmax(0, 1.45fr) minmax(260px, .8fr); }
}

@media (max-width: 820px) {
  .topbar { grid-template-columns: 44px minmax(0, 1fr) auto; padding-inline: 12px; }
  .topbar .history-button { width: 42px; padding-inline: 0; }
  .history-button-label,
  .history-button-count { display: none; }
  .primary-navigation { display: none; }
  .top-utilities .scope-button,
  .top-utilities > .notification-button { display: none; }
  .top-utilities > .mobile-menu-button { display: inline-flex; }
  .home-kpi-grid { grid-template-columns: 1fr; gap: 1px; }
  .home-kpi { min-height: 96px; }
  .home-kpi-readiness-grid { grid-template-columns: 1fr; }
  .home-decision-grid { grid-template-columns: 1fr; }
  .home-priority-card,
  .home-action-queue { min-height: 0; }
}

@media (max-width: 700px) {
  .experience-banner { align-items: flex-start; padding-inline: 12px; }
  .experience-banner > div { display: grid; gap: 2px; }
  .chat-scroll { padding: 16px 12px 20px; }
  .home-summary { gap: 12px; }
  .home-summary-header { min-height: 50px; }
  .home-summary-header h2 { font-size: 23px; }
  .home-summary-header p { font-size: 12px; line-height: 1.7; }
  .home-summary-header { align-items: stretch; flex-direction: column; }
  .home-preview-link { width: 100%; justify-content: center; }
  .home-section-heading { align-items: center; }
  .home-section-heading h3 { font-size: 16px; }
  .home-activity-grid,
  .home-report-grid { grid-template-columns: 1fr; }
  .home-activity-grid article { min-height: 88px; }
  .home-report-card { min-height: 108px; }
  .home-trust-strip { flex-wrap: wrap; gap: 7px 10px; overflow: visible; padding: 10px 12px; }
  .home-trust-divider { display: none; }
  .home-trust-strip [data-home-scope] { order: 3; flex-basis: calc(100% - 56px); justify-content: flex-start; }
  .home-trust-strip .home-trust-why { margin-inline-start: 0; }
  .home-kpi { min-height: 86px; grid-template-columns: 42px minmax(0, 1fr); padding: 12px 14px; }
  .home-kpi-icon { width: 40px; height: 40px; }
  .home-kpi strong { margin-block: 3px; font-size: 20px; }
  .home-priority-card { padding: 16px; }
  .home-priority-card h3 { font-size: 20px; }
  .home-priority-footer { align-items: stretch; flex-direction: column; }
  .home-priority-footer button { width: 100%; }
  .prompt-grid { grid-template-columns: 1fr; margin-top: 12px; }
  .meeting-prompts-heading { align-items: center; }
  .meeting-prompts-heading > div small { display: none; }
  .prompt-card { min-height: 76px; }
  .composer-wrap { padding-inline: 8px; }
  .modal:has(.home-trust-sheet) { width: 100%; border-radius: 0; }
  [dir="rtl"] .modal:has(.home-trust-sheet) { border-radius: 0; }
}

@media (max-width: 430px) {
  .experience-banner { font-size: 12px; }
  .home-section-heading { align-items: stretch; flex-direction: column; gap: 4px; }
  .home-section-heading > button { align-self: flex-start; padding-inline: 0; }
  .home-kpi-readiness { grid-template-columns: 28px minmax(0, 1fr); }
  .home-kpi-readiness em { grid-column: 2; }
  .top-utilities { min-width: 90px; }
  .profile-menu { position: fixed; top: 54px; right: 8px; width: calc(100vw - 16px); }
  [dir="rtl"] .profile-menu { right: 8px; }
  .home-trust-status { white-space: normal; }
  .home-source-badge { order: 2; }
  .home-priority-impact > span { align-items: flex-start; flex-direction: column; }
  .home-action-queue { padding: 13px; }
  .home-queue-item strong { white-space: normal; line-height: 1.55; }
}

/* Conversation library: a calm, searchable overlay that never reflows work. */
:root { --sidebar: 390px; }

.app-shell.sidebar-expanded { grid-template-columns: minmax(0, 1fr); }

.sidebar,
.app-shell.sidebar-expanded > .sidebar,
.app-shell:not(.sidebar-expanded) > .sidebar:not([hidden]) {
  position: fixed;
  z-index: 130;
  inset-block: 0;
  inset-inline-start: 0;
  display: flex;
  width: min(var(--sidebar), calc(100vw - 24px));
  overflow: hidden;
  border: 0;
  border-inline-end: 1px solid var(--border-soft);
  border-radius: 0 18px 18px 0;
  background: #fff;
  box-shadow: 24px 0 64px rgba(15, 23, 42, .16);
  transform: translateX(-105%);
  transition: transform 180ms ease;
}

[dir="rtl"] .sidebar,
[dir="rtl"] .app-shell.sidebar-expanded > .sidebar,
[dir="rtl"] .app-shell:not(.sidebar-expanded) > .sidebar:not([hidden]) {
  right: 0;
  left: auto;
  border-right: 0;
  border-left: 1px solid var(--border-soft);
  border-radius: 18px 0 0 18px;
  box-shadow: -24px 0 64px rgba(15, 23, 42, .16);
  transform: translateX(105%);
}

.sidebar.is-open,
.app-shell.sidebar-expanded > .sidebar.is-open,
.app-shell:not(.sidebar-expanded) > .sidebar.is-open:not([hidden]),
[dir="rtl"] .sidebar.is-open,
[dir="rtl"] .app-shell.sidebar-expanded > .sidebar.is-open,
[dir="rtl"] .app-shell:not(.sidebar-expanded) > .sidebar.is-open:not([hidden]) {
  transform: translateX(0);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: block;
  pointer-events: none;
  background: rgba(15, 23, 42, 0);
  backdrop-filter: blur(0);
  transition: background 180ms ease, backdrop-filter 180ms ease;
}

.sidebar-backdrop.is-visible {
  pointer-events: auto;
  background: rgba(15, 23, 42, .28);
  backdrop-filter: blur(2px);
}

body.sidebar-open { overflow: hidden; }

.filter-backdrop,
[dir="rtl"] .filter-backdrop { inset: 0; }

.sidebar .brand-row {
  grid-template-columns: 42px minmax(0, 1fr) 40px;
  min-height: 78px;
  padding: 15px 18px;
  background: #fff;
}

.history-drawer-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.history-drawer-icon svg { width: 21px; height: 21px; }
.sidebar .brand-row h1 { font-size: 16px; line-height: 1.4; }
.sidebar .brand-row p { margin-top: 2px; font-size: 11px; }
.sidebar .mobile-close { display: inline-flex; width: 40px; height: 40px; }

.sidebar .new-chat {
  min-height: 46px;
  margin: 14px 18px 12px;
  border: 1px solid var(--blue-dark);
  border-radius: 11px;
  background: var(--blue-dark);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(40, 77, 191, .16);
}

.sidebar .new-chat:hover,
.sidebar .new-chat:focus-visible { background: #1f43ad; }

.history-search {
  grid-template-columns: 18px minmax(0, 1fr) 30px;
  min-height: 44px;
  margin: 0 18px 10px;
  border-radius: 11px;
  background: #f8fafc;
}

.history-search-clear {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.history-search-clear svg { width: 15px; height: 15px; }
.history-search-clear:hover { background: #e9eef7; color: var(--text); }

.history-views {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 18px 8px;
  padding: 4px;
  border-radius: 11px;
  background: #f1f5f9;
}

.history-views button {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.history-views button[aria-selected="true"] {
  background: #fff;
  color: var(--blue-dark);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

.history-views small {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  padding-inline: 5px;
  background: #e5eaf2;
  font-size: 10px;
}

.history-views button[aria-selected="true"] small { background: var(--blue-soft); }

.history {
  padding: 8px 12px 24px;
  scrollbar-gutter: stable;
}

.history-search-results-heading {
  margin: 8px 8px 12px !important;
  color: var(--muted) !important;
}

.history-group + .history-group { margin-top: 18px; }

.history-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 8px 7px;
}

.history-group > header h2 { margin: 0; color: #526077; font-size: 11px; font-weight: 850; }
.history-group > header > span { color: var(--faint); font-size: 10px; font-weight: 750; }

.history-item-wrap {
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 2px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: 12px;
}

.history-item-wrap:hover,
.history-item-wrap:focus-within { border-color: var(--border-soft); background: #fbfcff; }

.history-item {
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: start;
  min-height: 86px;
  padding: 11px 8px 10px 10px;
  border-radius: 11px;
  text-align: start;
}

[dir="rtl"] .history-item { padding: 11px 10px 10px 8px; }

.history-item.is-active {
  background: #edf2ff;
  color: var(--blue-dark);
  box-shadow: inset 3px 0 0 var(--blue);
}

[dir="rtl"] .history-item.is-active { box-shadow: inset -3px 0 0 var(--blue); }

.history-item-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: #eef2f7;
  color: #526077;
}

.history-item.is-active .history-item-icon { background: #dce6ff; color: var(--blue-dark); }
.history-item.is-failed .history-item-icon { background: #fff1f1; color: var(--red); }
.history-item-icon svg { width: 16px; height: 16px; }

.history-item-copy { gap: 4px; }
.history-item-copy strong { font-size: 13px; line-height: 1.55; }

.history-item-preview {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.history-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  color: var(--faint);
  font-size: 10px;
}

.history-open-indicator { align-self: center; width: 15px; height: 15px; color: #a2acbb; }
.history-item.is-loading { opacity: .65; cursor: wait; }

.history-menu-wrap { align-self: center; opacity: 1; }
.history-menu-button { width: 34px; height: 34px; }

.empty-history {
  display: grid;
  justify-items: center;
  gap: 9px;
  margin: 32px 12px;
  padding: 24px 18px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: #fbfcff;
  text-align: center;
}

.empty-history > svg { width: 24px; height: 24px; color: #93a1b5; }
.empty-history strong { color: var(--muted); font-size: 12px; line-height: 1.8; }
.empty-history button { min-height: 34px; border: 0; background: transparent; color: var(--blue-dark); font-weight: 800; }

.sidebar-footer { padding: 10px 18px 14px; background: #fff; }

.history-management > summary {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  list-style: none;
}

.history-management > summary::-webkit-details-marker { display: none; }
.history-management > summary svg { width: 15px; height: 15px; }
.history-management[open] > summary svg:last-child { transform: rotate(180deg); }
.history-management .clear-button { width: 100%; margin: 6px 0 0; color: var(--red); }

@media (max-width: 600px) {
  .sidebar,
  .app-shell.sidebar-expanded > .sidebar,
  .app-shell:not(.sidebar-expanded) > .sidebar:not([hidden]),
  [dir="rtl"] .sidebar,
  [dir="rtl"] .app-shell.sidebar-expanded > .sidebar,
  [dir="rtl"] .app-shell:not(.sidebar-expanded) > .sidebar:not([hidden]) {
    width: 100vw;
    border: 0;
    border-radius: 0;
  }

  .sidebar .brand-row { min-height: 70px; padding: 11px 14px; }
  .sidebar .new-chat { margin-inline: 14px; }
  .history-search,
  .history-views { margin-inline: 14px; }
  .history { padding-inline: 8px; }
  .history-item { min-height: 82px; }
  .sidebar-footer { padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar-backdrop { transition: none; }
}

/* Top-level navigation contract: one destination, one selected state. */
.primary-navigation button[hidden],
.mobile-nav button[hidden] { display: none !important; }

.primary-navigation [aria-current="page"] {
  background: transparent;
  color: var(--blue-dark);
}

.primary-navigation [aria-current="page"]::after {
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--blue);
  content: "";
}

.work-route > #workRouteContent {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 20px clamp(14px, 2.5vw, 32px) 40px;
}

.work-route .my-work-inbox { gap: 18px; }
.work-route .my-work-header { padding: 18px; border: 1px solid var(--border-soft); border-radius: 14px; background: #fff; }
.work-route .my-work-views { position: sticky; top: 0; z-index: 4; padding-block: 8px; background: var(--surface-soft, #f8fafc); }

@media (max-width: 820px) {
  .top-utilities { min-width: auto; }
  .top-utilities .profile-menu-wrap { display: none; }
  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 180;
    background: rgba(15, 23, 42, .34);
    backdrop-filter: blur(2px);
  }

  .mobile-nav {
    position: fixed;
    z-index: 190;
    inset-block: 0;
    top: 0;
    right: auto;
    left: 0;
    display: grid;
    width: min(330px, 88vw);
    max-height: 100dvh;
    align-content: start;
    gap: 5px;
    overflow-y: auto;
    padding: 12px;
    border: 0;
    border-inline-end: 1px solid var(--border-soft);
    border-radius: 0 18px 18px 0;
    background: #fff;
    box-shadow: 24px 0 64px rgba(15, 23, 42, .18);
  }

  [dir="rtl"] .mobile-nav {
    right: 0;
    left: auto;
    border-right: 0;
    border-left: 1px solid var(--border-soft);
    border-radius: 18px 0 0 18px;
    box-shadow: -24px 0 64px rgba(15, 23, 42, .18);
  }

  .mobile-nav header { min-height: 52px; padding: 2px 4px 10px; }
  .mobile-nav-context { margin: 4px 4px 10px; padding: 10px; border-radius: 10px; background: #f7f9fc; color: var(--muted); font-size: 11px; line-height: 1.7; }
  .mobile-nav-section-label { margin: 12px 8px 2px; padding-top: 10px; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 10px; font-weight: 800; }
  .mobile-nav button { min-height: 48px; }
  .mobile-nav button.is-current { box-shadow: inset 3px 0 0 var(--blue); }
  [dir="rtl"] .mobile-nav button.is-current { box-shadow: inset -3px 0 0 var(--blue); }
  body.mobile-nav-open { overflow: hidden; }
  .work-route > #workRouteContent { padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav-backdrop { backdrop-filter: none; }
}

/* Chat-first checkpoint: one shared shell for company and illustrative data. */
.workspace {
  grid-template-rows: 116px minmax(0, 1fr);
  background: #fff;
}

.topbar {
  direction: ltr;
  display: grid;
  grid-template-columns: minmax(138px, auto) minmax(0, 1fr) minmax(290px, auto);
  min-height: 88px;
  margin: 24px 26px 4px;
  padding: 0 24px;
  border: 1px solid #dbe3ee;
  border-radius: 22px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .02);
}

.topbar .menu-button,
.topbar .history-button {
  display: inline-flex;
  grid-column: 1;
  width: max-content;
  min-width: 118px;
  height: 48px;
  justify-content: flex-start;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #3f4b61;
  padding: 0 8px;
}

.topbar .history-button:hover,
.topbar .history-button:focus-visible {
  background: #f7f9fc;
}

.topbar .history-button > svg {
  width: 25px;
  height: 25px;
  stroke-width: 1.8;
}

.history-button-label {
  color: #3f4b61;
  font-size: 15px;
  font-weight: 700;
}

.active-scope-summary {
  direction: rtl;
  grid-column: 2;
  justify-self: center;
  max-width: min(560px, 100%);
  min-height: 44px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #3f4b61;
  padding: 0 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-scope-summary:hover,
.active-scope-summary:focus-visible {
  background: #f7f9fc;
}

.active-scope-summary span {
  display: block;
  overflow: hidden;
  font-size: 15px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .top-actions {
  direction: rtl;
  grid-column: 3;
  justify-self: end;
  gap: 10px;
}

.profile-menu-wrap {
  display: block;
}

.profile-button,
.notification-button {
  display: inline-grid;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #41506a;
  padding: 0;
}

.profile-button:hover,
.notification-button:hover,
.profile-button:focus-visible,
.notification-button:focus-visible {
  background: #f7f9fc;
}

.profile-button > svg,
.notification-button > svg {
  width: 25px;
  height: 25px;
  stroke-width: 1.8;
}

.profile-initials-data {
  display: none !important;
}

.notification-button {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  min-width: 8px;
  width: 8px;
  height: 8px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #d94242;
  color: transparent;
  padding: 0;
}

.provenance-button {
  display: inline-flex;
  width: 174px;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  border: 1px solid #dbe3ee;
  border-radius: 13px;
  background: #fff;
  color: #334155;
  padding: 0 14px;
  font-weight: 750;
}

.provenance-button:hover,
.provenance-button:focus-visible {
  border-color: #b8c6dd;
  background: #f9fbfe;
}

.provenance-button > svg:first-child {
  width: 20px;
  height: 20px;
  color: #435472;
}

.provenance-button > svg:last-child {
  width: 16px;
  height: 16px;
}

.chat-panel {
  min-height: 0;
}

.chat-panel.is-home {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.chat-panel.is-home .chat-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 147px 24px 42px;
  scroll-padding-bottom: 24px;
}

.chat-hero {
  display: grid;
  width: 100%;
  justify-items: center;
}

.chat-hero-copy {
  text-align: center;
}

.chat-hero-copy h1 {
  margin: 0;
  color: #131b29;
  font-size: clamp(38px, 3.2vw, 48px);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -.02em;
}

.chat-hero-copy p {
  margin: 16px 0 0;
  color: #69758b;
  font-size: clamp(19px, 1.65vw, 24px);
  line-height: 1.7;
}

.hero-composer-slot {
  width: 100%;
  margin-top: 43px;
}

.chat-panel.is-home .composer-wrap {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.chat-panel.is-home .composer {
  position: relative;
  display: block;
  width: min(1020px, 100%);
  min-height: 170px;
  margin: 0 auto;
  overflow: hidden;
  border: 1.5px solid #4c72e6;
  border-radius: 20px;
  background: #fff;
  padding: 0;
  gap: 0;
  box-shadow: 0 8px 24px rgba(59, 99, 223, .10), 0 0 0 3px rgba(59, 99, 223, .03);
}

.chat-panel.is-home .composer:focus-within {
  border-color: #315ddb;
  box-shadow: 0 10px 30px rgba(59, 99, 223, .14), 0 0 0 4px rgba(59, 99, 223, .07);
}

.chat-panel.is-home .composer textarea {
  display: block;
  width: 100%;
  min-height: 168px;
  max-height: 220px;
  margin: 0;
  resize: none;
  border: 0;
  background: transparent;
  color: #172033;
  padding: 27px 29px 76px;
  font-size: 20px;
  line-height: 1.8;
  outline: 0;
}

.chat-panel.is-home .composer textarea::placeholder {
  color: transparent;
  opacity: 0;
  -webkit-text-fill-color: transparent;
}

.chat-panel.is-home .composer-placeholder {
  inset-inline-start: 29px;
  top: 27px;
  max-width: calc(100% - 58px);
  color: #69758b;
  font-size: 20px;
  line-height: 1.8;
}

.composer-sparkle {
  position: absolute;
  inset-inline-start: 27px;
  bottom: 27px;
  width: 27px;
  height: 27px;
  color: #435472;
  pointer-events: none;
  stroke-width: 1.8;
}

.chat-panel.is-home .send-button {
  position: absolute;
  inset-inline-end: 18px;
  bottom: 20px;
  display: inline-grid;
  width: 60px;
  min-width: 60px;
  height: 60px;
  place-items: center;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #4c73e7, #3b62dc);
  color: #fff;
  box-shadow: 0 6px 16px rgba(59, 99, 223, .23);
}

.chat-panel.is-home .send-button > svg {
  width: 25px;
  height: 25px;
  transform: none;
}

.chat-panel.is-home .prompt-grid {
  display: grid;
  width: min(1100px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
  margin: 64px auto 0;
}

.chat-panel.is-home .prompt-card {
  display: flex;
  min-width: 0;
  min-height: 72px;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  border: 1px solid #d8e1ee;
  border-radius: 18px;
  background: #fff;
  color: #43506a;
  padding: 0 22px;
  text-align: start;
  box-shadow: none;
}

.chat-panel.is-home .prompt-card:hover,
.chat-panel.is-home .prompt-card:focus-visible {
  border-color: #9db2eb;
  background: #fbfcff;
  box-shadow: 0 7px 22px rgba(59, 99, 223, .07);
  transform: translateY(-1px);
}

.chat-panel.is-home .prompt-card > svg {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  color: #3b63df;
  stroke-width: 1.8;
}

.chat-panel.is-home .prompt-card span {
  min-width: 0;
  color: #43506a;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.65;
}

.chat-panel.is-home .prompt-card:disabled {
  cursor: not-allowed;
  opacity: .48;
  transform: none;
}

.planner-degraded-panel {
  width: min(990px, 100%);
  margin: 0 auto 12px;
}

.role-home,
.finance-route,
.report-route,
.work-route {
  display: none !important;
}

.chat-panel:not(.is-home) {
  grid-template-rows: minmax(0, 1fr) auto;
}

.chat-panel:not(.is-home) .chat-scroll {
  padding: 34px clamp(18px, 5vw, 72px) 40px;
  scroll-padding-bottom: 48px;
}

.chat-panel:not(.is-home) .message-stack {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.chat-panel:not(.is-home) > .composer-wrap {
  width: 100%;
  padding: 12px clamp(16px, 5vw, 72px) 16px;
  border-top: 1px solid #e7ebf2;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -12px 34px rgba(15, 23, 42, .035);
}

.chat-panel:not(.is-home) > .composer-wrap .composer {
  position: relative;
  display: block;
  width: min(1120px, 100%);
  min-height: 68px;
  margin: 0 auto;
  border: 1px solid #cbd7ec;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(15, 23, 42, .055);
}

.chat-panel:not(.is-home) > .composer-wrap .composer textarea {
  display: block;
  width: 100%;
  min-height: 66px;
  max-height: 150px;
  resize: none;
  border: 0;
  background: transparent;
  padding: 18px 62px 18px 60px;
  font-size: 15px;
  line-height: 1.8;
  outline: 0;
}

.chat-panel:not(.is-home) > .composer-wrap .composer-placeholder {
  inset-inline-start: 76px;
  top: 50%;
  max-width: calc(100% - 152px);
  line-height: 1.5;
  transform: translateY(-50%);
}

.chat-panel:not(.is-home) > .composer-wrap .send-button {
  position: absolute;
  inset-inline-end: 10px;
  top: 50%;
  bottom: auto;
  display: inline-grid;
  width: 46px;
  min-width: 46px;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: #3b63df;
  color: #fff;
  transform: translateY(-50%);
}

.chat-panel:not(.is-home) > .composer-wrap .send-button > svg {
  width: 20px;
  height: 20px;
  transform: none;
}

.chat-panel:not(.is-home) > .composer-wrap .composer-sparkle {
  inset-inline-start: 18px;
  top: 50%;
  bottom: auto;
  width: 21px;
  height: 21px;
  transform: translateY(-50%);
}

.composer-filter-strip[hidden],
.filter-panel[hidden] {
  display: none !important;
}

.data-provenance-panel {
  display: grid;
  gap: 16px;
}

.data-provenance-panel > p {
  margin: 0;
  color: #5f6c80;
  font-size: 15px;
  line-height: 1.9;
}

.data-provenance-summary {
  display: grid;
  gap: 6px;
  border: 1px solid #e0e6ef;
  border-radius: 14px;
  background: #f8fafc;
  padding: 15px;
}

.data-provenance-summary span {
  color: #718096;
  font-size: 12px;
}

@media (max-width: 820px) {
  .workspace {
    grid-template-rows: 82px minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    min-height: 60px;
    margin: 12px 12px 10px;
    padding: 0 8px;
    border-radius: 17px;
  }

  .topbar .menu-button,
  .topbar .history-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    justify-content: center;
    padding: 0;
  }

  .history-button-label,
  .history-button-count {
    display: none;
  }

  .topbar .top-actions {
    gap: 2px;
  }

  .top-utilities > .notification-button {
    display: inline-grid;
  }

  .top-utilities .profile-menu-wrap {
    display: block;
  }

  .profile-button,
  .notification-button,
  .provenance-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    justify-content: center;
    padding: 0;
  }

  .provenance-button span,
  .provenance-button > svg:last-child {
    display: none;
  }

  .active-scope-summary {
    max-width: 100%;
    padding: 0 7px;
  }

  .active-scope-summary span {
    font-size: 11px;
  }

  .chat-panel.is-home .chat-scroll {
    padding: 74px 18px 34px;
  }

  .chat-hero-copy h1 {
    font-size: clamp(29px, 8.2vw, 38px);
    line-height: 1.45;
  }

  .chat-hero-copy p {
    margin-top: 10px;
    font-size: 16px;
  }

  .hero-composer-slot {
    margin-top: 30px;
  }

  .chat-panel.is-home .composer {
    min-height: 142px;
    border-radius: 17px;
  }

  .chat-panel.is-home .composer textarea {
    min-height: 140px;
    padding: 21px 20px 66px;
    font-size: 16px;
  }

  .chat-panel.is-home .composer-placeholder {
    inset-inline-start: 20px;
    top: 21px;
    max-width: calc(100% - 40px);
    font-size: 16px;
  }

  .chat-panel.is-home .send-button {
    width: 52px;
    min-width: 52px;
    height: 52px;
    bottom: 13px;
    border-radius: 14px;
  }

  .composer-sparkle {
    inset-inline-start: 20px;
    bottom: 24px;
    width: 23px;
    height: 23px;
  }

  .chat-panel.is-home .prompt-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 28px;
  }

  .chat-panel.is-home .prompt-card {
    min-height: 58px;
    border-radius: 15px;
    padding: 0 17px;
  }

  .chat-panel.is-home .prompt-card > svg {
    width: 21px;
    height: 21px;
  }

  .chat-panel.is-home .prompt-card span {
    font-size: 13px;
  }

  .chat-panel:not(.is-home) .chat-scroll {
    padding: 20px 12px 30px;
  }

  .chat-panel:not(.is-home) > .composer-wrap {
    padding: 8px;
  }

  .profile-menu {
    position: fixed;
    top: 72px;
    right: 12px;
    left: auto;
    width: min(310px, calc(100vw - 24px));
  }

  [dir="rtl"] .profile-menu {
    right: 12px;
    left: auto;
  }
}

@media (max-width: 430px) {
  .chat-panel.is-home .chat-scroll {
    padding-top: 54px;
  }

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

  .chat-hero-copy p {
    font-size: 14px;
  }

  .active-scope-summary span {
    max-width: 120px;
  }
}

.topbar .profile-menu-wrap .profile-button {
  display: inline-grid;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #41506a;
  padding: 0;
}

.topbar .profile-menu-wrap .profile-button:hover,
.topbar .profile-menu-wrap .profile-button:focus-visible,
.topbar .profile-menu-wrap .profile-button.is-open {
  background: #f7f9fc;
}

.topbar .profile-menu-wrap .profile-button > svg {
  width: 25px;
  height: 25px;
  margin: 0;
  transform: none;
  stroke-width: 1.8;
}

.provenance-mark {
  display: none;
}

@media (max-width: 820px) {
  .topbar .profile-menu-wrap .profile-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }

  .provenance-mark {
    display: block;
  }
}

/* Option 1 scope editor: one task-first sheet with progressive disclosure. */
.modal-backdrop:has(.source-context-form) {
  background: rgba(15, 23, 42, .27);
  backdrop-filter: blur(4px);
}

.modal:has(.source-context-form) {
  width: min(774px, calc(100vw - 36px));
  max-height: min(820px, calc(100dvh - 36px));
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 76px rgba(15, 23, 42, .20);
}

.modal:has(.source-context-form) > header {
  min-height: 80px;
  padding: 0 30px;
  border-bottom: 0;
}

.modal:has(.source-context-form) > header h2 {
  color: #111827;
  font-size: 21px;
  font-weight: 850;
}

.modal:has(.source-context-form) > header .icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
}

.modal:has(.source-context-form) > header .icon-button:focus-visible {
  outline: 3px solid rgba(59, 99, 223, .24);
  outline-offset: 2px;
}

.modal:has(.source-context-form) .modal-body {
  overflow-x: hidden;
  padding: 0;
}

.source-context-form {
  display: grid;
  gap: 0;
  padding: 0;
  color: #111827;
}

.scope-current-summary {
  display: grid;
  gap: 0;
  padding: 4px 30px 20px;
  text-align: center;
}

.scope-current-summary span {
  color: #798294;
  font-size: 11px;
  font-weight: 750;
}

.scope-current-summary strong {
  color: #667085;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.8;
}

.scope-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 16px;
  margin: 0 30px;
}

.scope-date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  grid-column: 1 / -1;
}

.scope-date-range[hidden],
.scope-editor-field[hidden] {
  display: none !important;
}

.close-month-selector {
  display: grid;
  gap: 4px;
  min-width: min(330px, 100%);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.close-month-selector select {
  min-height: 42px;
  max-width: 100%;
}

@media (max-width: 680px) {
  .scope-date-range {
    grid-template-columns: 1fr;
  }

  .close-month-selector {
    width: 100%;
    min-width: 0;
  }
}

.source-context-form .scope-editor-field,
.source-context-form > .scope-selector-grid > label,
.source-context-form > .scope-selector-grid > fieldset {
  min-width: 0;
  min-height: 102px;
  align-content: center;
  gap: 8px;
  margin: 0;
  padding: 15px 20px;
  border: 1px solid #e1e5ec;
  border-radius: 12px;
  background: #fff;
}

.source-context-form .scope-editor-field:focus-within {
  border-color: #7891df;
  box-shadow: 0 0 0 3px rgba(59, 99, 223, .09);
}

.scope-editor-field > span,
.scope-editor-field > legend {
  color: #798294;
  font-size: 13px;
  font-weight: 650;
}

.scope-editor-field > legend {
  padding: 0;
}

.source-context-form .scope-editor-field select {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  padding: 0;
  font-size: 18px;
  font-weight: 800;
}

.scope-company-picker {
  position: relative;
  min-width: 0;
}

.scope-company-picker > summary {
  min-height: 38px;
  color: #111827;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  line-height: 2.1;
}

.scope-company-options {
  position: absolute;
  inset: calc(100% + 8px) 0 auto;
  z-index: 12;
  display: grid;
  max-height: 220px;
  overflow-y: auto;
  gap: 2px;
  padding: 8px;
  border: 1px solid #dbe2ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, .16);
}

.scope-company-options label {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 13px;
  font-weight: 650;
}

.scope-company-options label:hover {
  background: #f6f8fc;
}

.scope-company-options input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: #4260d4;
}

.scope-selector-grid > .scope-period-callout {
  grid-column: 1 / -1;
  margin: -8px 0 0;
  padding: 13px 15px;
  border-color: #f4d4a4;
  border-radius: 10px;
  background: #fdfaf4;
}

.scope-readiness {
  margin: 29px 30px 0;
  overflow: hidden;
  border: 1px solid #f2d3a8;
  border-radius: 12px;
  background: #fdfaf4;
  padding: 0;
}

.scope-readiness-row {
  display: grid;
  min-height: 80px;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  color: #273248;
  cursor: pointer;
  list-style: none;
}

.scope-readiness-row::-webkit-details-marker {
  display: none;
}

.scope-readiness-row > span:first-child {
  font-size: 15px;
  font-weight: 800;
}

.scope-readiness-row > strong {
  border-radius: 10px;
  background: #fff0da;
  color: #8a5116;
  padding: 8px 15px;
  font-size: 13px;
}

.scope-readiness.is-ready {
  border-color: #cfe8da;
  background: #f7fcf9;
}

.scope-readiness.is-ready .scope-readiness-row > strong {
  background: #e9f7ef;
  color: #23734a;
}

.scope-readiness-action {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  color: #4260d4;
  font-size: 14px;
  font-weight: 750;
}

.scope-readiness-action svg {
  width: 18px;
  height: 18px;
  transition: transform .16s ease;
}

.scope-readiness[open] .scope-readiness-action svg {
  transform: rotate(-90deg);
}

.scope-readiness-content {
  border-top: 1px solid rgba(207, 170, 113, .35);
  background: rgba(255, 255, 255, .66);
  padding: 4px 22px 16px;
}

.scope-blocker-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scope-blocker-list li {
  display: grid;
  gap: 5px;
  padding: 15px 0;
  border-bottom: 1px solid #eee4d7;
}

.scope-blocker-list li:last-child {
  border-bottom: 0;
}

.scope-blocker-list p,
.scope-blocker-list small,
.scope-readiness-empty {
  margin: 0;
  color: #6e6251;
  font-size: 12px;
  line-height: 1.8;
}

.scope-source-details {
  margin: 26px 30px 0;
  overflow: hidden;
  border: 1px solid #e1e5ec;
  border-radius: 12px;
  background: #fff;
  padding: 0;
}

.scope-source-details > summary {
  display: flex;
  min-height: 62px;
  align-items: center;
  padding: 0 20px;
  color: #273248;
  cursor: pointer;
  font-size: 15px;
  font-weight: 750;
}

.scope-source-details > summary svg {
  width: 18px;
  height: 18px;
  margin-inline-start: auto;
  transition: transform .16s ease;
}

.scope-source-details[open] > summary svg {
  transform: rotate(-90deg);
}

.scope-source-content {
  display: grid;
  gap: 15px;
  border-top: 1px solid #edf0f4;
  padding: 18px 20px;
}

.scope-source-content > section {
  display: grid;
  gap: 5px;
}

.scope-source-content > section span,
.scope-source-content dt {
  color: #798294;
  font-size: 11px;
  font-weight: 700;
}

.scope-source-content p {
  margin: 0;
  color: #667085;
  line-height: 1.8;
}

.scope-source-content > dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.scope-source-content > dl > div {
  display: grid;
  gap: 4px;
}

.scope-source-content dd {
  margin: 0;
  color: #273248;
  font-size: 13px;
}

.scope-technical-details {
  border-top: 1px solid #edf0f4;
  padding-top: 12px;
}

.scope-technical-details > summary {
  color: #5f6c80;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.scope-technical-details code {
  unicode-bidi: isolate;
  overflow-wrap: anywhere;
}

.scope-change-preview {
  display: grid;
  gap: 4px;
  margin: 18px 30px 0;
  padding: 12px 15px;
  border: 1px solid #cdd8f7;
  border-radius: 10px;
  background: #f7f9ff;
}

.scope-change-preview span,
.scope-change-preview small {
  color: #69758b;
  font-size: 11px;
}

.scope-change-preview strong {
  line-height: 1.7;
}

.source-context-form > .modal-status {
  margin: 10px 30px 0;
}

.source-context-form > .modal-status:empty {
  display: none;
}

.source-context-form > .scope-editor-actions {
  position: sticky;
  bottom: 0;
  z-index: 8;
  min-height: 84px;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin: 24px 0 0;
  padding: 16px 30px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid #eceff3;
  background: rgba(255, 255, 255, .98);
}

.source-context-form > .scope-editor-actions button {
  min-width: 126px;
  min-height: 49px;
  border-radius: 10px;
  font-size: 14px;
}

.source-context-form > .scope-editor-actions [data-scope-save] {
  min-width: 145px;
  border-color: #4260d4;
  background: #4260d4;
  color: #fff;
}

@media (max-width: 680px) {
  .modal-backdrop:has(.source-context-form) {
    padding: 12px;
  }

  .modal:has(.source-context-form) {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 18px;
  }

  .modal:has(.source-context-form) > header {
    min-height: 66px;
    padding: 0 16px;
  }

  .modal:has(.source-context-form) > header h2 {
    font-size: 18px;
  }

  .scope-current-summary {
    padding: 2px 16px 18px;
  }

  .scope-current-summary strong {
    font-size: 12px;
  }

  .scope-selector-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 0 16px;
  }

  .source-context-form .scope-editor-field,
  .source-context-form > .scope-selector-grid > label,
  .source-context-form > .scope-selector-grid > fieldset {
    min-height: 78px;
    padding: 11px 14px;
  }

  .source-context-form .scope-editor-field select,
  .scope-company-picker > summary {
    font-size: 16px;
  }

  .scope-readiness,
  .scope-source-details {
    margin: 16px 16px 0;
  }

  .scope-readiness-row {
    min-height: 96px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px 15px;
  }

  .scope-readiness-action {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .scope-source-content > dl {
    grid-template-columns: 1fr;
  }

  .scope-change-preview {
    margin: 14px 16px 0;
  }

  .source-context-form > .modal-status {
    margin-inline: 16px;
  }

  .source-context-form > .scope-editor-actions {
    min-height: 76px;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }

  .source-context-form > .scope-editor-actions button {
    min-width: 0;
    flex: 1;
  }

  .source-context-form > .scope-editor-actions [data-scope-save] {
    flex: 1.25;
    min-width: 0;
  }
}
