@font-face {
  font-family: "Tight"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/fonts/inter-tight-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Tight"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/fonts/inter-tight-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --blue: #146EF5; --blue-deep: #0B4CC4; --blue-soft: #EAF1FE;
  --ink: #080A0F; --soft: #3E4450; --mute: #6B7280;
  --line: #E6E9EF; --paper: #FFFFFF; --tint: #F6F8FB;
  --ok: #17803D; --ok-bg: #E7F6EC; --warn: #8A6106; --warn-bg: #FDF3DC;
  --bad: #9B2C2C; --bad-bg: #FDECEC;
  --shadow: 0 1px 2px rgba(8,10,15,.04), 0 8px 24px -12px rgba(8,10,15,.10);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--tint); color: var(--ink); font-size: 15.5px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.2; }
a { color: var(--blue-deep); }

/* ── top bar ─────────────────────────────────────────── */
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 60px;
  display: flex; align-items: center; gap: 20px; }
.logo { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; text-decoration: none; color: var(--ink); }
.logo i { font-style: normal; color: var(--blue); }
.brandtabs { display: flex; gap: 4px; margin-left: 8px; flex: 1; min-width: 0; overflow-x: auto; }
.brandtab { font-size: 14px; font-weight: 600; color: var(--soft); text-decoration: none;
  padding: 7px 13px; border-radius: 8px; white-space: nowrap; }
.brandtab:hover { background: var(--tint); }
.brandtab.on { background: var(--ink); color: #fff; }
.topbar .right { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.topbar .right a { color: var(--mute); text-decoration: none; }
.topbar .right a:hover { color: var(--ink); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 24px 70px; }

/* ── app shell with left rail ────────────────────────── */
.shell { max-width: 1240px; margin: 0 auto; padding: 24px 24px 70px;
  display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 26px; align-items: start; }
.rail { position: sticky; top: 84px; }
.rail a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  color: var(--soft); text-decoration: none; font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.rail a:hover { background: var(--paper); color: var(--ink); }
.rail a.on { background: var(--blue-soft); color: var(--blue-deep); }
.rail a svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rail .sep { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--mute); padding: 16px 12px 6px; }
.rail .badge { margin-left: auto; background: var(--warn-bg); color: var(--warn);
  font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.rail a.soon { opacity: .55; cursor: default; }
.rail a.soon:hover { background: none; color: var(--soft); }

/* style picker */
.stylegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.styleopt { position: relative; display: block; }
.styleopt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; }
.styleopt .box { display: block; border: 2px solid var(--line); border-radius: 12px; overflow: hidden;
  cursor: pointer; background: #fff; transition: border-color .15s; }
.styleopt .box .lab { display: block; }
.styleopt input:checked + .box { border-color: var(--blue); }
.styleopt .box img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--tint); }
.styleopt .box .lab { padding: 9px 11px; font-size: 13.5px; font-weight: 700; }
.styleopt input:checked + .box .lab { color: var(--blue-deep); }

/* connection rows */
.conn { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.conn:last-child { border-bottom: none; }
.conn .ico { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 15px; }
.conn .who { flex: 1; min-width: 0; }
.conn .who b { display: block; font-size: 15px; }
.conn .who span { font-size: 13px; color: var(--mute); }

/* month calendar */
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.month .dow { font-size: 11.5px; font-weight: 700; color: var(--mute); text-transform: uppercase;
  letter-spacing: .05em; text-align: center; padding-bottom: 4px; }
.month .cell { background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  min-height: 92px; padding: 7px 8px; }
.month .cell.out { background: transparent; border-color: transparent; }
.month .cell .num { font-size: 12.5px; font-weight: 700; color: var(--mute); }
.month .cell.today .num { color: var(--blue); }
.month .ev { display: block; font-size: 11.5px; font-weight: 600; border-radius: 5px;
  padding: 2px 5px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month .ev.review { background: var(--warn-bg); color: var(--warn); }
.month .ev.approved { background: var(--blue-soft); color: var(--blue-deep); }
.month .ev.posted { background: var(--ok-bg); color: var(--ok); }
.month .ev.draft { background: var(--tint); color: var(--mute); }
.month .ev.skipped, .month .ev.failed { background: var(--bad-bg); color: var(--bad); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
  .rail a { white-space: nowrap; margin-bottom: 0; }
  .rail .sep, .rail a.soon { display: none; }
  .month .cell { min-height: 66px; }
}

/* ── page head ───────────────────────────────────────── */
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  flex-wrap: wrap; margin-bottom: 20px; }
.pagehead h1 { font-size: 27px; font-weight: 800; }
.pagehead .meta { color: var(--mute); font-size: 14px; margin-top: 3px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
  padding: 5px 11px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-deep); }
