:root {
  --bg-top: #f7fbff;
  --bg-bottom: #edf3ff;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --ink: #21304d;
  --muted: #60708c;
  --line: rgba(54, 81, 129, 0.14);
  --accent: #2364d6;
  --accent-soft: #6ec7e8;
  --accent-warm: #ff9f7a;
  --success: #1f9d74;
  --warning: #c47b1d;
  --danger: #ba4653;
  --shadow: 0 24px 60px rgba(44, 76, 134, 0.14);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(110, 199, 232, 0.28), transparent 28%),
    radial-gradient(circle at right 12% top 18%, rgba(255, 159, 122, 0.24), transparent 22%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 380px;
  height: 380px;
  left: -140px;
  bottom: -130px;
  background: radial-gradient(circle, rgba(35, 100, 214, 0.12), transparent 70%);
}

body::after {
  width: 300px;
  height: 300px;
  right: -90px;
  top: 80px;
  background: radial-gradient(circle, rgba(255, 159, 122, 0.16), transparent 68%);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Palatino Linotype", "Noto Serif SC", serif;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.8fr);
  gap: 22px;
  margin-bottom: 22px;
}

.hero-copy,
.hero-brand,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-brand,
.panel {
  overflow: hidden;
}

.hero-copy {
  padding: 34px 34px 30px;
  animation: float-up 0.6s ease both;
}

.hero-brand {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100%;
  padding: 24px;
  animation: float-up 0.75s ease both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1.05;
  margin-bottom: 18px;
}

.hero-copy p + p {
  margin-top: 10px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #3d91f0 65%, var(--accent-soft) 100%);
  box-shadow: 0 12px 30px rgba(35, 100, 214, 0.28);
}

.button.secondary {
  color: var(--ink);
  border-color: rgba(35, 100, 214, 0.2);
  background: rgba(255, 255, 255, 0.68);
}

.logo-wrap {
  display: grid;
  place-items: center;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(110, 199, 232, 0.2), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 255, 0.88));
  border: 1px solid rgba(54, 81, 129, 0.08);
  padding: 18px;
}

.logo-wrap img {
  width: min(100%, 700px);
  height: auto;
  filter: drop-shadow(0 16px 24px rgba(71, 101, 178, 0.12));
}

.brand-note {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
}

.brand-note strong {
  color: var(--ink);
}

.dashboard {
  display: grid;
  gap: 22px;
}

.panel {
  padding: 28px;
  animation: float-up 0.8s ease both;
}

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

.action-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px solid rgba(54, 81, 129, 0.09);
  word-break: break-word;
}

.card-index {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.14em;
}

.action-card h2 {
  font-size: 1.4rem;
}

.text-link {
  color: var(--accent);
  font-weight: 700;
}

.micro-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.upload-form {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.file-picker {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px dashed rgba(35, 100, 214, 0.28);
  background: rgba(246, 250, 255, 0.92);
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
}

.file-picker span {
  font-weight: 700;
  color: var(--ink);
}

.file-picker input {
  font: inherit;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: 1.8rem;
}

.section-heading p {
  max-width: 460px;
  color: var(--muted);
}

.run-list {
  display: grid;
  gap: 16px;
}

.run-card,
.empty-card {
  border-radius: 24px;
  border: 1px solid rgba(54, 81, 129, 0.1);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 36px rgba(44, 76, 134, 0.08);
}

.run-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.run-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 42px rgba(44, 76, 134, 0.12);
}

.run-card.is-focused {
  outline: 2px solid rgba(35, 100, 214, 0.26);
}

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

.run-title {
  display: grid;
  gap: 8px;
}

.run-title h3 {
  font-size: 1.2rem;
}

.run-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
}

.badge.running {
  color: #155a92;
  background: rgba(110, 199, 232, 0.2);
}

.badge.completed {
  color: #0d6f52;
  background: rgba(31, 157, 116, 0.16);
}

.badge.failed {
  color: #932737;
  background: rgba(186, 70, 83, 0.16);
}

