/* Gatefold — "Luggage-Tag Departure Rail" */

:root {
  --blue: #1f3a5f;
  --blue-deep: #16294a;
  --cream: #f3e3c3;
  --paper: #faf3e2;
  --coral: #e05a47;
  --mustard: #d9a441;
  --mint: #7fbf9e;
  --brass: #b98a3e;
  --brass-hi: #e6c37a;
  --ink: #2a2419;
  --muted: rgba(243, 227, 195, 0.72);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(120% 60% at 50% -10%, #2c4d7c 0%, var(--blue) 55%, var(--blue-deep) 100%);
  color: var(--cream);
  font-family: "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
}

.brand-sticker {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--coral);
  border: 3px solid var(--cream);
  box-shadow: inset 0 0 0 3px var(--coral), inset 0 0 0 6px var(--cream);
  flex: none;
}

.brand-text h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.tagline {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

/* ---------- main scroll area ---------- */

main {
  flex: 1;
  padding: 4px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

main > * { flex: none; }

.hint-line {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Gate: rail + focus tag ---------- */

.rail-block { position: relative; padding-top: 10px; }

.brass-rail {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #8a6426, var(--brass-hi) 30%, var(--brass) 60%, #8a6426);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.focus-tag {
  position: relative;
  margin: 10px 6px 0 0;
  background: var(--paper);
  color: var(--ink);
  border-radius: 4px 18px 18px 18px;
  padding: 22px 18px 18px;
  clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 0 100%);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.tag-hole {
  position: absolute;
  top: 8px;
  right: 18px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.6);
}

.tag-hole.small { top: 12px; right: 14px; width: 13px; height: 13px; }

.focus-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--brass);
  font-weight: bold;
}

.focus-name {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.15;
  color: var(--blue);
}

.focus-window {
  margin: 0 0 10px;
  font-size: 13px;
  color: #6b6152;
}

.focus-window strong { font-size: 17px; color: var(--ink); }

