:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-muted: #fafbfd;
  --line: #d7dde6;
  --line-strong: #c4ccd8;
  --text: #142033;
  --text-muted: #5a667a;
  --primary: #1d4f91;
  --primary-soft: #eaf1fb;
  --success: #216e4c;
  --success-soft: #e7f4ed;
  --warning: #8a5a14;
  --warning-soft: #fdf1df;
  --danger: #992f2f;
  --danger-soft: #fae8e8;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --radius: 10px;
  font-family: "IBM Plex Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

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

code,
pre,
.mono {
  font-family: "IBM Plex Mono", monospace;
}

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

.sidebar {
  border-right: 1px solid var(--line);
  background: #eef2f7;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.main {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.nav-link,
.subnav-link,
.text-link {
  color: var(--primary);
  text-decoration: none;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-size: 0.9rem;
}

.nav-link-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-link.is-active {
  border-color: #8fb0d9;
  background: #f7fbff;
  font-weight: 600;
}

.is-selected-row td {
  background: #f7fbff;
}

.subnav {
  display: flex;
  gap: 8px;
  margin-top: -4px;
}

.subnav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-size: 0.88rem;
}

.subnav-link.is-active {
  border-color: #8fb0d9;
  background: #f7fbff;
  font-weight: 600;
}

.compact-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-head,
.panel-title-row,
.toolbar-title,
.session-row-main,
.live-summary,
.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-head,
.panel-title-row {
  justify-content: space-between;
}

.toolbar {
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.toolbar-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.toolbar-meta strong {
  color: var(--text);
}

.toolbar h2,
.panel h2,
.sidebar h1,
.login-card h1 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 600;
}

.muted {
  color: var(--text-muted);
}

.timezone-note {
  margin-top: 4px;
  font-size: 0.8rem;
}

.notice {
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 0.92rem;
}

.notice-success {
  background: var(--success-soft);
  border-color: #b4dcc7;
  color: var(--success);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field span,
.detail-label,
th {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

input[type="text"],
input[type="password"],
select,
textarea,
input[type="file"] {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 180px;
}

.md-editor {
  min-height: 68vh;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.55;
}

.md-management-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.65fr);
  gap: 12px;
}

.md-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

button {
  border: 1px solid #1c4f93;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover:not(:disabled) {
  filter: brightness(0.96);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.danger-button {
  border-color: #b43a3a;
  background: #b43a3a;
  color: #fff;
}

.compact-button {
  padding: 8px 10px;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.count,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.count,
.badge-subtle {
  background: #edf2f7;
  color: var(--text-muted);
}

.count-attention {
  background: #ffedd8;
  color: #9a4d00;
}

.is-hidden {
  display: none !important;
}

.badge-idle,
.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-running {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-failed,
.badge-interrupted {
  background: var(--danger-soft);
  color: var(--danger);
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.session-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-decoration: none;
  color: inherit;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.session-row.is-active {
  border-color: #8fb0d9;
  background: #f7fbff;
}

.session-row-unread {
  border-color: #f0b46a;
  box-shadow: 0 0 0 1px rgba(240, 180, 106, 0.18);
}

.session-unread-pill {
  position: relative;
  box-shadow: 0 0 0 1px rgba(154, 77, 0, 0.08);
}

.session-unread-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.85;
}

.session-row-main {
  justify-content: space-between;
}

.session-row-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.session-row-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.session-row-snippet {
  color: var(--text);
  line-height: 1.45;
}

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

.session-stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #f7fafc 0%, #ffffff 100%);
  padding: 14px;
}

.session-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(140px, 0.5fr)) auto auto;
  gap: 10px;
}

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

.session-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.session-card-unread {
  border-color: #f0b46a;
  box-shadow: 0 0 0 1px rgba(240, 180, 106, 0.22);
}

.session-latest-reply-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.session-card-head,
.session-card-footer,
.pagination-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.session-card-title {
  min-width: 0;
}

.session-card-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.session-card-name-row h3 {
  margin: 0;
  font-size: 1rem;
}

.session-card-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.session-card-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.session-summary-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfd;
  padding: 10px 12px;
}

.session-summary-block p {
  margin: 4px 0 0;
  line-height: 1.5;
}

.session-card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.pagination-panel {
  padding: 12px 14px;
}

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

