:root {
  --bg: #17110f;
  --surface: #221a17;
  --surface2: #2e2420;
  --bar: #3a3027;
  --line: #4d423c;
  --text: #f1e4dc;
  --muted: #ab9e96;
  --accent: #f4b183;
  --chip: #5b4336;
  --chip-text: #f6dccb;
  --fab: #6e3d1c;
  --fab-text: #ffe0cb;
  --star: #f6c445;
  --danger: #ffb4ab;
  --radius: 18px;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
body {
  min-height: 100dvh;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--accent);
}
h1,
h2,
h3,
p {
  margin: 0;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ic {
  flex: none;
  display: block;
}
.muted {
  color: var(--muted);
}
.grow {
  flex: 1;
  min-width: 0;
}

/* 위쪽 막대 */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 60px;
  padding: 0 6px;
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
  background: var(--bg);
}
.bar.tinted {
  background: var(--bar);
}
.bar h1 {
  flex: 1;
  min-width: 0;
  margin: 0 10px;
  font-size: 22px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar > .inner {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}
.icon-btn {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
}
.icon-btn.sm {
  width: 36px;
  height: 36px;
  color: var(--muted);
}
.icon-btn:hover {
  background: #ffffff14;
}
.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 4px 16px calc(120px + env(safe-area-inset-bottom));
}

/* 단추 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--surface2);
  font-weight: 500;
  white-space: nowrap;
}
.btn.primary {
  background: var(--accent);
  color: #3b1d08;
}
.btn.tonal {
  background: var(--chip);
  color: var(--chip-text);
}
.btn.text {
  background: none;
  color: var(--accent);
  padding: 0 12px;
}
.btn.danger {
  background: #8c1d18;
  color: #ffdad6;
}
.btn.outline {
  background: none;
  border: 1px solid var(--line);
}
.btn.sm {
  min-height: 36px;
  font-size: 14px;
  padding: 0 12px;
}
.btn.wide {
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 목록 */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted);
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  color: var(--text);
}
.chips {
  display: flex;
  gap: 8px;
  padding: 4px 0 14px;
}
.filter {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: none;
  font-weight: 500;
}
.filter span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.filter .ic {
  color: var(--accent);
}
.filter.on {
  background: var(--chip);
  border-color: transparent;
  color: var(--chip-text);
}
.count {
  color: var(--muted);
  font-size: 14px;
  margin: 0 4px 8px;
}
.card {
  display: flex;
  gap: 14px;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}
.card:hover {
  background: #281f1b;
}
.thumb {
  flex: none;
  width: 88px;
  height: 88px;
  border-radius: 12px;
  background: var(--surface2);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-body {
  flex: 1;
  min-width: 0;
}
.card-title {
  font-size: 19px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rating {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rating b {
  font-weight: 400;
}
.rating.big {
  gap: 10px;
  font-size: 20px;
  margin: 6px 0 14px;
}
.stars {
  display: inline-flex;
  color: var(--star);
}
.meta {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: var(--chip);
  color: var(--chip-text);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 14px;
}
.tag.ghost {
  background: none;
  border: 1px dashed var(--line);
  color: var(--muted);
}
.cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 14px;
}
.cat .ic {
  color: var(--accent);
}
.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 64px 16px;
  text-align: center;
  color: var(--muted);
}
.empty p:first-of-type {
  color: var(--text);
  font-size: 18px;
}
.fab {
  position: fixed;
  right: max(16px, calc(50vw - 324px));
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 0 22px;
  border: 0;
  border-radius: 18px;
  background: var(--fab);
  color: var(--fab-text);
  font-size: 17px;
  font-weight: 500;
  box-shadow: 0 6px 16px #0008;
}

/* 상세 */
.gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  max-width: 680px;
  margin: 0 auto;
  background: #000;
}
.gallery img {
  flex: none;
  width: 100%;
  max-height: 62vh;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  scroll-snap-align: center;
  display: block;
}
.gallery.many img {
  width: 88%;
}
.detail {
  padding-top: 18px;
}
.detail-title {
  font-size: 26px;
  font-weight: 500;
  line-height: 1.3;
}
.info {
  display: grid;
  grid-template-columns: 28px 84px 1fr;
  gap: 10px;
  align-items: start;
  margin: 14px 0;
}
.info .ic {
  color: var(--accent);
  margin-top: 1px;
}
.info .lbl {
  font-weight: 500;
}
.map {
  height: 240px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface2);
  margin: 8px 0;
  z-index: 0;
}
.body-text {
  white-space: pre-wrap;
  font-size: 17px;
  line-height: 1.7;
}
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.sec-head h3 {
  font-size: 19px;
  font-weight: 500;
}
.summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  margin-bottom: 8px;
}
.resp-item {
  padding: 10px 0;
  border-bottom: 1px solid #3a302b;
}
.resp-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.resp-top .muted {
  font-size: 13px;
  text-align: right;
}
.resp-text {
  white-space: pre-wrap;
  margin-top: 2px;
}

