/* ==========================================================================
   OnePost UI v2 — design layer (loaded AFTER styles.css).
   Only restyles existing markup + styles the small v2 additions (v2.js).
   Rules: one blue primary per screen · mint = brand accent (non-text) ·
   grey text #5F6B78 (WCAG AA) · motion ≤0.2s, off with prefers-reduced-motion.
   ========================================================================== */
:root {
  --blue: #0047AB; --blue-dark: #003585; --blue-soft: #E8F0FA;
  --accent: #0047AB; --accent-hover: #003585;
  --mint: #14B8A0; --mint-ink: #0B7A68; --mint-50: #E8F7F3; --mint-100: #CDEFE7;
  --text: #191F28; --muted: #5F6B78; --line: #E5E8EB; --bg: #F4F6F8; --card: #fff;
  --ok: #0B7A3B; --fail: #B42318; --warn: #8A5A00;
  --c-instagram: #E1306C; --c-facebook: #1877F2; --c-threads: #2B2B2B; --c-youtube: #FF0033;
  --c-tiktok: #00A3A3; --c-x: #4A4A4A; --c-naver-clip: #03C75A; --c-naver-blog: #03C75A;
  --c-blogger: #FF8000; --c-linkedin: #0A66C2; --c-tumblr: #35465C; --c-video: #7A5AF8;
  --sh-1: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --sh-2: 0 4px 12px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.05);
  --sh-3: 0 12px 32px rgba(16,24,40,.10);
  --r: 16px; --r-sm: 12px;
}
body { background: var(--bg); color: var(--text); letter-spacing: -.01em; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--blue); }
.hint, .sub, .files, .who, .ghost-mini, .logout-btn { color: var(--muted); }
h2 { font-size: 24px; letter-spacing: -.02em; }
h3 { letter-spacing: -.015em; }

