/* ============================================
   Fanlog — Design System
   white main + red accent
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Ceviche+One&family=Black+Han+Sans&family=Gowun+Batang:wght@400;700&family=Pretendard:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

:root {
  /* surfaces */
  --bg:        #ffffff;
  --surface:   #f6f6f8;
  --surface2:  #ededf0;
  --border:    #e2e2e8;
  --border2:   #ceceda;

  /* text */
  --text:      #0e0e12;
  --text2:     #56565f;
  --text3:     #9898a4;

  /* accents — red point */
  --red:       oklch(0.54 0.21 24);
  --red-soft:  oklch(0.42 0.16 24);
  --red-bg:    oklch(0.97 0.02 24);
  --gold:      oklch(0.60 0.13 80);

  /* shape */
  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  /* type */
  --font-logo:    'Ceviche One', serif;
  --font-heading: 'Black Han Sans', 'Gowun Batang', sans-serif;
  --font-serif:   'Gowun Batang', 'Noto Serif KR', serif;
  --font-sans:    'Pretendard', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* spacing */
  --pad: clamp(16px, 4vw, 32px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(circle at 15% 10%, oklch(0.97 0.02 24), transparent 38%),
    radial-gradient(circle at 85% 90%, oklch(0.98 0.01 24), transparent 40%);
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }

/* ── HEADER ───────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px var(--pad);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-family: var(--font-logo);
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0e0e12;
  -webkit-text-stroke: 1.5px var(--red);
  paint-order: stroke fill;
  outline: none;
  position: relative;
}
.site-title::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 1px; background: var(--red);
  transform: scaleX(0.3); transform-origin: left;
  transition: transform 0.3s;
}
.site-title:hover::after { transform: scaleX(1); }

nav {
  display: flex; gap: 4px; align-items: center;
}

.nav-link {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--text2);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  position: relative;
}
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link.active { color: var(--text); }
.nav-link.active::before {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 1.5px; background: var(--red);
}

#edit-toggle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 7px 12px;
  margin-left: 8px;
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
#edit-toggle:hover { color: var(--text); border-color: var(--text3); }
.edit-mode #edit-toggle { color: var(--red); border-color: var(--red-soft); background: var(--red-bg); }

/* ── MAIN ─────────────────────────────────── */
main {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem var(--pad) 5rem;
}

/* ── SECTION TITLE ────────────────────────── */
.section-title {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  margin: 0 0 1.25rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: baseline; gap: 10px;
}
.section-title:lang(en) { letter-spacing: 0.18em; text-transform: uppercase; }
.section-title::before {
  content: ''; width: 6px; height: 6px;
  background: var(--red); display: inline-block;
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* ── HERO ─────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  filter: brightness(0.55) saturate(0.9);
}
.hero-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--text3);
  background-image:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(0,0,0,0.025) 14px 28px);
}
.hero-content {
  position: absolute; left: var(--pad); right: var(--pad); bottom: 8%;
  max-width: 800px; margin: 0 auto;
}
.hero-title {
  font-family: var(--font-logo);
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.55);
  outline: none;
  margin-bottom: 8px;
}
.hero-title::first-letter { color: oklch(0.82 0.14 24); }
.hero-sub {
  font-family: var(--font-serif);
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  color: rgba(255,255,255,0.82);
  outline: none;
  max-width: 540px;
}
.hero-upload-btn {
  position: absolute; top: 14px; right: 14px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 6px 11px;
  background: rgba(255,255,255,0.75);
  color: var(--text2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: none;
  transition: all 0.15s;
}
.hero-upload-btn:hover { color: var(--text); border-color: var(--red-soft); }
.edit-mode .hero-upload-btn { display: inline-flex; }

/* ── BUTTONS ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 9px 16px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--border); border-color: var(--text3); }
.btn-primary {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
  font-weight: 600;
}
.btn-primary:hover { background: var(--red-soft); border-color: var(--red-soft); color: #ffffff; }
.btn-danger { color: var(--red-soft); border-color: var(--border2); background: transparent; }
.btn-danger:hover { color: #ffffff; background: var(--red-soft); border-color: var(--red-soft); }
.btn-sm { font-size: 0.75rem; padding: 6px 11px; }

/* ── INPUTS ──────────────────────────────── */
.input-field {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  transition: border 0.15s;
  width: 100%;
}
.input-field:focus { border-color: var(--red-soft); }
.input-field::placeholder { color: var(--text3); }

textarea.input-field { font-family: var(--font-sans); resize: vertical; line-height: 1.7; }

.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 6px;
}

/* ── TAGS / FILTERS ──────────────────────── */
.tag {
  display: inline-flex; align-items: center;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text3);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.tag-filter:hover { color: var(--text2); border-color: var(--border2); }
