/* 색 체계 v1 (2026-10-19 사무엘님 "색상이 전반적으로 붕 떠 있다 … 색상 톤을 먼저 차분하게 확실하게 시스템으로 정리한 다음에 테마 색을 정하자")
   ① 기본 회색 단계(--n-0 ~ --n-950) 하나로 바탕·면·줄·글자를 모두 정한다. 노랑 기가 아주 조금 도는 같은 색조의 회색.
   ② 의미 색(--canvas·--surface·--border·--text…)만 화면 부품에 쓴다. 부품에 색 값을 직접 쓰지 않는다.
   ③ 상태색(성공·주의·위험·안내)과 꼬리표 색은 채도를 낮추고 밝기를 서로 맞춘다 — 한 색만 튀지 않게.
   ④ 채널 색(인스타그램·페이스북·스레드)은 체계 밖 예외로 각 회사 브랜드 색을 그대로 쓴다 — 채널 표시에만 쓰고 다른 부품에는 쓰지 않는다
      (2026-10-19 사무엘님 "페북 인스타 스레드 색상은 입힌 상태에서 봐야지").
   ⑤ 테마 색(--accent)은 정할 때까지 먹색(--n-900)으로 둔다. 정하면 --accent 묶음 다섯 줄만 바꾼다. */
:root {
  --n-0: #FFFFFF; --n-25: #FBFBFA; --n-50: #F6F6F5; --n-100: #EEEEEC; --n-150: #E5E5E2; --n-200: #D8D8D4;
  --n-300: #BFBFBA; --n-400: #9D9D98; --n-500: #6B6B66; --n-600: #5B5B57; --n-700: #444441; --n-800: #2E2E2C; --n-900: #1D1D1C; --n-950: #121211;

  --canvas: var(--n-50); --surface: var(--n-0); --sunken: var(--n-25); --field: var(--n-100);
  --hover: var(--n-100); --selected: var(--n-150);
  --border: var(--n-150); --border-strong: var(--n-200); --line: var(--n-150);
  --text: var(--n-900); --text2: var(--n-600); --text3: var(--n-500);

  --accent: var(--n-900); --accent-hover: var(--n-700); --on-accent: var(--n-0); --accent-soft: var(--n-150); --accent-text: var(--n-900);

  --ok: #3E7552; --ok-soft: #E9F1EB; --warn: #8A6418; --warn-soft: #F5EEDF; --bad: #A4433D; --bad-soft: #F6E9E7; --info: #3E5E8C; --info-soft: #E8EDF4;
  --tag-rose: #C48B98; --tag-violet: #9688BE; --tag-amber: #C39A5E; --tag-teal: #6E9E99;
  --ch-instagram: #E1306C; --ch-facebook: #0866FF; --ch-threads: #000000; --net-icon: #FFFFFF; --avatar-bg: var(--n-150); --avatar-text: var(--n-700);

  --dim: rgba(18, 18, 17, .40); --shadow: 0 12px 32px rgba(18, 18, 17, .12), 0 2px 6px rgba(18, 18, 17, .05); --raise: 0 1px 2px rgba(18, 18, 17, .07);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: var(--n-950); --surface: #1A1A19; --sunken: #161615; --field: #252523;
    --hover: #252523; --selected: #2E2E2C;
    --border: #2A2A28; --border-strong: #3A3A37; --line: #2A2A28;
    --text: #EDEDEA; --text2: #A6A6A1; --text3: #85857F;
    --accent: #EDEDEA; --accent-hover: #FFFFFF; --on-accent: var(--n-950); --accent-soft: #2E2E2C; --accent-text: #EDEDEA;
    --ok: #7FB592; --ok-soft: #1C2A21; --warn: #D2AE68; --warn-soft: #2D2617; --bad: #D88A84; --bad-soft: #31201E; --info: #8FA9CF; --info-soft: #1D2533;
    --tag-rose: #B98692; --tag-violet: #8F84B3; --tag-amber: #B4925E; --tag-teal: #6C9792;
    --ch-instagram: #E1306C; --ch-facebook: #0866FF; --ch-threads: #F2F2F0; --ch-threads-icon: #000000; --net-icon: #FFFFFF; --avatar-bg: #2E2E2C; --avatar-text: #CFCFCB;
    --dim: rgba(0, 0, 0, .6); --shadow: 0 12px 32px rgba(0, 0, 0, .55); --raise: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: var(--n-950); --surface: #1A1A19; --sunken: #161615; --field: #252523;
  --hover: #252523; --selected: #2E2E2C;
  --border: #2A2A28; --border-strong: #3A3A37; --line: #2A2A28;
  --text: #EDEDEA; --text2: #A6A6A1; --text3: #85857F;
  --accent: #EDEDEA; --accent-hover: #FFFFFF; --on-accent: var(--n-950); --accent-soft: #2E2E2C; --accent-text: #EDEDEA;
  --ok: #7FB592; --ok-soft: #1C2A21; --warn: #D2AE68; --warn-soft: #2D2617; --bad: #D88A84; --bad-soft: #31201E; --info: #8FA9CF; --info-soft: #1D2533;
  --tag-rose: #B98692; --tag-violet: #8F84B3; --tag-amber: #B4925E; --tag-teal: #6C9792;
  --ch-instagram: #E1306C; --ch-facebook: #0866FF; --ch-threads: #F2F2F0; --ch-threads-icon: #000000; --net-icon: #FFFFFF; --avatar-bg: #2E2E2C; --avatar-text: #CFCFCB;
  --dim: rgba(0, 0, 0, .6); --shadow: 0 12px 32px rgba(0, 0, 0, .55); --raise: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Pretendard Variable", Pretendard, Inter, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 14px; line-height: 20px; color: var(--text); background: var(--canvas);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--text2); }
.small { font-size: 12px; line-height: 16px; }
.grow { flex: 1; }

/* 단추 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn .i { width: 16px; height: 16px; }
.btn.green { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.green:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--text); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--hover); }
.icon-btn .i { width: 18px; height: 18px; }
.icon-btn.sm { width: 28px; height: 28px; }
.text-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 8px; border-radius: 6px; font-weight: 500; cursor: pointer; }
.text-btn:hover { background: var(--hover); }
.text-btn .i { width: 16px; height: 16px; }
.text-btn.danger { color: var(--bad); }
.text-green { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--accent-text); font-weight: 500; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.text-green:hover { background: var(--accent-soft); }
.text-green .i { width: 16px; height: 16px; }
.chip-btn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 500; cursor: pointer; }
.chip-btn:hover { background: var(--hover); }
.chip-btn .i { width: 14px; height: 14px; }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px; border: 0; background: none; color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap; }
.tb-btn:hover, .tb-btn[aria-expanded="true"] { background: var(--hover); }
.tb-btn .i { width: 16px; height: 16px; color: var(--text2); }
.tb-btn.on { background: var(--hover); }
.today-btn { height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); font-weight: 500; cursor: pointer; }
.today-btn:hover { background: var(--hover); }

/* 왼쪽 아이콘 줄 */
#app { display: flex; min-height: 100vh; }
.rail { width: 72px; flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 0 16px; overflow-y: auto; scrollbar-width: none; }
.rail-logo { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 10px; color: var(--text); }
.rail-logo .i { width: 26px; height: 26px; stroke-width: 2; }
.rail-new { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; cursor: pointer; margin-bottom: 12px; }
.rail-new:hover { background: var(--accent-hover); }
.rail-new .i { width: 22px; height: 22px; stroke-width: 2.2; }
.rail > a { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: var(--text); }
.rail > a:hover { background: var(--hover); }
.rail > a[aria-current="page"] { background: var(--selected); }
.rail > a .i { width: 22px; height: 22px; }
.rail-ch { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; align-items: center; }
.rail-grow { flex: 1; min-height: 12px; }
.rail-me { width: 40px; height: 40px; border-radius: 10px; background: var(--text); color: var(--surface); display: grid; place-items: center; font-weight: 600; margin-top: 8px; }

/* 채널 사진 + 채널 표시 */
.av { position: relative; width: 40px; height: 40px; border-radius: 10px; background: var(--avatar-bg); color: var(--avatar-text); display: grid; place-items: center; font-weight: 600; font-size: 15px; flex: none; border: 0; padding: 0; cursor: pointer; }
.av .badge { position: absolute; right: -4px; bottom: -4px; }
.av.big { width: 52px; height: 52px; border-radius: 12px; font-size: 18px; }
.av.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ring, var(--text)); }
.av.off { filter: grayscale(1); opacity: .45; }
.av.sel { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--text); }
.av .warn-dot { position: absolute; left: -3px; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--surface); }
.badge { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; color: var(--net-icon); box-shadow: 0 0 0 2px var(--surface); }
.badge .i { width: 13px; height: 13px; stroke-width: 2; }
.net { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--net-icon); flex: none; }
.net .i { width: 12px; height: 12px; stroke-width: 2.2; }
.net.lg { width: 28px; height: 28px; border-radius: 8px; } .net.lg .i { width: 16px; height: 16px; }
.instagram { background: var(--ch-instagram); } .facebook { background: var(--ch-facebook); } .threads { background: var(--ch-threads); }
:root .threads { color: var(--ch-threads-icon, #FFFFFF); }
.nets { display: inline-flex; } .nets .net + .net { margin-left: -5px; box-shadow: 0 0 0 1.5px var(--surface); }

/* 본문 판 */
.panel { flex: 1; min-width: 0; margin: 8px 8px 8px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; min-height: calc(100vh - 16px); }
.panel:focus { outline: none; }
.ph { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ph-tile { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--border); display: grid; place-items: center; flex: none; }
.ph-tile .i { width: 24px; height: 24px; stroke-width: 2; }
.ph h1 { font-size: 26px; line-height: 34px; font-weight: 600; letter-spacing: -0.02em; }
.ph p { color: var(--text2); width: 100%; }
.view-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; }
.view-toggle button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--text2); font-weight: 500; cursor: pointer; }
.view-toggle button .i { width: 16px; height: 16px; }
.view-toggle button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }
.toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.toolbar .month { font-size: 18px; line-height: 26px; font-weight: 500; padding: 0 8px 0 6px; white-space: nowrap; }
.toolbar .vsep { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }
.pop-anchor { position: relative; }
.pop { position: absolute; z-index: 60; top: calc(100% + 6px); right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 12px; min-width: 220px; }
.pop.left { left: 0; right: auto; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; font-size: 14px; }
.menu-item:hover { background: var(--hover); }
.menu-item .i.ck { width: 16px; height: 16px; margin-left: auto; color: var(--accent); }
.ch-pop { width: 320px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1.5px solid var(--border-strong); border-radius: 10px; }
.search .i { width: 18px; height: 18px; color: var(--text2); }
.search input { border: 0; outline: none; background: none; flex: 1; min-width: 0; }
.ch-pop-h { display: flex; justify-content: space-between; color: var(--text2); font-size: 13px; padding: 0 2px; }
.ch-pop-h button { border: 0; background: none; color: var(--text2); cursor: pointer; font-size: 13px; }
.ch-opt { display: flex; align-items: center; gap: 12px; padding: 6px 2px; cursor: pointer; }
.ch-opt .av { cursor: pointer; }
.ch-opt .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-opt b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-opt small { color: var(--text3); font-size: 12px; }
.box-check { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex: none; color: var(--on-accent); }
.box-check .i { width: 14px; height: 14px; stroke-width: 3; }
.box-check.on { background: var(--accent); border-color: var(--accent); }