.chip.auto { background: #E7F6EC; color: var(--ok); }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ── stats ───────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.stat span { font-size: 12.5px; color: var(--mute); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* ── layout ──────────────────────────────────────────── */
.cols { display: grid; grid-template-columns: minmax(0,1.9fr) minmax(0,1fr); gap: 20px; align-items: start; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.card .hint { color: var(--mute); font-size: 13.5px; margin-bottom: 14px; }

/* ── forms ───────────────────────────────────────────── */
label { font-size: 13px; font-weight: 600; color: var(--soft); display: block; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: 15px; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
.field { margin-bottom: 14px; }
.btn { display: inline-flex; align-items: center; gap: 7px; background: var(--blue); color: #fff;
  border: 1px solid var(--blue); border-radius: 9px; padding: 10px 16px; font-family: inherit;
  font-size: 14.5px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--tint); border-color: var(--mute); }
.btn.sm { padding: 7px 12px; font-size: 13.5px; border-radius: 8px; }
.btn.block { width: 100%; justify-content: center; }

/* weekday toggles */
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.day { position: relative; }
.day input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.day span { display: block; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--mute); background: #fff; cursor: pointer; }
.day input:checked + span { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-deep); }

/* ── posts ───────────────────────────────────────────── */
.dayhead { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.dayhead h2 { font-size: 14px; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: .06em; }
.dayhead .rule { flex: 1; height: 1px; background: var(--line); }

.post { background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.post-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.post-when { font-size: 13.5px; color: var(--mute); font-weight: 600; }
.post-when b { color: var(--ink); font-size: 15px; }
.post-body { display: flex; gap: 16px; align-items: flex-start; }
.post-body img { width: 128px; height: 128px; object-fit: cover; border-radius: 11px;
  border: 1px solid var(--line); flex: none; }
.post-caption { flex: 1; min-width: 0; font-size: 15.5px; }
.post-caption.empty { color: var(--mute); font-style: italic; }
.post-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.err { color: var(--bad); font-size: 13px; margin-top: 8px; }

.pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill.review { background: var(--warn-bg); color: var(--warn); }
.pill.approved { background: var(--blue-soft); color: var(--blue-deep); }
.pill.posted { background: var(--ok-bg); color: var(--ok); }
.pill.draft { background: var(--tint); color: var(--mute); }
.pill.failed, .pill.skipped { background: var(--bad-bg); color: var(--bad); }

/* photo grid */
.photos { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.photos img { width: 62px; height: 62px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); }
.upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.upload input[type=file] { font-size: 13px; max-width: 190px; }

.empty-state { text-align: center; padding: 36px 20px; color: var(--mute); }

/* ── auth ────────────────────────────────────────────── */
.authwrap { min-height: 78vh; display: flex; align-items: center; justify-content: center; padding: 30px 20px; }
.authcard { width: 100%; max-width: 396px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 16px; padding: 30px; box-shadow: var(--shadow); }
.authcard h1 { font-size: 24px; font-weight: 800; }
.authcard .sub { color: var(--mute); font-size: 14.5px; margin: 4px 0 20px; }
.alert { background: var(--bad-bg); color: var(--bad); border-radius: 9px; padding: 10px 13px;
  font-size: 14px; margin-bottom: 14px; }
.muted { color: var(--mute); font-size: 13.5px; }

@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .post-body img { width: 96px; height: 96px; }
}