.focus-stage {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 14px;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stage-blue { background: var(--blue); }
.stage-coral { background: var(--coral); }
.stage-mustard { background: var(--mustard); color: #423307; }
.stage-mint { background: var(--mint); color: #14301f; }

.focus-note {
  margin: 0 0 14px;
  font-size: 14px;
  color: #5c5344;
  border-left: 3px solid var(--brass-hi);
  padding-left: 10px;
}

.cycle-strip {
  display: block;
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 10px;
  background: var(--coral);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  cursor: pointer;
  box-shadow: 0 3px 0 #a63c2c;
}

.cycle-strip:active { transform: translateY(2px); box-shadow: 0 1px 0 #a63c2c; }

/* ---------- counters ---------- */

.counter-row {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.counter {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 4px solid var(--brass);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  padding: 8px;
}

.counter-ready { border-color: var(--mint); }

.counter-num { font-size: 32px; font-weight: bold; line-height: 1; }

.counter-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

/* ---------- about disclosure ---------- */

.about-disclosure {
  background: rgba(243, 227, 195, 0.12);
  border: 1px solid rgba(243, 227, 195, 0.3);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
}

.about-disclosure summary {
  cursor: pointer;
  font-weight: bold;
  color: var(--cream);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.about-disclosure p { color: var(--muted); margin: 8px 0 12px; }

.danger-btn {
  width: 100%;
  min-height: 46px;
  border: 2px solid var(--coral);
  background: transparent;
  color: var(--coral);
  border-radius: 10px;
  font-size: 15px;
  font-weight: bold;
  padding: 10px 14px;
  cursor: pointer;
}

.danger-btn:active { background: var(--coral); color: #fff; }

/* ---------- luggage-tag rows ---------- */

.tag-row {
  position: relative;
  display: flex;
  align-items: stretch;
  background: var(--paper);
  color: var(--ink);
  border-radius: 12px;
  margin: 10px 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  overflow: visible;
}

.ribbon {
  flex: none;
  width: 9px;
  border-radius: 12px 0 0 12px;
}

.r-blue { background: var(--blue); }
.r-coral { background: var(--coral); }
.r-mustard { background: var(--mustard); }
.r-mint { background: var(--mint); }

.row-hole {
  position: absolute;
  top: -5px;
  left: 20px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--blue-deep);
  box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.6);
}

.row-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  text-align: left;
  font: inherit;
  color: inherit;
  padding: 12px 10px 12px 22px;
  min-height: 56px;
  cursor: pointer;
  min-width: 0;
}

.disc {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid var(--brass);
}

.disc b { font-size: 15px; }
.disc i { font-style: normal; font-size: 9px; text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

.row-text { display: flex; flex-direction: column; min-width: 0; }

.row-text strong {
  font-size: 16px;
  color: var(--blue);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-line { font-size: 12px; color: #6b6152; margin-top: 2px; }

.row-note {
  font-size: 12px;
  color: #8a7f6b;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-del {
  flex: none;
  width: 48px;
  border: none;
  background: transparent;
  color: var(--coral);
  font-size: 18px;
  cursor: pointer;
}

.row-del:active { color: #a63c2c; }

/* ---------- stage sections ---------- */

.stage-section { margin: 0 0 6px; }

.stage-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 2px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--cream);
}

.stage-head .ribbon { width: 14px; height: 14px; border-radius: 4px; }

.stage-count {
  margin-left: auto;
  background: rgba(243, 227, 195, 0.16);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
}

.stage-empty {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  padding: 8px 2px;
}

/* ---------- Add: ticket panel ---------- */

.ticket-panel {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.ticket-head {
  position: relative;
  background: var(--blue);
  color: var(--cream);
  padding: 16px 18px 14px;
}

.ticket-head h2 { margin: 0; font-size: 20px; letter-spacing: 1px; }

.ticket-body {
  padding: 16px 16px 18px;
  border-top: 3px dashed rgba(31, 58, 95, 0.35);
}

.field { display: block; margin: 0 0 14px; padding: 0; border: none; }

.field-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--blue);
  margin-bottom: 6px;
}

.field-label em {
  font-style: normal;
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
  color: var(--coral);
  font-size: 12px;
}

input[type="text"],
input[type="date"],
input[type="search"],
textarea {
  width: 100%;
  min-height: 48px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: #fffdf6;
  border: 2px solid var(--blue);
  border-radius: 10px;
  padding: 10px 12px;
  appearance: none;
  -webkit-appearance: none;
}

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

input:focus, textarea:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(224, 90, 71, 0.25);
}

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

.chip {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--blue);
  background: transparent;
  color: var(--blue);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

.chip-on { background: var(--coral); border-color: var(--coral); color: #fff; }

.form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(224, 90, 71, 0.14);
  border: 1px solid var(--coral);
  color: #a63c2c;
  font-size: 14px;
}

.form-actions { display: flex; gap: 10px; }

.btn-primary, .btn-ghost {
  flex: 1;
  min-height: 52px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  padding: 12px 14px;
}

.btn-primary {
  border: none;
  background: var(--blue);
  color: var(--cream);
  box-shadow: 0 3px 0 #101f38;
}

.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #101f38; }

.btn-ghost {
  background: transparent;
  border: 2px solid var(--blue);
  color: var(--blue);
}

.btn-ghost:active { background: rgba(31, 58, 95, 0.12); }

/* ---------- Find ---------- */

.search-wrap { margin-bottom: 2px; }

.search-label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  color: var(--cream);
}

/* ---------- empty states ---------- */

.empty-tag {
  border: 2px dashed rgba(243, 227, 195, 0.55);
  border-radius: var(--radius);
  padding: 28px 20px 24px;
  text-align: center;
  position: relative;
}

.empty-hole {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--blue-deep);
  box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.6);
}

.empty-tag h3 { margin: 6px 0 6px; font-size: 18px; color: var(--cream); }
.empty-tag p { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.empty-tag .cycle-strip { max-width: 280px; margin: 0 auto; }

/* ---------- bottom tab bar: luggage handles ---------- */

.tabbar {
  display: flex;
  background: var(--blue-deep);
  border-top: 2px solid var(--brass);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  gap: 6px;
  position: sticky;
  bottom: 0;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 6px 2px 4px;
  min-height: 56px;
  cursor: pointer;
  color: rgba(243, 227, 195, 0.55);
  font-family: inherit;
}

.handle {
  display: block;
  width: 38px;
  height: 18px;
  border: 3px solid currentColor;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
}

.tab-label { font-size: 12px; font-weight: bold; letter-spacing: 0.5px; }

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

.tab.active .handle {
  transform: translateY(-4px);
  filter: drop-shadow(0 5px 3px rgba(0, 0, 0, 0.45));
  color: var(--brass-hi);
}

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

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

/* ---------- focus visibility ---------- */

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--brass-hi);
  outline-offset: 2px;
}