/* 안내 띠 */
.note { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 10px; background: var(--canvas); }
.note.warn { background: var(--warn-soft); }
.note > .i { width: 18px; height: 18px; color: var(--text2); }
.note.warn > .i { color: var(--warn); }
.note p { flex: 1; }

/* 주간 칸 */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex: 1; min-height: 520px; }
.wcol { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
.wcol:last-child { border-right: 0; }
.wh { height: 40px; display: flex; align-items: center; justify-content: center; gap: 6px; border-bottom: 1px solid var(--line); color: var(--text2); font-weight: 500; flex: none; }
.wh b { font-weight: 500; color: var(--text); }
.wcol.today .wh { background: var(--accent-soft); color: var(--accent-text); }
.wcol.today .wh b { color: var(--accent-text); }
.wbody { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); position: relative; }
.wcol.past .wbody { background: var(--sunken); }
.add-slot { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-radius: 8px; border: 1px dashed var(--border-strong); background: var(--surface); color: var(--text2); font-size: 13px; font-weight: 500; cursor: pointer; width: 100%; opacity: 0; transition: opacity .12s; }
.wbody:hover .add-slot, .add-slot:focus-visible { opacity: 1; }
.add-slot .i { width: 16px; height: 16px; }
.card { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); text-align: left; cursor: pointer; width: 100%; color: var(--text); }
.card:hover { box-shadow: var(--raise); border-color: var(--border-strong); }
.card-top { display: flex; align-items: center; gap: 8px; }
.card-top time { font-size: 12px; color: var(--text2); font-weight: 500; white-space: nowrap; margin-left: auto; }
.lbls { display: flex; gap: 4px; flex-wrap: wrap; }
.lbl-pill { width: 18px; height: 6px; border-radius: 3px; }
.card-img { border-radius: 6px; background: var(--field) center/cover no-repeat; aspect-ratio: 4 / 5; max-height: 180px; width: 100%; }
.card p { font-size: 13px; line-height: 18px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; overflow-wrap: anywhere; }
.status { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text2); display: inline-flex; align-items: center; gap: 4px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text3); }
.status.scheduled::before { background: var(--ok); }
.status.published::before { background: var(--info); }
.status.attention, .status.overdue { color: var(--warn); } .status.attention::before, .status.overdue::before { background: var(--warn); }

