@font-face { font-family: "Mona Sans"; src: url("/brand-assets/socketjournal/fonts/MonaSans.ttf") format("truetype"); font-weight: 200 900; font-stretch: 75% 125%; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/brand-assets/socketjournal/fonts/SourceSerif4.ttf") format("truetype"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/brand-assets/socketjournal/fonts/JetBrainsMono.ttf") format("truetype"); font-weight: 100 800; font-display: swap; }

:root {
  --ink: #0e1726; --ink2: #162036; --ink-line: #2a3650; --on-ink: #fff; --on-ink2: #aeb8c8;
  --paper: #f4f5f7; --surface: #fff; --line: #e2e5ea; --line2: #cbd0d8;
  --text: #0e1726; --text2: #414b5a; --text3: #5f6a7a;
  --accent: #1f5fd6; --ok: #1a7f45; --warn: #a15c07; --bad: #b42318;
  --ok-bg: #e8f4ed; --warn-bg: #fdf3e2; --bad-bg: #fbeceb; --info-bg: #e9effb;
  --r: 4px; --side: 232px;
  --sans: "Mona Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--sans); color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 8px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text3); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ------------------------------------------------------------ layout */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--ink); color: var(--on-ink2); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 18px 20px 14px; border-bottom: 1px solid var(--ink-line); }
.side .brand img { height: 22px; display: block; }
.side .brand .product { margin-top: 8px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-ink2); }
.nav { padding: 8px 0 24px; }
.nav .group { padding: 14px 20px 4px; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: #7d8aa0; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 6px 20px; color: var(--on-ink2); font-size: 13.5px; border-left: 2px solid transparent; }
.nav a:hover { color: var(--on-ink); background: var(--ink2); text-decoration: none; }
.nav a.active { color: var(--on-ink); background: var(--ink2); border-left-color: var(--on-ink); }
.nav .count { font-family: var(--mono); font-size: 11px; color: var(--on-ink); background: var(--ink-line); border-radius: var(--r); padding: 0 6px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 0 24px; height: 56px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .title { font-weight: 650; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .menu { display: none; }
.content { padding: 24px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--text3); max-width: 760px; }

/* ------------------------------------------------------------ pieces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.card > .hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card > .bd { padding: 16px; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--text3); }
.stat .v { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .s { font-size: 12px; color: var(--text3); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.meter { height: 6px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.meter > i { display: block; height: 100%; background: var(--ink); }
.meter.warn > i { background: var(--warn); }
.meter.bad > i { background: var(--bad); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 550; padding: 1px 7px; border-radius: var(--r); border: 1px solid var(--line2); color: var(--text2); background: var(--surface); white-space: nowrap; }
.badge.ok { color: var(--ok); background: var(--ok-bg); border-color: #b9dcc7; }
.badge.warn { color: var(--warn); background: var(--warn-bg); border-color: #edd3a6; }
.badge.bad { color: var(--bad); background: var(--bad-bg); border-color: #efc2be; }
.badge.info { color: var(--accent); background: var(--info-bg); border-color: #c3d3f3; }
.badge.ink { color: var(--on-ink); background: var(--ink); border-color: var(--ink); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.pf { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 550; }
.pf svg { width: 15px; height: 15px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; font: 550 13px var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--text3); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn.primary:hover { background: var(--ink2); }
.btn.danger { color: var(--bad); border-color: #efc2be; }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; }
.kill { height: 32px; }
.kill.on { background: var(--bad); color: #fff; border-color: var(--bad); }

table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-weight: 600; font-size: 11.5px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t .clip { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scroll-x { overflow-x: auto; }

label.f { display: block; }
label.f > span { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 4px; }
label.f > small { display: block; color: var(--text3); font-size: 12px; margin-top: 4px; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], input[type=time], select, textarea {
  width: 100%; font: 13.5px var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r); padding: 7px 9px;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check input { margin-top: 3px; }
.check small { display: block; color: var(--text3); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.counter { font-family: var(--mono); font-size: 11.5px; color: var(--text3); text-align: right; margin-top: 3px; }
.counter.over { color: var(--bad); font-weight: 700; }

.note { padding: 10px 12px; border-radius: var(--r); background: var(--info-bg); color: #1d3f86; border: 1px solid #c3d3f3; font-size: 13px; }
.note.warn { background: var(--warn-bg); color: #6b3d04; border-color: #edd3a6; }
.note.bad { background: var(--bad-bg); color: #7a1912; border-color: #efc2be; }
.note.ok { background: var(--ok-bg); color: #10532c; border-color: #b9dcc7; }
.empty { padding: 32px 16px; text-align: center; color: var(--text3); }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--text2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 550; }
.tabs a.active { color: var(--text); border-bottom-color: var(--ink); }
.tabs a:hover { text-decoration: none; color: var(--text); }

/* ------------------------------------------------------------ post list */
.posts { display: grid; gap: 10px; }
.post { display: grid; grid-template-columns: 88px 1fr auto; gap: 14px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.post .thumb { width: 88px; height: 110px; object-fit: cover; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); }
.post .thumb.land { height: 50px; }
.post .cap { white-space: pre-wrap; color: var(--text2); font-size: 13px; max-height: 60px; overflow: hidden; }
.post .meta { font-size: 12px; color: var(--text3); }
.post .acts { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }

/* ------------------------------------------------------------ calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.cal .day { min-height: 180px; border-right: 1px solid var(--line); padding: 8px; }
.cal .day:last-child { border-right: 0; }
.cal .day.today { background: #fafbfc; }
.cal .dh { font-size: 12px; font-weight: 650; color: var(--text2); margin-bottom: 6px; display: flex; justify-content: space-between; }
.cal .ev { display: block; font-size: 11.5px; padding: 4px 6px; border: 1px solid var(--line); border-left-width: 3px; border-radius: 2px; margin-bottom: 4px; color: var(--text); background: var(--surface); overflow: hidden; }
.cal .ev:hover { text-decoration: none; border-color: var(--line2); }
.cal .ev .tm { font-family: var(--mono); color: var(--text3); }
.cal .ev .tl { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.st-published { border-left-color: var(--ok); }
.ev.st-scheduled { border-left-color: var(--accent); }
.ev.st-pending_approval, .ev.st-draft, .ev.st-held { border-left-color: var(--warn); }
.ev.st-failed, .ev.st-needs_review { border-left-color: var(--bad); }

/* ------------------------------------------------------------ gallery */
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.gal figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.gal img { display: block; width: 100%; height: auto; background: var(--paper); cursor: zoom-in; }
.gal figcaption { padding: 8px 10px; font-size: 12px; color: var(--text2); border-top: 1px solid var(--line); }
.style-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.style-pick .opt { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.style-pick .opt.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.style-pick .imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); }
.style-pick .imgs img { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; }
.style-pick .bd { padding: 12px 14px; }

.lightbox { position: fixed; inset: 0; background: rgba(14, 23, 38, 0.86); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; background: #fff; }

/* ------------------------------------------------------------ platform mockups */
.mocks { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.mock { width: 340px; background: #fff; color: #0f1419; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 14px; }
.mock .lbl { font: 600 11px var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text3); padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--paper); display: flex; justify-content: space-between; }
.mock .av { width: 32px; height: 32px; border-radius: 50%; display: block; flex: none; object-fit: cover; background: var(--ink); }
.mock .who { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.mock .who b { font-weight: 600; font-size: 13.5px; }
.mock .who .sub { color: #737373; font-size: 12.5px; }
.mock .media { position: relative; background: #efefef; }
.mock .media img { width: 100%; display: block; }
.mock .dots { display: flex; justify-content: center; gap: 4px; padding: 8px 0 0; }
.mock .dots i { width: 6px; height: 6px; border-radius: 50%; background: #c7c7c7; }
.mock .dots i.on { background: #0095f6; }
.mock .icons { display: flex; gap: 14px; padding: 8px 12px 4px; }
.mock .icons svg { width: 22px; height: 22px; stroke: #0f1419; fill: none; stroke-width: 1.8; }
.mock .icons .end { margin-left: auto; }
.mock .text { padding: 4px 12px 12px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.4; }
.mock .text .tags { color: #00376b; }
.mock .text a { color: #1d9bf0; }
.mock .more { color: #737373; }
.mock .count { font-family: var(--mono); font-size: 11px; }
.mock.ig-story { width: 260px; background: #000; color: #fff; border-color: #000; }
.mock.ig-story .frame { position: relative; aspect-ratio: 9/16; }
.mock.ig-story .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mock.ig-story .bar { position: absolute; top: 8px; left: 8px; right: 8px; height: 2px; background: rgba(255,255,255,0.4); }
.mock.ig-story .bar i { display: block; width: 35%; height: 100%; background: #fff; }
.mock.ig-story .who { position: absolute; top: 14px; left: 0; color: #fff; padding: 6px 10px; }
.mock.ig-story .who .sub { color: rgba(255,255,255,0.75); }
.mock.ig-story .sticker { position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); background: #fff; color: #0f1419; font-weight: 600; font-size: 12px; padding: 6px 12px; border-radius: 6px; white-space: nowrap; }
.mock.threads .post-body { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 12px; }
.mock.threads .media img, .mock.x .media img { border-radius: 8px; border: 1px solid #e5e5e5; }
.mock.threads .media, .mock.x .media { background: none; margin-top: 8px; }
.mock.x .post-body { display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 12px; }
.mock.x .av { width: 40px; height: 40px; }
.mock.x .icons, .mock.threads .icons { padding: 8px 0 0; justify-content: space-between; max-width: 260px; }
.mock.x .icons svg, .mock.threads .icons svg { width: 18px; height: 18px; stroke: #536471; }
.mock .linkcard { margin-top: 8px; border: 1px solid #e5e5e5; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; color: #536471; }

/* ------------------------------------------------------------ editor */
.editor { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.pages { display: grid; gap: 12px; }
.page-ed { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; background: var(--paper); }
.render-out img { max-width: 100%; border: 1px solid var(--line); display: block; }
.warnings { margin: 8px 0 0; padding-left: 18px; color: var(--bad); font-size: 12.5px; }

/* ------------------------------------------------------------ login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink); padding: 24px; }
.login .box { width: 100%; max-width: 360px; background: var(--surface); border-radius: var(--r); padding: 28px; }
.login .box img { height: 24px; margin-bottom: 6px; }
.login h1 { font-size: 17px; margin-bottom: 18px; color: var(--text2); font-weight: 550; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; }
.toast div { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r); font-size: 13px; max-width: 420px; }
.toast div.bad { background: var(--bad); }

.chart { width: 100%; height: auto; display: block; }
.chart text { font: 11px var(--sans); fill: var(--text3); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

pre.log { margin: 0; font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; }
.lv-error { color: var(--bad); font-weight: 600; }
.lv-warn { color: var(--warn); font-weight: 600; }
.lv-debug { color: var(--text3); }

/* ------------------------------------------------------------ small screens */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor { grid-template-columns: 1fr; }
  .style-pick { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 264px; transform: translateX(-100%); transition: transform 0.15s; }
  .shell.nav-open .side { transform: none; }
  .top .menu { display: inline-flex; }
  .top { padding: 0 14px; }
  .content { padding: 16px 14px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .post { grid-template-columns: 64px 1fr; }
  .post .thumb { width: 64px; height: 80px; }
  .post .acts { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .cal { grid-template-columns: 1fr; }
  .cal .day { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .mock { width: 100%; max-width: 360px; }
  .top .hide-sm { display: none; }
}

/* carousel strip inside mockups */
.mock .media.strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.mock .media.strip img { flex: 0 0 100%; scroll-snap-align: start; }
.mock .media.strip::-webkit-scrollbar { display: none; }
a.card.stat { color: inherit; }
a.card.stat:hover { text-decoration: none; border-color: var(--line2); }

/* Telegram mockup */
.mock.tg { background: #dfe7ee; }
.mock.tg .who { background: #fff; border-bottom: 1px solid #e4e4e4; }
.mock.tg .tg-msg { margin: 12px; background: #fff; border-radius: 10px; overflow: hidden; }
.mock.tg .tg-msg img { width: 100%; display: block; }
.mock.tg .tg-msg .text { padding: 8px 10px 0; }
.mock.tg .tg-msg .text a { color: #2a6fb0; }
.mock.tg .tg-meta { text-align: right; font-size: 11px; color: #8a96a3; padding: 2px 10px 6px; }
