/* 우리 사이 (/saju/) — design pass matching /lab.css tokens and typography.
 * Loaded after /lab.css and saju/saju.css. Selectors only; no content: text injection. */

:root {
  --bg: var(--lab-bg);
  --surface: var(--lab-surface);
  --surface2: var(--lab-surface2);
  --text: var(--lab-text);
  --muted: var(--lab-muted);
  --faint: var(--lab-faint);
  --line: var(--lab-line);
  --line-strong: var(--lab-line-strong);
  --primary: var(--lab-ink);
  --on-primary: var(--lab-on-ink);
  --accent: var(--lab-accent);
  --accent-soft: #fdf0e7;
  --good: #1a56ab;
  --good-soft: #edf4fc;
  --bad: #b3262f;
  --bad-soft: #fbe9ea;
  --g1: #5690d0;
  --g2: #2e74c7;
  --g3: #1a56ab;
  --b1: #d46f74;
  --b2: #c54148;
  --b3: #b3262f;
  --mid: #83868f;
  --e-목: #196e39;
  --e-화: #be232a;
  --e-토: #854d0e;
  --e-금: #52545a;
  --e-수: #1d4ed8;
  --bubble: #fdf6ed;
  --bubble-line: #ebd6be;
  --node-bg: #fffaf3;
  --yn-ring: #eab88c;
  --radius: 12px;
  --radius-sm: var(--lab-radius, 8px);
  --shadow: var(--lab-shadow-sm);
  --shadow-lg: var(--lab-shadow-lg);
  --shade: rgba(10, 10, 12, .52);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent-soft: #2a1a10;
    --good: #8cc0ff;
    --good-soft: #142235;
    --bad: #ff8a8f;
    --bad-soft: #2d1618;
    --g1: #4c7fb3;
    --g2: #6ca6ec;
    --g3: #8cc0ff;
    --b1: #aa5b60;
    --b2: #e06c73;
    --b3: #ff8a8f;
    --mid: #757882;
    --e-목: #5fd08a;
    --e-화: #ff7b7b;
    --e-토: #e8b54a;
    --e-금: #c4c6cc;
    --e-수: #7fb0ff;
    --bubble: #221c17;
    --bubble-line: #3e3126;
    --node-bg: #202023;
    --yn-ring: #855c3a;
    --shade: rgba(10, 10, 12, .64);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --accent-soft: #2a1a10;
  --good: #8cc0ff;
  --good-soft: #142235;
  --bad: #ff8a8f;
  --bad-soft: #2d1618;
  --g1: #4c7fb3;
  --g2: #6ca6ec;
  --g3: #8cc0ff;
  --b1: #aa5b60;
  --b2: #e06c73;
  --b3: #ff8a8f;
  --mid: #757882;
  --e-목: #5fd08a;
  --e-화: #ff7b7b;
  --e-토: #e8b54a;
  --e-금: #c4c6cc;
  --e-수: #7fb0ff;
  --bubble: #221c17;
  --bubble-line: #3e3126;
  --node-bg: #202023;
  --yn-ring: #855c3a;
  --shade: rgba(10, 10, 12, .64);
  color-scheme: dark;
}

/* ---------- base, typography & focus ---------- */
html {
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--lab-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow-x: clip;
}

:is(a, button, input, select, textarea, summary, [tabindex], [data-act]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: 1200px;
  min-height: calc(100dvh - 57px);
  margin: 0 auto;
  padding: 0 16px 84px;
}

h1,
h2,
h3 {
  letter-spacing: -.02em;
}

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

.small {
  font-size: 13px;
  line-height: 1.5;
}

.good {
  color: var(--good);
  font-weight: 700;
}

.bad {
  color: var(--bad);
  font-weight: 700;
}

.loading {
  padding: 40px 0;
  color: var(--muted);
  font-size: 15px;
}

.fine {
  font-size: 12.5px;
  line-height: 1.52;
  color: var(--muted);
  margin: 8px 0 0;
  max-width: 56ch;
}