.tag-filter.on {
  color: var(--text);
  background: var(--red-bg);
  border-color: var(--red-soft);
}

/* ── GALLERY ─────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.gallery-card {
  position: relative;
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.2s;
}
.gallery-card:hover { border-color: var(--red-soft); transform: translateY(-2px); }
.gallery-card img {
  width: 100%; height: 100%; object-fit: cover; cursor: zoom-in;
  transition: transform 0.4s;
}
.gallery-card:hover img { transform: scale(1.04); }
.gallery-card-del {
  position: absolute; top: 6px; right: 6px;
  display: none;
  background: rgba(255,255,255,0.9);
  color: var(--text2);
  border: 1px solid var(--border2);
  font-size: 0.7rem;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
}
.gallery-card-del:hover { color: var(--red); border-color: var(--red); }
.edit-mode .gallery-card-del { display: block; }

.gallery-add {
  display: none;
  aspect-ratio: 1;
  background: transparent;
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text3);
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.15s;
}
.gallery-add:hover { border-color: var(--red-soft); color: var(--red); }
.edit-mode .gallery-add { display: flex; align-items: center; justify-content: center; }

/* image placeholder (striped) */
.img-ph {
  background-image:
    repeating-linear-gradient(45deg,
      var(--surface) 0 8px,
      var(--surface2) 8px 16px);
  display: flex; align-items: center; justify-content: center;
  color: var(--text3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  border: 1px solid var(--border);
}

/* ── POST CARD (events list) ─────────────── */
.post-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: all 0.15s;
  position: relative;
}
.post-card::before {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 2px; background: transparent;
  transition: background 0.15s;
}
.post-card:hover { border-color: var(--border2); transform: translateX(2px); }
.post-card:hover::before { background: var(--red); }
.post-thumb {
  width: 84px; height: 84px;
  border-radius: var(--radius-sm);
  object-fit: cover; flex-shrink: 0;
}
.post-thumb.img-ph { font-size: 0.6rem; }
.post-card .name {
  font-family: var(--font-serif);
  font-size: 1rem !important;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}
.post-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--text3);
  margin-bottom: 6px;
}
.post-preview {
  font-size: 0.83rem;
  color: var(--text2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── BACK BTN ────────────────────────────── */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--text3);
  padding: 6px 0;
  transition: color 0.15s;
}
.back-btn:hover { color: var(--red); }

/* ── PHOTO GRID (detail) ─────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.photo-item {
  width: 100%; aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: zoom-in;
}
.photo-add-btn {
  display: none;
  aspect-ratio: 1;
  background: transparent;
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text3);
  font-size: 1.2rem;
  cursor: pointer;
}
.photo-add-btn:hover { border-color: var(--red-soft); color: var(--red); }
.edit-mode .photo-add-btn { display: flex; align-items: center; justify-content: center; }

.post-body {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text);
  white-space: pre-wrap;
  padding: 4px 2px;
  min-height: 1em;
}

/* ── GOODS CARD ──────────────────────────── */
.goods-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: all 0.15s;
}
.goods-card:hover { border-color: var(--border2); }
.goods-img {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  cursor: pointer;
}
.goods-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 4px;
  outline: none;
}
.stars { color: var(--gold); letter-spacing: 1px; line-height: 1; margin-bottom: 4px; }

/* ── TODO ────────────────────────────────── */
.todo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.todo-check {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 1.5px solid var(--border2);
  border-radius: 4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  color: var(--red);
  transition: all 0.15s;
}
.todo-check:hover { border-color: var(--red-soft); }
.todo-item.done .todo-check { background: var(--red-bg); border-color: var(--red-soft); }
.todo-label {
  flex: 1;
  outline: none;
  color: var(--text);
  font-size: 0.9rem;
}
.todo-item.done .todo-label {
  color: var(--text3);
  text-decoration: line-through;
}
.todo-del {
  display: none;
  background: transparent;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 6px;
}
.todo-del:hover { color: var(--red); }
.edit-mode .todo-del { display: block; }

/* ── TAB BAR ─────────────────────────────── */
.tab-bar {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  background: transparent;
  color: var(--text3);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px;
  cursor: pointer;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--text2); }
.tab-btn.on { color: var(--text); border-bottom-color: var(--red); }

/* ── GOODS MEMO ──────────────────────────── */
.goods-memo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 0.88rem;
}
.goods-memo-item span { flex: 1; outline: none; }
.goods-memo-item span::before {
  content: '◆'; color: var(--red); margin-right: 8px; font-size: 0.7rem;
}
.goods-memo-item-del {
  display: none;
  background: transparent;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 0.8rem;
}
.goods-memo-item-del:hover { color: var(--red); }
.edit-mode .goods-memo-item-del { display: block; }

