/* Camp Until Next Tuesday: one hand-rolled stylesheet, dark camping theme. */

:root {
  --bg: #10160f;
  --bg-raised: #182115;
  --bg-inset: #0c110b;
  --border: #2a3626;
  --text: #f0ead9;
  --muted: #9aa78f;
  --green: #3f7d4e;
  --green-strong: #4f9a61;
  --green-dim: #2e5c3a;
  --orange: #e8590c;
  --orange-soft: #f47b3a;
  --danger: #c9402e;
  --radius: 12px;
  --radius-sm: 8px;
  --tap: 44px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

main.container { flex: 1; padding-top: 24px; padding-bottom: 48px; }

a { color: var(--green-strong); }
a:hover { color: var(--orange-soft); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

/* Header and footer */

.site-header {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand:hover { color: var(--text); }

.brand-mark { width: 28px; height: 28px; align-self: center; }

.brand-name {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  color: var(--orange);
}

.brand-tagline {
  color: var(--muted);
  font-size: 0.85rem;
}

.header-camp {
  color: var(--text);
  font-weight: 600;
  border-left: 1px solid var(--border);
  padding-left: 12px;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.signed-in { color: var(--muted); font-size: 0.9rem; }

.inline-form { display: inline; margin: 0; }

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  padding: 16px 0;
  text-align: center;
}

/* Cards, buttons, inputs */

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--green); color: var(--text); }

.btn-primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover { background: var(--orange-soft); border-color: var(--orange-soft); color: #fff; }

.btn-danger { border-color: var(--danger); color: #e88a7c; }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-sm { min-height: 40px; padding: 4px 12px; font-size: 0.85rem; }

.icon-btn {
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  line-height: 1;
}
.icon-btn:hover { color: var(--danger); background: var(--bg-inset); }

input[type="text"], input[type="password"], input[type="date"],
input:not([type]), select, textarea {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  min-height: var(--tap);
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--green);
  outline-offset: 0;
  border-color: var(--green);
}
input[readonly] { color: var(--muted); }

input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--orange);
  cursor: pointer;
}

label { display: block; margin-bottom: 10px; font-size: 0.9rem; color: var(--muted); }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--text); }

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

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

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.badge-active { background: var(--green-dim); color: #cde8d2; }
.badge-archived { background: #3a3226; color: #cbbb9b; }

.form-error {
  background: rgba(201, 64, 46, 0.15);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  color: #f0a99e;
  padding: 10px 12px;
}

/* Toasts */

.toast-host {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  width: min(92vw, 420px);
}

.toast {
  background: #2b1611;
  border: 1px solid var(--danger);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-ok { background: #14231a; border-color: var(--green); }

/* Landing page */

.hero { text-align: center; padding: 32px 0 8px; }
.hero h1 { font-size: 2rem; }
.hero-sub { color: var(--orange-soft); font-weight: 600; margin-top: -6px; }
.hero p { max-width: 640px; margin-left: auto; margin-right: auto; }

.camp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.camp-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-decoration: none;
  color: var(--text);
  min-height: var(--tap);
}
.camp-card:hover { border-color: var(--orange); color: var(--text); }
.camp-card-name { font-weight: 600; }
.camp-card-go { color: var(--orange); font-size: 0.85rem; font-weight: 600; }

.empty-state {
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 16px;
  margin-top: 16px;
}

/* Camp page: locked (unauth) */

.camp-locked { display: flex; flex-direction: column; gap: 24px; }

.code-entry { max-width: 480px; margin: 0 auto; width: 100%; text-align: center; }
.code-entry p { color: var(--muted); }

.code-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.code-form input {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1.1rem;
}

.lists-grid-locked { opacity: 0.85; }

.list-items-static { list-style: none; margin: 0; padding: 0; }
.list-items-static .item-row { display: flex; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.list-items-static .item-row:last-child { border-bottom: none; }
.acq-mark { width: 20px; color: var(--orange); font-weight: 700; flex: none; }

/* Camp page: authed board */

#camp-board { display: flex; flex-direction: column; gap: 20px; }

.camp-meta-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.camp-meta-head h1 { margin-bottom: 4px; }

.camp-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 4px 0 0; }
.camp-facts dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.camp-facts dd { margin: 0; font-weight: 500; }

.camp-notes { color: var(--muted); margin: 10px 0 0; white-space: pre-line; }

/* Todo panels */

.todo-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.todo-items, .list-items { list-style: none; margin: 0 0 8px; padding: 0; }

.todo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--border);
  min-height: var(--tap);
}
.todo-row:last-child { border-bottom: none; }
.todo-text { flex: 1; overflow-wrap: anywhere; }
.todo-row.done .todo-text { text-decoration: line-through; color: var(--muted); }

.todo-check { display: flex; align-items: center; margin: 0; min-height: 36px; }

.other-todos summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 28px;
  color: var(--muted);
}
.other-todos summary:hover { color: var(--text); }
.other-todo-group { margin-top: 12px; }
.other-todo-group h3 { color: var(--green-strong); margin-bottom: 4px; }
.todo-items-static { list-style: none; margin: 0; padding: 0; }
.todo-items-static li { padding: 4px 0; border-bottom: 1px solid var(--border); }
.todo-items-static li:last-child { border-bottom: none; }
.todo-items-static li.done { text-decoration: line-through; color: var(--muted); }

