:root, html[data-mode="dark"] {
  color-scheme: dark;
  --bg: #0c1016;
  --outer: #0c1016;
  --card: #171c27;
  --ink: #e7e9ef;
  --ink-soft: #9aa3b5;
  --muted: #9aa3b5;
  --line: #2c3444;
  --accent: #8ea2c4;
  --sage: #9aafd0;
  --soft: #222838;
  --field: #10151e;
  --seg: #121722;
  --seg-on: #262e3e;
  --gate-a: #171d29;
  --gate-b: #0b0e14;
  --hover-wash: rgba(255, 255, 255, 0.06);
  --font: "Pretendard", "IBM Plex Sans KR", system-ui, sans-serif;
  --display: "Pretendard", "IBM Plex Sans KR", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
html[data-mode="light"] {
  color-scheme: light;
  --bg: #efeae0;
  --outer: #efeae0;
  --card: #fffdf9;
  --ink: #2a2824;
  --ink-soft: #8a8478;
  --muted: #8a8478;
  --line: #e4ddd2;
  --accent: #2d4b3e;
  --sage: #2d4b3e;
  --soft: #f3efe7;
  --field: #f3efe7;
  --seg: #efeae1;
  --seg-on: #ffffff;
  --gate-a: #f7f4ee;
  --gate-b: #efeae0;
  --hover-wash: rgba(255, 255, 255, 0.55);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--outer);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  letter-spacing: -0.02em;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2.5rem 1.25rem;
  background: radial-gradient(ellipse at center, var(--gate-a) 0%, var(--gate-b) 72%);
}
.mode-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.gate-wrap { width: min(380px, 100%); text-align: center; }
.gate-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}
.site-row { display: flex; gap: 0.4rem; align-items: center; }
.site-row input { flex: 1; min-width: 0; }
.site-row .btn { flex: none; border-radius: 12px; padding: 0.72rem 0.75rem; white-space: nowrap; }
.site-check { min-height: 1.2em; margin: -0.2rem 0 0.45rem; font-size: 0.78rem; }
.site-check.ok { color: var(--sage); }
.site-check.bad { color: #8d4d45; }
.gate-notes {
  margin: 0.95rem 0 0;
  padding: 0;
  list-style: none;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.75rem;
  line-height: 1.65;
}
.gate .brand {
  margin: 0 0 1.1rem;
  font-family: "Noto Serif KR", serif;
  font-size: 3.15rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--ink);
  text-align: center;
}
.gate-sub {
  margin: 0.55rem 0 1.15rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.gate-card, .card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 0 #fff inset;
}
.gate-card {
  width: 100%;
  padding: 0.85rem 0.9rem 0.7rem;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(70, 58, 40, 0.05);
}
.brand {
  margin: 0;
  font-family: var(--display);
  font-size: 2rem;
}
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.gate .seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  margin: 0 0 0.95rem;
  padding: 0.22rem;
  background: var(--seg);
  border-radius: 12px;
}
.gate .seg button {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.55rem 0.4rem;
  color: var(--ink-soft);
  font-weight: 650;
  box-shadow: none;
}
.gate .seg button.active {
  background: var(--seg-on);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(40, 32, 20, 0.08);
}
.gate label.field { color: var(--ink); font-size: 0.8rem; font-weight: 600; }
.gate input {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.72rem 0.8rem;
}
.gate-submit {
  width: 100%;
  margin-top: 0.25rem;
  border-radius: 12px;
  padding: 0.78rem 0.8rem;
  font-size: 0.95rem;
}
.gate .err { text-align: center; }

.seg { display: flex; gap: 0.35rem; margin: 0.9rem 0; }
.seg button, .btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  font-weight: 600;
}
.seg button.active, .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.tiny { padding: 0.18rem 0.55rem; font-size: 0.78rem; }
.btn.ghost { background: transparent; }