.badge.queued {
  color: #855213;
  background: rgba(196, 123, 29, 0.18);
}

.message-line {
  color: var(--ink);
  font-weight: 600;
}

.overall-progress,
.sub-progress {
  display: grid;
  gap: 8px;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
}

.progress-track {
  position: relative;
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(35, 100, 214, 0.09);
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent) 0%, #3d91f0 65%, var(--accent-soft) 100%);
  transition: width 240ms ease;
}

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

.sub-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(246, 249, 255, 0.94);
  border: 1px solid rgba(54, 81, 129, 0.08);
}

.sub-card h4 {
  margin: 0;
  font-size: 1rem;
}

.sub-card p {
  color: var(--muted);
  font-size: 0.94rem;
}

.run-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff5ef 0%, #ffd7c6 100%);
  color: #874019;
  font-weight: 700;
}

.error-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(186, 70, 83, 0.08);
  color: var(--danger);
  white-space: pre-wrap;
}

.empty-card {
  padding: 32px 24px;
  color: var(--muted);
  text-align: center;
}

.noscript-note {
  margin-top: 16px;
  color: var(--warning);
}

@keyframes float-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- User bar --- */

.user-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-bottom: 14px;
}

.user-bar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  margin-right: auto;
}

.back-link:hover {
  opacity: 0.8;
}

.user-greeting {
  color: var(--muted);
  font-size: 0.95rem;
}

.credits-display {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(31, 157, 116, 0.1);
  color: var(--success);
  font-weight: 700;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.button.small {
  min-height: 34px;
  padding: 0 14px;
  font-size: 0.88rem;
}

/* --- Upload form enhancements --- */

.upload-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.upload-btn-row .button {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Estimate panel --- */

/* (estimate panel is now rendered inside modal) */

.estimate-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.est-item {
  display: grid;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(54, 81, 129, 0.06);
  font-size: 0.88rem;
}

.est-item span {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.est-item strong {
  font-size: 0.95rem;
}

.estimate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 12px;
}

.estimate-table th {
  text-align: left;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 8px;
  border-bottom: 2px solid var(--line);
}

.estimate-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}

.estimate-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.estimate-table th:not(:first-child) {
  text-align: right;
}

.estimate-table tfoot td {
  border-bottom: none;
  border-top: 2px solid var(--line);
}

.estimate-cost {
  font-size: 1rem;
  padding-top: 4px;
}

.estimate-cost strong {
  color: var(--accent);
  font-size: 1.15rem;
}

.estimate-balance {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.balance-row span {
  color: var(--muted);
}

.balance-short strong {
  color: var(--danger);
}

.balance-ok strong {
  color: var(--success);
}

/* --- Modal --- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: none;
  place-items: center;
  background: rgba(33, 48, 77, 0.45);
  backdrop-filter: blur(6px);
  padding: 24px;
  overflow-y: auto;
}

.modal-overlay:not([hidden]) {
  display: grid;
}

.modal-dialog {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 28px 28px 24px;
  border-radius: var(--radius-xl);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  box-shadow: 0 32px 80px rgba(44, 76, 134, 0.22);
  animation: float-up 0.25s ease both;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: none;
  background: rgba(54, 81, 129, 0.08);
  border-radius: 50%;
  font-size: 1.2rem;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 150ms ease;
}

.modal-close:hover {
  background: rgba(54, 81, 129, 0.16);
  color: var(--ink);
}

.modal-body {
  display: grid;
  gap: 16px;
}

.modal-title {
  margin: 0;
  font-size: 1.4rem;
}

.modal-title-warning {
  color: var(--danger);
}

.modal-details {
  border-radius: var(--radius-md);
  background: rgba(246, 249, 255, 0.7);
  border: 1px solid var(--line);
}

.modal-details summary {
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
}

.modal-details summary:hover {
  background: rgba(35, 100, 214, 0.04);
}

.modal-details > .estimate-summary,
.modal-details > .estimate-table-wrap,
.modal-details > .estimate-cost {
  margin: 0 16px 14px;
}

.estimate-table-wrap {
  overflow-x: auto;
}

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

.modal-actions .button {
  cursor: pointer;
}

@media (max-width: 640px) {
  .modal-dialog {
    padding: 22px 18px 20px;
    border-radius: 22px;
  }
}

/* --- Run card link --- */

.run-card-link {
  color: var(--accent);
  transition: opacity 150ms ease;
}

.run-card-link:hover {
  opacity: 0.75;
}

/* --- Delete button --- */

.delete-btn {
  cursor: pointer;
  color: var(--danger);
  border-color: rgba(186, 70, 83, 0.22);
  font-size: 0.88rem;
}

.delete-btn:hover {
  background: rgba(186, 70, 83, 0.08);
}

/* --- Filter bar --- */

.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.filter-input {
  flex: 1;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(246, 250, 255, 0.92);
  font: inherit;
  color: var(--ink);
  transition: border-color 180ms ease;
}

.filter-input:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-select {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(246, 250, 255, 0.92);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 180ms ease;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* --- Empty card enhanced --- */

.empty-card {
  padding: 48px 24px;
  color: var(--muted);
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.empty-icon {
  margin-bottom: 4px;
}

/* --- Toast system --- */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  pointer-events: none;
  max-width: 400px;
}

.toast {
  pointer-events: auto;
  padding: 14px 20px;
  border-radius: 16px;
  backdrop-filter: blur(18px);
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.toast-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  background: rgba(31, 157, 116, 0.15);
  color: #0d6f52;
  border: 1px solid rgba(31, 157, 116, 0.2);
}

.toast-error {
  background: rgba(186, 70, 83, 0.12);
  color: #932737;
  border: 1px solid rgba(186, 70, 83, 0.2);
}

.toast-info {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
}

.toast-warning {
  background: rgba(196, 123, 29, 0.12);
  color: #855213;
  border: 1px solid rgba(196, 123, 29, 0.2);
}

/* --- Detail page --- */

.detail-page {
  animation: float-up 0.6s ease both;
}

.detail-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.detail-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.15;
  margin-bottom: 10px;
}

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

.badge.big {
  min-height: 42px;
  padding: 0 20px;
  font-size: 1rem;
}

.detail-message {
  color: var(--ink);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 22px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--line);
}

/* Phase timeline */

.phase-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 22px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  overflow-x: auto;
}