.page-chip {
  min-width: 42px;
}

.page-chip-active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #8fb0d9;
  border-radius: 8px;
  background: #f7fbff;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

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

.overview-focus-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.overview-primary-panel {
  padding: 16px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-value {
  margin-top: 6px;
  font-size: 1.2rem;
  font-weight: 700;
}

.stat-note {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.detail-value {
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.mention-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-panel,
.collapsible-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-muted);
}

.mini-panel > summary,
.collapsible-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

.mini-panel > summary::-webkit-details-marker,
.collapsible-panel > summary::-webkit-details-marker {
  display: none;
}

.mini-panel > summary::after,
.collapsible-panel > summary::after {
  content: "+";
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
}

.mini-panel[open] > summary::after,
.collapsible-panel[open] > summary::after {
  content: "-";
}

.mini-panel > :not(summary),
.collapsible-body {
  padding: 0 12px 12px;
}

.summary-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.quick-upload {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-muted);
  padding: 10px;
}

.dropzone {
  border: 1px dashed #9fb0c7;
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropzone.is-dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.dropzone-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.dropzone-text,
.dropzone-note {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mention-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-muted);
  padding: 8px;
}

.mention-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px 10px;
}

.mention-item small {
  grid-column: 2;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 12px;
}

.runs-grid {
  grid-template-columns: 0.9fr 1.1fr;
}

.lower-grid {
  align-items: start;
}

.inline-checkbox {
  align-self: end;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  color: var(--text);
}

.grow {
  flex: 1 1 auto;
}

.align-end {
  align-self: end;
}

