:root {
  --bg: #f3ecdd;
  --bg-accent: #e0d0b2;
  --surface: rgba(255, 252, 245, 0.86);
  --surface-strong: #fff9ef;
  --text: #2a2418;
  --muted: #706452;
  --line: rgba(74, 58, 32, 0.15);
  --primary: #9c4b20;
  --primary-dark: #703011;
  --success: #2f6b4f;
  --danger: #9b2f2f;
  --warning: #8a6116;
  --shadow: 0 18px 40px rgba(62, 41, 11, 0.14);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 35%),
    radial-gradient(circle at bottom right, rgba(163, 95, 43, 0.18), transparent 30%),
    linear-gradient(145deg, var(--bg), var(--bg-accent));
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.landing-body,
.auth-body,
.app-body {
  display: flex;
  justify-content: center;
}

.landing-shell,
.auth-shell,
.app-shell {
  width: min(1200px, calc(100% - 32px));
  padding: 24px 0 48px;
}

.hero-card,
.auth-card,
.panel,
.summary-card {
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  margin-top: 10vh;
  padding: 42px;
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  font-size: 12px;
}

h1,
h2,
h3 {
  margin: 0 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.08;
}

h1 {
  font-size: clamp(34px, 5vw, 58px);
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 20px;
}

.hero-text,
.muted-text,
.section-description {
  color: var(--muted);
  line-height: 1.6;
}

.hero-actions,
.toolbar,
.inline-actions,
.stack-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.primary-button {
  color: #fffdf9;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.secondary-button,
.ghost-button {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--line);
}

.danger-button {
  color: #fff;
  background: linear-gradient(135deg, #c14a4a, var(--danger));
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.auth-card {
  width: min(520px, 100%);
  padding: 32px;
}

.auth-grid,
.form-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 14px;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.field textarea {
  min-height: 104px;
  resize: vertical;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.app-title {
  display: grid;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  font-size: 14px;
}

.badge.ok {
  color: var(--success);
}

.badge.warn {
  color: var(--warning);
}

.badge.error {
  color: var(--danger);
}

.dashboard-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.panel {
  padding: 22px;
}

.panel-wide {
  grid-column: 1 / -1;
}

.summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.summary-card {
  padding: 16px;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.summary-card strong {
  font-size: 18px;
}

.notice {
  min-height: 24px;
  font-size: 14px;
}

.notice.ok {
  color: var(--success);
}

.notice.error {
  color: var(--danger);
}

.notice.info {
  color: var(--muted);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.data-table td input,
.data-table td textarea {
  width: 100%;
}

.inline-form {
  display: grid;
  gap: 12px;
}

.inline-form.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inline-form.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.player-shell {
  display: grid;
  gap: 18px;
}

.player-card {
  padding: 28px;
}

.player-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.mono {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

audio {
  width: 100%;
  margin-top: 18px;
}

@media (max-width: 800px) {
  .app-shell,
  .landing-shell {
    width: calc(100% - 20px);
  }

  .hero-card,
  .auth-card,
  .panel,
  .player-card {
    padding: 20px;
  }

  .inline-form.three,
  .inline-form.four {
    grid-template-columns: 1fr;
  }

  .app-header {
    flex-direction: column;
  }
}