/* ---------- top brand band ---------- */
.app-shell::before {
  content: ""; position: fixed; left: 0; right: 0; top: 0; height: 4px; z-index: 50;
  background: linear-gradient(90deg, var(--mint), #4FB3F0 55%, var(--blue));
}

/* ---------- layout: promo rail ----------
   home/jobs: right column (as before)
   올리기·분석: moved BELOW the main work area as a quiet white card (never next to the primary button, never primary blue)
   달력·결제: hidden */
.app-shell { grid-template-columns: 240px minmax(0, 1fr) 280px; }
body[data-v2view="compose"] .app-shell,
body[data-v2view="analysis"] .app-shell,
body[data-v2view="calendar"] .app-shell,
body[data-v2view="billing"] .app-shell { grid-template-columns: 240px minmax(0, 1fr); }
body[data-v2view="calendar"] .ad-rail,
body[data-v2view="billing"] .ad-rail { display: none !important; }
body[data-v2view="compose"] .side,
body[data-v2view="analysis"] .side { grid-row: 1 / span 2; }
body[data-v2view="compose"] .ad-rail,
body[data-v2view="analysis"] .ad-rail {
  grid-column: 2; grid-row: 2; position: static; max-height: none; overflow: visible; align-self: start;
  margin: 0 32px 48px; padding: 0; border: 0; background: transparent;
}
body[data-v2view="compose"] #ad-rail-slots,
body[data-v2view="analysis"] #ad-rail-slots { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
body[data-v2view="compose"] .ad-rail .ad-card,
body[data-v2view="analysis"] .ad-rail .ad-card,
body[data-v2view="compose"] .ad-rail .ad-adsense,
body[data-v2view="analysis"] .ad-rail .ad-adsense {
  margin: 0 !important; background: #fff !important; border: 1px solid var(--line) !important; box-shadow: none !important; border-radius: 14px;
}
body[data-v2view="compose"] .ad-rail .ad-adsense,
body[data-v2view="analysis"] .ad-rail .ad-adsense { margin-top: 12px !important; padding: 12px; }
body[data-v2view="compose"] .ad-rail .ad-card-cta,
body[data-v2view="analysis"] .ad-rail .ad-card-cta { color: #333D4B !important; border-color: #D5DAE1 !important; background: #fff !important; }
body[data-v2view="compose"] .site-company,
body[data-v2view="analysis"] .site-company { grid-column: 1 / -1; }
@media (max-width: 800px) {
  body[data-v2view="compose"] .side, body[data-v2view="analysis"] .side { grid-row: auto; }
  body[data-v2view="compose"] .ad-rail, body[data-v2view="analysis"] .ad-rail { grid-column: 1; grid-row: auto; margin: 0 16px 24px; }
  body[data-v2view="compose"] #ad-rail-slots, body[data-v2view="analysis"] #ad-rail-slots { grid-template-columns: 1fr; }
}
.ad-rail { background: transparent; border-left: 0; padding-top: 28px; }
.ad-rail > * { }
.main { padding: 28px 32px 56px; }

/* ---------- sidebar ---------- */
.side { background: #fff; border-right: 0; box-shadow: 1px 0 0 var(--line); padding: 20px 14px 14px; }
.side .logo { padding: 4px 8px 18px; }
.side .logo b { font-size: 17px; letter-spacing: -.02em; }
select.shop {
  border: 0; background: #F2F4F6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235F6B78' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none; -webkit-appearance: none; border-radius: 12px; padding: 12px 34px 12px 12px; font-weight: 700;
}
.client-add-form input { border-color: var(--line); border-radius: 10px; }
.client-add-form button { background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 10px; font-weight: 600; }
.nav a, .nav-more > summary {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px;
  color: #333D4B; font-size: 15px; font-weight: 500; position: relative; transition: background .15s;
}
.nav a:hover, .nav-more > summary:hover { background: #F2F4F6; }
.nav a.on, .nav a.active { background: var(--mint-50); color: var(--text); font-weight: 700; }
.nav a.on::before, .nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--mint);
}
.nav .v2i { width: 20px; height: 20px; flex: none; color: #4E5968; }
.nav a.on .v2i, .nav a.active .v2i { color: var(--mint-ink); }
.nav kbd { margin-left: auto; font: 600 11px/1 Pretendard, sans-serif; color: var(--muted); background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 3px 5px; }
.nav-more { margin-top: 2px; }
.nav-more > summary { list-style: none; cursor: pointer; user-select: none; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid #8B95A1; border-bottom: 2px solid #8B95A1; transform: rotate(45deg); margin-right: 4px; transition: transform .15s; }
.nav-more[open] > summary::after { transform: rotate(-135deg); }
.nav-more .nav-sub { display: grid; gap: 1px; padding: 2px 0 6px 30px; }
.nav-more .nav-sub a { font-size: 14px; padding: 8px 10px; color: #4E5968; }
.v2-helpbox { margin: 14px 2px 6px; background: linear-gradient(160deg, var(--mint-50), #EEF5FD); border-radius: 14px; padding: 12px 12px 10px; }
.v2-helpbox b { display: block; font-size: 13px; margin-bottom: 6px; }
.v2-helpbox a { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #333D4B; text-decoration: none; padding: 6px 2px; }
.v2-helpbox a:hover { color: var(--blue); }

/* ---------- generic surfaces ---------- */
.tile, .box, .insight-card, .links, .naver-item, .card, .billing-card, .admin-stat {
  border: 0 !important; box-shadow: var(--sh-2); border-radius: var(--r);
}
.box { background: #fff; }
table { border-collapse: separate; border-spacing: 0; }
#jobs-table table, #scheduled-table table { background: #fff; border-radius: var(--r); box-shadow: var(--sh-2); overflow: hidden; width: 100%; }
#jobs-table th, #scheduled-table th { background: #F9FAFB; color: var(--muted); font-weight: 600; font-size: 13px; }
#jobs-table td, #jobs-table th, #scheduled-table td, #scheduled-table th { padding: 12px 14px; border-bottom: 1px solid #F2F4F6; text-align: left; vertical-align: top; }
input[type=text], input[type=email], input[type=number], input[type=datetime-local], textarea, select {
  border-radius: 12px; border: 1px solid #D1D6DB; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,71,171,.14); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* buttons: blue only for the single primary */
button, .btn { border-radius: 12px; font-weight: 600; transition: transform .1s, background .15s, box-shadow .15s; }
button:active, .btn:active { transform: scale(.98); }
button.secondary, .btn.ghost, .btn.secondary, .btn:not(.primary):not(.kakao):not(.naver):not(.fb) { background: #fff; color: var(--text); border: 1px solid #D1D6DB; }
.main .btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
#rm-send, #sns-report-png, #sns-report-pdf { background: #fff !important; color: var(--text) !important; border: 1px solid #D1D6DB !important; }

/* badges */
.badge { border-radius: 999px; padding: 3px 9px; font-weight: 600; border: 0; }
.badge.sim, .badge.done { background: #E7F6EC; color: var(--ok); }
.badge.sched { background: var(--blue-soft); color: var(--blue); }
.badge.wait { background: #FFF4DB; color: var(--warn); }
.badge.busy { background: var(--mint-50); color: var(--mint-ink); }
.badge.fail { background: #FDECEA; color: var(--fail); }

/* ---------- home ---------- */
#view-home > h2 { display: none; }
#view-home > .sub { margin-bottom: 14px; }
.v2-greet { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.v2-greet h2 { margin: 0; }
.v2-greet p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.v2-hero {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; padding: 22px;
  border-radius: 22px; background: linear-gradient(135deg, #E9F8F4 0%, #EEF5FE 60%, #F4F1FE 100%); box-shadow: var(--sh-2); margin-bottom: 18px;
  position: relative; overflow: hidden;
}
.v2-hero .k { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--mint-ink); background: #fff; border-radius: 999px; padding: 4px 10px; }
.v2-hero .big { font-size: 46px; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.v2-hero .delta { font-size: 14px; font-weight: 700; color: var(--ok); }
.v2-hero .delta.down { color: var(--fail); }
.v2-hero .delta.none { color: var(--muted); font-weight: 500; }
.v2-hero svg.spark { width: 100%; height: 86px; margin-top: 10px; display: block; }
.v2-hero .legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.v2-hero .legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.v2-top { background: #fff; border-radius: 18px; box-shadow: var(--sh-2); overflow: hidden; display: flex; flex-direction: column; }
.v2-top .ph { position: relative; aspect-ratio: 16/10; background: linear-gradient(135deg, var(--mint-100), #D9E8FB); }
.v2-top .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v2-top .ph .rk { position: absolute; left: 10px; top: 10px; background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; box-shadow: var(--sh-1); }
.v2-top .meta { padding: 12px 14px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.v2-top .meta b { font-size: 15px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-top .meta span { font-size: 12px; color: var(--muted); }
.v2-top .meta .v { font-weight: 800; font-size: 18px; white-space: nowrap; }
.v2-hero .empty { color: var(--muted); font-size: 14px; margin-top: 10px; }
.v2-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.v2-quick a, .v2-quick button {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 16px; box-shadow: var(--sh-2); padding: 14px 16px; font-size: 14px; font-weight: 700; color: var(--text);
}
.v2-quick .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.v2-quick small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; margin-top: 2px; }
.v2-quick [aria-disabled="true"] { cursor: default; opacity: .78; }
.v2-soon { display: inline-block; font-size: 11px; font-weight: 700; color: var(--warn); background: #FFF4DB; border-radius: 999px; padding: 2px 7px; margin-left: 6px; vertical-align: 1px; }
.v2-h3 { font-size: 17px; font-weight: 800; margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }

.tiles { gap: 14px; }
.tile { position: relative; padding: 16px 16px 14px 20px; overflow: hidden; transition: box-shadow .15s, transform .15s; }
.tile:hover { box-shadow: var(--sh-3); }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--chc, #D1D6DB); }
.tile[data-sns] .tile-name { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.tile[data-sns] .tile-name::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--chc, #D1D6DB); flex: none; }
.tile[data-sns="youtube"] { --chc: var(--c-youtube); } .tile[data-sns="instagram"] { --chc: var(--c-instagram); }
.tile[data-sns="facebook"] { --chc: var(--c-facebook); } .tile[data-sns="threads"] { --chc: var(--c-threads); }
.tile[data-sns="tiktok"] { --chc: var(--c-tiktok); } .tile[data-sns="x"] { --chc: var(--c-x); }
.tile[data-sns="linkedin"] { --chc: var(--c-linkedin); } .tile[data-sns="tumblr"] { --chc: var(--c-tumblr); } .tile[data-sns="blogger"] { --chc: var(--c-blogger); }
.tile[data-sns="naver-clip"] { --chc: var(--c-naver-clip); } .tile[data-sns="video"] { --chc: var(--c-video); }
.tile .st { font-size: 13px; margin-bottom: 10px; }
.tile .st.ok { color: var(--ok); font-weight: 600; }
.tile .st.off { color: var(--muted); }
.tile-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tile-actions .btn { height: 36px; font-size: 13px; padding: 0 12px; margin-top: 0; flex: 1 1 auto; white-space: nowrap; }
/* "연결" on tiles is NOT the screen primary → keep outlined; one blue per screen */
.tile-actions .btn.primary { background: #fff !important; color: var(--blue) !important; border: 1px solid #B9CCE8 !important; }
.tile.v2-connected { background: linear-gradient(180deg, #fff 0%, #FBFEFD 100%); }

/* ---------- compose ---------- */
#view-publish > h2 { margin-bottom: 2px; }
.v2-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; align-items: center; }
.v2-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: #fff; box-shadow: var(--sh-1); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: #333D4B; }
.v2-chip[aria-disabled="true"] { color: #6B7684; background: #F9FAFB; cursor: default; }
.post { grid-template-columns: minmax(300px, 1.1fr) minmax(250px, .9fr) minmax(240px, .85fr); gap: 18px; }
.compose-left { background: #fff; border-radius: var(--r); box-shadow: var(--sh-2); padding: 18px; }
.compose-stage .dropzone { border: 2px dashed #B8C4D6; border-radius: 14px; background: linear-gradient(180deg, #FAFCFF, #F3F7FC); transition: border-color .15s, background .15s; }
.compose-stage .dropzone:hover { border-color: var(--mint); background: var(--mint-50); }
.dropzone-title { font-weight: 700; }
.preview { background: #fff; color: var(--text); box-shadow: var(--sh-2); border-radius: var(--r); padding: 14px; }
.preview .tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chrome-tab { border-radius: 999px !important; padding: 5px 10px !important; font-size: 12px !important; font-weight: 600; background: #F2F4F6 !important; color: #4E5968 !important; border: 0 !important; text-decoration: none; }
.chrome-tab.active, .chrome-tab.on { background: var(--chc, var(--text)) !important; color: #fff !important; }
.chrome-tab[data-sns="youtube"] { --chc: var(--c-youtube); } .chrome-tab[data-sns="instagram"] { --chc: var(--c-instagram); }
.chrome-tab[data-sns="facebook"] { --chc: var(--c-facebook); } .chrome-tab[data-sns="threads"] { --chc: var(--c-threads); }
.chrome-tab[data-sns="tiktok"] { --chc: var(--c-tiktok); } .chrome-tab[data-sns="x"] { --chc: var(--c-x); }
.chrome-tab[data-sns="naver-clip"] { --chc: var(--c-naver-clip); } .chrome-tab[data-sns="linkedin"] { --chc: var(--c-linkedin); } .chrome-tab[data-sns="tumblr"] { --chc: var(--c-tumblr); }
.phone { border-radius: 26px; background: #111; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.box.chs { padding: 16px; }
.box.chs > .hint:first-child { font-size: 14px; font-weight: 800; color: var(--text); margin: 0 0 4px; }
.chs label.compose-channel-pick {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: #fff; position: relative; transition: box-shadow .15s, border-color .15s;
  border-left: 4px solid var(--chc, #D1D6DB);
}
.chs label.compose-channel-pick:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--chc, var(--blue)), var(--sh-1); border-color: var(--chc, var(--blue)); }
.chs label.compose-channel-pick:has(input:disabled) { background: #F9FAFB; color: #6B7684; cursor: not-allowed; border-left-color: #D1D6DB; }
.chs label.compose-channel-pick:has(input:disabled) .ch-hint { color: #6B7684; }
.chs label.compose-channel-pick[data-ch="instagram"] { --chc: var(--c-instagram); } .chs label.compose-channel-pick[data-ch="facebook"] { --chc: var(--c-facebook); }
.chs label.compose-channel-pick[data-ch="youtube"] { --chc: var(--c-youtube); } .chs label.compose-channel-pick[data-ch="tiktok"] { --chc: var(--c-tiktok); }
.chs label.compose-channel-pick[data-ch="threads"] { --chc: var(--c-threads); } .chs label.compose-channel-pick[data-ch="x"] { --chc: var(--c-x); }
.chs label.compose-channel-pick[data-ch="naver-clip"] { --chc: var(--c-naver-clip); } .chs label.compose-channel-pick[data-ch="linkedin"] { --chc: var(--c-linkedin); } .chs label.compose-channel-pick[data-ch="tumblr"] { --chc: var(--c-tumblr); }
.chs input[type=checkbox] { accent-color: var(--blue); width: 17px; height: 17px; vertical-align: -3px; }
.chs input[type=checkbox]:checked { animation: v2pop .18s ease-out; }
#compose-check-all-btn { border-radius: 999px; font-size: 13px; }
/* sticky single primary action bar */
.compose-actions {
  position: sticky; bottom: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(6px);
  margin: 12px -16px 8px; padding: 12px 16px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); flex-wrap: wrap;
}
#compose-publish-all-btn { flex: 1 1 140px; height: 46px; font-size: 15px; font-weight: 700; box-shadow: 0 6px 16px rgba(0,71,171,.25); }
#compose-publish-all-btn:disabled { box-shadow: none; }
.compose-actions .v2-kbd { font-size: 11px; color: var(--muted); width: 100%; }
#submit-btn { background: #fff; color: var(--text); border: 1px solid #D1D6DB; }
.channel-advanced > summary { border-radius: 14px; }
.tiktok-dp-box { border-radius: 14px; border: 0; box-shadow: inset 0 0 0 1.5px rgba(0,163,163,.35); }

/* ---------- 달력 (scheduled) ---------- */
.v2-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 6px 0 22px; }
.v2-day { background: #fff; border-radius: 14px; box-shadow: var(--sh-1); padding: 10px 8px; min-height: 120px; }
.v2-day.today { background: var(--mint-50); box-shadow: inset 0 0 0 1.5px var(--mint); }
.v2-day h4 { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; display: flex; justify-content: space-between; }
.v2-day h4 b { color: var(--text); font-size: 15px; }
.v2-slot { display: block; background: #F9FAFB; border-radius: 10px; padding: 6px 8px; margin-bottom: 6px; font-size: 12px; border-left: 4px solid var(--chc, var(--blue)); }
.v2-slot b { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-slot span { color: var(--muted); }
.v2-dots { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: 1px; }
.v2-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--chc); }

/* ---------- 분석 ---------- */
.v2-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 18px; }
.v2-tabs button { all: unset; cursor: pointer; padding: 10px 14px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.v2-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--mint); }
#view-yt-report[data-v2tab="perf"] #analysis-report-mail { display: none; }
#view-yt-report[data-v2tab="mail"] #analysis-insights-block,
#view-yt-report[data-v2tab="mail"] #v2-onepage-report { display: none; }
.v2-note { background: #FFF8E1; border: 1px solid #F3E2A6; color: #5C4600; border-radius: 12px; padding: 10px 12px; font-size: 13px; margin: 0 0 14px; }
.insights-total { background: linear-gradient(135deg, #E9F8F4, #EEF5FE); border-radius: 18px; box-shadow: var(--sh-2); border: 0; padding: 18px; }
.insights-total-val { font-size: 40px; font-weight: 800; letter-spacing: -.03em; }
.period-btn { border-radius: 999px; background: #F2F4F6; color: #4E5968; border: 0; }
.period-btn.active { background: var(--text); color: #fff; }
.sns-mini-card { border-radius: 14px; box-shadow: var(--sh-1); }
.sns-spark-col i { background: var(--mint) !important; border-radius: 3px 3px 0 0; }
.analysis-report-mail { background: #fff; border-radius: var(--r); box-shadow: var(--sh-2); padding: 18px; }

/* ---------- help '?' ---------- */
.v2-q { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #E5E8EB; color: #4E5968; font: 700 11px/1 Pretendard, sans-serif; cursor: help; position: relative; vertical-align: 1px; margin-left: 4px; }
.v2-q:hover::after, .v2-q:focus::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 240px;
  background: #191F28; color: #fff; font-size: 12px; font-weight: 500; line-height: 1.5; padding: 8px 10px; border-radius: 10px; z-index: 60; white-space: normal;
}

/* ---------- login ---------- */
body.logged-out, .login { background: #F4F6F8; }
.login-hero { background: radial-gradient(800px 420px at 10% -10%, rgba(20,184,160,.20), transparent 60%), radial-gradient(700px 380px at 95% 5%, rgba(0,71,171,.12), transparent 55%), linear-gradient(180deg, #EEF7F5 0%, #F4F6F8 60%); }
.login-hero::before { opacity: .25; }
.login-pitch-kicker { color: var(--mint-ink) !important; font-weight: 700; }
.login-pitch-title { font-size: 40px !important; letter-spacing: -.035em; line-height: 1.2 !important; }
.login .card, .login-card { border: 0; box-shadow: var(--sh-3); border-radius: 22px; }
.login .btn { height: 48px; border-radius: 12px; font-weight: 700; }
.google-login-btn { border: 1px solid #D1D6DB !important; }
.v2-login-photos { display: flex; gap: 10px; margin-top: 18px; }
.v2-login-photos span { width: 86px; height: 86px; border-radius: 18px; background: linear-gradient(135deg, var(--mint-100), #D9E8FB); box-shadow: var(--sh-2); display: grid; place-items: center; font-size: 26px; }
.v2-login-photos span:nth-child(2) { transform: translateY(10px) rotate(3deg); }
.v2-login-photos span:nth-child(3) { transform: rotate(-3deg); }

/* ---------- mobile ---------- */
.v2-tabbar { display: none; }
@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr !important; }
  .main { padding: 18px 16px 110px; }
  .side { position: sticky; top: 0; z-index: 40; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px 10px; min-height: 0; max-height: none; overflow: visible; box-shadow: 0 1px 0 var(--line); }
  .side .logo { padding: 0; order: 0; }
  .side .logo span { display: none; }
  .side select.shop { order: 1; flex: 1; margin: 0; width: auto; min-width: 0; }
  .side > *:not(.logo):not(select.shop) { display: none; }
  body.v2-more-open .side { position: fixed; inset: 0; z-index: 70; overflow: auto; flex-direction: column; align-items: stretch; flex-wrap: nowrap; padding-bottom: 100px; }
  body.v2-more-open .side > *:not(.hidden):not([hidden]) { display: revert; }
  body.v2-more-open .side > nav.side-nav { display: block; }
  body.v2-more-open .side .nav-more { display: block; }
  body.v2-more-open .side .client-add-form, body.v2-more-open .side .client-mini-actions { display: flex; }
  .nav kbd { display: none; }
  .v2-tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    background: rgba(255,255,255,.97); backdrop-filter: blur(8px); box-shadow: 0 -1px 0 var(--line), 0 -6px 18px rgba(16,24,40,.06); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .v2-tabbar a, .v2-tabbar button { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: #6B7684; padding: 4px 0; position: relative; }
  .v2-tabbar .v2i { width: 22px; height: 22px; }
  .v2-tabbar .on { color: var(--text); }
  .v2-tabbar .on::before { content: ""; position: absolute; top: -6px; width: 22px; height: 3px; border-radius: 3px; background: var(--mint); }
  .v2-tabbar .fab span.c { width: 48px; height: 48px; margin-top: -20px; border-radius: 16px; background: var(--text); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px rgba(25,31,40,.3); }
  .v2-tabbar .fab .v2i { color: #fff; }
  .ad-rail { padding: 0 16px 100px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 14px 12px 12px 16px; }
  .tile-actions .btn { flex: 1 1 100%; }
  .v2-hero { grid-template-columns: 1fr; padding: 18px; }
  .v2-hero .big { font-size: 40px; }
  .v2-top .ph { aspect-ratio: 16/9; max-height: 200px; }
  .v2-greet h2 { font-size: 21px; }
  .v2-quick { grid-template-columns: 1fr; gap: 8px; }
  .post { grid-template-columns: 1fr; }
  .compose-actions { bottom: 64px; }
  .v2-week { grid-template-columns: 1fr; }
  .v2-day { min-height: 0; display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: start; }
  .v2-day h4 { flex-direction: column; margin: 0; }
  .login-pitch-title { font-size: 30px !important; }
  #jobs-table, #scheduled-table { overflow-x: auto; }
}

/* ---------- motion ---------- */
@keyframes v2pop { 0% { transform: scale(.6); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes v2rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.v2-hero, .v2-quick, .tile { animation: v2rise .2s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* promo rail: informational, never the screen's primary */
.ad-rail .btn.primary, .ad-rail a.btn { background:#fff !important; color:var(--blue) !important; border:1px solid #B9CCE8 !important; }
.ad-rail { font-size: 14px; }
.ad-rail > *:first-child { }
.ad-card { background:#fff; border-radius:18px; box-shadow:var(--sh-2); padding:16px; margin-bottom:12px; border:0; }
.ad-card:first-child { background:linear-gradient(160deg,#F4F1FE,#EEF5FE); }
.ad-card-cta { display:inline-flex !important; align-items:center; height:40px; padding:0 14px; border-radius:12px; background:#fff !important; color:var(--blue) !important; border:1px solid #B9CCE8 !important; font-weight:700; text-decoration:none; }
.ad-card-eyebrow { color:var(--muted); }
#compose-publish-all-btn.v2-empty { background:#E5E8EB; border-color:#E5E8EB; color:#4E5968; box-shadow:none; }
/* 올리기: keep the channel column + its single primary button in view */
@media (min-width: 1101px) {
  .post > .box.chs { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
}
@media (max-width: 800px) {
  .v2-tools { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-right: -16px; }
  .v2-chip { flex: none; }
  body[data-v2view="compose"] .main { padding-bottom: 200px; }
  body[data-v2view="compose"] .compose-actions { position: fixed; left: 0; right: 0; bottom: 62px; margin: 0; border-radius: 0; z-index: 75; box-shadow: 0 -4px 14px rgba(16,24,40,.06); }
}
@media (max-width: 800px) { .v2-tabbar .fab.on::before { display: none; } .v2-tabbar .fab.on span.c { background: var(--mint-ink); } }
@media (max-width: 800px) { #jobs-table table, #scheduled-table table { min-width: 640px; } }
@media (max-width: 800px) {
  body.v2-more-open .side .logo { display: flex; }
  body.v2-more-open .side select.shop { display: block; width: 100%; flex: none; margin: 10px 0 8px; order: 0; }
  body.v2-more-open .side .client-add-form { margin-bottom: 4px; }
  .login .login-card { order: -1; }
  .v2-login-photos { display: none; }
}
.login-pitch-list li { border: 0 !important; box-shadow: var(--sh-1); }
.login-pitch-list li::before { background: var(--mint) !important; box-shadow: 0 0 0 3px rgba(20,184,160,.2) !important; }

/* logged out: no bottom tab bar */
body:has(#login-screen:not([hidden]):not(.hidden)) .v2-tabbar { display: none !important; }

/* 연결이 끊겼거나 곧 끊기는 채널: 서버 토큰 상태 기준 (sns-auto-refresh) */
.tile .st.bad { color: var(--fail); font-weight: 700; }
.needs-reconnect { color: var(--fail) !important; font-weight: 700; }
.btn.reconnect-btn { background: var(--fail) !important; border-color: var(--fail) !important; color: #fff !important; }
.tile-actions .btn.reconnect-btn { background: #fff !important; color: var(--fail) !important; border: 1px solid var(--fail) !important; font-weight: 700; }
