:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --surface-soft: #fcfaf6;
  --line: #e8e0d4;
  --text: #1f2937;
  --muted: #6b7280;
  --green: #166534;
  --green-soft: #dcfce7;
  --amber: #b45309;
  --amber-soft: #ffedd5;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --slate-soft: #e5e7eb;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(22, 101, 52, 0.08), transparent 28%),
    linear-gradient(180deg, #faf8f3 0%, var(--bg) 100%);
}

button {
  font: inherit;
}

strong {
  font-weight: 700;
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.hero-card,
.panel,
.summary-card,
.alert-banner,
.message-banner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  margin-bottom: 18px;
}

.hero-copy {
  max-width: 720px;
}

.hero-tag {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-card h1 {
  margin: 12px 0 10px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.hero-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.button {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
}

.button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.button-secondary {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--text);
}

.message-banner {
  padding: 14px 16px;
  margin-bottom: 14px;
}

.message-error {
  color: var(--red);
  background: var(--red-soft);
}

.message-note {
  color: var(--amber);
  background: var(--amber-soft);
}

.alert-banner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.alert-banner-label {
  font-size: 1.1rem;
  font-weight: 800;
}

.alert-banner-text {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.alert-banner-meta {
  min-width: 220px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.summary-grid,
.content-grid {
  display: grid;
  gap: 16px;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 18px;
  align-items: stretch;
}

.content-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.summary-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.summary-label,
.panel-subtext,
.empty-state,
.key-value-row dt,
.table th {
  color: var(--muted);
}

.summary-label {
  font-size: 0.84rem;
  margin-bottom: 10px;
}

.summary-value {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.25;
}

.summary-subtext {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0;
  font-size: 1.1rem;
}

.key-value-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.key-value-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.key-value-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.key-value-row dt,
.key-value-row dd {
  margin: 0;
}

.key-value-row dd {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-ready,
.status-active {
  background: var(--green-soft);
  color: var(--green);
}

.status-watching {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-error {
  background: var(--red-soft);
  color: var(--red);
}

.status-idle {
  background: var(--slate-soft);
  color: #475569;
}

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

.table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: normal;
  word-break: break-word;
  font-size: 0.92rem;
}

.table th {
  background: var(--surface-soft);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.empty-state {
  padding: 24px 8px 8px;
}

.pnl-summary {
  margin: 8px 0 12px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.section-space {
  margin-top: 18px;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 18px 12px 28px;
  }

  .hero-card,
  .alert-banner,
  .panel-head,
  .key-value-row {
    display: block;
  }

  .hero-status {
    align-items: stretch;
  }

  .hero-status .button {
    width: 100%;
    margin-top: 12px;
  }

  .alert-banner-meta {
    min-width: 0;
    margin-top: 12px;
  }

  .panel-head .status-badge,
  .panel-head .panel-subtext {
    margin-top: 10px;
  }

  .key-value-row dt {
    margin-bottom: 4px;
  }
}
