:root {
  --bg: #11100e;
  --card: #1c1915;
  --text: #eee6d8;
  --muted: #aaa092;
  --accent: #d6a85f;
  --border: #383028;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, #2a2118 0, #11100e 38%),
    #11100e;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}

a {
  color: var(--accent);
}

.page {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero,
.card {
  background: rgba(28, 25, 21, 0.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.hero {
  margin-top: 10vh;
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}

h1 {
  font-size: clamp(36px, 7vw, 72px);
  line-height: 1;
  margin: 20px 0;
}

h2 {
  margin-top: 32px;
}

.lead {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.small,
.date {
  color: var(--muted);
  font-size: 14px;
}

.form {
  display: grid;
  gap: 12px;
}

label {
  color: var(--muted);
  margin-top: 10px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  background: #100f0d;
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.button,
button {
  display: inline-block;
  border: 0;
  background: var(--accent);
  color: #1b1208;
  padding: 12px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  font-family: system-ui, sans-serif;
}

.secondary {
  background: #c8bfae;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.entries {
  display: grid;
  gap: 16px;
}

.entry-card {
  border: 1px solid var(--border);
  background: #15130f;
  border-radius: 18px;
  padding: 18px;
}

.entry-card h3 {
  margin: 8px 0;
}

.reading {
  max-width: 780px;
  margin: 0 auto;
}

.diary-text {
  white-space: pre-wrap;
  font-size: 20px;
  line-height: 1.75;
}

.source,
.fact-box {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.feedback {
  margin-top: 32px;
  display: grid;
  gap: 12px;
}

.feedback button {
  width: fit-content;
}

.topline {
  margin-bottom: 16px;
}

@media (max-width: 760px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .card,
  .hero {
    padding: 22px;
  }
}

.error-box {
  border: 1px solid #8a3a2a;
  background: rgba(138, 58, 42, 0.15);
  color: #ffd1c7;
  border-radius: 12px;
  padding: 12px;
  white-space: pre-wrap;
  margin-top: 12px;
}

.selected-card {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(214, 168, 95, 0.35);
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.score-grid div {
  border: 1px solid var(--border);
  background: #100f0d;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  background: #100f0d;
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 12px;
  color: var(--text);
}

details {
  margin-top: 16px;
}

summary {
  cursor: pointer;
  color: var(--accent);
}

@media (max-width: 760px) {
  .score-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.score-grid {
  grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 960px) {
  .score-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .score-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.journey-settings {
  margin: 2rem 0;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}

.journey-toggle {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.schedule-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}

.schedule-days label {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.success-message {
  padding: 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 760px) {
  .schedule-days {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(224, 174, 91, 0.22);
}

.app-nav__brand {
  color: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
}

.app-nav__brand:hover {
  color: #e0ae5b;
}

.app-nav__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-nav__link {
  white-space: nowrap;
}

.app-nav__logout {
  margin: 0;
}

.app-nav__button {
  width: auto;
  margin: 0;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(224, 174, 91, 0.55);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.app-nav__button:hover {
  background: #e0ae5b;
  color: #17130f;
}

@media (max-width: 640px) {
  .app-nav {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 2rem;
  }

  .app-nav__actions {
    width: 100%;
    flex-wrap: wrap;
  }
}

.public-language-switch {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2rem;
}

.language-switch {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.45rem;
  align-items: center;
}

.language-switch form {
  display: inline-flex;
  margin: 0;
}

.language-switch button {
  width: auto;
  min-width: 3rem;
  margin: 0;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(224, 174, 91, 0.35);
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 248, 240, 0.82);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.language-switch button:hover {
  border-color: rgba(224, 174, 91, 0.75);
  color: #fff8f0;
}

.language-switch button[aria-current="true"] {
  background: #e0ae5b;
  border-color: #e0ae5b;
  color: #17130f;
  box-shadow: 0 0 0 1px rgba(224, 174, 91, 0.15);
}

.language-switch button:not([aria-current="true"]) {
  opacity: 0.82;
}

.app-nav .language-switch {
  flex-shrink: 0;
}

.app-nav__actions .language-switch {
  margin-right: 0.25rem;
}

