/* ============================================================
   인스타그램 웹 디자인 언어를 따른다.
   목적: 실제 인스타와 오가며 쓸 때 눈과 손이 헷갈리지 않게 하는 것.

   참고한 규칙
     · 좌측 세로 사이드바 (넓게 → 아이콘만 → 하단 탭바)
     · 본문은 가운데 정렬, 최대 폭 제한
     · 얇은 회색 경계선, 채도 낮은 무채색 바탕
     · 강조는 인스타 블루 하나로만
     · 선(line) 아이콘, 현재 위치는 굵게(채움)
   ============================================================ */

:root {
  /* 인스타그램 라이트 팔레트 */
  --bg:        #ffffff;
  --bg-elev:   #ffffff;
  --bg-soft:   #fafafa;
  --line:      #dbdbdb;
  --line-soft: #efefef;
  --text:      #262626;
  --text-2:    #737373;
  --text-3:    #8e8e8e;
  --blue:      #0095f6;
  --blue-hov:  #1877f2;
  --btn-2:     #efefef;
  --btn-2-hov: #dbdbdb;
  --danger:    #ed4956;

  --sidebar-w: 245px;
  --sidebar-mini: 73px;
  --r:         8px;

  --accent:    #0095f6;   /* 현재 계정 색 — JS가 바꾼다 */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #000000;
    --bg-elev:   #262626;
    --bg-soft:   #121212;
    --line:      #262626;
    --line-soft: #1f1f1f;
    --text:      #f5f5f5;
    --text-2:    #a8a8a8;
    --text-3:    #737373;
    --btn-2:     #363636;
    --btn-2-hov: #4a4a4a;
  }
}

* { box-sizing: border-box; }

/**
 * hidden 속성이 항상 이기게 한다.
 * 브라우저 기본 [hidden]{display:none} 은 우선순위가 가장 낮아
 * .modal{display:flex} 같은 클래스 규칙에 밀린다.
 */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Malgun Gothic", "Apple SD Gothic Neo", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* 인스타 아이콘과 같은 얇은 선 스타일 */
.ic {
  width: 24px; height: 24px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ── 레이아웃 ─────────────────────────────────────────── */
.app { display: flex; min-height: 100%; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 auto;
  border-right: 1px solid var(--line);
  padding: 8px 12px 20px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  background: var(--bg);
  z-index: 20;
}

.brand {
  display: flex; align-items: center;
  height: 72px; padding: 0 12px;
  font-size: 20px; font-weight: 700; letter-spacing: -.3px;
}
.brand-mini { display: none; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 16px;
  background: none; border: 0; cursor: pointer;
  padding: 12px; border-radius: var(--r);
  color: var(--text); text-align: left; width: 100%;
  transition: background .12s;
}
.nav-item:hover { background: var(--btn-2); }
/* 릴스처럼 다른 페이지로 가는 항목은 <a> 다 — 버튼과 같아 보이게 한다 */
a.nav-item { text-decoration: none; box-sizing: border-box; }
.nav-item:active { transform: scale(.97); }
/* 인스타처럼 아이콘이 살짝 커지는 호버 반응 */
.nav-item .ic { transition: transform .1s ease-out; }
.nav-item:hover .ic { transform: scale(1.06); }
.nav-item .lbl { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 현재 위치는 인스타처럼 아이콘을 굵게 + 글자를 굵게 */
.nav-item.is-on .ic { stroke-width: 2.6; }
.nav-item.is-on .lbl { font-weight: 700; }

.side-foot { margin-top: auto; padding-top: 12px; }

/* 계정 아바타 — 계정 색을 인스타 스토리 링처럼 두른다.
   다중 계정에서 '잘못된 계정에 올리는 사고'를 막는 장치다. */
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border: 2px solid var(--accent);
  padding: 2px;
}
.avatar-in {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--accent);
  display: grid; place-items: center;
  color: #fff; font-size: 10px; font-weight: 700; line-height: 1;
}

