:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #1e1b16;
  --muted: #6f6a61;
  --accent: #155e63;
  --accent-2: #f59e0b;
  --danger: #b91c1c;
  --border: #e2ded5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: #0f3d3e;
  color: #f5f5f2;
}

.topbar .brand {
  font-weight: 700;
  letter-spacing: 0.4px;
}

.topbar nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.topbar a,
.linkish {
  color: #f5f5f2;
  text-decoration: none;
  font-weight: 500;
}

.container {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 20px 60px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.04);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

h1, h2, h3 {
  margin-top: 0;
}

.grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: center;
}

label {
  font-weight: 600;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

textarea {
  font-family: "IBM Plex Mono", "Fira Code", monospace;
}

button {
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  opacity: 0.9;
}

button.danger {
  background: var(--danger);
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.preview {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  background: #fbfaf7;
}

.preview h1, .preview h2, .preview h3 {
  margin-top: 0;
}

.inline {
  display: inline;
}

.linkish {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.auth-card {
  max-width: 420px;
  margin: 60px auto;
  background: var(--card);
  padding: 30px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.error {
  color: var(--danger);
  font-weight: 600;
}

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

.status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: #e7e2d6;
}

.status-ready,
.status-complete {
  background: #d1fae5;
  color: #065f46;
}

.status-failed {
  background: #fee2e2;
  color: #991b1b;
}

.status-generating,
.status-transcribing,
.status-downloading,
.status-publishing,
.status-queued {
  background: #fef3c7;
  color: #92400e;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.gallery img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
}

figure {
  margin: 0;
}

figcaption {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  text-align: left;
  background: #f0ece3;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.transcript {
  white-space: pre-wrap;
  font-size: 13px;
  background: #f8f5ef;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

@media (max-width: 720px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
