/* =========================================================================
   DISPOSITION APP FOR CUSTOMER SERVICE
   Base stylesheet - design tokens + shared components.
   Desktop-first, responsive down to mobile. Kept deliberately plain:
   clarity over decoration.
   ========================================================================= */

/* ---- Design tokens ---------------------------------------------------- */
:root {
  --color-bg: #f4f6f9;
  --color-surface: #ffffff;
  --color-surface-alt: #f8fafc;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;

  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-text-inverse: #ffffff;

  --color-primary: #1d4ed8;
  --color-primary-hover: #1e40af;
  --color-primary-soft: #eff6ff;

  --color-success: #15803d;
  --color-success-soft: #ecfdf5;
  --color-warning: #b45309;
  --color-warning-soft: #fffbeb;
  --color-danger: #b91c1c;
  --color-danger-soft: #fef2f2;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);

  --content-max-width: 1600px;

  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
}

/* ---- Dark theme -------------------------------------------------------
   Overrides the same tokens the light theme sets above, so every
   already-built page gets dark mode for free. Sidebar/topbar are fixed
   brand chrome (see below) and intentionally do not respond to this. */
:root[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-surface-alt: #273449;
  --color-border: #334155;
  --color-border-strong: #475569;

  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-text-inverse: #0f172a;

  --color-primary: #60a5fa;
  --color-primary-hover: #93c5fd;
  --color-primary-soft: #1e3a5f;

  --color-success: #4ade80;
  --color-success-soft: #14352490;
  --color-warning: #fbbf24;
  --color-warning-soft: #4536106e;
  --color-danger: #f87171;
  --color-danger-soft: #4c1d1d90;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* ---- Reset ------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, dl, dd { margin: 0; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

[hidden] { display: none !important; }

.text-capitalize { text-transform: capitalize; }

/* ---- Centered page layout --------------------------------------------- */
.page-centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-5);
}

.status-shell { width: 100%; max-width: 620px; }

/* ---- Cards ------------------------------------------------------------ */
.status-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-7) var(--space-6);
  text-align: center;
}

.status-card__header { margin-bottom: var(--space-5); }

.status-card__title {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0.01em;
  margin-top: var(--space-4);
}

.status-card__subtitle {
  margin-top: var(--space-2);
  color: var(--color-text-muted);
  font-size: 14px;
}

.status-card__footer {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-5);
}

.status-card__note {
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: left;
  word-break: break-word;
}

.status-card--error .status-card__title { color: var(--color-danger); }

/* ---- Brand mark ------------------------------------------------------- */
.brand-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark--error { background: var(--color-danger); }

.brand-logo {
  width: 84px;
  height: 84px;
  margin: 0 auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(49, 46, 129, 0.25));
  animation: brand-logo-in 0.5s ease both;
}

@keyframes brand-logo-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Status line ------------------------------------------------------ */
.status-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--color-success-soft);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  font-size: 15px;
}

.status-line__label { color: var(--color-text-muted); }
.status-line__value { font-weight: 650; color: var(--color-success); }

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-text-muted);
  flex: none;
}

.status-dot--online {
  background: var(--color-success);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.16);
}

.status-dot--offline {
  background: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.16);
}

/* ---- Meta grid -------------------------------------------------------- */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-5);
  text-align: left;
}

.meta-grid__item {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.meta-grid__item dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.meta-grid__item dd { margin-top: var(--space-1); font-weight: 600; }

/* ---- Badges ----------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge--ok {
  background: var(--color-success-soft);
  color: var(--color-success);
  border-color: #bbf7d0;
}

.badge--pending {
  background: var(--color-warning-soft);
  color: var(--color-warning);
  border-color: #fde68a;
}

.badge--error {
  background: var(--color-danger-soft);
  color: var(--color-danger);
  border-color: #fecaca;
}

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 38px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:hover { text-decoration: none; }

.btn--primary { background: var(--color-primary); color: var(--color-text-inverse); }
.btn--primary:hover:not(:disabled) { background: var(--color-primary-hover); }

.btn--ghost {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

.btn--ghost:hover:not(:disabled) { background: var(--color-surface-alt); }

.btn--danger { background: var(--color-danger); color: var(--color-text-inverse); }
.btn--danger:hover:not(:disabled) { background: #991b1b; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
}

.btn-icon--danger:hover { background: var(--color-danger-soft); color: var(--color-danger); border-color: var(--color-danger); }

/* ---- Toasts ----------------------------------------------------------- */
.toast-container {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 1000;
}

.toast {
  min-width: 260px;
  max-width: 380px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-primary);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  font-size: 14px;
  animation: toast-in 0.18s ease-out;
}

.toast--success { border-left-color: var(--color-success); }
.toast--error { border-left-color: var(--color-danger); }
.toast--warning { border-left-color: var(--color-warning); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
  .btn { transition: none; }
}