.phase-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 6px 0;
}

.phase-step + .phase-step::before {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin-right: 8px;
  background: var(--line);
  flex-shrink: 0;
}

.phase-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--line);
  background: transparent;
  transition: all 200ms ease;
}

.phase-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.phase-done .phase-dot {
  background: var(--success);
  border-color: var(--success);
}

.phase-done .phase-label {
  color: var(--success);
}

.phase-done + .phase-step::before {
  background: var(--success);
}

.phase-active .phase-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(35, 100, 214, 0.18);
}

.phase-active .phase-label {
  color: var(--accent);
}

.phase-active + .phase-step::before {
  background: linear-gradient(90deg, var(--accent), var(--line));
}

.phase-failed .phase-dot {
  background: var(--danger);
  border-color: var(--danger);
}

.phase-failed .phase-label {
  color: var(--danger);
}

/* Detail summary */

.detail-summary-grid {
  display: flex;
  gap: 16px;
  margin-bottom: 22px;
}

.summary-item {
  display: grid;
  gap: 4px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--line);
  min-width: 120px;
}

.summary-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-item strong {
  font-size: 1.3rem;
}

/* Detail progress section */

.detail-progress-section {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 22px;
}

.detail-overall {
  margin-bottom: 18px;
}

.progress-track.large {
  height: 16px;
}

/* Config details */

.config-details {
  margin-bottom: 22px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}