.main { flex: 1; min-width: 0; display: flex; justify-content: center; }
.content { width: 100%; max-width: 935px; padding: 30px 20px 90px; }

/* ── 페이지 머리 ──────────────────────────────────────── */
.page-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.page-head h1 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: -.2px; }
.page-head p { margin: 0; color: var(--text-2); font-size: 14px; }
.spacer { flex: 1; }

/* ── 버튼 (인스타 규격) ───────────────────────────────── */
.btn {
  border: 0; background: var(--btn-2); color: var(--text);
  border-radius: var(--r); padding: 8px 16px; cursor: pointer;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .12s, opacity .12s;
}
.btn:hover { background: var(--btn-2-hov); }
.btn:active { opacity: .7; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hov); }
.btn-danger { background: none; color: var(--danger); }
.btn-danger:hover { background: rgba(237,73,86,.09); }
.btn-ghost { background: none; color: var(--blue); font-weight: 600; }
.btn-ghost:hover { background: none; color: var(--text); }
.btn-sm { padding: 6px 13px; font-size: 13px; }

.x-btn {
  background: none; border: 0; cursor: pointer; color: var(--text);
  padding: 6px; display: grid; place-items: center; border-radius: 50%;
}
.x-btn:hover { background: var(--btn-2); }

/* ── 카드 ─────────────────────────────────────────────── */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

/* ── 계정 목록 ────────────────────────────────────────── */
.acct-list { display: flex; flex-direction: column; }

.acct-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line-soft);
}
.acct-card:last-child { border-bottom: 0; }
.acct-card.off { opacity: .5; }

/* 인스타 프로필 아바타의 그라데이션 링을 계정 색으로 대체 */
.acct-av {
  width: 56px; height: 56px; border-radius: 50%;
  flex: 0 0 auto; padding: 2px;
  border: 2px solid var(--c, var(--blue));
  display: grid; place-items: center;
}
.acct-av span {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--c, var(--blue)); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 18px;
}

.acct-card .meta { flex: 1; min-width: 0; }
.acct-card .nm { font-weight: 600; font-size: 14px; }
.acct-card .hd { color: var(--text-2); font-size: 14px; margin-top: 1px; }
.acct-card .st { color: var(--text-3); font-size: 12.5px; margin-top: 3px; }

.badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
  background: var(--btn-2); color: var(--text-2); margin-left: 6px;
  vertical-align: 1px;
}

/* ── 계정 전환 팝오버 ─────────────────────────────────── */
.acct-menu {
  position: fixed; bottom: 76px; left: 16px;
  width: 300px; max-width: calc(100vw - 32px);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 6px 28px rgba(0,0,0,.2);
  padding: 8px; z-index: 40;
}
.acct-menu .ttl {
  font-weight: 700; font-size: 14px; padding: 8px 10px 10px;
}
.acct-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 8px 10px; border: 0; background: none;
  border-radius: var(--r); cursor: pointer; text-align: left;
}
.acct-row:hover { background: var(--btn-2); }
.acct-row .nm { font-weight: 600; font-size: 14px; }
.acct-row small { display: block; color: var(--text-2); font-size: 12.5px; font-weight: 400; }
.acct-row .tick { margin-left: auto; color: var(--blue); }
.acct-menu hr { border: 0; border-top: 1px solid var(--line); margin: 8px 2px; }

/* ── 폼 (인스타 로그인 폼 스타일) ─────────────────────── */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .hint { color: var(--text-2); font-size: 12px; margin: 5px 0 0; line-height: 1.5; }
.field input[type=text], .field input[type=password], .field input[type=email],
.field textarea, .field select {
  width: 100%; padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px; color: var(--text);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--text-3);
}
.field input:disabled { color: var(--text-3); }
.field textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%;
  border: 0; cursor: pointer; padding: 0;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 2px transparent;
}
.swatch.is-on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }

