:root {
  --bg: #f5efe5;
  --bg-accent: #e6dcc8;
  --card: rgba(255, 251, 245, 0.88);
  --border: rgba(78, 58, 44, 0.16);
  --text: #1d1a16;
  --muted: #62564b;
  --highlight: #8b4513;
  --highlight-soft: #d68f4b;
  --shadow: 0 24px 60px rgba(50, 33, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(214, 143, 75, 0.28), transparent 32%),
    radial-gradient(circle at top right, rgba(91, 132, 177, 0.18), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, #fbf8f2 100%);
}

body.auth-locked .page {
  display: none;
}

body.auth-ready .auth-shell {
  display: none;
}

.page {
  width: min(1800px, calc(100vw - 20px));
  margin: 0 auto;
  padding: 16px 0 32px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card {
  width: min(860px, 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 248, 238, 0.96), rgba(246, 237, 222, 0.86));
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

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

.auth-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(78, 58, 44, 0.2);
  border-radius: 12px;
  background: white;
  font: inherit;
}

.auth-message {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 248, 238, 0.96), rgba(246, 237, 222, 0.86));
  box-shadow: var(--shadow);
}

.eyebrow,
.card-kicker,
.meta-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--muted);
}

h1 {
  margin: 2px 0 4px;
  font-size: clamp(1.15rem, 2vw, 1.8rem);
  line-height: 1;
}

.lede {
  max-width: 980px;
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.25;
  color: var(--muted);
}

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.meta-card,
.card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.meta-card {
  padding: 8px 10px;
  border-radius: 14px;
}

.meta-card strong {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
}

.hero-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.refresh-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  background: linear-gradient(135deg, var(--highlight), var(--highlight-soft));
  box-shadow: 0 10px 24px rgba(139, 69, 19, 0.22);
}

.refresh-button:hover {
  filter: brightness(1.04);
}

.secondary-button {
  background: linear-gradient(135deg, #4d5d6b, #74879a);
}

.status-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.card {
  padding: 14px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

h2 {
  margin: 4px 0 0;
  font-size: 1.3rem;
}

.open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: white;
  background: linear-gradient(135deg, var(--highlight), var(--highlight-soft));
  white-space: nowrap;
}

img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: white;
}

.caption {
  margin: 8px 0 0;
  color: var(--muted);
  word-break: break-word;
  font-size: 0.9rem;
}

@media (max-width: 700px) {
  .page {
    width: min(100vw - 20px, 1400px);
    padding-top: 10px;
  }

  .hero,
  .card {
    padding: 14px;
    border-radius: 18px;
  }

  .card-head {
    flex-direction: column;
  }

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