.disclaimer {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  margin: 24px 0 0;
}

/* ---------- buttons, cards, inputs & checkboxes ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: auto;
  min-height: 38px;
  max-width: 100%;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: 600 14px/1.3 var(--lab-sans);
  white-space: normal;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .15s, background-color .15s, color .15s, opacity .15s;
}

.btn:not(.primary):not([aria-pressed="true"]):not(:disabled):hover {
  border-color: var(--text);
  background: var(--surface2);
}

.btn:not(:disabled):active {
  opacity: .84;
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.btn.primary:not(:disabled):hover {
  border-color: var(--primary);
  opacity: .88;
}

.btn.sm {
  min-height: 32px;
  padding: 5px 11px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: .55;
  cursor: default;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1.03rem;
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.35;
}

.card.empty {
  margin-top: 20px;
}

.card.empty > .yn:first-child {
  margin-top: 0;
}

.card.empty > p:last-child {
  margin: 14px 0 0;
}

.card > .yn:only-child {
  margin: 0;
}

.chk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
  cursor: pointer;
}

.chk input {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

#app input:not([type="checkbox"]):not([type="radio"]),
#app select,
#app textarea,
dialog.dlg input:not([type="checkbox"]):not([type="radio"]),
dialog.dlg select,
dialog.dlg textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--lab-sans);
  font-size: 15.5px;
  line-height: 1.45;
  transition: border-color .15s, background-color .15s;
}

#app select option,
dialog.dlg select option {
  background: var(--surface);
  color: var(--text);
}

#app input:not([type="checkbox"]):not([type="radio"]):hover,
#app select:hover,
#app textarea:hover,
dialog.dlg input:not([type="checkbox"]):not([type="radio"]):hover,
dialog.dlg select:hover,
dialog.dlg textarea:hover {
  border-color: var(--muted);
}

#app input:not([type="checkbox"]):not([type="radio"]):focus,
#app select:focus,
#app textarea:focus,
dialog.dlg input:not([type="checkbox"]):not([type="radio"]):focus,
dialog.dlg select:focus,
dialog.dlg textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

#app input::placeholder,
#app textarea::placeholder,
dialog.dlg input::placeholder,
dialog.dlg textarea::placeholder {
  color: var(--faint);
  opacity: 1;
}

/* ---------- start hero, make room, trip promo & joined rooms ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 276px;
  gap: 32px;
  align-items: center;
  padding: 30px 0 22px;
}

.hero-txt {
  min-width: 0;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3.4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
}

.lead {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.62;
  max-width: 44em;
}

.lead b {
  color: var(--text);
}

.hero-img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

#makeForm,
.make {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin: 18px 0 10px;
}

.make .fld {
  flex: 1 1 240px;
  margin: 0;
}

.make .fld > span {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0;
}

#makeForm input {
  background: var(--surface);
  min-height: 44px;
}

#makeForm .btn.primary {
  min-height: 44px;
  padding: 9px 18px;
  font-weight: 700;
}

.sub {
  margin: 10px 0 14px;
}

.sub .btn {
  min-height: 40px;
}

.trip-promo {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  border-left: 3px solid var(--accent);
}

.trip-promo > div {
  min-width: 0;
  flex: 1 1 260px;
}

.trip-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--accent);
  text-transform: uppercase;
}

.trip-promo h2 {
  margin: 0 0 4px;
  font-size: 1.08rem;
}

.trip-promo p {
  margin: 0;
  font-size: 14px;
  line-height: 1.58;
  max-width: 58ch;
}

.trip-promo .btn.primary {
  flex: none;
  min-height: 42px;
  padding: 8px 18px;
}

#roomList .rooms-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.rooms-head h2 {
  margin: 0;
}

.rooms-head .btn[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.rooms-head .btn[aria-pressed="true"]:not(:disabled):hover {
  border-color: var(--primary);
  opacity: .88;
}

.rooms-undo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg);
  font-size: 13.5px;
  color: var(--text);
}

#roomList .rooms {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.rooms li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 2px;
  border-top: 1px solid var(--line);
  min-width: 0;
  transition: background-color .15s;
}

.rooms li:first-child {
  border-top: 0;
  padding-top: 4px;
}

.rooms li:last-child {
  padding-bottom: 2px;
}

.rooms a {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  transition: color .15s;
}

.rooms a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.rooms small {
  flex: none;
  font-family: var(--lab-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.rooms.editing li {
  align-items: center;
}

@media (max-width: 680px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 20px 0 16px;
  }

  .hero-img {
    width: 152px;
    order: -1;
    justify-self: center;
  }
}

/* ---------- Yeoni speech bubbles ---------- */
.yn {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0;
}