label.field, div.field { display: grid; gap: 0.22rem; margin-bottom: 0.65rem; font-size: 0.84rem; color: var(--muted); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--field);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
}
textarea { min-height: 6.5rem; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-color: var(--accent);
}
.row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.gate-actions { justify-content: center; margin-top: 0.4rem; }
.err { color: #8d4d45; min-height: 1.2em; font-size: 0.86rem; }

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.2rem 0.9rem;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 70%, var(--bg));
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.rail nav { display: grid; gap: 0.2rem; margin-top: 0.8rem; }
.rail button.navbtn {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  cursor: pointer;
}
.rail button.navbtn.active { background: var(--accent); color: #fff; }
.rail .grow { flex: 1; }
.code {
  font-family: var(--display);
  font-size: 1.15rem;
  margin: 0.2rem 0;
}
.stage { padding: 1.3rem 1.4rem 2.4rem; min-width: 0; }
.stage h2 {
  margin: 0 0 0.7rem;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 700;
}
.grid-2 { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 0.8rem; }
.stack { display: grid; gap: 0.75rem; align-content: start; }
.panel { padding: 0.95rem 1rem 1rem; }
.panel h3 { margin: 0 0 0.55rem; font-size: 1rem; }

.list { display: grid; gap: 0.45rem; }
.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.6rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}
.item h3, .item p { margin: 0; }
.item p { color: var(--muted); font-size: 0.86rem; white-space: pre-wrap; }
.tag {
  display: inline-block;
  margin-right: 0.3rem;
  padding: 0.02rem 0.4rem;
  border-radius: 999px;
  background: var(--soft);
  font-size: 0.74rem;
  font-weight: 600;
}

