:root {
  --bg: #F3ECDD;
  --surface: #FBF7EE;
  --ink: #1C2B4A;
  --ink-on: #F3ECDD;
  --text-secondary: #6B5A48;
  --border: #1C2B4A;
  --hairline: #DDD2BE;
  --accent: #86200F;
  --visit-1: #EBC0B0;
  --visit-2: #D27F68;
  --visit-3: #B94A35;
  --visit-4: #86200F;
  --visit-text-dark: var(--ink);
  --visit-text-light: #FFFFFF;
  --success: #3A7D44;
  --warn: #9A6A1E;
  --star: #B8860B;
}

@font-face {
  font-family: "Noto Serif KR Subset";
  src: url("./fonts/NotoSerifKR-Black-subset.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.55;
}

.shell {
  min-height: 100dvh;
  width: min(100%, 490px);
  display: flex;
  flex-direction: column;
  margin-inline: auto;
  padding: max(22px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.masthead {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 900;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 14px;
}

.masthead img { border-radius: 12px; }

main { flex: 1; padding-block: clamp(25px, 6vh, 60px) 24px; }
footer { color: var(--text-secondary); text-align: center; font-size: .75rem; }

.panel {
  padding: clamp(18px, 5vw, 29px);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--accent);
  border-radius: 16px;
}

h1 {
  font-family: "Noto Serif KR Subset", "Malgun Gothic", serif;
  font-weight: 900;
  font-size: clamp(1.52rem, 6vw, 2rem);
  line-height: 1.3;
  letter-spacing: -.035em;
  word-break: keep-all;
  margin: 0 0 9px;
}

p { margin: 0 0 16px; color: var(--text-secondary); word-break: keep-all; }
form { display: grid; gap: 12px; margin-top: 18px; }
.divided { padding-top: 18px; border-top: 1px solid var(--hairline); }
.form-label { display: grid; gap: 6px; font-size: .88rem; font-weight: 700; }

input {
  min-width: 0;
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 9px;
}

input::placeholder { color: var(--text-secondary); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

button {
  min-height: 46px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
}

button:disabled { cursor: wait; opacity: .65; }
.primary { border: 1px solid var(--ink); background: var(--ink); color: var(--ink-on); }
.secondary { border: 1px solid var(--border); background: transparent; color: var(--ink); }
.text-button {
  background: transparent;
  color: var(--accent);
  border: 0;
  padding-inline: 0;
  margin-top: 10px;
  text-underline-offset: 3px;
  text-decoration: underline;
}
.hint, .notice { font-size: .85rem; margin: 0; }
.hint { margin-top: -6px; }
.notice { color: var(--accent); }
.notice[data-success] { color: var(--success); }
.install { margin-top: 18px; padding: 11px 15px; border: 1px solid var(--hairline); border-radius: 10px; }
.install summary { cursor: pointer; font-size: .88rem; font-weight: 700; }
.install p { font-size: .85rem; margin: 9px 0 0; }
.ticket { text-align: center; border: 1px dashed var(--accent); border-radius: 12px; padding: 15px 8px; }
.ticket div, .ticket small { font-size: .82rem; color: var(--text-secondary); }
.ticket output, .code-input { font-family: ui-monospace, monospace; letter-spacing: .16em; }
.ticket output { display: block; font-size: clamp(1.6rem, 8vw, 2.25rem); font-weight: 800; overflow-wrap: anywhere; }
.code-input { text-transform: uppercase; }
.paired { color: var(--success); font-weight: 700; }
.partner { border-block: 1px solid var(--hairline); padding-block: 12px; }
.partner dt { font-size: .82rem; color: var(--text-secondary); }
.partner dd { margin: 3px 0 0; font-weight: 700; overflow-wrap: anywhere; }

select, textarea {
  min-width: 0;
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 9px;
}
textarea { resize: vertical; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.title-row .text-button, .back { margin-top: 0; min-height: 0; }
.back { display: block; margin-bottom: 10px; }
.wide { width: 100%; }
.danger { color: var(--accent); margin-top: 16px; }
.empty { margin: 18px 0 0; text-align: center; }
.place-list { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--hairline); }
.place {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 13px 2px;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
}
.place-name { font-size: 1.02rem; overflow-wrap: anywhere; }
.place-meta { font-size: .82rem; font-weight: 400; color: var(--text-secondary); }
.place-memo {
  font-size: .85rem;
  font-weight: 400;
  color: var(--text-secondary);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: pre-line;
}
.place-memo:empty { display: none; }
