/* Dark theme palette - same exact values as wombat-narrates' style.css, so
   this app feels like the same product family, not a separate one. */
:root {
  --bg-main: #111315;
  --bg-accent: #2b3138;
  --bg-accent-active: #3a4149;
  --fg-main: #f3f4f6;
  --fg-muted: #aeb6bf;
  --fg-status-speaking: #9fc6ff;
  --fg-status-error: #ff9b9b;
  --grade-a: #5fd97a;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg-main);
  color: var(--fg-main);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  min-height: 100vh;
}

.banner {
  display: block;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  height: auto;
}

.view {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 20px 48px;
}

.view[hidden] {
  display: none;
}

h1 {
  font-size: 1.6rem;
  margin: 0.2em 0;
}

h2 {
  font-size: 1.15rem;
  margin-top: 0;
}

h3 {
  font-size: 1rem;
}

.muted {
  color: var(--fg-muted);
}

.app-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.card {
  background: var(--bg-accent);
  border-radius: 10px;
  padding: 20px;
  margin-top: 16px;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field span {
  display: block;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 4px;
}

.field input[type="text"],
.field input[type="file"] {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-main);
  color: var(--fg-main);
  border: 1px solid var(--bg-accent-active);
  border-radius: 6px;
  font-size: 1rem;
}

button {
  font-size: 1rem;
  cursor: pointer;
}

.btn-primary {
  background: var(--fg-status-speaking);
  color: var(--bg-main);
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: bold;
}

.btn-primary:disabled {
  background: var(--bg-accent-active);
  color: var(--fg-muted);
  opacity: 1;
  cursor: not-allowed;
}

.login-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.btn-secondary {
  background: transparent;
  color: var(--fg-main);
  border: 1px solid var(--bg-accent-active);
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: bold;
}

/* Bold+larger rather than underlined - matches the rest of this app
   family's link styling (see wombat-narrates' docs/PROJECT-DECISIONS.md,
   link-style entry). */
.btn-link {
  background: none;
  border: none;
  color: var(--fg-status-speaking);
  font-weight: bold;
  font-size: 1.05rem;
  padding: 0;
}

.status {
  font-weight: bold;
}

.log {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--fg-muted);
  white-space: pre-wrap;
  margin-top: 8px;
}

#result-area {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--bg-accent-active);
}

#result-area h3 {
  margin: 0 0 4px;
}

.chapter-row {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.chapter-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.03);
}

#download-area a {
  display: inline-block;
  margin-top: 10px;
  font-weight: bold;
  font-size: 1.05rem;
  color: var(--grade-a);
}

.tabs {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  border-bottom: 1px solid var(--bg-accent-active);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-weight: bold;
  padding: 8px 14px;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: var(--fg-main);
  border-bottom-color: var(--fg-status-speaking);
}

.panel[hidden] {
  display: none;
}

.help-section {
  margin-bottom: 18px;
}

.help-heading {
  font-weight: bold;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.help-section p {
  color: var(--fg-muted);
  margin: 0;
}

.attribution {
  color: var(--fg-muted);
  font-style: italic;
  font-size: 0.8rem;
  margin-top: 4px;
}

#btn-read-preview {
  margin: 10px 0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-box {
  background: var(--bg-accent);
  border-radius: 12px;
  padding: 16px;
}

/* Wide/tall, unlike a plain confirmation modal - reading needs real
   width, not the .view's own narrow 640px column. */
.preview-modal-box {
  width: min(900px, 95vw);
  height: min(90vh, 1000px);
  display: flex;
  flex-direction: column;
}

#btn-close-preview {
  align-self: flex-end;
  margin-bottom: 8px;
}

#preview-frame {
  flex: 1;
  width: 100%;
  border: none;
  border-radius: 8px;
  background: #f5f0e8;
}