/* Supply lists grid */

.lists-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

@media (min-width: 700px) {
  .lists-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1080px) {
  .lists-grid { grid-template-columns: repeat(3, 1fr); }
}

.list-column { padding: 12px 14px 14px; }

.list-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.list-header h2 { margin: 0; flex: 1; text-align: left; }

.list-title-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 6px 4px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  min-height: 36px;
}
.list-title-btn:hover { background: var(--bg-inset); }

.list-count {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  flex: none;
}

.list-rename { display: flex; gap: 8px; margin-bottom: 8px; }

/* Item rows */

.item-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  min-height: var(--tap);
}
.item-row:last-child { border-bottom: none; }

.pending { opacity: 0.55; pointer-events: none; }

.drag-handle {
  flex: none;
  width: 32px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
  user-select: none;
  font-size: 0.9rem;
}
.drag-handle:active { cursor: grabbing; }

.acq-box { display: flex; align-items: center; margin: 0; min-height: 36px; flex: none; }

.item-main {
  flex: 1;
  min-width: 120px;
  background: none;
  border: none;
  padding: 6px 4px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  min-height: 36px;
}
.item-main:hover { background: var(--bg-inset); }

.item-qty { color: var(--orange-soft); font-size: 0.85rem; margin-left: 6px; }
.item-note { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 2px; overflow-wrap: anywhere; }

.item-row.acquired .item-name { text-decoration: line-through; color: var(--muted); }
.item-row.acquired .item-qty { color: var(--muted); }

.chip {
  flex: none;
  width: auto;
  max-width: 130px;
  min-height: 36px;
  padding: 4px 24px 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--muted);
  background-image: none;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-inset);
  text-overflow: ellipsis;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6'%3E%3Cpath d='M0 0l4 6 4-6z' fill='%239aa78f'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.chip.assigned { color: #cde8d2; border-color: var(--green); background-color: var(--green-dim); }

.item-editor {
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin: 4px 0 8px;
}
.item-editor label { margin-bottom: 8px; }
.editor-actions { display: flex; gap: 8px; justify-content: space-between; }

/* Quick add */

.quick-add { display: flex; gap: 8px; align-items: stretch; }
.quick-add input { flex: 1; min-width: 0; }
.quick-add .btn { flex: none; }

.add-list-card { border-style: dashed; background: none; }

/* Sortable states */

.sortable-ghost { opacity: 0.35; background: var(--green-dim); border-radius: var(--radius-sm); }
.sortable-chosen { background: var(--bg-inset); border-radius: var(--radius-sm); }
.sortable-drag { opacity: 0.9; }

/* Admin */

.auth-card { max-width: 420px; margin: 48px auto 0; }

.admin-section { margin-bottom: 32px; }
.admin-section > h2 { margin-bottom: 12px; }

.table-wrap { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 4px 16px;
}
.form-grid .form-span { grid-column: 1 / -1; }

.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.code-copy { display: flex; gap: 6px; align-items: center; }
.code-copy .code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.05em;
  width: 12em;
  min-height: 36px;
  padding: 4px 10px;
  color: var(--text);
}

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

