/* Bring-inspirierte Optik: warmer Sand-Hintergrund, weiße Kacheln, korallenrote Akzente */

:root {
  --brand: #e8554d;
  --brand-dark: #d6423a;
  --bg: #f3efe9;
  --card: #ffffff;
  --text: #35322e;
  --text-muted: #8d8779;
  --green: #2fa466;
  --shadow: 0 1px 3px rgba(60, 50, 30, 0.10), 0 4px 14px rgba(60, 50, 30, 0.06);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

/* ---------- Header ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--card);
  padding: calc(10px + env(safe-area-inset-top)) 16px 0;
  box-shadow: 0 1px 0 rgba(60, 50, 30, 0.08);
}

.header-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.header-titles { flex: 1; min-width: 0; }

.app-header h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.app-header p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.icon-btn {
  border: none;
  background: var(--bg);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #ece7de;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: var(--green);
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.search-row { margin-top: 10px; }

#search {
  width: 100%;
  border: none;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
}

#search::placeholder { color: var(--text-muted); }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 12px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  border: none;
  background: var(--bg);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
}

.chip.active {
  background: var(--brand);
  color: #fff;
}

/* ---------- Liste ---------- */

main { padding: 16px 16px 0; max-width: 900px; margin: 0 auto; }

.category { margin-bottom: 26px; }

.category-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.category-header h2 {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.category-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.category-count.done { color: var(--green); }

.category-edit {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 6px;
}

.category-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.tile {
  position: relative;
  background: var(--card);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 6px 10px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, opacity 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.tile:active { transform: scale(0.95); }

.tile-emoji { font-size: 1.7rem; line-height: 1.2; }

.tile-name {
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.tile-spec {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.tile.packed {
  opacity: 0.55;
  box-shadow: none;
  background: #efece5;
}

.tile.packed .tile-name { text-decoration: line-through; }

.tile-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.7rem;
  line-height: 20px;
  display: none;
}

.tile.packed .tile-check { display: block; }

.tile.add-tile {
  background: transparent;
  box-shadow: none;
  border: 2px dashed #d8d2c6;
  color: var(--text-muted);
  justify-content: center;
}

.tile.add-tile .tile-emoji { font-size: 1.4rem; }

.empty-search {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
  font-size: 0.9rem;
}

/* ---------- Info-Tab ---------- */

.info-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.info-card h2 { font-size: 1rem; margin-bottom: 10px; }

.info-card p { font-size: 0.87rem; margin-top: 8px; line-height: 1.5; }

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-list li { font-size: 0.87rem; line-height: 1.5; }

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

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.82rem;
  min-width: 480px;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #eee9df;
  vertical-align: top;
}

th {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---------- Bottom-Nav ---------- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  background: var(--card);
  box-shadow: 0 -1px 0 rgba(60, 50, 30, 0.08);
  padding-bottom: env(safe-area-inset-bottom);
}

.tab {
  flex: 1;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 0 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tab.active { color: var(--brand); }

.tab-icon { font-size: 1.25rem; }

/* ---------- Dialoge ---------- */

dialog {
  border: none;
  border-radius: 18px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  padding: 20px;
  width: min(420px, calc(100vw - 32px));
  margin: auto;
}

dialog::backdrop { background: rgba(40, 35, 25, 0.45); }

dialog h3 { font-size: 1.05rem; margin-bottom: 14px; }

dialog label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
}

dialog input {
  display: block;
  width: 100%;
  margin-top: 4px;
  border: 1px solid #ddd7cb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #faf8f4;
  outline: none;
}

dialog input:focus { border-color: var(--brand); }

.emoji-input { max-width: 90px; }

.dialog-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.spacer { flex: 1; }

.btn {
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
}

.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:active { background: var(--brand-dark); }
.btn.ghost { background: var(--bg); color: var(--text); }
.btn.danger { background: none; color: var(--brand); padding-left: 0; }

.menu-sheet { display: flex; flex-direction: column; gap: 4px; }

.menu-entry {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  padding: 12px 8px;
  border-radius: 10px;
  cursor: pointer;
}

.menu-entry:active { background: var(--bg); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #35322e;
  color: #fff;
  font-size: 0.85rem;
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 50;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 32px);
  text-align: center;
}