.config-details summary {
  padding: 16px 20px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.config-details summary:hover {
  background: rgba(35, 100, 214, 0.04);
}

.config-table-wrap {
  padding: 0 20px 18px;
  overflow-x: auto;
}

.config-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.config-table tr + tr {
  border-top: 1px solid var(--line);
}

.config-table td {
  padding: 8px 12px 8px 0;
  vertical-align: top;
}

.cfg-key {
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
  width: 1%;
}

.cfg-val {
  color: var(--ink);
  word-break: break-all;
}

/* Detail error */

.detail-error {
  margin-bottom: 22px;
  font-size: 0.95rem;
}

/* Detail actions */

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* --- Auth page (split layout) --- */

.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.auth-brand-panel {
  display: grid;
  place-items: center;
  place-content: center;
  padding: 56px 48px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(110, 199, 232, 0.22), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(255, 159, 122, 0.18), transparent 50%),
    linear-gradient(160deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

.auth-brand-inner {
  text-align: center;
  max-width: 440px;
}

.auth-brand-inner img {
  width: min(440px, 90%);
  height: auto;
  margin-bottom: 24px;
  filter: drop-shadow(0 12px 20px rgba(71, 101, 178, 0.10));
}

.auth-brand-inner h2 {
  font-size: 1.6rem;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.auth-brand-tagline {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.auth-brand-desc {
  font-size: 0.94rem;
  line-height: 1.75;
  color: var(--muted);
  text-align: center;
}

.auth-form-panel {
  display: grid;
  place-items: center;
  padding: 48px 40px;
  background: var(--panel-strong);
  border-left: 1px solid var(--line);
}

.auth-form-card {
  width: min(360px, 100%);
  animation: float-up 0.5s ease both;
}

.auth-form-card h1 {
  font-size: 1.6rem;
  margin-bottom: 24px;
  text-align: center;
}

.auth-error {
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: rgba(186, 70, 83, 0.08);
  color: var(--danger);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
}

.auth-form {
  display: grid;
  gap: 16px;
  text-align: left;
}

.auth-field {
  display: grid;
  gap: 5px;
}

.auth-field span {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.auth-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(246, 250, 255, 0.92);
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.auth-field input::placeholder {
  color: rgba(96, 112, 140, 0.5);
}

.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(35, 100, 214, 0.1);
}

.auth-submit {
  margin-top: 8px;
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
  cursor: pointer;
}

.auth-switch {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.auth-switch a {
  color: var(--accent);
  font-weight: 700;
}

/* Agreement checkbox */

.auth-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.5;
}

.auth-agree input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.auth-agree a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
}

/* Terms page */

.terms-page {
  max-width: 800px;
  margin: 0 auto;
}

.terms-page h1 {
  font-size: 2rem;
  margin-bottom: 6px;
}

.terms-updated {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.terms-section {
  margin-bottom: 24px;
}

.terms-section h2 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--accent);
}

.terms-section p,
.terms-section li {
  line-height: 1.75;
  color: var(--ink);
}

.terms-section ul {
  padding-left: 20px;
  margin: 8px 0;
}

.terms-section li + li {
  margin-top: 6px;
}

.terms-section a {
  color: var(--accent);
  text-decoration: underline;
}

/* --- Responsive --- */

@media (max-width: 980px) {
  .hero,
  .action-grid,
  .sub-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .detail-header {
    flex-direction: column;
  }

  .phase-timeline {
    gap: 0;
    padding: 14px 16px;
  }

  .detail-summary-grid {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .auth-split {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-form-panel {
    border-left: none;
    min-height: 100vh;
  }

  .filter-bar {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .hero-copy,
  .hero-brand,
  .panel {
    border-radius: 22px;
  }

  .hero-copy,
  .panel {
    padding: 22px;
  }

  .hero-brand {
    padding: 18px;
  }

  .run-card {
    padding: 18px;
  }

  .run-header,
  .progress-head {
    flex-direction: column;
    align-items: start;
  }

  .user-bar {
    flex-wrap: wrap;
  }

  .detail-summary-grid {
    flex-direction: column;
  }

  .summary-item {
    min-width: 0;
  }
}