/* 입력 */
.field {
  display: block;
  margin: 18px 0;
}
.field > .lbl {
  display: block;
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 6px;
}
.field .hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.input,
.field input[type='text'],
.field input[type='search'],
.field input[type='password'],
.field input[type='datetime-local'],
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  outline: none;
}
.field textarea {
  resize: vertical;
  line-height: 1.6;
}
.field input:focus,
.field textarea:focus,
.field select:focus,
.input:focus {
  border-color: var(--accent);
}
.star-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.star-input {
  display: inline-flex;
  color: var(--star);
  cursor: pointer;
  border-radius: 8px;
  touch-action: manipulation;
}
.star-val {
  color: var(--muted);
}
.star-wrap {
  gap: 4px 8px;
}
.tag-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.field .tag-edit input[type='text'] {
  flex: 1;
  width: auto;
  min-width: 120px;
  min-height: 30px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: none;
  outline: none;
}
.tag-sug {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}
.photo {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface2);
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo.add {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  border: 1px dashed var(--line);
  background: none;
  color: var(--muted);
  font-size: 14px;
}
.photo .badge,
.photo .mini {
  position: absolute;
  left: 6px;
  bottom: 6px;
  border: 0;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  background: #000a;
  color: #fff;
}
.photo .badge {
  background: var(--accent);
  color: #3b1d08;
}
.photo .mini.x {
  left: auto;
  right: 6px;
  top: 6px;
  bottom: auto;
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
}
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 6px 4px;
}
.check input {
  flex: none;
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}
.pick-list {
  max-height: 46vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 10px;
}
.pick-list .check + .check {
  border-top: 1px solid #3a302b;
}
.link-box {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}
.link-box input {
  flex: 1;
  min-width: 0;
}
.state {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 13px;
  background: #2f4a2f;
  color: #cfeccd;
}
.state.off {
  background: var(--surface2);
  color: var(--muted);
}

/* 겹침 화면 */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #000a;
}
.scrim.bottom {
  place-items: end center;
  padding: 0;
}
.dialog {
  width: min(100%, 420px);
  padding: 22px;
  border-radius: 24px;
  background: var(--surface2);
}
.dialog-msg {
  font-size: 17px;
  white-space: pre-wrap;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}
.sheet {
  width: min(100%, 680px);
  max-height: 82dvh;
  overflow-y: auto;
  padding: 18px 12px calc(16px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--surface2);
}
.sheet-title {
  font-size: 18px;
  font-weight: 500;
  padding: 0 10px 10px;
}
.sheet-body {
  padding: 0 10px;
}
.sheet-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  text-align: left;
}
.sheet-item:hover {
  background: #ffffff12;
}
.sheet-item.sel {
  color: var(--accent);
}
.full {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.picker-search {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
}
.picker-search input {
  flex: 1;
  min-width: 0;
}
.picker-map-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}
.picker-map {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.picker-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -100%);
  color: #d9480f;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px #0008);
}
.picker-results {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 8px;
  z-index: 3;
  max-height: 50%;
  overflow-y: auto;
  border-radius: 14px;
  background: var(--surface2);
}
.picker-results:empty {
  display: none;
}
.picker-results p {
  padding: 12px 14px;
}
#toasts {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 100;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  max-width: 520px;
  padding: 12px 18px;
  border-radius: 12px;
  background: #efe0d6;
  color: #2b1d15;
  box-shadow: 0 4px 12px #0008;
  transition: opacity 0.3s;
}
.toast.out {
  opacity: 0;
}

/* 로그인 */
.login {
  display: grid;
  gap: 14px;
  width: min(100% - 40px, 380px);
  margin: 12vh auto 0;
}
.login h1 {
  font-size: 28px;
  font-weight: 500;
}
.form-msg {
  color: var(--danger);
  min-height: 1.5em;
}

/* 설문 응답 화면 */
.sv-head {
  padding: 28px 0 8px;
}
.sv-head h1 {
  font-size: 26px;
  font-weight: 500;
  line-height: 1.3;
}
.sv-intro {
  white-space: pre-wrap;
  margin-top: 10px;
}
.sv-item {
  padding: 16px;
  margin: 14px 0;
  border-radius: var(--radius);
  background: var(--surface);
}
.sv-item-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}
.sv-item-head .thumb {
  width: 72px;
  height: 72px;
}
.sv-item h2 {
  font-size: 19px;
  font-weight: 500;
}
.sv-item textarea {
  margin-top: 12px;
}
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.thanks {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18vh 16px;
  text-align: center;
}
.thanks .ic {
  color: var(--accent);
}

/* 인쇄(PDF로 저장) */
#print {
  display: none;
}
@media print {
  html,
  body {
    background: #fff;
    color: #111;
    font-size: 11pt;
  }
  #app,
  #overlays,
  #toasts {
    display: none !important;
  }
  #print {
    display: block;
  }
  #print h1 {
    font-size: 20pt;
  }
  #print .p-sub {
    color: #555;
    margin-bottom: 14pt;
  }
  #print article {
    break-inside: avoid;
    border-top: 1px solid #999;
    padding: 10pt 0;
  }
  #print h2 {
    font-size: 14pt;
  }
  #print .p-meta {
    color: #444;
  }
  #print img {
    display: block;
    max-width: 60%;
    max-height: 70mm;
    margin: 6pt 0;
  }
  #print .p-body {
    white-space: pre-wrap;
    margin-top: 6pt;
  }
  #print .p-resp {
    margin-top: 6pt;
    padding-left: 10pt;
    border-left: 2px solid #bbb;
  }
  #print p {
    margin: 2pt 0;
  }
}
