:root {
  --bg: #f3efe4;
  --panel: rgba(255, 251, 242, 0.92);
  --panel-border: rgba(24, 45, 61, 0.12);
  --text: #17222b;
  --muted: #5d6a71;
  --accent: #d06b2d;
  --accent-deep: #9f4f1c;
  --ok: #2d7c61;
  --warn: #b36a14;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow: 0 20px 48px rgba(23, 34, 43, 0.08);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(208, 107, 45, 0.18), transparent 24rem),
    linear-gradient(180deg, #f7f1e6 0%, #ece6da 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
  padding: 1rem;
}

.topbar,
.panel,
.composer-shell {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.topbar {
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent-deep);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
}

.topbar-actions,
.inline-actions,
.composer-actions,
.voice-status,
.panel-heading,
.message-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

.panel,
.timeline,
.composer-shell {
  border-radius: var(--radius-lg);
}

.panel {
  padding: 1rem 1.1rem;
}

.setup-panel summary {
  cursor: pointer;
  font-weight: 600;
}

label {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(23, 34, 43, 0.16);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
}

textarea {
  resize: vertical;
}

button {
  border: none;
  border-radius: 999px;
  padding: 0.78rem 1rem;
  background: #1d3744;
  color: white;
}

a {
  text-decoration: none;
}

.artifact-actions a,
.review-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.78rem 1rem;
}

.ghost-button {
  background: rgba(29, 55, 68, 0.08);
  color: var(--text);
}

.accent-button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
}

.hidden {
  display: none !important;
}

.status-badge,
.draft-badge {
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: rgba(29, 55, 68, 0.08);
  color: var(--muted);
  font-size: 0.84rem;
}

.status-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.live {
  background: var(--ok);
  box-shadow: 0 0 0 0.25rem rgba(45, 124, 97, 0.14);
}

.status-dot.recording {
  background: var(--accent);
  box-shadow: 0 0 0 0.35rem rgba(208, 107, 45, 0.18);
}

.current-artifact,
.timeline,
.message-card {
  background: rgba(255, 255, 255, 0.72);
}

.current-artifact {
  border-radius: var(--radius-md);
  padding: 1rem;
  min-height: 8rem;
  display: grid;
  gap: 0.8rem;
}

.current-artifact.empty {
  color: var(--muted);
}

.timeline {
  padding: 0.9rem;
  border: 1px solid var(--panel-border);
  display: grid;
  gap: 0.9rem;
}

.message-card {
  border-radius: var(--radius-md);
  padding: 0.95rem;
  border: 1px solid rgba(23, 34, 43, 0.08);
}

.message-card.user {
  background: rgba(29, 55, 68, 0.92);
  color: white;
}

.message-card.user .message-meta {
  color: rgba(255, 255, 255, 0.78);
}

.message-role {
  font-weight: 700;
}

.message-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.message-body {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.8rem;
}

.summary-block {
  padding: 0.9rem;
  border-radius: 14px;
  background: rgba(208, 107, 45, 0.08);
}

.artifact-list,
.review-list,
.erp-list {
  display: grid;
  gap: 0.65rem;
}

.artifact-item,
.review-item,
.erp-item {
  border: 1px solid rgba(23, 34, 43, 0.1);
  border-radius: 14px;
  padding: 0.8rem;
  display: grid;
  gap: 0.55rem;
}

.artifact-actions,
.review-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.supporting-text,
.microcopy {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.composer-shell {
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
}

.composer textarea {
  min-height: 5.5rem;
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr);
    align-items: start;
  }

  .setup-panel,
  .current-panel {
    position: sticky;
    top: 1rem;
  }

  .current-panel {
    top: 16rem;
  }
}