/* 달 */
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.month-grid .wd { height: 36px; display: grid; place-items: center; color: var(--text2); font-weight: 500; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.month-grid > :nth-child(7n) { border-right: 0; }
.mcell { min-height: 116px; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; text-align: left; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); color: var(--text); }
.mcell:hover { background: var(--hover); }
.mcell.out { background: var(--sunken); } .mcell.out .mnum { color: var(--text3); }
.mnum { font-size: 13px; font-weight: 500; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; }
.mcell.today .mnum { background: var(--accent); color: var(--on-accent); }
.mpost { display: flex; gap: 6px; align-items: center; font-size: 12px; line-height: 16px; color: var(--text2); min-width: 0; }
.mpost .net { width: 16px; height: 16px; } .mpost .net .i { width: 10px; height: 10px; }
.mpost span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mmore { font-size: 12px; color: var(--text3); }

/* 목록 */
.list { display: flex; flex-direction: column; gap: 24px; max-width: 920px; }
.group h2 { font-size: 15px; line-height: 22px; font-weight: 600; margin-bottom: 10px; display: flex; gap: 8px; align-items: baseline; }
.group h2 span { color: var(--text2); font-weight: 400; font-size: 13px; }
.rows { display: flex; flex-direction: column; gap: 10px; }
.lrow { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; width: 100%; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-align: left; cursor: pointer; color: var(--text); }
.lrow:hover { border-color: var(--border-strong); box-shadow: var(--raise); }
.lrow .when { width: 84px; flex: none; display: flex; flex-direction: column; gap: 6px; }
.lrow .when b { font-weight: 600; font-size: 14px; }
.lrow .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.lrow .txt p { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: keep-all; }
.lrow .limg { width: 64px; height: 64px; border-radius: 8px; background: var(--field) center/cover no-repeat; flex: none; }
.empty { padding: 48px 24px; text-align: center; color: var(--text2); display: flex; flex-direction: column; align-items: center; gap: 12px; border: 1px dashed var(--line); border-radius: 12px; }