.yn-face {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex: none;
  border: 2px solid var(--yn-ring);
  background: #ffffff;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.yn-face.sm {
  width: 36px;
  height: 36px;
  border-width: 1.5px;
}

.yn-bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  background: var(--bubble);
  border: 1px solid var(--bubble-line);
  border-radius: 4px 12px 12px 12px;
  padding: 11px 14px;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--text);
  overflow-wrap: anywhere;
}

.yn-bubble p {
  margin: .2em 0 .6em;
}

.yn-bubble p:last-child {
  margin-bottom: 0;
}

.yn-bubble h3 {
  margin: 15px 0 4px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
}

.yn-bubble h3:first-of-type {
  margin-top: 6px;
}

.yn-name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 3px;
}

.yn-list {
  margin: 4px 0 0;
  padding-left: 1.2em;
  display: grid;
  gap: 5px;
}

.yn-list li {
  margin: 0;
}

.yn-list li.link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 42%, var(--bubble-line));
  text-underline-offset: 3px;
  transition: color .15s, text-decoration-color .15s;
}

.yn-list li.link:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* ---------- room header & two-column layout ---------- */
.room-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 16px;
  align-items: flex-end;
  padding: 24px 0 10px;
}

.room-head > div:first-child {
  min-width: 0;
  flex: 1 1 220px;
}

