:root {
  color-scheme: light;
  --ink: #171b22;
  --muted: #657083;
  --soft: #f2f4f1;
  --paper: #fbfbf8;
  --panel: #ffffff;
  --line: #d9ded6;
  --line-strong: #bbc4b7;
  --green: #245b45;
  --green-2: #dfe9e0;
  --blue: #284e7a;
  --amber: #a4631c;
  --red: #a93f35;
  --shadow: 0 18px 40px rgba(32, 38, 44, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  min-height: 34px;
  border-radius: 7px;
  padding: 0 12px;
  cursor: pointer;
}

button:hover {
  border-color: var(--green);
  color: var(--green);
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 36px;
  padding: 0 11px;
  background: var(--paper);
  color: var(--ink);
}

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

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(380px, 100%);
  display: grid;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-panel .brand-mark {
  width: 44px;
}

.login-panel h1 {
  font-size: 24px;
}

.login-panel p {
  color: var(--muted);
}

.login-panel button {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.side-nav {
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #eef2ea;
  padding: 18px 14px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
}

.brand-block {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  height: 44px;
  border: 1px solid var(--green);
  color: var(--green);
  font-weight: 700;
  border-radius: 8px;
  letter-spacing: 0;
}

.brand-block h1 {
  font-size: 18px;
  font-weight: 700;
}

#status {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.side-nav nav {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.nav-button,
.side-action {
  width: 100%;
  max-width: 100%;
  text-align: left;
  background: transparent;
}

.nav-button.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.side-action {
  text-align: center;
}

.side-footer {
  display: grid;
  gap: 8px;
}

#userBadge {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.workbench {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.workbench-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.workbench-header h2 {
  font-size: 25px;
  margin-top: 3px;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.header-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.view {
  display: none;
  padding: 22px 28px 28px;
  min-width: 0;
  overflow: auto;
}

.active-view {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 112px;
  padding: 16px;
  display: grid;
  align-content: space-between;
}

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

.metric-card strong {
  font-size: 24px;
  letter-spacing: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel.full {
  min-height: calc(100vh - 150px);
}

.panel.wide {
  min-width: 0;
}

.panel.span-all {
  grid-column: 1 / -1;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.admin-tab {
  flex: 0 0 auto;
  min-height: 40px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.admin-tab.active {
  border-bottom-color: var(--green);
  color: var(--green);
}

.admin-panel {
  padding: 16px;
}

.admin-panel[hidden] {
  display: none;
}

.admin-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0;
}

.console-section-header {
  display: grid;
  gap: 4px;
  margin-bottom: 4px;
}

.console-section-header h4 {
  margin: 0;
  font-size: 16px;
}

.console-section-header span {
  color: var(--muted);
  font-size: 12px;
}

.panel-header {
  min-height: 58px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-header h3 {
  font-size: 16px;
}

.panel-header span,
.tool-title {
  color: var(--muted);
  font-size: 12px;
}

.panel-header > button {
  flex: 0 0 auto;
}

.table-actions input {
  width: min(300px, 42vw);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.filter-row input {
  width: 150px;
}

.bar-list {
  padding: 14px 16px 16px;
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.bar-track {
  height: 9px;
  border-radius: 999px;
  background: #edf0ea;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: inherit;
}

.compact .bar-fill {
  background: var(--blue);
}

.batch-list {
  padding: 8px 16px 16px;
}

.fund-overview-list {
  display: grid;
}

.fund-overview-item {
  border-bottom: 1px solid var(--line);
}

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

.fund-overview-summary {
  min-height: 70px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 180px) minmax(150px, 220px);
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.fund-overview-summary::marker {
  color: var(--muted);
}

.fund-overview-name {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.fund-overview-name span,
.fund-overview-metric span {
  color: var(--muted);
  font-size: 12px;
}

.fund-overview-metric {
  display: grid;
  gap: 4px;
}

.fund-overview-metric strong {
  font-size: 17px;
}

.fund-lock-breakdown {
  padding: 0 16px 14px 44px;
  display: grid;
  gap: 8px;
}

.fund-lock-row {
  min-height: 40px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 92px minmax(120px, 1fr) minmax(160px, 1.4fr);
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.link-button {
  border: 0;
  padding: 0;
  min-height: 0;
  background: transparent;
  color: var(--green);
  font-weight: 700;
}

.group-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.group-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper);
}

.group-chip strong {
  display: block;
  margin-bottom: 4px;
}

.detail-section {
  padding: 16px;
}

.detail-section + .detail-section {
  border-top: 1px solid var(--line);
}

.detail-section h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.security-insights-section {
  padding-top: 0;
}

.insight-tabs {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.insight-tab {
  flex: 0 0 auto;
  min-height: 46px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 0 2px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.insight-tab:hover,
.insight-tab.active {
  border-bottom-color: var(--green);
  color: var(--green);
}

.insight-tab-panel {
  padding-top: 14px;
}

.insight-tab-panel[hidden] {
  display: none;
}

.trade-section {
  border-top: 1px solid var(--line);
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.section-header h4 {
  margin: 0;
}

.section-header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.research-list {
  border-top: 1px solid var(--line);
}

.research-item {
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}

.research-item h5 {
  margin: 0 0 5px;
  font-size: 14px;
  line-height: 1.45;
}

.research-item-meta {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.research-item > strong {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--green);
  font-size: 12px;
}

.research-quality-warning {
  display: inline-block;
  margin: 0 0 4px 8px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
}

.research-content {
  display: grid;
  gap: 8px;
  margin: 0 0 4px;
  color: #313b46;
  font-size: 13px;
  line-height: 1.7;
}

.research-content h6 {
  margin: 7px 0 0;
  color: #24313b;
  font-size: 13px;
}

.research-content p {
  margin: 0;
}

.research-content-bullet {
  padding-left: 14px;
  text-indent: -12px;
}

.research-content.is-collapsed {
  max-height: 14em;
  overflow: hidden;
}

.research-expand-text {
  margin-top: 6px;
  padding: 5px 9px;
  color: var(--green);
  font-size: 12px;
}

.research-reader-dialog {
  width: min(880px, calc(100vw - 32px));
  max-height: 88vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 18px 54px rgb(21 35 29 / 20%);
}

.research-reader-dialog::backdrop {
  background: rgb(20 29 25 / 45%);
}

.research-reader-shell {
  display: flex;
  max-height: 88vh;
  flex-direction: column;
}

.research-reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.research-reader-header h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
}

.research-reader-header button {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.research-reader-body {
  overflow: auto;
  padding: 20px;
}

.research-reader-body .research-content {
  font-size: 15px;
  line-height: 1.85;
}

.research-summary-status {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.research-summary-status.warning {
  color: var(--amber);
}

.research-document-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-top: 10px;
  padding: 6px 10px;
  border: 1px solid var(--green);
  border-radius: 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.research-document-link:hover,
.research-document-link:focus-visible {
  background: var(--green-2);
}

.research-load-more {
  display: block;
  margin: 14px auto 0;
  min-width: 180px;
}

.settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px 16px;
  padding: 18px;
  max-width: 920px;
}

.settings-section {
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
}

.settings-current-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.settings-current-card strong {
  font-size: 15px;
}

.settings-current-card span {
  color: var(--muted);
  font-size: 13px;
}

.upload-form {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 180px auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
}

.upload-form label {
  display: grid;
  gap: 6px;
}

.upload-form label span {
  color: var(--muted);
  font-size: 13px;
}

.upload-note {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
}

.upload-form button {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.section-divider {
  border-top: 1px solid var(--line);
}

.compact-header {
  min-height: 48px;
}

.import-issues-panel {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.import-issues-panel .panel-header {
  padding-inline: 0;
}

.settings-form label {
  display: grid;
  gap: 6px;
}

.settings-form label span {
  color: var(--muted);
  font-size: 13px;
}

.settings-form-title {
  grid-column: 1 / -1;
}

.settings-form-title strong {
  font-size: 14px;
}

.settings-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-actions button[type="submit"] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.settings-status {
  grid-column: 1 / -1;
  color: var(--muted);
  min-height: 24px;
}

.research-inbox-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.research-inbox-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.research-inbox-item div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.research-inbox-item strong,
.research-inbox-item span {
  overflow-wrap: anywhere;
}

.research-inbox-item span {
  color: var(--muted);
  font-size: 12px;
}

.batch-item {
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
  display: grid;
  gap: 4px;
}

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

.batch-item strong {
  font-size: 13px;
}

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

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 11px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  background: #f3f5f1;
  position: sticky;
  top: 0;
  z-index: 1;
  color: #3d4754;
  font-weight: 700;
}

.sort-header {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.sort-header:hover {
  color: var(--green);
}

tbody tr:hover {
  background: #fafcf8;
}

tfoot td {
  background: #f8faf5;
  border-top: 2px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #1f2a37;
  font-weight: 800;
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  background: var(--green-2);
  color: var(--green);
}

.status-pill.locked {
  background: #fff0d9;
  color: var(--amber);
}

.status-pill.unlocked {
  background: var(--green-2);
  color: var(--green);
}

.empty,
.warning {
  color: var(--muted);
  padding: 16px;
}

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

.ask-layout {
  grid-template-columns: minmax(520px, 1fr);
  min-height: 0;
}

.ask-layout.active-view {
  display: grid;
}

.chat-pane {
  height: calc(100vh - 150px);
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
}

.runtime-status {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.quick-actions-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-right: 4px;
}

.quick-actions button {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 8px 12px;
  text-align: left;
}

.quick-actions button strong {
  font-size: 14px;
  font-weight: 700;
}

.quick-actions button span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.messages {
  overflow: auto;
  min-height: 0;
  padding: 16px;
}

.message {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  white-space: pre-wrap;
  line-height: 1.55;
}

.message.user {
  background: #f7fbff;
}

.message.assistant {
  background: #fbfdf8;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.composer button {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  min-width: 76px;
}

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

  .side-nav {
    position: sticky;
    top: 0;
    z-index: 5;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav nav {
    grid-auto-flow: column;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .nav-button {
    white-space: nowrap;
    text-align: center;
  }

  .side-footer {
    grid-auto-flow: column;
    align-items: center;
  }

  #userBadge {
    display: none;
  }

  .metric-grid,
  .content-grid,
  .ask-layout.active-view,
  .settings-form,
  .upload-form,
  .group-summary {
    grid-template-columns: 1fr;
  }

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

  .fund-overview-summary,
  .fund-lock-row {
    grid-template-columns: 1fr;
  }

  .fund-lock-breakdown {
    padding-left: 16px;
  }

  .chat-pane {
    height: min(680px, calc(100vh - 170px));
  }
}

@media (max-width: 760px) {
  body {
    background: var(--paper);
  }

  button,
  input,
  select {
    min-height: 42px;
  }

  .login-view {
    padding: 16px;
    align-items: start;
    padding-top: 12vh;
  }

  .login-panel {
    padding: 20px;
    box-shadow: none;
  }

  .app-shell {
    min-height: 100svh;
  }

  .side-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 10px 12px;
  }

  .brand-block {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 12px;
    border-radius: 7px;
  }

  .brand-block h1 {
    font-size: 16px;
  }

  #status {
    font-size: 11px;
  }

  .side-nav nav {
    display: flex;
    max-width: 100%;
    gap: 7px;
    margin: 0 -2px;
    padding: 0 2px 4px;
  }

  .nav-button {
    width: auto;
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 12px;
    font-size: 14px;
    border-radius: 999px;
  }

  .side-footer {
    display: flex;
    gap: 8px;
  }

  .side-action {
    width: auto;
    flex: 1 1 0;
    min-height: 38px;
    font-size: 13px;
  }

  .workbench-header {
    display: grid;
    gap: 12px;
    padding: 16px;
  }

  .workbench-header h2 {
    font-size: 22px;
  }

  .header-meta {
    justify-content: flex-start;
  }

  .header-meta span {
    max-width: 100%;
    border-radius: 7px;
    line-height: 1.35;
  }

  .view {
    padding: 14px 10px 18px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .metric-card {
    min-height: 96px;
    padding: 12px;
  }

  .metric-card strong {
    font-size: 20px;
    line-height: 1.2;
  }

  .panel {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .panel.full {
    min-height: auto;
  }

  .panel-header,
  .section-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
    padding: 12px;
  }

  .panel-header > button,
  .section-header > button {
    width: 100%;
  }

  .table-actions input,
  .filter-row input,
  .filter-row button {
    width: 100%;
  }

  .filter-row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .bar-list,
  .batch-list,
  .detail-section,
  .group-summary,
  .settings-form,
  .upload-form {
    padding: 12px;
  }

  .admin-tabs {
    padding: 8px 10px 0;
  }

  .admin-panel {
    padding: 12px;
  }

  .admin-status-grid {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .fund-overview-summary {
    min-height: 0;
    padding: 12px;
    gap: 10px;
  }

  .fund-lock-breakdown {
    padding: 0 12px 12px;
  }

  .fund-lock-row {
    gap: 6px;
    padding: 10px;
  }

  .group-summary {
    gap: 8px;
  }

  .group-chip {
    padding: 10px 12px;
  }

  .settings-form,
  .upload-form,
  .settings-section {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .upload-form button,
  .settings-actions button {
    width: 100%;
  }

  .research-inbox-item {
    align-items: stretch;
    flex-direction: column;
  }

  .security-insights-section {
    padding-top: 0;
  }

  .insight-tabs {
    gap: 18px;
  }

  .table-wrap {
    margin: 0 -1px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 760px;
    font-size: 12px;
  }

  th,
  td {
    padding: 8px 9px;
  }

  .ask-layout.active-view {
    display: block;
  }

  .chat-pane {
    height: calc(100svh - 178px);
    min-height: 520px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .runtime-status {
    padding: 9px 12px;
    font-size: 12px;
  }

  .quick-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 10px 12px;
    -webkit-overflow-scrolling: touch;
  }

  .quick-actions-label {
    flex: 0 0 auto;
  }

  .quick-actions button {
    flex: 0 0 180px;
    min-height: 62px;
  }

  .messages {
    padding: 12px;
  }

  .message {
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.55;
  }

  .composer {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px;
  }

  .composer button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .side-nav nav {
    gap: 5px;
  }

  .nav-button {
    padding: 0 8px;
    font-size: 13px;
  }

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

  .header-meta {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  table {
    min-width: 700px;
  }
}