.check { display: flex; align-items: center; gap: 9px; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }
.check label { font-size: 14px; }

/* ── 모달 ─────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px; overflow-y: auto;
}
.modal-box {
  background: var(--bg-elev);
  border-radius: 12px;
  width: 100%; max-width: 500px;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 12px 18px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.modal-head h2 { flex: 1; font-size: 16px; font-weight: 700; margin: 0; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot {
  padding: 12px 18px; border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end; flex: 0 0 auto;
}

/* ── 넓은 모달 (글 편집기) ────────────────────────────── */
.modal-box.wide { max-width: 935px; }   /* 인스타 게시물 모달과 같은 최대 폭 */

/* ── 편집기 2단 ───────────────────────────────────────── */
.ed { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.ed-side { min-width: 0; }

/* 구분 선택 (유형·비율) — 인스타 필터 칩 모양 */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  border: 1px solid var(--line); background: var(--bg-elev);
  border-radius: 999px; padding: 6px 14px; cursor: pointer;
  font-size: 13px; color: var(--text);
}
.seg button:hover { background: var(--btn-2); }
.seg button.is-on {
  background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600;
}

.field input[type=datetime-local] {
  width: 100%; padding: 9px 11px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 6px; color: var(--text);
}

.counter-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 5px; min-height: 18px;
}
.counter { font-size: 12px; color: var(--text-3); }
.counter.over { color: var(--danger); font-weight: 700; }
.banned-warn { font-size: 12px; color: var(--danger); font-weight: 600; }

