:root {
  --bg: #f5f7f2;
  --panel: #ffffff;
  --ink: #1e2421;
  --muted: #66716b;
  --line: #dbe2db;
  --accent: #176b52;
  --accent-dark: #104b3a;
  --red: #b8443b;
  --blue: #315f8f;
  --gold: #a66f22;
  --done: #eef1ee;
  --shadow: 0 16px 44px rgba(32, 42, 35, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
p {
  margin: 0;
}

.shell {
  min-height: 100vh;
}

.login-view {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: hidden;
}

.login-view::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url("/assets/xmas-login-bg.png") center / cover no-repeat;
}

.login-view::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(10, 20, 17, 0.08), rgba(10, 20, 17, 0.36));
}

.login-panel {
  width: min(100%, 420px);
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
  font-size: 20px;
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 82, 0.16);
}

.primary,
.ghost {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
}

.primary {
  color: #fff;
  background: var(--accent);
}

.primary:hover {
  background: var(--accent-dark);
}

.ghost {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.status {
  min-height: 19px;
  color: var(--red);
  font-size: 13px;
}

.app-view {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.app-view::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url("/assets/xmas-login-bg.png") center / cover no-repeat;
}

.app-view::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(245, 247, 242, 0.78);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  background: rgba(245, 247, 242, 0.88);
  backdrop-filter: blur(12px);
}

.topbar h1 {
  font-size: 24px;
  line-height: 1.05;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.logout-short {
  display: none;
}

.tabs {
  position: sticky;
  top: 67px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px 10px 12px;
  background: rgba(245, 247, 242, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.tab.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.page {
  display: none;
  padding: 14px;
}

.page.active {
  display: block;
}

.empty-copy {
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  display: grid;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 0;
  color: var(--muted);
}

.empty-state h2 {
  color: var(--ink);
  font-size: 19px;
}

.info-layout,
.calendar,
.food-layout {
  width: min(100%, 820px);
  margin: 0 auto;
}

.info-layout {
  display: grid;
  gap: 12px;
}

.info-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(32, 42, 35, 0.12);
}

.object-image {
  aspect-ratio: auto;
  object-fit: contain;
  background: #fff;
}

.info-card,
.ideas-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
}

.info-card h2 {
  font-size: 18px;
}

.travel-window {
  display: grid;
  gap: 8px;
}

.travel-window div {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: 8px;
  background: #f7faf6;
}

.travel-window span {
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 900;
}

.travel-window strong {
  color: var(--muted);
  font-size: 13px;
}

.price-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f7faf6;
}

.price-grid span,
.info-note,
.prose,
.clean-list {
  color: var(--muted);
}

.price-grid strong {
  text-align: right;
  color: var(--ink);
}

.bank-box {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(23, 107, 82, 0.1);
}

.bank-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bank-box strong {
  color: var(--accent-dark);
  overflow-wrap: anywhere;
}

.info-note,
.prose {
  line-height: 1.55;
}

.prose {
  display: grid;
  gap: 10px;
}

.clean-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.calendar {
  display: grid;
  gap: 10px;
}

.day-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  overflow: hidden;
}

.day-card.active {
  border-color: rgba(23, 107, 82, 0.55);
  box-shadow: 0 8px 22px rgba(32, 42, 35, 0.1);
}

.day-button {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.day-button strong,
.day-button small {
  display: block;
}

.day-button strong {
  font-size: 17px;
}

.day-button small {
  color: var(--muted);
  font-size: 13px;
}

.calendar-entries {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 12px 12px;
  list-style: none;
}

.calendar-entry {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f7faf6;
}

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

.day-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fbfcfa;
}

.food-layout {
  display: grid;
  gap: 14px;
}

.recipe-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
}

.recipe-grid {
  display: grid;
  gap: 10px;
  max-height: 70vh;
  overflow: auto;
  padding-right: 2px;
}

.recipe-list {
  display: grid;
  gap: 10px;
}

.recipe-entry {
  display: grid;
  gap: 8px;
}

.recipe-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  align-items: stretch;
  min-height: 92px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.recipe-card img,
.recipe-placeholder {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef1ee;
}