/* ---- Forms -------------------------------------------------------------- */
.form-field { text-align: left; margin-bottom: var(--space-4); }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.form-input {
  width: 100%;
  min-height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-surface);
}

.form-input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.form-error {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-danger-soft);
  border: 1px solid #fecaca;
  color: var(--color-danger);
  font-size: 14px;
  text-align: left;
}

/* ---- Login page --------------------------------------------------------
   Scoped to .login-page / .login-card so the rest of the app's forms and
   cards keep their plainer, data-density-first look. */
body.login-page {
  background: radial-gradient(circle at 50% -10%, #4f46e5 0%, #312e81 45%, var(--color-bg) 100%);
}

.login-card {
  max-width: 400px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
  animation: login-card-in 0.5s ease both;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #312e81, #4f46e5, #818cf8);
}

@keyframes login-card-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-card .form-input {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.login-card .form-input:hover {
  border-color: var(--color-border-strong);
}

.login-card .form-input:focus-visible {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
  transform: translateY(-1px);
}

.login-card .btn--primary {
  background: linear-gradient(135deg, #4f46e5, #312e81);
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.login-card .btn--primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
  filter: brightness(1.08);
}

.login-card .btn--primary:active:not(:disabled) {
  transform: translateY(0);
}

.form-success {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-success-soft);
  border: 1px solid #bbf7d0;
  color: var(--color-success);
  font-size: 14px;
  text-align: left;
}

.btn--block { width: 100%; }
.btn--small { min-height: 30px; padding: 0 var(--space-3); font-size: 13px; }

/* ---- App shell (topbar + sidebar + content) ---------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas: "topbar topbar" "sidebar content";
  height: 100vh;
  overflow: hidden;
}

.app-shell .topbar { grid-area: topbar; }

.sidebar {
  grid-area: sidebar;
  background: linear-gradient(180deg, #312e81 0%, #4f46e5 100%);
  border-right: 1px solid #312e81;
  padding: var(--space-4);
  overflow-y: auto;
}

.content-wrap {
  grid-area: content;
  position: relative;
  height: 100%;
  overflow: hidden;
}

.content-area {
  padding: var(--space-6);
  max-width: var(--content-max-width);
  height: 100%;
  overflow-y: auto;
}

.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }

.nav-link {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.12); text-decoration: none; }

.nav-link--active { background: rgba(255, 255, 255, 0.2); color: #ffffff; }

/* ---- Topbar ------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: #e0e7ff;
  border-bottom: 1px solid #c7d2fe;
  color: #0f172a;
}

.topbar__brand { display: flex; align-items: center; gap: var(--space-3); }

.brand-mark--small { width: 32px; height: 32px; font-size: 16px; border-radius: var(--radius-sm); }

.topbar__logo { width: 34px; height: 34px; object-fit: contain; }

.topbar__app-name { font-weight: 650; font-size: 14px; }

.topbar__user { display: flex; align-items: center; gap: var(--space-3); }

.topbar__user-name { font-size: 14px; font-weight: 600; }

.topbar__logout-form { margin: 0; }

.theme-toggle {
  min-height: 34px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid #a5b4fc;
  background: #ffffff;
  color: #312e81;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.theme-toggle:hover { background: #eef2ff; }

/* ---- Screen lock --------------------------------------------------------
   Idle/manual privacy lock. The overlay itself is never blurred — only
   .app-shell is, via the html[data-locked] rule below — so the warning
   card stays crisp and readable. */
html[data-locked="true"] .app-shell {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

.lock-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

html[data-locked="true"] .lock-overlay { display: flex; }

.lock-overlay__card {
  width: 100%;
  max-width: 360px;
  margin: var(--space-4);
  padding: var(--space-6) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  text-align: center;
  animation: login-card-in 0.3s ease both;
}

.lock-overlay__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto var(--space-3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5, #312e81);
  color: #ffffff;
}

.lock-overlay__title { font-size: 18px; font-weight: 650; }

.lock-overlay__caption {
  margin-top: var(--space-2);
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.badge--role {
  background: #c7d2fe;
  color: #312e81;
  border-color: #a5b4fc;
}

/* ---- Dashboard content --------------------------------------------------- */
.dashboard-shell__title { font-size: 22px; font-weight: 650; }

.dashboard-shell__subtitle { margin-top: var(--space-1); color: var(--color-text-muted); }

.dashboard-shell__note {
  margin-top: var(--space-5);
  color: var(--color-text-muted);
  font-size: 13px;
}

.dashboard-toggle {
  display: inline-flex;
  gap: 4px;
  margin-top: var(--space-4);
  padding: 4px;
  border-radius: var(--radius-lg);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
}

.dashboard-toggle__btn {
  min-height: 36px;
  padding: 0 var(--space-5);
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dashboard-toggle__btn:hover { color: var(--color-text); }

.dashboard-toggle__btn--active {
  background: linear-gradient(135deg, #4f46e5, #312e81);
  color: #ffffff;
}

.dashboard-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.dashboard-card {
  display: block;
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.dashboard-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

a.dashboard-card:hover { transform: translateY(-2px); }

.dashboard-card--pending { border-left-color: var(--color-warning); }
.dashboard-card--resolved { border-left-color: var(--color-success); }
.dashboard-card--rts { border-left-color: #7c3aed; }

.dashboard-card__title { font-size: 15px; font-weight: 650; }

.dashboard-card__desc {
  margin-top: var(--space-2);
  margin-bottom: var(--space-3);
  color: var(--color-text-muted);
  font-size: 13px;
}

.dashboard-card__stat {
  margin: var(--space-2) 0 0;
  font-size: 30px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.chart-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-top: var(--space-4);
}

/* ---- Dashboard space-warp decoration -----------------------------------
   Anchored to .content-wrap (a positioning context spanning the sidebar-to-
   viewport-edge grid cell), starting exactly at .content-area's max-width
   boundary — never the raw viewport edge. This keeps it strictly in the
   leftover margin: it can never sit on top of .content-area's own
   scrollbar (which lives inside content-area, left of this boundary), and
   on a narrow viewport where content-area has no leftover margin at all,
   this resolves to zero width and simply doesn't render anything.
   Negative z-index + no pointer events, so it never affects layout,
   scrolling, or clicks. The canvas itself is driven by static/js/space-warp.js. */
.space-warp {
  position: absolute;
  top: 0;
  left: var(--content-max-width);
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.space-warp canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---- Admin: user management --------------------------------------------- */
.admin-section { margin-top: var(--space-6); }

.admin-section--danger {
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--color-danger-soft);
}

.admin-section__title { font-size: 16px; font-weight: 650; margin-bottom: var(--space-3); }

.inline-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
}

.inline-fields .form-field { margin-bottom: 0; min-width: 160px; }

.inline-fields--compact { display: flex; align-items: center; gap: var(--space-2); }
.inline-fields--compact .form-input { min-height: 32px; width: auto; }

.distribute-form { text-align: left; min-width: 220px; }
.distribute-agents {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
}
.distribute-agent-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.distribute-agent-checkbox input { margin: 0; }

/* ---- Incoming Agent: New Caller form ------------------------------------ */
.tracking-context {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  font-size: 14px;
}

.caller-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.caller-form-row .form-field { flex: 1 1 200px; margin-bottom: 0; }
.caller-form-row .form-field--full { flex: 1 1 100%; }

.form-input--uppercase { text-transform: uppercase; }
.form-input--uppercase::placeholder { text-transform: none; }

.email-input-group { display: flex; gap: var(--space-2); }
.email-input-group input { flex: 1 1 auto; min-width: 0; }
.email-input-group select { flex: 0 0 130px; }

.field-error {
  margin-top: var(--space-1);
  margin-bottom: 0;
  font-size: 12px;
  color: var(--color-danger);
}

.caller-form-actions { display: flex; gap: var(--space-3); }

.table-scroll { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.data-table th,
.data-table td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table td.col-wrap {
  white-space: normal;
  min-width: 240px;
  max-width: 420px;
}

.data-table th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ---- Modal ---------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  z-index: 2000;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.modal__title { font-size: 16px; font-weight: 650; }

.modal__body { padding: var(--space-5); }

.modal__footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
}

.remark-list {
  list-style: none;
  margin: var(--space-3) 0 var(--space-4);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 220px;
  overflow-y: auto;
}

.remark-item {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-size: 13px;
}

.remark-item p { margin-top: var(--space-1); white-space: pre-wrap; }

.remark-item__date { color: var(--color-text-muted); font-size: 12px; }

.remark-item--empty { color: var(--color-text-muted); text-align: center; }

/* ---- Responsive ------------------------------------------------------- */
@media (max-width: 640px) {
  .status-card { padding: var(--space-5) var(--space-4); }
  .status-card__title { font-size: 18px; }
  .meta-grid { grid-template-columns: minmax(0, 1fr); }
  .toast-container { left: var(--space-4); right: var(--space-4); }
  .toast { max-width: none; }
  .topbar { flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: var(--space-3) var(--space-4); }
  .content-area { padding: var(--space-4); height: auto; overflow-y: visible; }
  .content-wrap { height: auto; overflow: visible; }
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "topbar" "sidebar" "content";
    height: auto;
    overflow: visible;
  }
  .sidebar { border-right: none; border-bottom: 1px solid var(--color-border); overflow-y: visible; }
  .nav-list { flex-direction: row; flex-wrap: wrap; }
}