/* ── 인스타 미리보기 ──────────────────────────────────── */
.pv-phone {
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-elev); overflow: hidden;
}
.pv-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; font-size: 13px;
}
.pv-dots { margin-left: auto; color: var(--text); font-weight: 700; }
.pv-av {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--c, var(--blue)); padding: 1.5px;
  display: grid; place-items: center; flex: 0 0 auto;
}
.pv-av span {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--c, var(--blue)); color: #fff;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
}
.pv-media {
  background: var(--bg-soft); position: relative;
  display: grid; place-items: center;
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.pv-ph { width: 44px; height: 44px; color: var(--text-3); stroke-width: 1.2; }
.pv-multi { position: absolute; top: 10px; right: 12px; font-size: 15px; color: var(--text-2); }
.pv-cdots { display: flex; gap: 4px; justify-content: center; padding: 8px 0 0; }
.pv-cdots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.pv-cdots i.on { background: var(--blue); }
.pv-acts { display: flex; gap: 14px; padding: 10px 12px 6px; }
.pv-acts .ic { width: 22px; height: 22px; }
.pv-cap { padding: 0 12px 12px; font-size: 13px; line-height: 1.5; word-break: break-all; }
.pv-more {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--text-3); font-size: 13px;
}
.pv-tags { color: #00376b; }
@media (prefers-color-scheme: dark) { .pv-tags { color: #e0f1ff; } }

/* 릴스/스토리 — 검은 프레임 + 하단 오버레이 */
.pv-dark { background: #000; color: #fff; position: relative; }
.pv-fill { position: absolute; inset: 0; display: grid; place-items: center; }
.pv-dark .pv-ph { color: #555; }
.pv-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px; font-size: 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
}
.pv-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pv-cap-dark { line-height: 1.45; word-break: break-all; }
.pv-cap-dark .pv-tags { color: #cfe4ff; }

.pv-note {
  text-align: center; font-size: 11px; color: var(--text-3); margin-top: 8px;
}

/* 계정 가이드 (편집기 옆에 상시 표시) */
.guide {
  margin-top: 14px; border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px; font-size: 12.5px;
  background: var(--bg-soft);
}
.g-head { font-weight: 700; margin-bottom: 8px; }
.g-row { margin-bottom: 6px; line-height: 1.5; }
.g-row b { display: inline-block; min-width: 44px; color: var(--text-2); font-weight: 600; }

/* 이력 보기 */
.hist-view { display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; line-height: 1.6; }
.hist-view b { color: var(--text-2); font-weight: 600; }

/* ── 보드 ─────────────────────────────────────────────── */
.board {
  /* 1fr 이 아니라 minmax(0,1fr) — 긴 nowrap 텍스트가 열의 최소 폭을
     밀어내 4열이 화면 밖으로 터지는 것을 막는다 (실제로 겪은 버그) */
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; align-items: start;
}
.col {
  min-width: 0;
  background: var(--bg-soft); border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 120px;
}
.col-head {
  font-size: 13px; font-weight: 700; padding: 4px 6px;
  display: flex; align-items: center; gap: 6px;
}
.col-head .cnt { color: var(--text-3); font-weight: 400; }
.col-empty { color: var(--text-3); font-size: 12.5px; padding: 14px 6px; text-align: center; }

.post-card {
  text-align: left; width: 100%; cursor: pointer;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 8px; padding: 11px 12px;
  transition: box-shadow .12s;
}
.post-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.pc-title {
  font-weight: 600; font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pc-line {
  color: var(--text-2); font-size: 12.5px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pc-meta {
  display: flex; gap: 8px; align-items: center;
  margin-top: 7px; font-size: 11.5px; color: var(--text-3);
}
.pc-meta .badge { margin: 0; }

/* ── 전략 화면 ────────────────────────────────────────── */
.strat-formula { text-align: center; padding: 26px 20px; margin-bottom: 6px; }
.sf-main { font-size: 18px; font-weight: 700; line-height: 1.5; letter-spacing: -.2px; }
.sf-sub { margin-top: 10px; color: var(--text-2); font-size: 13px; }

.strat-h {
  font-size: 15px; font-weight: 700; margin: 28px 0 12px;
  display: flex; align-items: baseline; gap: 8px;
}
.strat-h .muted { font-size: 12.5px; font-weight: 400; }

.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-cell {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 8px; text-align: center; background: var(--bg-elev);
}
.week-cell .wd { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.week-cell .ww { font-size: 11.5px; color: var(--text-2); line-height: 1.45; word-break: keep-all; }
.week-cell.is-today { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.week-cell.is-today .wd { color: var(--blue); }

.formula-steps { display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; line-height: 1.55; }
.formula-steps b { color: var(--blue); margin-right: 6px; }

.idea-group { margin-bottom: 18px; }
.ig-name { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.idea-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
}
.idea-title {
  flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.idea-row .badge { margin: 0; flex: 0 0 auto; }

/* 보드 상단 '오늘의 발행' 배너 */
.today-plan {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left; cursor: pointer;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 14px; margin-bottom: 16px;
  font-size: 13.5px; color: var(--text);
}
.today-plan:hover { background: var(--btn-2); }
.today-plan b { color: var(--blue); }
.tp-go { margin-left: auto; color: var(--text-3); font-size: 12.5px; white-space: nowrap; }

@media (max-width: 767px) {
  .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── 빈 상태 · 알림 ───────────────────────────────────── */
.empty { text-align: center; padding: 60px 20px; }
.empty .ic-lg {
  width: 62px; height: 62px; margin: 0 auto 18px;
  border: 2px solid var(--text); border-radius: 50%;
  display: grid; place-items: center;
}
.empty .ic-lg .ic { width: 30px; height: 30px; }
.empty h3 { margin: 0 0 8px; font-size: 22px; font-weight: 300; letter-spacing: -.2px; }
.empty p { margin: 0 0 20px; color: var(--text-2); }

.alert {
  border-radius: 12px; padding: 16px 18px; margin-bottom: 16px;
  border: 1px solid var(--line); background: var(--bg-soft); line-height: 1.6;
}
.alert-bad { border-color: var(--danger); }
.alert h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.alert code {
  background: var(--btn-2); padding: 2px 6px; border-radius: 4px;
  font-size: 12.5px; word-break: break-all;
}
.alert ol, .alert ul { margin: 8px 0 0; padding-left: 20px; }
.alert li { margin-bottom: 4px; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 12px 20px; border-radius: var(--r);
  z-index: 60; box-shadow: 0 4px 20px rgba(0,0,0,.3);
  max-width: 90vw; font-weight: 500;
}
.toast.bad { background: var(--danger); color: #fff; }

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

/* ── 로그인 화면 ───────────────────────────────────────
   인스타그램 로그인/가입 페이지의 규격을 그대로 따른다.
     · 폭 350px, 흰 카드 두 장(본체 + 전환), 배경 #fafafa
     · 카드 모서리는 거의 각짐(1px)
     · 입력칸: 배경 #fafafa, 글자 12px, 높이 38px
     · 플로팅 라벨 — 입력하면 라벨이 위로 작게 올라간다
     · 버튼: 파랑, 높이 32px, 14px/600, 모서리 8px
   ---------------------------------------------------- */
.auth-body {
  display: grid; place-items: center;
  min-height: 100vh; padding: 20px 0;
  background: var(--bg-soft);
}
.auth-wrap { width: 100%; max-width: 350px; padding: 0 12px; }

.auth-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 30px 40px 22px;
  text-align: center;
}
.auth-logo {
  font-size: 30px; font-weight: 700; letter-spacing: -1px;
  margin: 12px 0 26px;
}
/* 가입 화면 안내문 — 인스타 가입 페이지의 부제와 같은 규격(17px/600/회색) */
.auth-lead {
  color: var(--text-2); font-size: 13px; line-height: 1.45;
  margin: 0 0 16px; font-weight: 600;
}
.auth-lead strong {
  display: block; color: var(--text-2);
  font-size: 17px; font-weight: 600; margin-bottom: 8px;
}
.auth-lead .muted { font-weight: 400; }

.auth-form { display: flex; flex-direction: column; gap: 6px; }

/* 플로팅 라벨 입력칸 (인스타의 대표적인 폼 요소) */
.ig-field { position: relative; }
.ig-field input {
  width: 100%; height: 38px;
  padding: 9px 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 12px; color: var(--text);
  transition: padding .1s ease-out;
}
.ig-field input:focus { outline: none; border-color: var(--text-3); }

/* 값이 있거나 포커스되면 글자를 아래로 밀어 라벨 자리를 만든다 */
.ig-field input:focus,
.ig-field input:not(:placeholder-shown) { padding: 16px 8px 2px; }

.ig-field label {
  position: absolute; left: 9px; top: 50%;
  transform: translateY(-50%) scale(1);
  transform-origin: left center;
  font-size: 12px; color: var(--text-3);
  pointer-events: none;
  transition: transform .1s ease-out, top .1s ease-out;
}
.ig-field input:focus ~ label,
.ig-field input:not(:placeholder-shown) ~ label {
  top: 11px;
  transform: translateY(-50%) scale(.833);   /* 12px → 10px */
}

/* 비밀번호 표시 버튼이 있는 칸은 글자가 버튼 밑으로 들어가지 않게 여백을 준다 */
.ig-field.has-eye input { padding-right: 74px; }

/* 비밀번호 표시 버튼 (인스타에도 있다) */
.pw-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text);
  padding: 4px;
}
.pw-eye:hover { color: var(--text-2); }

.auth-submit {
  margin-top: 10px; height: 32px; padding: 0 16px;
  border-radius: 8px; font-size: 14px; font-weight: 600;
}
.auth-submit:disabled { opacity: .5; cursor: default; }

/* "또는" 구분선 — 인스타 로그인과 동일 구성 */
.or-sep {
  display: flex; align-items: center; gap: 18px;
  margin: 16px 0 14px;
}
.or-sep span { flex: 1; height: 1px; background: var(--line); }
.or-sep b { font-size: 13px; font-weight: 600; color: var(--text-3); }

/* 비밀번호 찾기 링크 */
.forgot {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 12px; color: #00376b; margin-top: 4px;
}
@media (prefers-color-scheme: dark) { .forgot { color: #e0f1ff; } }
.forgot:hover { text-decoration: underline; }
.forgot-box {
  margin-top: 12px; padding: 12px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 6px; font-size: 12px; line-height: 1.7;
  color: var(--text-2); text-align: left;
}
.forgot-box code { background: var(--btn-2); padding: 1px 5px; border-radius: 3px; }

.auth-loading { color: var(--text-2); padding: 20px 0; font-size: 13px; }

.auth-err {
  margin-top: 12px; color: var(--danger);
  font-size: 13px; line-height: 1.45; white-space: pre-line;
}

.auth-note {
  text-align: center; color: var(--text-2);
  font-size: 12px; line-height: 1.7; margin: 18px 0 0;
}
.auth-note strong { color: var(--text); }
.auth-form a { color: var(--blue); }

/* 로그인 ↔ 회원가입 전환 — 인스타처럼 별도 카드 */
.auth-switch {
  margin-top: 10px; padding: 22px 20px;
  font-size: 14px; color: var(--text);
}
.linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--blue); font-weight: 600; font-size: 14px;
}
.linkish:hover { text-decoration: underline; }

/* 비밀번호 세기 표시 — 막대와 설명을 따로 두어 겹치지 않게 한다 */
.pw-meter { margin: 2px 0 4px; }
.pw-bar {
  height: 3px; background: var(--line);
  border-radius: 2px; overflow: hidden;
}
.pw-bar span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }
.pw-label { margin-top: 5px; font-size: 11px; color: var(--text-2); text-align: left; }
.pw-meter.weak .pw-bar span { background: var(--danger); }
.pw-meter.mid  .pw-bar span { background: #f5871f; }
.pw-meter.good .pw-bar span { background: #12a150; }
.pw-meter.weak .pw-label { color: var(--danger); }

/* 설정 화면의 항목 줄 */
.set-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--line-soft);
}
.set-row:first-child { padding-top: 0; }
.set-row .meta { flex: 1; min-width: 0; }
.set-row .nm { font-weight: 600; font-size: 14px; }
.set-row .hd { color: var(--text-2); font-size: 13px; margin-top: 2px; }

/* ── 반응형: 인스타와 동일한 3단 변화 ─────────────────── */

/* 중간 폭 — 아이콘만 남는다 */
@media (max-width: 1263px) {
  .sidebar { width: var(--sidebar-mini); padding: 8px 8px 20px; align-items: center; }
  .brand { justify-content: center; padding: 0; }
  .brand-full { display: none; }
  .brand-mini { display: block; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item .lbl { display: none; }
  .acct-menu { left: 84px; }
}

@media (max-width: 1000px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ed { grid-template-columns: 1fr; }
  .ed-side { order: -1; }   /* 좁은 화면에서는 미리보기를 위로 */
}

/* 좁은 폭 — 하단 탭바로 내려간다 */
@media (max-width: 767px) {
  .board { grid-template-columns: 1fr; }
  .app { flex-direction: column; }
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0;
    width: auto; height: auto;
    flex-direction: row; align-items: center;
    border-right: 0; border-top: 1px solid var(--line);
    padding: 6px 4px; z-index: 30;
  }
  .brand { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .side-foot { margin-top: 0; padding-top: 0; }
  .nav-item { padding: 10px; }
  .content { padding: 18px 14px 90px; max-width: none; }
  .row2 { grid-template-columns: 1fr; }
  .acct-menu { left: 12px; right: 12px; bottom: 68px; width: auto; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-box { max-width: none; border-radius: 14px 14px 0 0; max-height: 92vh; }
  .empty { padding: 40px 12px; }
}