.room-head h1 {
  margin: 0;
  font-size: clamp(1.375rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.room-head p {
  margin: 3px 0 0;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.head-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-tip {
  margin: 0 0 16px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.cols {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.col-map,
.col-yn {
  min-width: 0;
}

@media (max-width: 899px) {
  .cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}

/* ---------- relationship map card & graph SVG ---------- */
.map-card {
  overflow: hidden;
}

.map-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.map-bar h2 {
  margin: 0;
}

.graph {
  margin: 6px 0 0;
  min-width: 0;
}

#graph svg,
.graph svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 620px;
}

.graph-empty {
  padding: 8px 0;
}

.graph-empty .yn {
  margin: 0;
}

#graph .ln,
.ln {
  stroke-linecap: round;
  pointer-events: none;
  transition: stroke-width .15s, opacity .15s;
}

.ln.g1 { stroke: var(--g1); }
.ln.g2 { stroke: var(--g2); }
.ln.g3 { stroke: var(--g3); }
.ln.b1 { stroke: var(--b1); }
.ln.b2 { stroke: var(--b2); }
.ln.b3 { stroke: var(--b3); }
.ln.mid { stroke: var(--mid); stroke-dasharray: 3 5; }
.ln.dim { opacity: .16; }

#graph .hit,
.hit {
  stroke: transparent;
  stroke-width: 22;
  cursor: pointer;
  pointer-events: stroke;
}

.hit:focus,
.hit:focus-visible {
  outline: none;
}

.hit:hover + .ln,
.hit:focus + .ln,
.hit:focus-visible + .ln {
  stroke-width: 7px;
  opacity: 1;
}

#graph .nd,
.nd {
  cursor: pointer;
}

.nd:focus,
.nd:focus-visible {
  outline: none;
}

.nd.dim svg,
.nd.dim .nd-bg {
  opacity: .32;
}

.nd-bg {
  fill: var(--node-bg);
  stroke: var(--line-strong);
  stroke-width: 1.6;
  transition: stroke .15s, stroke-width .15s, opacity .15s;
}

.nd:hover .nd-bg,
.nd:focus .nd-bg,
.nd:focus-visible .nd-bg {
  stroke: var(--accent);
  stroke-width: 2.6;
}

.nd-name,
.nd-sub {
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 4.5px;
  stroke-linejoin: round;
  stroke-linecap: round;
  font-family: var(--lab-sans);
  text-anchor: middle;
}

.nd-name {
  fill: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.nd-sub {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.graph svg.narrow .nd-name {
  font-size: 16.5px;
}

.graph svg.narrow .nd-sub {
  font-size: 12.5px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 10px 0 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.lg {
  display: inline-block;
  width: 22px;
  height: 4px;
  border-radius: 999px;
  flex: none;
}

.lg.good {
  background: var(--g3);
}

.lg.bad {
  background: var(--b3);
  margin-left: 4px;
}

.lg-note {
  margin-left: auto;
  color: var(--muted);
}

.add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* ---------- people list ---------- */
.people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.people .person {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px 8px 8px;
  background: var(--surface);
  min-width: 0;
  transition: border-color .15s, background-color .15s;
}

.people .person:hover {
  border-color: var(--line-strong);
  background: var(--bg);
}

.people .person.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.p-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 2px;
}

.p-av {
  flex: none;
  display: inline-flex;
}

.p-av svg {
  display: block;
}

.p-txt {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.p-txt b {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  overflow-wrap: anywhere;
}

.p-txt small {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 0;
}

.people .person.on .me {
  background: var(--surface);
  border-color: var(--accent);
}

.p-acts {
  display: flex;
  gap: 6px;
  flex: none;
}

@media (max-width: 420px) {
  .people .person {
    flex-wrap: wrap;
  }

  .p-acts {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ---------- pairs list ---------- */
.pairs-box summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.015em;
  padding: 2px 0;
  border-radius: 6px;
  color: var(--text);
  transition: color .15s;
}

.pairs-box summary:hover {
  color: var(--accent);
}

.pairs {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.pairs button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 9px 6px;
  cursor: pointer;
  text-align: left;
  transition: background-color .15s;
}

.pairs li:first-child button {
  border-top: 0;
}

.pairs button:hover {
  background: var(--surface2);
}

.pairs b {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mid);
  flex: none;
}

.dot.good {
  background: var(--g3);
}

.dot.bad {
  background: var(--b3);
}

.grade {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 1px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface2);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--muted);
  white-space: nowrap;
  flex: none;
}

.grade.good {
  background: var(--good-soft);
  border-color: color-mix(in srgb, var(--good) 28%, var(--line));
  color: var(--good);
}

.grade.bad {
  background: var(--bad-soft);
  border-color: color-mix(in srgb, var(--bad) 28%, var(--line));
  color: var(--bad);
}

/* ---------- person & pair panels ---------- */
.yn-card h2 {
  margin-bottom: 6px;
}

.pp-head,
.pair-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.pp-head > div {
  min-width: 0;
  flex: 1;
}

.pp-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.pp-head p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.close {
  margin-left: auto;
  flex: none;
}

.pair-line {
  flex: 0 1 60px;
  min-width: 18px;
  height: 5px;
  border-radius: 999px;
  background: var(--mid);
}

.pair-line.good {
  background: var(--g3);
}

.pair-line.bad {
  background: var(--b3);
}

h2.pair-title {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.pair-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 0;
}

table.pillars {
  width: 100%;
  border-collapse: separate;
  border-spacing: 5px;
  table-layout: fixed;
  margin: 8px 0 6px;
  text-align: center;
}

.pillars th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  padding: 0 2px 4px;
}

.pillars td {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  background: var(--surface2);
  vertical-align: middle;
}

.pillars .ch {
  display: block;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.2;
  font-family: "Noto Serif KR", "Apple SD Gothic Neo", serif;
}

.pillars small {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.pillars td.none {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.el-목 { color: var(--e-목); }
.el-화 { color: var(--e-화); }
.el-토 { color: var(--e-토); }
.el-금 { color: var(--e-금); }
.el-수 { color: var(--e-수); }

.el-bg-목 { background: var(--e-목); }
.el-bg-화 { background: var(--e-화); }
.el-bg-토 { background: var(--e-토); }
.el-bg-금 { background: var(--e-금); }
.el-bg-수 { background: var(--e-수); }

.el-bars {
  margin: 14px 0 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.el-title {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.el-row {
  display: grid;
  grid-template-columns: 5.8em minmax(0, 1fr) 1.8em;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  margin: 5px 0;
}

.el-name {
  font-weight: 700;
}

.el-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface2);
  overflow: hidden;
}

.el-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width .3s ease;
}

.el-row b {
  text-align: right;
  font-family: var(--lab-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.power {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 12.5px;
  color: var(--muted);
  margin: 4px 0 8px;
}

.pw-track {
  display: inline-flex;
  gap: 3px;
}

.pw-track i {
  width: 12px;
  height: 10px;
  border-radius: 3px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
}

.pw-track i.on {
  background: var(--accent);
  border-color: var(--accent);
}

.daeun {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.daeun ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  gap: 6px;
}

.daeun li {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 4px;
  text-align: center;
  background: var(--bg);
}

.daeun li.now {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.daeun b {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  font-family: "Noto Serif KR", "Apple SD Gothic Neo", serif;
}

.daeun small {
  display: block;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.trip-link {
  margin: 14px 0 0;
}

/* ---------- Ask Yeoni chat ---------- */
.chat h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 1px 8px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted);
}

.chat-log {
  max-height: 520px;
  overflow: auto;
  display: grid;
  gap: 14px;
  margin: 6px 0 14px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.chat-empty {
  margin: 4px 0;
  padding: 14px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--muted);
  text-align: center;
  font-size: 13.5px;
}

.chat-off {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 12px;
  margin: 0 0 10px;
}

.qa .q {
  margin: 0 0 8px;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}

.qa .q b {
  font-weight: 700;
}

.qa .q small {
  color: var(--muted);
  font-size: 12.5px;
}

.qa .q span {
  flex-basis: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px 12px 4px 12px;
  padding: 9px 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.qa.mine .q span {
  border-style: dashed;
  border-color: var(--line-strong);
}

.mine-tag {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}

.qa .a {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.qa .yn-bubble {
  font-size: 14px;
  line-height: 1.58;
  padding: 10px 13px;
}

.qa.failed .yn-bubble {
  background: var(--bad-soft);
  border-color: color-mix(in srgb, var(--bad) 36%, var(--line));
}

.qa .err {
  color: var(--bad);
  font-weight: 600;
  margin: 0;
}

.dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}

.dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: dot 1s infinite alternate;
}

.ask {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.asker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
}

.asker input {
  flex: 1 1 160px;
  max-width: 16em;
  min-width: 0;
}

.ask .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.chip {
  height: auto;
  min-height: 32px;
  max-width: 100%;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 600 13px/1.35 var(--lab-sans);
  white-space: normal;
  text-align: left;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .15s, background-color .15s, color .15s, opacity .15s;
}

.chip:hover {
  border-color: var(--text);
  background: var(--surface2);
}

.chip:active {
  opacity: .84;
}

.who {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 13.5px;
}

.who summary {
  cursor: pointer;
  font-weight: 600;
  border-radius: 4px;
}

.who summary small {
  color: var(--muted);
  font-weight: 500;
}

.who-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  padding: 8px 0 2px;
}

.composer {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  resize: vertical;
  font-size: 15px;
  line-height: 1.5;
}

.composer .btn {
  flex: none;
  min-width: 68px;
}

.ask .fine {
  display: block;
  margin: 0;
}

.byok {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}

.byok summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 0;
  transition: color .15s;
}

.byok summary:hover,
.byok[open] summary {
  color: var(--text);
}

.byok summary .tag {
  margin-left: 6px;
  vertical-align: 1px;
  background: var(--good-soft);
  border-color: color-mix(in srgb, var(--good) 28%, var(--line));
  color: var(--good);
}

.byok-in {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.byok-in p {
  margin: 0;
  line-height: 1.55;
}

.byok-in a {
  color: var(--accent);
  font-weight: 600;
  text-underline-offset: 3px;
}

.byok-in > [data-act="key-forget"] {
  justify-self: start;
}

.byok-why {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.55;
  font-weight: 500;
}

.key-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.key-row input {
  flex: 1 1 0;
  min-width: 0;
}

.key-row .btn {
  flex: none;
  min-height: 42px;
  padding: 0 14px;
}

dialog.lab-ai-dlg .lab-ai-dlg-b .btn {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  box-shadow: none;
}

dialog.lab-ai-dlg .lab-ai-dlg-b .btn:hover {
  opacity: .88;
}

/* ---------- add / edit dialog & shared form fields ---------- */
dialog.dlg {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

dialog.dlg::backdrop {
  background: var(--shade);
}

.dlg-in {
  padding: 18px 20px 20px;
}

.dlg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.dlg-head h2 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -.015em;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dlg-note {
  font-size: 13.5px;
  line-height: 1.55;
  background: var(--bubble);
  border: 1px solid var(--bubble-line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 9px 12px;
  margin: 0 0 14px;
  color: var(--text);
}

.fld {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  border: 0;
  padding: 0;
  min-width: 0;
}

#app fieldset,
dialog.dlg fieldset {
  min-width: 0;
}

.fld > span,
.fld > legend {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  padding: 0;
  margin-bottom: 4px;
}

.fld > span {
  margin-bottom: 0;
}

.fld em {
  font-style: normal;
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  margin-left: 4px;
}

.fld small,
.dlg small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.48;
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow: var(--shadow);
  width: max-content;
  max-width: 100%;
  overflow: visible;
}

.seg label {
  position: relative;
  cursor: pointer;
}

.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  margin: 0;
}

.seg span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 13px;
  border: 0;
  border-radius: calc(var(--radius-sm) - 3px);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: color .15s, background-color .15s;
}

.seg label + label span {
  border-left: 0;
}

.seg label:hover input:not(:checked) + span {
  color: var(--text);
  background: var(--surface2);
}

.seg input:checked + span {
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
}

.seg input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.ymd {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.leap {
  margin-top: 4px;
}

.leap[hidden] {
  display: none;
}

.solar-of {
  margin-top: 2px;
}

.time-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.time-row input {
  flex: 1 1 150px;
  min-width: 0;
}

.time-row .chk {
  flex: none;
}

.sub-fld {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.show {
  margin-top: 4px;
}

.dlg-err {
  margin: 10px 0 0;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--bad) 34%, var(--line));
  border-left: 3px solid var(--bad);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.48;
}

.dlg-err[hidden] {
  display: none;
}

.dlg-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.dlg-foot .btn {
  min-width: 112px;
  min-height: 40px;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-lg);
  font-family: var(--lab-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  transition: opacity .2s, transform .2s;
}

.toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 2027 travel saju pages ---------- */
.wrap > .trip-form,
.wrap > .trip-back,
.wrap > .trip-head,
.wrap > .trip-head ~ .card,
.wrap > .trip-acts,
.wrap > .trip-fine {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.trip-form,
.trip-head {
  margin-top: 20px;
}

.trip-form h1,
.trip-head h1 {
  margin: 0 0 6px;
  font-size: clamp(1.32rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.trip-f {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  max-width: min(30em, 100%);
}

.trip-f .fld {
  margin: 0;
}

.trip-f .btn.primary {
  justify-self: start;
  min-height: 44px;
  padding: 9px 20px;
  font-weight: 700;
}

.trip-back,
.trip-fine {
  margin-top: 6px;
  margin-bottom: 16px;
}

.trip-head {
  display: flex;
  gap: 16px;
  align-items: center;
}

.trip-head > div {
  min-width: 0;
  flex: 1;
}

.trip-head p {
  margin: 0;
}

.trip-months {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 5px;
  align-items: end;
  margin: 8px 0 14px;
}

.trip-months .tm {
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 12.5px;
  padding: 6px 3px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.tm b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tm small {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.15;
}

.tm.best {
  background: var(--good-soft);
  border-color: var(--good);
  outline: none;
  box-shadow: 0 0 0 1px var(--good) inset;
}

.tm.best b {
  color: var(--good);
  font-weight: 700;
}

.tm.avoid b {
  color: var(--bad);
  font-weight: 700;
}

.trip-months .tm .tm-bar {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 64px;
  width: 100%;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}

.tm-bar i {
  display: block;
  width: 58%;
  min-height: 4px;
  border-radius: 4px 4px 2px 2px;
}

.tm-bar i.up {
  background: var(--g2);
}

.tm.best .tm-bar i.up {
  background: var(--g3);
}

.tm-bar i.down {
  background: var(--b2);
}

.trip-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
  font-size: 14px;
  line-height: 1.55;
}

.trip-list small {
  color: var(--muted);
  font-size: 12.5px;
}

.trip-sub {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 16px 0 8px;
}

.trip-places {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(144px, 100%), 1fr));
  gap: 8px;
}

.trip-places li {
  display: grid;
  gap: 8px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: var(--bg);
  min-width: 0;
  transition: border-color .15s;
}

.trip-places li:hover {
  border-color: var(--line-strong);
}

.trip-places b {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.trip-places .btn {
  justify-self: start;
}

.trip-buddies {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.trip-buddies li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  min-width: 0;
}

.trip-buddies li > div {
  min-width: 0;
  flex: 1;
}

.trip-buddies b {
  font-size: 14.5px;
  font-weight: 700;
}

.trip-buddies small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.trip-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 10px;
}

.trip-acts .btn {
  min-height: 42px;
  padding: 8px 16px;
}

/* ---------- mobile responsiveness (360px - 520px) ---------- */
@media (max-width: 520px) {
  .yn.long {
    flex-direction: column;
    gap: 6px;
  }

  .yn.long .yn-face {
    width: 44px;
    height: 44px;
  }

  .yn.long .yn-bubble {
    border-radius: 12px;
  }

  .pw-track i {
    width: 10px;
  }

  .trip-months {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px 4px;
  }

  .el-row {
    grid-template-columns: 5em minmax(0, 1fr) 1.6em;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .make .btn.primary,
  .sub .btn,
  .trip-promo .btn.primary,
  .trip-f .btn.primary {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .wrap {
    padding: 0 12px 72px;
  }

  .card {
    padding: 14px;
    margin-bottom: 14px;
  }

  .room-head {
    padding: 18px 0 8px;
  }

  .hero-img {
    width: 144px;
  }

  .add-row .btn,
  .trip-acts .btn {
    flex: 1 1 140px;
  }

  .pp-head {
    gap: 10px;
  }

  .pp-head .p-av svg {
    width: 54px;
    height: 54px;
  }

  .trip-head {
    gap: 12px;
  }

  .trip-head .p-av svg {
    width: 58px;
    height: 58px;
  }

  .trip-places li {
    padding: 10px;
  }

  table.pillars {
    border-spacing: 4px;
  }

  .pillars td {
    padding: 7px 2px;
  }

  .pillars .ch {
    font-size: 1.5rem;
  }

  .pillars small {
    font-size: 11px;
  }

  .dlg-in {
    padding: 16px;
  }

  .ymd select {
    padding: 8px 6px;
    font-size: 14.5px;
  }

  .dlg-foot .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .chip,
  .people .person,
  .pairs button,
  .rooms li,
  .rooms a,
  .trip-places li,
  .yn-list li.link,
  .ln,
  .nd-bg,
  .el-fill,
  .seg span,
  .toast,
  .dots i,
  #app input,
  #app select,
  #app textarea,
  dialog.dlg input,
  dialog.dlg select,
  dialog.dlg textarea {
    transition: none;
    animation: none;
  }
}
