:root {
  --wine-900: #2b0a17;
  --wine-800: #37101f;
  --wine-700: #4a0e1f;
  --wine-600: #6d1730;
  --gold: #c9a227;
  --gold-light: #d9b96a;
  --cream: #f6f0e4;
  --cream-2: #efe6d3;
  --ink: #2a1015;
  --ink-soft: #6b5a5e;
  --white: #ffffff;
  --green: #2f9e6e;
  --blue: #3f7fbf;
  --red: #c0392b;
  --purple: #7c5cbf;
  --cyan: #2f9ecf;
  --pink: #c23b6b;
  --amber: #b8862f;
  --radius: 16px;
  --shadow: 0 10px 28px rgba(43, 10, 23, .14);
  --shadow-sm: 0 4px 12px rgba(43, 10, 23, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Georgia', 'Iowan Old Style', serif, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--ink);
}

body, input, button {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.serif { font-family: Georgia, 'Times New Roman', serif; }

.app { min-height: 100vh; }

button { font: inherit; cursor: pointer; }

a { color: inherit; }

/* ---------- Login ---------- */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 80% 10%, rgba(201,162,39,.18), transparent 45%),
    linear-gradient(160deg, var(--wine-600), var(--wine-900) 70%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(43, 10, 23, .35);
  border: 1px solid rgba(201, 162, 39, .45);
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  backdrop-filter: blur(6px);
}

.login-icon {
  width: 108px;
  height: auto;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
  margin-bottom: 14px;
}

.login-badge {
  color: var(--gold);
  letter-spacing: .25em;
  font-size: .78rem;
  font-weight: 600;
}

.login-title {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--gold-light);
  font-size: 2.4rem;
  line-height: 1.1;
  margin: 10px 0 4px;
}
.login-title span {
  display: block;
  font-size: 1.15rem;
  color: var(--gold);
  letter-spacing: .08em;
  font-weight: 400;
}

.login-tag {
  display: inline-block;
  margin: 14px 0 26px;
  padding: 8px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--wine-900);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .06em;
}

.login-form { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }

.field {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(201,162,39,.4);
  border-radius: 12px;
  padding: 0 14px;
}
.field-icon { opacity: .8; margin-right: 8px; }
.field input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--cream);
  padding: 20px 0 8px;
  font-size: 1rem;
}
.field input::placeholder { color: transparent; }
.field-label {
  position: absolute;
  left: 42px;
  top: 16px;
  color: rgba(246,240,228,.65);
  font-size: .95rem;
  pointer-events: none;
  transition: all .15s ease;
}
.field input:focus + .field-label,
.field input:not(:placeholder-shown) + .field-label {
  top: 6px;
  font-size: .68rem;
  color: var(--gold-light);
}

.field-password input { padding-right: 34px; }
.field-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1rem;
  opacity: .7;
  padding: 4px;
  line-height: 1;
}
.field-toggle:hover { opacity: 1; }

.login-error {
  color: #ffb4b4;
  font-size: .85rem;
  margin: 0;
  text-align: left;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-weight: 700;
  font-size: 1rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--wine-600), var(--wine-900));
  color: var(--gold-light);
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-cta {
  align-self: center;
  padding: 19px 42px;
  font-size: 1.08rem;
  border-radius: 999px;
  margin-top: 6px;
}
.btn-ghost {
  background: var(--cream-2);
  color: var(--wine-800);
}
.btn-link {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: .9rem;
  font-weight: 600;
}
.btn-link:hover { color: var(--wine-700); }

.login-hint {
  margin-top: 22px;
  color: rgba(246,240,228,.6);
  font-size: .78rem;
}

/* ---------- Shell / layout ---------- */

.shell { max-width: 1040px; margin: 0 auto; padding: 0 20px 60px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}
.topbar-title { font-weight: 700; color: var(--wine-800); letter-spacing: .02em; }

/* ---------- Hero ---------- */

.hero {
  line-height: 0;
}
.hero-banner {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ---------- Panels ---------- */

.panel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }
@media (max-width: 720px) { .panel-row { grid-template-columns: 1fr; } }

.panel {
  background: var(--white);
  border: 1px solid var(--cream-2);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.panel h3 { margin: 0 0 8px; color: var(--wine-800); font-size: 1rem; }
.panel p { margin: 0 0 6px; color: var(--ink-soft); font-size: .92rem; line-height: 1.5; }
.panel-note { font-style: italic; color: var(--wine-700) !important; }

.progress-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.progress-count strong { color: var(--wine-800); font-size: 1.3rem; }
.progress-pct { color: var(--gold); font-weight: 700; }
.progress-bar { height: 10px; border-radius: 999px; background: var(--cream-2); overflow: hidden; }
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--wine-600));
  transition: width .25s ease;
}
.progress-dots { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.progress-dots span {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--cream-2);
}
.progress-dots span.done { background: var(--wine-700); }

/* ---------- Filters ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 16px;
}
.filter-chip {
  border: 1px solid var(--cream-2);
  background: var(--white);
  color: var(--ink-soft);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-chip.active {
  background: var(--wine-800);
  border-color: var(--wine-800);
  color: var(--gold-light);
}

/* ---------- Days grid ---------- */

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

.day-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--cream-2);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  text-align: left;
  padding: 0;
  transition: transform .15s ease, box-shadow .15s ease;
}
.day-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.day-card-cover {
  height: 90px;
  background-size: cover;
  background-position: center;
  position: relative;
  background-color: var(--wine-800);
}
.day-card-status {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: .68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  color: var(--wine-800);
}
.day-card-status.done { background: var(--green); color: var(--white); }

.day-card-body { padding: 12px 14px 16px; }
.day-card-day { color: var(--gold); font-weight: 800; font-size: 1.4rem; line-height: 1; }
.day-card-title {
  margin: 4px 0 8px;
  font-size: .82rem;
  color: var(--ink);
  min-height: 34px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.badge-category {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .7rem;
  font-weight: 700;
  color: var(--white);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ---------- Day detail ---------- */

.day-cover {
  height: 200px;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--gold);
  margin-bottom: 16px;
}
.day-body .badge-category { margin-bottom: 10px; }
.day-title { margin: 0 0 18px; color: var(--wine-800); font-family: Georgia, serif; font-size: 1.6rem; }
.section-title { color: var(--wine-800); font-size: 1.05rem; margin: 26px 0 12px; }

.stories-list { display: flex; flex-direction: column; gap: 12px; }
.story-card {
  background: var(--white);
  border: 1px solid var(--cream-2);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.story-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.story-label { color: var(--gold); font-weight: 800; font-size: .82rem; letter-spacing: .05em; }
.story-text { white-space: pre-line; line-height: 1.55; font-size: .95rem; color: var(--ink); }
.btn-copy {
  border: 1px solid var(--wine-700);
  background: var(--cream);
  color: var(--wine-700);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: .75rem;
  font-weight: 700;
}
.btn-copy.copied { background: var(--wine-700); color: var(--cream); border-color: var(--wine-700); }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; color: var(--ink-soft); }
.checklist input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--wine-700); }
.checklist li.checked span { color: var(--ink); text-decoration: line-through; text-decoration-color: var(--gold); }

.day-nav { display: flex; gap: 12px; margin-top: 26px; }
.day-nav .btn { flex: 1; text-align: center; }
.day-nav .btn[disabled] { opacity: .4; pointer-events: none; }

