/* Epic 7 and 8 views while they migrate into the v2 components. */
@scope (.legacy) {
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-muted); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break { word-break: break-all; }
.noscript { padding: 48px; text-align: center; color: var(--text-muted); }
.link { color: var(--accent); }
.link:hover { text-decoration: underline; }

.page { display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 22px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-sub { margin-top: 6px; color: var(--text-muted); }
.page-lead { margin-top: -8px; }
.back { display: inline-block; margin-bottom: 8px; color: var(--text-muted); font-size: 13px; }
.back:hover { color: var(--text); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.slot:empty { display: none; }

/* Buttons and inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-small);
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.btn:hover:not(:disabled) { background: var(--bg-hover); }
.btn:focus-visible, .input:focus-visible, .row:focus-visible, .nav-link:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger); filter: brightness(0.95); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { color: var(--text); }
.btn-ghost-danger { border-color: transparent; background: transparent; color: var(--danger); }
.btn-ghost-danger:hover:not(:disabled) { background: var(--danger-soft); }
.btn-small { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-wide { width: 100%; height: 36px; }
.label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.help { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }
.input {
  width: 100%; min-height: 34px; padding: 7px 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-small);
  background: var(--surface); color: var(--text); font: inherit;
}
textarea.input { resize: vertical; min-height: 72px; }
.input::placeholder { color: var(--text-faint); }
.field { flex: 1; min-width: 0; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { min-width: 120px; }
.field-group { display: flex; flex-direction: column; gap: 12px; }
.form { display: flex; flex-direction: column; gap: 14px; }

/* Lists */
.list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; }
.card .list { border: none; border-radius: 0; margin: 0 -20px -20px; border-top: 1px solid var(--border); }
.row {
  display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }
a.row:hover { background: var(--bg-subtle); }
.row-main { flex: 2.2 1 0; min-width: 0; }
.row-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { display: flex; gap: 10px; align-items: center; color: var(--text-muted); margin-top: 2px; min-width: 0; }
.row-meta { flex: 1.4 1 0; min-width: 0; color: var(--text-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-status { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.row-error { color: var(--danger); font-size: 12px; max-width: 220px; text-align: right; }
.row-actions { flex: 0 0 auto; display: flex; gap: 4px; justify-content: flex-end; }
.id { color: var(--text-faint); }
.empty { padding: 48px 20px; text-align: center; }
.empty-title { font-weight: 500; margin-bottom: 4px; }
.empty-actions { margin-top: 16px; }
/* Tokens are typed into masked text fields, not password fields (no password manager offers). */
.masked { -webkit-text-security: disc; }

/* Status pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-subtle);
  color: var(--text-muted); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }
.pill-running .pill-dot, .pill-ready .pill-dot { background: var(--ok); }
.pill-running, .pill-ready { color: var(--text); }
.pill-failed { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); }
.pill-failed .pill-dot { background: var(--danger); }
.pill-busy .pill-dot { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }
.pill-deleted { opacity: 0.6; }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .pill-busy .pill-dot { animation: none; } }

/* Cards and facts */
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 20px;
  display: flex; flex-direction: column; gap: 14px; }
.card-title { font-size: 14px; }
.facts { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; min-width: 0; }
.copy-label { font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; }
.copy-row { display: flex; gap: 8px; }
.copy-input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: var(--radius-small); background: var(--bg-subtle); color: var(--text); }

/* Notices */
.notice { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--bg-subtle); }
.notice-error { border-color: var(--danger-soft); background: var(--danger-soft); }
.notice-error .notice-title { color: var(--danger); }
.notice-title { font-weight: 500; }
.notice-hint { color: var(--text-muted); margin-top: 2px; }
.notice-code { color: var(--text-faint); margin-top: 4px; }
.notice-info { background: var(--accent-soft); border-color: var(--accent-soft); }

/* Login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg-subtle); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 32px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 20px; }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.login-title { font-size: 18px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form .help { margin-top: -4px; }

/* Dialogs */
.dialog { border: 1px solid var(--border); border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(16, 17, 20, 0.35); }
.dialog-form { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.dialog-title { font-size: 16px; }
.dialog-body { display: flex; flex-direction: column; gap: 14px; }
.dialog-text { color: var(--text-muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Terminal */
.term-page { gap: 12px; height: calc(100vh - 56px - 48px); }
.term-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.term-head-right { display: flex; align-items: center; gap: 12px; }
.term-title { font-size: 18px; }
.term-status { font-size: 13px; }
.term-screen { flex: 1; min-height: 240px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--term-bg); padding: 10px 12px; overflow: hidden; }
.term-screen .xterm { height: 100%; }

@media (max-width: 760px) {
  .row { flex-wrap: wrap; }
  .row-main { flex-basis: 100%; }
  .row-meta { flex: 1 1 auto; }
  .row-meta:not(.row-times) { display: none; }
  .facts { grid-template-columns: 1fr; gap: 2px 0; }
  .facts dd { margin-bottom: 8px; }
}
}
