:root {
  --bg: #07111f;
  --bg-secondary: #0f1f32;
  --surface: rgba(12, 23, 38, 0.9);
  --panel: rgba(20, 33, 54, 0.9);
  --border: rgba(148, 163, 184, 0.17);
  --text: #f5f7fb;
  --muted: #b9c6d9;
  --accent: #ff9f1c;
  --accent-soft: rgba(255, 159, 28, 0.15);
  --success: #44d6ae;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #06101a, #0d1a2a 45%, #122943);
  color: var(--text);
}

body {
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

textarea {
  font: inherit;
}

.shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 52px;
}

.topbar,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 22px 28px;
  margin-bottom: 24px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.eyebrow {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #f8dca7;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.eyebrow.subtle {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

h1 {
  margin-top: 10px;
  font-size: clamp(2rem, 3vw, 3rem);
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 24px;
}

.panel {
  padding: 20px;
}

.panel-header,
.progress-header,
.passage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.main-panel {
  display: grid;
  gap: 18px;
}

.plan-list,
.progress-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.plan-item,
.progress-item {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 12px;
  color: var(--text);
  cursor: pointer;
}

.plan-item.active,
.progress-item.done {
  border-color: rgba(68, 214, 174, 0.8);
  background: rgba(68, 214, 174, 0.1);
}

.plan-item strong,
.progress-item strong {
  display: block;
  margin-bottom: 6px;
}

.plan-item span,
.progress-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.plan-form {
  display: grid;
  gap: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 18px;
}

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

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

.field-grid.single {
  grid-template-columns: 1fr;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select,
button {
  border-radius: 12px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(7, 17, 31, 0.85);
  color: var(--text);
}

textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(7, 17, 31, 0.85);
  color: var(--text);
  resize: vertical;
  border-radius: 12px;
  min-height: 96px;
}

input[type="range"] {
  padding: 0;
}

.form-actions,
.audio-controls,
.voice-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 12px;
  min-height: 42px;
  padding: 0 16px;
  cursor: pointer;
  text-decoration: none;
}

.button.primary {
  background: linear-gradient(135deg, #ff9f1c, #ffc25d);
  color: #1a1206;
  font-weight: 700;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(68, 214, 174, 0.16);
  color: var(--success);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.reading-panel,
.progress-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
}

.passage-text {
  line-height: 1.8;
  color: var(--text);
  white-space: pre-line;
  min-height: 120px;
}

.voice-controls {
  align-items: end;
}

.voice-controls label {
  min-width: 170px;
  flex: 1;
}

.progress-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.progress-item button {
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
}

.empty-state {
  color: var(--muted);
  padding: 12px 0;
}

.install-hint {
  color: var(--muted);
  font-size: 0.88rem;
}

.section-builder-header {
  display: grid;
  gap: 12px;
}

.section-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.section-rows {
  display: grid;
  gap: 12px;
}

.section-row {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  padding: 12px;
  background: rgba(7, 17, 31, 0.45);
  display: grid;
  gap: 10px;
}

.section-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.section-row .field-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.section-row .button {
  min-height: 36px;
  padding: 0 12px;
}

.drop-zone {
  border: 1px dashed rgba(255, 159, 28, 0.7);
  border-radius: 14px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  background: rgba(255, 159, 28, 0.06);
}

.drop-zone.active {
  border-color: rgba(68, 214, 174, 0.9);
  background: rgba(68, 214, 174, 0.12);
  color: var(--text);
}

.converter-preview {
  margin: 0;
  white-space: pre-wrap;
  background: rgba(7, 17, 31, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  min-height: 110px;
  max-height: 280px;
  overflow: auto;
  padding: 12px;
  color: var(--text);
}

@media (max-width: 820px) {
  .layout,
  .field-grid,
  .field-grid.compact {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-header,
  .passage-header,
  .progress-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