.recipe-card div {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.recipe-card strong {
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.recipe-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.recipe-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.add-recipe-idea,
.view-recipe {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
}

.recipe-detail {
  display: grid;
  gap: 13px;
  padding: 13px;
  border: 1px solid rgba(23, 107, 82, 0.3);
  border-radius: 8px;
  background: #f7faf6;
}

.recipe-detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.recipe-detail h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.recipe-detail p,
.recipe-note {
  color: var(--muted);
  line-height: 1.45;
}

.close-recipe {
  flex: 0 0 auto;
  min-height: 36px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(49, 95, 143, 0.12);
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.recipe-detail-sections {
  display: grid;
  gap: 14px;
}

.recipe-detail-sections h4 {
  margin: 0 0 7px;
  font-size: 15px;
}

.recipe-detail-sections ul,
.recipe-detail-sections ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.45;
}

.recipe-source-link {
  width: fit-content;
}

.todo-actions,
.create-list,
.lists {
  width: min(100%, 820px);
  margin: 0 auto;
}

.todo-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(219, 226, 219, 0.82);
}

.create-list {
  display: grid;
  gap: 14px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(32, 42, 35, 0.08);
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.person-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check-pill {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.check-pill input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.form-row {
  display: flex;
  gap: 8px;
}

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

.list-picker {
  display: grid;
  gap: 10px;
}

.list-button {
  width: 100%;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(32, 42, 35, 0.08);
  text-align: left;
  cursor: pointer;
}

.list-button strong,
.list-button small {
  display: block;
}

.list-button strong {
  margin-bottom: 5px;
  font-size: 18px;
}

.list-button small {
  color: var(--muted);
  font-size: 13px;
}

.count-pill {
  flex: 0 0 auto;
  max-width: 102px;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(23, 107, 82, 0.11);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.todo-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.list-head {
  display: grid;
  gap: 7px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
}

.back-button {
  width: fit-content;
  min-height: 38px;
  padding: 0 11px;
}

.list-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.list-title-row h2 {
  font-size: 18px;
  line-height: 1.2;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(49, 95, 143, 0.12);
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.editors {
  color: var(--muted);
  font-size: 13px;
}

.add-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.add-item[hidden] {
  display: none;
}

.items {
  list-style: none;
  display: grid;
  margin: 0;
  padding: 0;
}

.item {
  display: grid;
  grid-template-columns: 42px 1fr 44px;
  gap: 0;
  align-items: stretch;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
}

.delete-item {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--red);
  font-size: 18px;
  cursor: pointer;
}

.delete-item:disabled {
  color: #b3bbb5;
  cursor: not-allowed;
}

.item:last-child {
  border-bottom: 0;
}

.item.done {
  background: var(--done);
  color: var(--muted);
}

.item-check {
  display: grid;
  place-items: center;
}

.item-check input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--accent);
}

.item-body {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 9px 11px 9px 2px;
}

.item-text {
  overflow-wrap: anywhere;
  font-weight: 750;
}

.done .item-text {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.item-meta {
  color: var(--muted);
  font-size: 12px;
}

.locked {
  padding: 12px 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
  font-size: 13px;
}

@media (min-width: 720px) {
  .topbar,
  .tabs,
  .page {
    padding-left: max(24px, calc((100vw - 920px) / 2));
    padding-right: max(24px, calc((100vw - 920px) / 2));
  }

  .tabs {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .travel-window {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 430px) {
  .topbar {
    align-items: start;
  }

  .logout-button {
    min-width: 56px;
    padding: 0 10px;
  }

  .logout-full {
    display: none;
  }

  .logout-short {
    display: inline;
  }

  .tab {
    font-size: 13px;
    padding: 0 4px;
  }

  .todo-actions .primary,
  .form-row .primary,
  .form-row .ghost {
    width: 100%;
  }

  .form-row {
    display: grid;
  }

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

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

  .recipe-card {
    grid-template-columns: 76px 1fr;
  }

  .recipe-card img,
  .recipe-placeholder {
    width: 76px;
    height: 76px;
  }

  .recipe-detail-head {
    display: grid;
  }

  .close-recipe,
  .recipe-source-link {
    width: 100%;
  }

  .list-button {
    align-items: stretch;
    flex-direction: column;
  }

  .count-pill {
    max-width: none;
    width: fit-content;
  }
}