/* ── MODAL ───────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.12);
}
.modal h3 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text);
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 22px;
}

/* ── LIGHTBOX ────────────────────────────── */
.lightbox {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 200;
  align-items: center; justify-content: center;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw; max-height: 92vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 80px rgba(0,0,0,0.8);
}
.lightbox-close {
  position: absolute; top: 20px; right: 20px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}
.lightbox-close:hover { border-color: var(--red); color: var(--red); }

/* ── FOOTER ──────────────────────────────── */
footer {
  padding: 2rem var(--pad) 3rem;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}
.footer-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text3);
  outline: none;
}

/* ── EDIT MODE HINTS ─────────────────────── */
.edit-mode [contenteditable="true"] {
  outline: 1px dashed var(--red-soft);
  outline-offset: 4px;
  border-radius: 2px;
}
.edit-mode [contenteditable="true"]:focus {
  outline: 1px solid var(--red);
  background: var(--red-bg);
}

.edit-only { display: none; }
.edit-mode .edit-only { display: inline-flex; }

/* ── QUOTE BLOCK ─────────────────────────── */
.quote-block {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem 1.5rem;
  position: relative;
}
.quote-deco {
  font-family: var(--font-heading);
  font-size: 3rem;
  line-height: 0.5;
  color: var(--gold);
  opacity: 0.6;
  display: block;
  user-select: none;
}
.quote-deco.close { text-align: right; }
.quote-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.9;
  font-style: italic;
  color: var(--text);
  outline: none;
  display: block;
  margin: 0.5rem 0;
}
.quote-source {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text3);
  outline: none;
  display: block;
  margin-top: 0.5rem;
}
.edit-mode .quote-block {
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
}

/* ── QUOTE CARD (character tab) ──────────── */
.char-quote-item {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  position: relative;
}
.char-quote-item::before {
  content: ''; flex-shrink: 0;
  width: 3px; align-self: stretch;
  background: var(--red);
  border-radius: 2px;
}
.char-quote-body { flex: 1; min-width: 0; }
.char-quote-text {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.8;
  color: var(--text);
  outline: none;
  display: block;
  margin-bottom: 6px;
}
.char-quote-source {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text3);
}

/* ── TIMELINE ────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 1px; background: var(--border2);
}
.timeline-item { position: relative; margin-bottom: 1.75rem; }
.timeline-item::before {
  content: ''; position: absolute;
  left: -24px; top: 6px;
  width: 10px; height: 10px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--red);
}
.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 4px;
}
.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.timeline-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  outline: none;
  margin-bottom: 6px;
}
.timeline-content {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.7;
  white-space: pre-wrap;
  outline: none;
}
.timeline-memo {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text3);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border2);
  outline: none;
}

/* ── RELATION NODES ──────────────────────── */
.relation-center {
  display: flex; justify-content: center;
  margin-bottom: 1.5rem;
}
.relation-center-box {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text);
  background: var(--red-bg);
  border: 2px solid var(--red-soft);
  border-radius: var(--radius);
  padding: 10px 28px;
}
.relation-list { display: flex; flex-wrap: wrap; gap: 8px; }
.relation-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex: 1; min-width: 200px;
  position: relative;
}
.relation-type {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--red);
  background: var(--red-bg);
  border: 1px solid var(--red-soft);
  border-radius: 4px;
  padding: 2px 7px;
  flex-shrink: 0;
}
.relation-name {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.relation-desc {
  font-size: 0.8rem;
  color: var(--text2);
  min-width: 0;
}

/* ── ACCORDION ───────────────────────────── */
.accordion-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.accordion-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.accordion-header:hover { background: var(--surface2); }
.accordion-title {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  outline: none;
}
.accordion-arrow {
  font-size: 0.75rem;
  color: var(--text3);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 12px;
}
.accordion-item.open .accordion-arrow { transform: rotate(180deg); }
.accordion-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.2s;
  padding: 0 16px;
}
.accordion-item.open .accordion-body {
  max-height: 600px;
  padding: 0 16px 16px;
}
.accordion-content {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--text2);
  white-space: pre-wrap;
  outline: none;
}

/* ── DDAY CARDS ──────────────────────────── */
.dday-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 1.5rem; }
.dday-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}
.dday-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
}
.dday-number {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 600;
  line-height: 1;
  color: var(--red);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.dday-number.gold { color: var(--gold); }
.dday-sublabel {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text3);
}
.dday-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.dday-list-item.past { opacity: 0.45; }
.dday-list-name {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
}
.dday-list-date {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text3);
  letter-spacing: 0.04em;
}
.dday-list-num {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--red);
  min-width: 52px;
  text-align: right;
  letter-spacing: 0.02em;
}
.dday-list-item.past .dday-list-num { color: var(--text3); }
.dday-del-btn {
  display: none;
  background: transparent; border: none;
  color: var(--text3); cursor: pointer; font-size: 0.8rem; padding: 2px 6px;
}
.dday-del-btn:hover { color: var(--red); }
.edit-mode .dday-del-btn { display: block; }