.new-code-callout {
  background: #23150c;
  border: 1px solid var(--orange);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.new-code-callout .code-copy { margin-top: 8px; }
.new-code-callout .code-input { font-size: 1.2rem; width: 100%; max-width: 16em; color: var(--orange-soft); }

/* Template editing */

.tpl-card { margin-bottom: 12px; }
.tpl-card > summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 28px;
}
.tpl-card > summary .muted { font-weight: 400; font-size: 0.85rem; margin-left: 8px; }

.tpl-body { margin-top: 12px; display: flex; flex-direction: column; gap: 16px; }

.tpl-fields { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.tpl-fields label { flex: 1; min-width: 180px; margin: 0; }

.tpl-lists {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.tpl-list {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.tpl-list-head { display: flex; gap: 6px; margin-bottom: 8px; }
.tpl-list-head .tpl-list-name { font-weight: 600; }

.tpl-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }

.tpl-item { display: flex; gap: 6px; }

.input-qty { width: 5.5em; flex: none; }

.tpl-item input, .tpl-list-head input, .tpl-add-item input, .tpl-add-item .btn {
  min-height: 36px;
  padding: 4px 10px;
  font-size: 0.9rem;
}
.tpl-add-item { gap: 6px; }

/* Small screens */

@media (max-width: 480px) {
  .brand-tagline { display: none; }
  .header-camp { border-left: none; padding-left: 0; width: 100%; }
  .todo-panels { grid-template-columns: 1fr; }
  .camp-facts { flex-direction: column; gap: 8px; }
  h1 { font-size: 1.4rem; }
}

/* Board pills: Overview / Food / Weather. */
.board-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.board-tab {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.board-tab:hover { border-color: var(--green); }
.board-tab.active {
  background: var(--green-dim);
  border-color: var(--green);
  color: #cde8d2;
}

/* The who-are-you step behind the shared camp code. */
.join-roster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.join-name { min-height: var(--tap); padding: 8px 20px; }
.join-divider { color: var(--muted); margin: 12px 0 4px; }

/* Weather strip on the overview. */
.weather-strip { padding: 12px 16px; }
.weather-strip-row {
  display: flex;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  overflow-x: auto;
}
.wx-day {
  flex: 1 1 0;
  min-width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
}
.wx-day.camp-day { background: var(--bg-inset); outline: 1px solid var(--green-dim); }
.wx-date { color: var(--muted); font-size: 0.85rem; }
.wx-emoji { font-size: 1.4rem; }
.wx-temps { font-weight: 600; }
.wx-low { color: var(--muted); font-weight: 400; }
.wx-precip { color: var(--orange-soft); font-size: 0.85rem; }
.wx-note { margin: 8px 0 0; font-size: 0.9rem; }

/* Weather page: day cards and the astro table. */
.wx-days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.wx-day-card { padding: 14px 16px; }
.wx-day-card.camp-day { outline: 1px solid var(--green); }
.wx-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.wx-day-date { font-weight: 700; }
.wx-day-main {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.wx-emoji-lg { font-size: 1.8rem; }
.wx-label { flex: 1; }
.wx-temps-lg { font-weight: 700; font-size: 1.1rem; }
.wx-facts { display: flex; gap: 16px; margin: 0; }
.wx-facts div { display: flex; gap: 6px; }
.wx-facts dt { color: var(--muted); }
.wx-facts dd { margin: 0; }
.astro-section h2 { margin: 8px 0 8px; }
.astro-verdict { font-weight: 700; }
.astro-great { color: var(--green-strong); }
.astro-decent { color: var(--orange-soft); }
.astro-poor { color: var(--muted); }
.astro-unknown { color: var(--muted); }

/* Admin: template picks on camp create, list kind selects, camper rename. */
.template-picks { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
.template-picks legend { color: var(--muted); padding: 0 6px; }
.check-label { display: inline-flex; align-items: center; gap: 8px; margin-right: 16px; min-height: 32px; }
.tpl-list-kind, .tpl-add-list select { flex: none; }
.participant-rename { display: inline-flex; gap: 8px; margin-top: 6px; }