.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.22rem; text-align: center; }
.cal-head { color: var(--muted); font-size: 0.74rem; margin-bottom: 0.25rem; }
.day {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  min-height: 2.3rem;
  border-radius: 8px;
  cursor: pointer;
}
.day.mute { color: #b0b6ae; }
.day.has { background: var(--soft); font-weight: 600; }
.day.today { border-color: var(--accent); }
.day.on { background: var(--accent); color: #fff; }
.month-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.45rem; }
.month-bar strong { font-family: var(--display); }

.stars button {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 1.2rem;
  color: #c5cdc2;
  cursor: pointer;
  padding: 0 0.05rem;
}
.stars button.on { color: var(--accent); }

.page { width: min(860px, calc(100% - 2rem)); margin: 0 auto; padding: 1.4rem 0 3rem; }
.page-top { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 0.8rem; }
.page h1 { margin: 0; font-family: var(--display); font-size: 2.1rem; }
.handle { margin: 0.15rem 0 0; color: var(--muted); }
.page-nav { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.8rem 0 1rem; }
.page-nav a {
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.86rem;
}
.block { margin: 0 0 0.8rem; padding: 1rem 1.05rem; }
.block h2 { margin: 0 0 0.45rem; font-family: var(--display); font-size: 1.25rem; }
.checks { display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; margin-bottom: 0.8rem; }
.checks label { display: flex; gap: 0.35rem; align-items: center; color: var(--ink); font-size: 0.92rem; }

.colors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.colors input[type="color"] { padding: 0.2rem; height: 2.4rem; }

.app-page {
  min-height: 100vh;
  padding: 24px;
  display: flex;
  justify-content: center;
  background: var(--outer);
  box-sizing: border-box;
}
.app-shell { width: min(1400px, 100%); display: flex; flex-direction: column; gap: 24px; }
.topbar { display: flex; flex-direction: column; gap: 24px; }
.topbar-row1 { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 0 4px 0 28px; }
.topbar-brand-name { font-weight: 800; font-size: 1.1rem; color: var(--sage); text-decoration: none; }
.topbar-tagline { margin: 2px 0 0; font-size: 0.7rem; color: var(--ink-soft); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.cloud-note { font-size: 0.72rem; color: var(--ink-soft); }
.header-icon-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; text-decoration: none;
}
.header-icon-btn:hover { background: var(--outer); color: var(--ink); }
.topbar-tabs-row { position: relative; z-index: 2; padding-left: 8px; }
.topbar-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar-tab {
  appearance: none; border: 1px solid transparent; background: transparent;
  font-size: 0.75rem; font-weight: 700; padding: 10px 20px;
  border-radius: 12px 12px 0 0; color: var(--ink-soft); cursor: pointer; white-space: nowrap;
}
.topbar-tab:hover { background: var(--hover-wash); color: var(--sage); }
.topbar-tab.active {
  background: var(--card); border-color: var(--line); border-top: 2px solid var(--sage);
  border-bottom-color: var(--card); color: var(--sage); margin-bottom: -1px; position: relative; z-index: 3;
}
.body-layout { display: flex; gap: 24px; align-items: flex-start; margin-top: -24px; }
.main-col {
  flex: 1; min-width: 0; padding: 24px 28px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; border-top: 5px solid var(--sage);
  box-shadow: 0 12px 45px -10px color-mix(in srgb, var(--sage) 6%, transparent);
}
.pane-head { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pane-head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.side-col { flex: none; width: 260px; display: flex; flex-direction: column; gap: 16px; }
.side-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 16px 14px;
  box-shadow: 0 8px 30px color-mix(in srgb, var(--sage) 3%, transparent);
}
.mini-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--ink-soft); }
.mini-nav { display: flex; gap: 2px; }
.mini-nav button { appearance: none; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1rem; padding: 0 4px; }
.mini-nav button:hover { color: var(--sage); }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.mini-dow { font-family: var(--mono); font-size: 0.62rem; color: var(--ink-soft); padding-bottom: 4px; }
.mini-cell {
  appearance: none; border: 0; background: transparent; color: var(--ink);
  height: 22px; border-radius: 5px; font-family: var(--mono); font-size: 0.68rem; cursor: pointer; padding: 0;
  position: relative;
}
.mini-cell.empty { visibility: hidden; }
.mini-cell.is-today { background: var(--sage); color: #fff; font-weight: 700; }
.mini-cell.is-picked:not(.is-today) { box-shadow: inset 0 0 0 1px var(--sage); color: var(--sage); }
.mini-cell.has::after { content: ""; position: absolute; bottom: 1px; left: 50%; width: 3px; height: 3px; border-radius: 50%; background: var(--sage); transform: translateX(-50%); }
.mini-cell.is-today.has::after { background: #fff; }
.mini-cell:not(.empty):not(.is-today):hover { background: var(--outer); color: var(--sage); }
.side-card h3 { margin: 0 0 8px; font-family: var(--mono); font-size: 0.78rem; font-weight: 500; color: var(--ink-soft); }
.event-add-row { display: flex; justify-content: flex-end; margin: 0 0 0.35rem; }
.event-add { display: flex; align-items: center; gap: 0.3rem; margin: 0 0 0.4rem; }
.event-add input { flex: 1; min-width: 0; padding: 0.22rem 0.4rem; font-size: 0.78rem; }
.event-add .btn { padding: 0.12rem 0.4rem; font-size: 0.68rem; }
.roster-stack { display: flex; flex-direction: column; background: var(--sage); border-radius: 16px; overflow: hidden; }
.roster-card {
  display: grid; gap: 2px; text-decoration: none; color: #fff;
  background: transparent; padding: 14px 18px;
}
.roster-stack .roster-card + .roster-card { border-top: 1px solid rgba(255, 255, 255, 0.28); }
.roster-note {
  margin: 0; padding: 0.55rem 18px 0.75rem; border-top: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.68rem; line-height: 1.4; color: rgba(255, 255, 255, 0.88);
}
.roster-card span { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; opacity: 0.75; }
.roster-card strong { font-size: 0.95rem; }
.tool-main { padding: 1.2rem 1.3rem 2rem; }
.day-sheet { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1.2rem; align-items: start; max-width: 40rem; }
.day-mark { display: grid; justify-items: start; gap: 0.15rem; padding-top: 0.2rem; }
.day-mark b { font-family: var(--display); font-size: 1.8rem; line-height: 1; font-weight: 700; }
.day-mark span, .day-mark em { font-size: 0.78rem; color: var(--ink-soft); font-style: normal; }
.day-body h2 { margin: 0 0 0.7rem; font-size: 0.95rem; font-weight: 700; }
.day-body h3 { margin: 1.1rem 0 0.35rem; font-size: 0.78rem; color: var(--ink-soft); font-weight: 700; }
.day-add { display: flex; flex-wrap: nowrap; gap: 0.45rem; align-items: center; }
.day-add input, .mark-add input, .note-sheet input, .note-sheet textarea {
  width: 100%; min-width: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; padding: 0.35rem 0.1rem; font: inherit;
}
.day-add input[name="text"] { flex: 1; width: auto; }
.day-add select, .day-add input[type="time"] {
  flex: none; width: auto; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; padding: 0.35rem 0.1rem; font: inherit; color: inherit;
}
.day-add .btn { flex: none; white-space: nowrap; }
.day-meta { flex: none; font-style: normal; font-size: 0.75rem; color: var(--ink-soft); }
.day-list { list-style: none; margin: 0.55rem 0 0; padding: 0; display: grid; }
.day-task, .day-empty { display: flex; align-items: center; gap: 0.45rem; padding: 0.42rem 0; border-bottom: 1px solid var(--line); font-size: 0.78rem; }
.day-task span { flex: 1; min-width: 0; }
.day-task.is-done span { color: var(--ink-soft); text-decoration: line-through; }
.day-empty { color: var(--ink-soft); font-size: 0.82rem; }
.day-check {
  width: 0.95rem; height: 0.95rem; border-radius: 50%; border: 1px solid var(--ink-soft);
  background: transparent; padding: 0; cursor: pointer; flex: none;
}
.day-check.on { background: var(--sage); border-color: var(--sage); }
.day-move { border: 0; background: transparent; color: var(--ink-soft); font-size: 0.68rem; cursor: pointer; padding: 0; }
.desk-split { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 1.4rem; align-items: start; }
.note-desk header, .mark-desk h2 { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.note-desk h2, .mark-desk h2 { margin: 0 0 0.7rem; font-size: 1.15rem; }
.note-index { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.7rem; }
.note-tab { border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--ink-soft); cursor: pointer; padding: 0.15rem 0.1rem; font: inherit; }
.note-tab.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }
.note-sheet textarea { min-height: 14rem; line-height: 1.9; resize: vertical; background-image: repeating-linear-gradient(transparent, transparent 1.75rem, var(--line) 1.8rem); }
.mark-desk { padding: 0.9rem 0.95rem 1rem; border-radius: 16px; background: var(--field); }
.note-compose textarea { min-height: 5.5rem; }
.note-board { display: grid; gap: 0.45rem; margin-top: 0.8rem; }
.note-card .note-title { font-size: 0.86rem; }
.note-card .guest-text { text-align: left; font-size: 0.78rem; }
.mark-add { display: grid; grid-template-columns: 1fr; gap: 0.15rem; margin-bottom: 0.8rem; }
.mark-add .btn { justify-self: start; margin-top: 0.2rem; }
.mark-shelf { display: grid; gap: 0.45rem; }
.mark-card { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.mark-actions { display: flex; align-items: center; gap: 0.4rem; flex: none; }
.mark-card a { display: grid; color: inherit; text-decoration: none; min-width: 0; }
.mark-card b { grid-row: 1 / span 2; width: 1.7rem; height: 1.7rem; border-radius: 8px; display: grid; place-items: center; background: var(--card); font-size: 0.8rem; }
.mark-card strong, .mark-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark-card span { font-size: 0.72rem; color: var(--ink-soft); }
.settings-overlay { position: fixed; inset: 0; background: rgba(30,42,34,0.35); display: flex; align-items: center; justify-content: center; z-index: 50; }
.settings-modal {
  width: min(360px, calc(100vw - 2rem)); max-height: 85vh; overflow: auto;
  background: var(--outer); border-radius: 18px; padding: 20px;
  box-shadow: 0 24px 48px -20px rgba(30,42,34,0.4);
}
.settings-modal h3 { margin: 0 0 12px; font-size: 1rem; }
.settings-label { margin: 0.85rem 0 0.35rem; font-size: 0.78rem; color: var(--ink-soft); }
.settings-modal .checks { display: grid; grid-template-columns: 1fr; gap: 0.28rem; margin: 0 0 0.8rem; }
.settings-modal .checks label { justify-content: space-between; width: 100%; white-space: nowrap; font-size: 0.86rem; }
.settings-modal .checks input { width: auto; flex: none; margin: 0; }
.main-col .field textarea { min-height: 4.2rem; }
.who { margin: 0.15rem 0 0.35rem; font-size: 1.35rem; font-weight: 800; }
.profile { display: grid; }
.profile-view { display: grid; grid-template-columns: 120px minmax(0, 1fr); column-gap: 0.75rem; align-items: start; }
.profile-view .avatar-col { width: 120px; }
.avatar-col { display: flex; flex-direction: column; gap: 0.65rem; min-width: 0; }
.profile-copy { min-width: 0; }
.profile-name { margin-top: 0.85rem; }
.contact-label { margin: 0.15rem 0 0; font-size: 0.78rem; color: var(--ink-soft); }
.avatar-wrap { display: flex; align-items: flex-start; gap: 0.8rem; }
.photo-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; margin-top: 2.1rem; }
#clear-photo { background: #a33d3d; border-color: #a33d3d; color: #fff; }
#clear-photo:hover { background: #8d3232; border-color: #8d3232; }
.avatar {
  width: 120px; height: 120px; border-radius: 18px; object-fit: cover;
  background: var(--field); border: 1px solid var(--line); display: grid; place-items: center;
  font-size: 2rem; font-weight: 700; color: var(--ink-soft); overflow: hidden;
}
.photo-btn { cursor: pointer; }
.photo-hint { margin: 0; font-size: 0.72rem; color: var(--ink-soft); line-height: 1.3; }
.intro { margin: 0.15rem 0 0.7rem; line-height: 1.65; word-break: break-word; }
.intro-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.45rem; }
.intro-size { display: flex; align-items: center; gap: 0.35rem; margin: 0; font-size: 0.75rem; color: var(--ink-soft); }
.intro-tools select { width: auto; padding: 0.28rem 0.45rem; border-radius: 999px; background: var(--field); }
.intro-color { display: flex; align-items: center; gap: 0.3rem; margin: 0; font-size: 0.75rem; color: var(--ink-soft); }
.intro-color input { width: 2rem; height: 1.6rem; padding: 0.1rem; }
.intro-edit {
  min-height: 11rem;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--field);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  line-height: 1.65;
  outline: none;
}
.intro-edit:focus { border-color: var(--accent); }
.contact-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.3rem 0 0.8rem; }
.contact-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem;
  width: 4.8rem; text-align: center; text-decoration: none;
  border: 1px solid var(--line); background: var(--field); border-radius: 12px;
  padding: 0.55rem 0.35rem;
}
.contact-card img, .contact-card .mark { width: 26px; height: 26px; }
.contact-card .kakao { color: #fee500; }
.contact-card em { display: block; font-style: normal; font-size: 0.68rem; color: var(--ink-soft); word-break: break-all; }
.rel-form { margin-bottom: 0.8rem; }
.rel-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.rel-person { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; min-width: 0; }
.rel-person.view { flex-direction: column; align-items: center; text-align: center; gap: 0.55rem; }
.rel-person.view .rel-photo { width: 200px; height: 200px; border-radius: 22px; font-size: 2rem; }
.memo-edit { min-height: 6.5rem; }
.rel-person .field { width: 100%; }
.rel-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.rel-photo {
  width: 96px; height: 96px; border-radius: 16px; object-fit: cover; flex: none;
  background: var(--field); border: 1px solid var(--line); display: grid; place-items: center;
  font-size: 1.2rem; font-weight: 700; color: var(--ink-soft); overflow: hidden;
}
.rel-card {
  padding: 0.95rem 1.35rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}
.card-head { display: flex; align-items: flex-start; gap: 0.7rem; }
.card-head .band-year { flex: 1; }
.fold-btn { margin-left: auto; flex: none; padding: 0.08rem 0.42rem; font-size: 0.68rem; line-height: 1.3; }
.log-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.log-switch { display: flex; align-items: center; gap: 0.28rem; margin-left: auto; }
.log-switch button {
  border: 0; background: transparent; color: var(--ink-soft); font: inherit; cursor: pointer; padding: 0.1rem 0.2rem;
}
.log-switch button.active { color: var(--ink); font-weight: 800; }
.log-bar { color: var(--line); }
.log-shelf { display: flex; flex-wrap: wrap; gap: 0.9rem 0.75rem; align-items: flex-start; }
.log-empty { flex: 1; }
.log-tile {
  width: 132px; display: flex; flex-direction: column; align-items: center; gap: 0.28rem;
  padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: center;
}
.log-tile strong { font-size: 0.84rem; line-height: 1.35; font-weight: 700; }
.log-stars { margin: 0; letter-spacing: 0.05em; color: var(--ink-soft); font-size: 0.78rem; }
.log-tile .log-cover, .log-pop .log-cover {
  width: 132px; height: 176px; border-radius: 10px; object-fit: cover; display: block;
  background: var(--card); border: 1px solid var(--line);
}
.log-pop .log-cover { width: 180px; height: 240px; }
.log-pop {
  width: min(420px, 100%); background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 18px; padding: 0.9rem 1rem 1.1rem;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.28rem;
}
.log-pop h3 { margin: 0 0 0.35rem; font-size: 1.15rem; font-weight: 800; }
.log-pop .tag { margin: 0.2rem 0 0; }
.log-by { margin: 0; color: var(--ink-soft); }
.log-review {
  margin: 0.45rem auto 0; width: min(100%, 18rem); text-align: center;
  white-space: pre-wrap; line-height: 1.55;
}
.log-pop-bar { display: flex; justify-content: flex-end; align-items: center; gap: 0.3rem; width: 100%; }
#log-pop-close { align-self: auto; }
.rel-pick .log-cover { width: 120px; height: 160px; border-radius: 10px; object-fit: cover; display: block; background: var(--card); border: 1px solid var(--line); }
.heart { border: 0; background: transparent; color: var(--ink-soft); font: inherit; cursor: pointer; padding: 0.2rem 0; }
.heart.on { color: #d4536a; }
.guest-who { display: flex; align-items: center; justify-content: flex-start; gap: 0.4rem; width: 100%; color: inherit; text-decoration: none; font-weight: 700; text-align: left; }
.mini-face { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); overflow: hidden; font-size: 0.78rem; }
.guest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; align-items: stretch; }
.guest-card {
  display: flex; flex-direction: column; align-items: stretch; text-align: left;
  gap: 0.35rem; padding: 0.55rem 0.6rem 0.45rem;
  border: 1px solid var(--line); border-radius: 12px; background: var(--field); min-width: 0;
}
.guest-card.is-editing { grid-column: 1 / -1; }
.guest-foot { display: flex; justify-content: flex-end; align-items: center; gap: 0.28rem; margin-top: auto; }
.guest-foot .heart { padding: 0; font-size: 0.72rem; line-height: 1; }
.guest-card .profile-actions { justify-content: flex-end; margin: 0; width: auto; gap: 0.15rem; }
.guest-foot .btn {
  border: 0; background: transparent; border-radius: 0; box-shadow: none;
  padding: 0 0.15rem; font-size: 0.68rem; font-weight: 500; color: var(--ink-soft);
}
.guest-text { margin: 0.05rem 0; color: var(--ink); font-size: 0.78rem; line-height: 1.45; word-break: break-word; width: 100%; text-align: center; }
.guest-label { font-size: 0.78rem; color: var(--ink-soft); text-align: left; }
.guest-form { text-align: left; }
.guest-signin { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; justify-items: start; }
.guest-signin .field { width: 100%; text-align: left; }
.guest-compose-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 0.35rem; }
.guest-submit { display: flex; align-items: center; gap: 0.35rem; }
.guest-lock.on { color: var(--accent); border-color: var(--accent); }
.guest-lock-mark { margin-left: auto; display: inline-flex; color: var(--ink-soft); }
.guest-lock-mark svg { width: 14px; height: 14px; }
.guest-seal-note, .guest-sealed { color: var(--ink-soft); }
.guest-seal-note { margin: 0.35rem 0 0; font-size: 0.72rem; }
.guest-lock-mark { margin-left: auto; font-style: normal; font-size: 0.66rem; font-weight: 600; color: var(--ink-soft); }
.guest-compose-bar .intro-tools { margin-top: 0; }
.guest-form .intro-edit { min-height: 4.2rem; text-align: left; font-size: 0.78rem; }
.guest-pager { display: flex; justify-content: center; align-items: center; gap: 0.7rem; margin-top: 0.7rem; }
.guest-pager span { font-variant-numeric: tabular-nums; }
.fold-names { font-weight: 700; line-height: 1.4; }
.fold-title { font-weight: 800; }
.year-split { flex: 1; height: 0; margin: 0.55rem 0 0.85rem; border-top: 1px solid var(--line); }
.rel-card.is-folded .card-body { display: none; }
.rel-card[draggable="true"] { cursor: grab; }
.rel-card.dragging { opacity: 0.45; }
.rel-card.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.rel-card.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.band-year {
  margin: 0 0 0.95rem;
  padding: 0.15rem 0.15rem 0.7rem;
  font-weight: 800;
  font-size: 1.45rem;
  line-height: 1;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.band-dim { font-size: 0.72rem; font-weight: 500; color: var(--ink-soft); }
.rel-kind { margin: 0.75rem 0 0; color: var(--ink); font-weight: 800; text-align: center; font-size: 1.05rem; }
.rel-memo { margin-top: 0.35rem; text-align: center; }
.profile-actions { display: flex; justify-content: flex-end; gap: 0.35rem; margin-top: 0.8rem; }
.profile-actions .btn { padding: 0.18rem 0.62rem; font-size: 0.75rem; font-weight: 600; }
.guest-foot .profile-actions .btn {
  border: 0; background: transparent; border-radius: 0;
  padding: 0 0.12rem; font-size: 0.68rem; font-weight: 500; color: var(--ink-soft);
}
.crop-overlay {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  background: rgba(8, 10, 16, 0.62); padding: 1rem;
}
.crop-card {
  width: min(360px, 100%); background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 18px; padding: 1rem;
}
.crop-title { margin: 0 0 0.7rem; font-weight: 700; }
#crop-view { width: 100%; height: auto; border-radius: 12px; cursor: grab; touch-action: none; background: #000; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail nav { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .colors { grid-template-columns: 1fr; }
  .rel-pair { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .rel-person.view .rel-photo { width: 100%; max-width: 200px; height: auto; aspect-ratio: 1; }
  .app-page { padding: 12px; }
  .body-layout { flex-direction: column; }
  .main-col { width: 100%; flex: none; }
  .side-col { width: 100%; }
  .topbar-row1 { padding-left: 8px; }
  .topbar-tabs { flex-wrap: nowrap; width: 100%; }
  .topbar-tab { flex: 1 0 0; padding: 10px 2px; font-size: 0.68rem; text-align: center; }
  .day-sheet, .desk-split { grid-template-columns: 1fr; }
}