/* ── CHAR INFO TABLE ─────────────────────── */
.info-table { width: 100%; border-collapse: collapse; }
.info-table tr { border-bottom: 1px solid var(--border); }
.info-table tr:last-child { border-bottom: none; }
.info-table td { padding: 10px 12px; vertical-align: top; }
.info-key {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text3);
  white-space: nowrap;
  width: 96px;
  outline: none;
}
.info-value {
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  line-height: 1.6;
}
.info-del-btn {
  display: none;
  background: transparent; border: none;
  color: var(--text3); cursor: pointer; font-size: 0.78rem; padding: 2px 6px;
}
.info-del-btn:hover { color: var(--red); }
.edit-mode .info-del-btn { display: inline; }

/* ── CHAR HERO ───────────────────────────── */
.char-hero {
  position: relative;
  width: 100%; min-height: 320px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  display: flex; align-items: flex-end;
}
.char-hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  filter: brightness(0.45) saturate(0.8);
}
.char-hero-bg-ph {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, transparent 0 14px, rgba(0,0,0,0.03) 14px 28px);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; color: var(--text3);
}
.char-illust {
  position: absolute; right: clamp(16px,6vw,80px); bottom: 0;
  height: 90%; max-height: 380px;
  object-fit: contain; object-position: bottom;
  filter: drop-shadow(-4px 0 24px rgba(0,0,0,0.4));
}
.char-illust-ph {
  position: absolute; right: clamp(16px,6vw,80px); bottom: 0;
  width: 140px; height: 260px;
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius);
  display: none; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.65rem; color: var(--text3);
}
.edit-mode .char-illust-ph { display: flex; }
.char-hero-info {
  position: relative; z-index: 2;
  padding: clamp(16px,4vw,32px);
  padding-bottom: 28px;
  max-width: 480px;
}
.char-hero-name {
  font-family: var(--font-logo);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.7);
  outline: none;
  margin-bottom: 10px;
}
.char-hero-sub {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.65);
  outline: none;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.char-hero-sub span { outline: none; }
.hero-upload-sm {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em;
  padding: 4px 9px;
  background: rgba(255,255,255,0.7);
  color: var(--text2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); cursor: pointer;
  display: none; transition: all 0.15s;
}
.edit-mode .hero-upload-sm { display: inline-flex; }

/* ── STICKY TAB NAV ──────────────────────── */
.char-tab-nav {
  position: sticky; top: 53px; z-index: 40;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; overflow-x: auto;
  scrollbar-width: none;
}
.char-tab-nav::-webkit-scrollbar { display: none; }
.char-tab-btn {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  white-space: nowrap;
  background: transparent;
  color: var(--text3);
  border: none;
  border-bottom: 2.5px solid transparent;
  padding: 12px 20px;
  cursor: pointer;
  margin-bottom: -1px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.char-tab-btn:hover { color: var(--text2); }
.char-tab-btn.on { color: var(--red); border-bottom-color: var(--red); }

/* ── PREVIEW SECTION ─────────────────────── */
.preview-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.see-all-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--red);
  transition: opacity 0.15s;
}
.see-all-link:hover { opacity: 0.7; }

/* ── PROFILE CARD ────────────────────────── */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 10px;
}
.avatar-wrap {
  width: 80px; height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border2);
  background: var(--surface2);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}
.avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.avatar-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.6rem; color: var(--text3);
  background-image: repeating-linear-gradient(45deg, var(--surface) 0 6px, var(--surface2) 6px 12px);
}
.profile-nick {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  outline: none;
}
.profile-bio {
  font-size: 0.82rem;
  color: var(--text2);
  outline: none;
  line-height: 1.5;
}
.char-name-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex; flex-direction: column;
  justify-content: center; gap: 10px;
}
.char-name-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text3);
}
.char-name-big {
  font-family: var(--font-logo);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.1;
  color: var(--text);
  outline: none;
}
.char-name-big::first-letter { color: var(--red); }
.char-name-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--red);
  align-self: flex-start;
  margin-top: 4px;
  transition: opacity 0.15s;
}
.char-name-link:hover { opacity: 0.7; }

/* ── TWO-COL GRID ────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .two-col { grid-template-columns: 1fr; } .dday-grid { grid-template-columns: 1fr; } }

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 600px) {
  header { padding: 12px 16px; }
  nav { gap: 0; }
  .nav-link { padding: 6px 8px; font-size: 0.78rem; }
  #edit-toggle { padding: 5px 8px; font-size: 0.66rem; margin-left: 4px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .post-thumb { width: 64px; height: 64px; }
  .hero-title { font-size: 2rem; }
}