.live-summary {
  flex-wrap: wrap;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.log-box {
  margin: 0;
  min-height: 240px;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
  color: #17202f;
  padding: 12px;
}

.reply-box {
  margin: 0;
  min-height: 220px;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 12px;
}

.reply-box-fresh {
  border-color: #f0b46a;
  box-shadow: 0 0 0 3px rgba(240, 180, 106, 0.18);
  animation: replyPulse 1.4s ease-out 1;
}

.run-reply {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.conversation-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.conversation-entry {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.conversation-entry-user {
  align-items: flex-end;
}

.conversation-entry-assistant {
  align-items: flex-start;
}

.conversation-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.conversation-speaker {
  font-weight: 700;
  color: var(--text);
}

.conversation-time {
  color: var(--text-muted);
}

.conversation-box {
  margin: 0;
  width: min(100%, 980px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.conversation-box-user {
  background: #eef4ff;
  border-color: #c9d8ef;
}

.conversation-box-assistant {
  background: var(--panel);
}

.conversation-files {
  width: min(100%, 980px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.conversation-file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.conversation-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
}

.conversation-file-path {
  color: var(--text-muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--panel);
}

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

.data-table thead th {
  position: sticky;
  top: 0;
  background: var(--panel-muted);
  z-index: 1;
}

.preview-cell {
  width: 88px;
}

.toggle-cell {
  width: 56px;
  text-align: center;
}

.toggle-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.file-thumb-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-muted);
  overflow: hidden;
}

.file-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--text-muted);
  background: var(--panel-muted);
}

.cell-pre {
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.rich-output {
  line-height: 1.65;
  overflow-wrap: anywhere;
  overflow-x: auto;
}

.rich-output > :first-child {
  margin-top: 0;
}

.rich-output > :last-child {
  margin-bottom: 0;
}

.rich-output p,
.rich-output ul,
.rich-output ol,
.rich-output blockquote,
.rich-output pre,
.rich-output table,
.rich-output h1,
.rich-output h2,
.rich-output h3,
.rich-output h4,
.rich-output h5,
.rich-output h6 {
  margin: 0 0 0.9em;
}

.rich-output h1,
.rich-output h2,
.rich-output h3,
.rich-output h4,
.rich-output h5,
.rich-output h6 {
  line-height: 1.28;
}

.rich-output h1 {
  font-size: 1.45rem;
}

.rich-output h2 {
  font-size: 1.2rem;
}

.rich-output h3 {
  font-size: 1rem;
}

.rich-output ul,
.rich-output ol {
  padding-left: 1.35rem;
}

.rich-output blockquote {
  border-left: 3px solid #c9d8ef;
  padding-left: 12px;
  color: #33445e;
}

.rich-output code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92em;
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
  background: #edf2f7;
}

.rich-output pre code {
  display: block;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.rich-output a {
  color: var(--primary);
}

.rich-output table {
  width: max-content;
  min-width: min(100%, 640px);
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.45;
  background: var(--panel);
}

.rich-output th,
.rich-output td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.rich-output th {
  background: var(--panel-muted);
  color: var(--text-muted);
  font-weight: 700;
}

.rich-output .align-left {
  text-align: left;
}

.rich-output .align-center {
  text-align: center;
}

.rich-output .align-right {
  text-align: right;
}

.rich-output .rich-empty {
  color: var(--text-muted);
}

.rich-pre,
.terminal-pre {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f1724;
  color: #e6edf5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.55;
}

.rich-output-terminal {
  background: #0f1724;
  color: #e6edf5;
}

.rich-output-terminal .activity-block {
  border-bottom: 1px solid rgba(230, 237, 245, 0.12);
  padding: 0 0 12px;
  margin-bottom: 12px;
}

.rich-output-terminal .activity-block:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

@keyframes replyPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(240, 180, 106, 0.34);
  }
  100% {
    box-shadow: 0 0 0 3px rgba(240, 180, 106, 0.18);
  }
}

.activity-title {
  margin-bottom: 8px;
  color: #9db4cf;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ansi-bold {
  font-weight: 700;
}

.ansi-dim {
  opacity: 0.72;
}

.ansi-italic {
  font-style: italic;
}

.ansi-underline {
  text-decoration: underline;
}

.ansi-fg-0 { color: #111827; }
.ansi-fg-1 { color: #ef4444; }
.ansi-fg-2 { color: #22c55e; }
.ansi-fg-3 { color: #f59e0b; }
.ansi-fg-4 { color: #60a5fa; }
.ansi-fg-5 { color: #f472b6; }
.ansi-fg-6 { color: #22d3ee; }
.ansi-fg-7 { color: #e5e7eb; }
.ansi-fg-bright-0 { color: #94a3b8; }
.ansi-fg-bright-1 { color: #f87171; }
.ansi-fg-bright-2 { color: #4ade80; }
.ansi-fg-bright-3 { color: #fbbf24; }
.ansi-fg-bright-4 { color: #93c5fd; }
.ansi-fg-bright-5 { color: #f9a8d4; }
.ansi-fg-bright-6 { color: #67e8f9; }
.ansi-fg-bright-7 { color: #f8fafc; }
.ansi-bg-0 { background: #111827; }
.ansi-bg-1 { background: #7f1d1d; }
.ansi-bg-2 { background: #14532d; }
.ansi-bg-3 { background: #78350f; }
.ansi-bg-4 { background: #1d4ed8; }
.ansi-bg-5 { background: #831843; }
.ansi-bg-6 { background: #155e75; }
.ansi-bg-7 { background: #cbd5e1; }
.ansi-bg-bright-0 { background: #475569; }
.ansi-bg-bright-1 { background: #dc2626; }
.ansi-bg-bright-2 { background: #16a34a; }
.ansi-bg-bright-3 { background: #d97706; }
.ansi-bg-bright-4 { background: #2563eb; }
.ansi-bg-bright-5 { background: #db2777; }
.ansi-bg-bright-6 { background: #0891b2; }
.ansi-bg-bright-7 { background: #f8fafc; color: #111827; }

.run-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.run-history-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfd;
  padding: 14px;
}

.run-history-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

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

.run-history-content {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  min-height: 120px;
}

.empty-panel {
  padding: 24px;
}

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

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.error-text {
  margin: 0;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 600;
}

@media (max-width: 1280px) {
  .stats-grid,
  .detail-grid,
  .session-stats-grid,
  .session-board {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell,
  .stats-grid,
  .detail-grid,
  .md-management-grid,
  .session-stats-grid,
  .session-board {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .main {
    padding: 12px;
  }

  .form-row,
  .toolbar-meta,
  .live-summary,
  .toolbar,
  .session-card-head,
  .session-card-footer,
  .pagination-row,
  .run-history-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .session-filter-bar,
  .session-card-summary,
  .run-history-columns {
    grid-template-columns: 1fr;
  }
}
