:root {
  --bg: #f8f2e8;
  --panel: rgba(255, 252, 247, 0.94);
  --panel-soft: rgba(249, 243, 233, 0.94);
  --line: rgba(65, 56, 49, 0.12);
  --text: #2f2925;
  --muted: #6e635b;
  --accent: #e88f7c;
  --accent-dark: #d97c69;
  --ok: #6e9d68;
  --warn: #aa7a4d;
  --bad: #b95f5f;
  --shadow: 0 12px 32px rgba(81, 64, 52, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, Arial, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 10%, rgba(232, 143, 124, 0.12), transparent 24%),
    radial-gradient(circle at 88% 12%, rgba(159, 187, 142, 0.16), transparent 18%),
    linear-gradient(180deg, #fcf7f0 0%, var(--bg) 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
  min-width: 0;
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 12px 32px;
}

.app-hero,
.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.app-hero {
  padding: 24px 20px;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0;
  color: #88786d;
}

.app-hero h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1.02;
}

.hero-copy {
  margin: 14px 0 0;
  max-width: 740px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  align-items: stretch;
}

.hero-actions > * {
  flex: 0 1 auto;
}

.app-layout {
  display: grid;
  gap: 14px;
}

.panel {
  padding: 20px;
}

.panel-head {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.panel-head p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.summary-grid,
.dashboard-stack,
.activity-stack {
  display: grid;
  gap: 14px;
}

.card-grid {
  display: grid;
  gap: 14px;
}

.summary-card,
.module-card,
.technical-card {
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(249, 242, 231, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.summary-card h3,
.module-card h3,
.technical-card h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0;
  color: #87776b;
}

.summary-value,
.module-value {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 800;
}

.summary-meta,
.module-meta,
.stack-note,
.helper-text {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
  color: #5f534b;
}

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf4;
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

.textarea {
  min-height: 132px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.input:focus,
.textarea:focus {
  border-color: rgba(232, 143, 124, 0.8);
  box-shadow: 0 0 0 4px rgba(232, 143, 124, 0.14);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.primary-button,
.secondary-button,
.ghost-button {
  appearance: none;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  transition: background-color 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.primary-button {
  border: 0;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 14px 26px rgba(232, 143, 124, 0.22);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  color: var(--text);
  background: #f1e8da;
  border: 1px solid rgba(65, 56, 49, 0.08);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(65, 56, 49, 0.08);
}

.secondary-button:hover,
.ghost-button:hover {
  background: #e8dccb;
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.ghost-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(232, 143, 124, 0.16);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(65, 56, 49, 0.08);
  background: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 700;
}

.status-chip.ok {
  color: #4d7447;
}

.status-chip.warn {
  color: #94683f;
}

.status-chip.bad {
  color: #964747;
}

.metric-list,
.detail-list {
  display: grid;
  gap: 0;
  margin: 14px 0 0;
}

.metric-row,
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(65, 56, 49, 0.08);
}

.metric-row:first-child,
.detail-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.metric-label,
.detail-label {
  color: var(--muted);
  line-height: 1.45;
}

.metric-value,
.detail-value {
  text-align: right;
  font-weight: 700;
  line-height: 1.45;
  max-width: 48%;
  overflow-wrap: anywhere;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(65, 56, 49, 0.08);
  font-size: 13px;
  font-weight: 700;
  color: #62574f;
}

.technical-card {
  display: grid;
  gap: 14px;
}

.technical-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.technical-card-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1 1 260px;
}

.technical-card-note {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.technical-card-actions {
  display: flex;
  flex: 0 0 auto;
}

.technical-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.technical-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(65, 56, 49, 0.08);
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: #62574f;
}

.technical-pre,
.technical-card pre {
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(65, 56, 49, 0.08);
  background: rgba(247, 242, 235, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  max-height: min(46vh, 420px);
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-gutter: stable;
  tab-size: 2;
}

@media (min-width: 900px) {
  .app-layout {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  }

  .panel-summary {
    grid-column: 1 / -1;
  }

  .summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 12px 10px 24px;
  }

  .app-hero,
  .panel {
    padding: 16px;
  }

  .app-hero h1 {
    font-size: 32px;
  }

  .hero-copy {
    font-size: 15px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions > * {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .panel-head h2 {
    font-size: 20px;
  }

  .summary-value,
  .module-value {
    font-size: 22px;
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button-row > * {
    width: 100%;
  }

  .metric-row,
  .detail-row {
    flex-direction: column;
    gap: 6px;
  }

  .metric-value,
  .detail-value {
    max-width: none;
    text-align: left;
  }

  .technical-card {
    padding: 16px;
    gap: 12px;
  }

  .technical-card-head {
    flex-direction: column;
  }

  .technical-card-actions {
    width: 100%;
  }

  .technical-card-actions .secondary-button {
    width: 100%;
  }

  .technical-meta {
    gap: 6px;
  }

  .technical-pre,
  .technical-card pre {
    max-height: 40vh;
    padding: 12px;
    font-size: 11.5px;
    line-height: 1.55;
  }
}