/* 채널 연결·성과·설정 */
.sec { display: flex; flex-direction: column; gap: 12px; }
.sec-h h2 { font-size: 16px; line-height: 24px; font-weight: 600; }
.sec-h p { font-size: 13px; line-height: 18px; color: var(--text2); }
.grid4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.box { border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); }
.box-top { display: flex; align-items: center; gap: 12px; }
.box-top > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.box-top > div strong { font-weight: 600; }
.box-top > div span { font-size: 13px; line-height: 18px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.box > p { font-size: 13px; line-height: 18px; color: var(--text2); flex: 1; }
.box .btn { align-self: flex-start; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.soon { background: var(--field); color: var(--text2); }
.letter { width: 40px; height: 40px; border-radius: 10px; background: var(--field); color: var(--text2); display: grid; place-items: center; font-weight: 600; flex: none; }
.switch { width: 40px; height: 24px; border-radius: 12px; border: 0; padding: 3px; background: var(--border-strong); cursor: pointer; flex: none; display: flex; }
.switch::after { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--n-0); transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.stat { gap: 4px; }
.stat span { font-size: 13px; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.stat b { font-size: 26px; line-height: 34px; font-weight: 600; font-variant-numeric: tabular-nums; }
.field { display: flex; flex-direction: column; gap: 6px; max-width: 360px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text2); }
.input { height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; border: 1px solid var(--border); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-size: 13px; color: var(--text2); cursor: pointer; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }

/* 게시물 만들기 창 */
.modal-wrap { position: fixed; inset: 0; background: var(--dim); display: grid; place-items: center; padding: 24px; z-index: 50; }
.modal { width: min(1160px, 100%); height: min(760px, calc(100vh - 48px)); display: flex; gap: 12px; }
.m-main { flex: 1; min-width: 0; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.modal.small { width: min(420px, 100%); height: auto; padding: 24px; flex-direction: column; gap: 12px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.modal.small h2 { font-size: 18px; line-height: 26px; font-weight: 600; }
.modal.small p { color: var(--text2); }
.q-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.m-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 18px 28px; border-bottom: 1px solid var(--border); }
.m-head h2 { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.015em; }
.m-labels { display: flex; gap: 6px; flex-wrap: wrap; }
.lab { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 6px; background: var(--hover); font-size: 12px; font-weight: 500; }
.lab i { width: 10px; height: 10px; border-radius: 3px; }
.tag-pop { width: 220px; padding: 6px; left: 0; right: auto; }
.tag-pop .menu-item i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.m-tabs { display: none; }
.m-body { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.avatars { display: flex; gap: 16px; flex-wrap: wrap; padding-left: 44px; }
.editor-row { display: flex; gap: 12px; align-items: flex-start; }
.editor-net { width: 32px; flex: none; display: flex; justify-content: center; padding-top: 6px; }
.editor { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.editor:focus-within { border-color: var(--border-strong); }
.editor textarea { border: 0; resize: none; min-height: 150px; font-size: 16px; line-height: 26px; background: none; outline: none; padding: 0; }
.editor textarea::placeholder { color: var(--text3); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tagchip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 8px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; line-height: 18px; }
.tagchip button { border: 0; background: none; padding: 0; color: var(--text3); cursor: pointer; display: grid; }
.tagchip button .i { width: 14px; height: 14px; }
.tags input { border: 0; outline: none; background: none; font-size: 13px; padding: 4px 2px; min-width: 120px; flex: 1; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photos:empty { display: none; }
.ph-item { width: 76px; height: 76px; border-radius: 8px; background: var(--field) center/cover no-repeat; position: relative; }
.ph-item button { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ph-item button .i { width: 12px; height: 12px; }
.ed-tools { display: flex; align-items: center; gap: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.tool { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; display: grid; place-items: center; cursor: pointer; color: var(--text); }
.tool:hover { background: var(--hover); }
.tool .i { width: 18px; height: 18px; }
.count { min-width: 34px; height: 24px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; color: var(--text2); display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; margin-right: 4px; }
.count.over { color: var(--bad); border-color: var(--bad); }
.help-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 10px; background: var(--canvas); }
.help-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; align-items: center; }
.help-row label { font-size: 13px; color: var(--text2); font-weight: 500; }
.help-row input { height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills button { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 500; cursor: pointer; }
.pills button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-text); }
.help-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.m-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px 14px 28px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check span { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; }
.check input:checked + span { background: var(--accent); border-color: var(--accent); }
.check input:checked + span::after { content: ""; width: 5px; height: 9px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.err { flex: 1; color: var(--bad); font-size: 13px; min-width: 100px; text-align: right; }
.date-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; border-radius: 8px; border: 0; background: var(--field); font-weight: 500; cursor: pointer; white-space: nowrap; }
.date-btn:hover { background: var(--selected); }
.date-btn .i { width: 16px; height: 16px; color: var(--text2); }
.date-pop { bottom: calc(100% + 8px); top: auto; width: 340px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.dp-head { display: flex; align-items: center; gap: 4px; }
.dp-head b { flex: 1; font-size: 16px; font-weight: 600; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.dp-grid .dw { font-size: 13px; color: var(--text2); font-weight: 500; padding: 6px 0; }
.dp-grid button { height: 34px; border: 0; background: none; border-radius: 8px; font-weight: 500; cursor: pointer; font-variant-numeric: tabular-nums; }
.dp-grid button:hover { background: var(--hover); }
.dp-grid button.out { color: var(--text3); font-weight: 400; }
.dp-grid button:disabled { color: var(--text3); opacity: .5; cursor: not-allowed; background: none; }
.dp-grid button.sel { background: var(--accent); color: var(--on-accent); }
.dp-sec { font-size: 13px; font-weight: 500; color: var(--text2); }
.slots { display: flex; gap: 6px; flex-wrap: wrap; }
.slots button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-weight: 500; cursor: pointer; }
.slots button:hover { background: var(--hover); }
.dp-time { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.dp-time .i { width: 18px; height: 18px; }
.dp-time input { flex: 1; border: 0; background: none; outline: none; font-size: 16px; font-weight: 600; color: var(--text); min-width: 0; }
.dp-time span { font-size: 13px; font-weight: 500; }
.dp-foot { display: flex; justify-content: space-between; padding-top: 6px; border-top: 1px solid var(--border); }
.m-preview { width: 380px; flex: none; background: var(--canvas); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.pv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pv-top b { font-size: 15px; font-weight: 600; }
.pv { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.pv-h { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.pv-h .pav { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--avatar-bg); color: var(--avatar-text); font-size: 12px; font-weight: 600; flex: none; }
.pv-h b { flex: 1; font-size: 13px; font-weight: 600; }
.pv-h .sub { display: block; font-size: 12px; color: var(--text3); font-weight: 400; }
.pv-img { aspect-ratio: 1 / 1; background: var(--field) center/cover no-repeat; display: grid; place-items: center; color: var(--text3); max-width: 100%; }
.pv-img .i { width: 32px; height: 32px; }
.pv-img.wide { aspect-ratio: 4 / 3; }
.pv-txt { padding: 10px 12px 14px; font-size: 13px; line-height: 19px; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }
.pv-txt .tg { color: var(--info); }
.pv-txt .more { color: var(--text3); }
.pv-empty { padding: 32px 16px; text-align: center; color: var(--text2); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* 좁은 화면 */
@media (max-width: 1180px) {
  .m-preview { display: none; }
  .m-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; border: 1px solid var(--border); }
  .m-tabs button { border: 0; background: none; padding: 4px 10px; border-radius: 7px; font-size: 13px; color: var(--text2); font-weight: 500; cursor: pointer; }
  .m-tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-text); }
  .modal[data-ctab="preview"] .m-main .m-body { display: none; }
  .modal[data-ctab="preview"] .m-preview { display: flex; position: absolute; inset: 88px 24px 24px; z-index: 2; }
  .modal { position: relative; }
}
@media (max-width: 1100px) {
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)); border: 0; gap: 0; }
  .wcol { border: 1px solid var(--line); margin: 0 -1px -1px 0; }
}
@media (max-width: 760px) {
  #app { flex-direction: column; }
  .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; height: auto; flex-direction: row; justify-content: space-around; padding: 8px max(12px, env(safe-area-inset-left, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 30; background: color-mix(in srgb, var(--canvas) 85%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--border); overflow: visible; gap: 2px; }
  .rail-logo, .rail-ch, .rail-grow, .rail-me { display: none; }
  .rail-new { margin: 0; order: 3; }
  .rail > a { width: 44px; height: 44px; }
  .rail > a[data-nav="channels"] { order: 4; } .rail > a[data-nav="settings"] { order: 5; }
  .panel { margin: 0; border: 0; border-radius: 0; padding: 16px max(16px, env(safe-area-inset-left, 0px)) 96px; min-height: 100vh; }
  .ph h1 { font-size: 22px; line-height: 30px; }
  .ph-tile { width: 40px; height: 40px; }
  .view-toggle { margin-left: auto; }
  .toolbar .month { font-size: 16px; }
  .toolbar .vsep { display: none; }
  .week { grid-template-columns: 1fr; min-height: 0; }
  .wcol.past { display: none; }
  .wh { justify-content: flex-start; padding: 0 12px; }
  .add-slot { opacity: 1; }
  .mcell { min-height: 60px; padding: 4px; }
  .mpost span { display: none; }
  .lrow .when { width: 64px; }
  .lrow .limg { display: none; }
  .modal-wrap { padding: 0; }
  .modal { height: 100%; width: 100%; }
  .m-main { border-radius: 0; }
  .m-head { padding: 12px 12px 12px 16px; flex-wrap: wrap; }
  .m-body { padding: 16px; }
  .avatars { padding-left: 0; gap: 12px; }
  .editor-net { display: none; }
  .m-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .err { order: 9; flex-basis: 100%; text-align: left; }
  .m-foot .pop-anchor { margin-left: auto; }
  .date-pop { position: fixed; left: 8px; right: 8px; bottom: 76px; width: auto; }
  .modal[data-ctab="preview"] .m-preview { inset: 64px 0 72px; border-radius: 0; }
  .ch-pop { position: fixed; left: 8px; right: 8px; top: 120px; width: auto; }
}
