/* T.Social — design system + app shell.
   Every legacy utility class (.card .btn .badge .muted .row .progress
   .empty-state .ratio-*) is preserved so existing templates keep working. */

:root {
  color-scheme: light dark;
  --brand: #2f6bff;
  --brand-strong: #1f52e0;
  --brand-tint: #eef3ff;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e6e8ee;
  --border-strong: #d7dae2;
  --text: #0f1729;
  --text-2: #475069;
  --muted: #8b93a7;
  --ok: #16a34a;
  --ok-bg: #e9f7ef;
  --warn: #b45309;
  --warn-bg: #fdf3e3;
  --bad: #dc2626;
  --bad-bg: #fdecec;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow-md: 0 6px 24px rgba(15,23,42,.08);
  --sidebar-w: 250px;
  --hero-grad: linear-gradient(120deg, #e8f0ff 0%, #eef4ff 45%, #f3f0ff 100%);
  /* the sidebar is always dark, independent of the light/dark theme */
  --nav-bg: #0e1626;
  --nav-text: #9aa3b8;
  --nav-hover-bg: #1a2540;
  --nav-active-bg: #2f6bff;
}

/* dark palette — applied by the OS preference (unless the user chose light)
   and by the in-app theme toggle (data-theme="dark") */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #4f82ff; --brand-strong: #6f99ff; --brand-tint: #17233f;
    --bg: #0c1017; --surface: #121722; --surface-2: #161c28;
    --border: #232a38; --border-strong: #313a4c;
    --text: #eef1f6; --text-2: #b9c1d0; --muted: #7c869a;
    --ok-bg: #12271c; --warn-bg: #2a2013; --bad-bg: #2a1615;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 10px 30px rgba(0,0,0,.5);
    --hero-grad: linear-gradient(120deg, #13233f, #16182a);
  }
}
:root[data-theme="dark"] {
  --brand: #4f82ff; --brand-strong: #6f99ff; --brand-tint: #17233f;
  --bg: #0c1017; --surface: #121722; --surface-2: #161c28;
  --border: #232a38; --border-strong: #313a4c;
  --text: #eef1f6; --text-2: #b9c1d0; --muted: #7c869a;
  --ok-bg: #12271c; --warn-bg: #2a2013; --bad-bg: #2a1615;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 10px 30px rgba(0,0,0,.5);
  --hero-grad: linear-gradient(120deg, #13233f, #16182a);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* .btn etc. set display and would otherwise win */
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; font-weight: 650; letter-spacing: -.02em; margin: 0 0 .3rem; }
h2 { font-size: 1.08rem; font-weight: 620; margin: 1.3rem 0 .5rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; font-weight: 620; margin: 0 0 .35rem; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: .05rem .3rem; font-size: .85em; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.app.no-nav { grid-template-columns: 1fr; }

.sidebar {
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; font-weight: 800; font-size: 1.22rem; letter-spacing: -.02em; color: #fff; }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand b { color: #fff; font-weight: 800; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 11px;
  color: var(--nav-text); font-weight: 550; font-size: .93rem;
}
.nav a:hover { background: var(--nav-hover-bg); text-decoration: none; color: #fff; }
.nav a.active { background: var(--nav-active-bg); color: #fff; font-weight: 650; box-shadow: 0 6px 16px rgba(47,107,255,.35); }
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .95; }
.nav a.soon { pointer-events: none; }
.nav a.soon svg { opacity: .5; }
.nav a.soon::after {
  content: "SOON"; margin-left: auto; font-size: .58rem; font-weight: 700;
  letter-spacing: .06em; color: #6f7a92; background: #1a2440;
  border-radius: 6px; padding: 2px 6px;
}

.sidebar-spacer { flex: 1; }
.promo { background: #182241; border: 1px solid #22335c; border-radius: var(--radius); padding: 14px; text-align: center; margin-top: 12px; color: #c6cfe4; }
.promo .emoji { font-size: 1.5rem; }
.promo strong { display: block; margin: 4px 0 2px; color: #fff; }
.promo p { font-size: .82rem; color: #9aa3b8; margin: .3rem 0 .7rem; }
.sidebar-foot { padding: 14px 8px 2px; margin-top: 10px; border-top: 1px solid #1c2740; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sidebar-foot a, .sidebar-foot .foot-link {
  color: #8b94ab; font-size: .86rem; display: inline-flex; gap: 9px; align-items: center;
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: .86rem;
}
.sidebar-foot a:hover, .sidebar-foot .foot-link:hover { color: #fff; text-decoration: none; }
.sidebar-foot svg { width: 17px; height: 17px; }

.topbar {
  height: 52px; background: var(--bg);
  display: flex; align-items: center; justify-content: flex-end; gap: 4px;
  padding: 8px 26px 0; position: sticky; top: 0; z-index: 20;
}
.topbar .icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; position: relative;
}
.topbar .icon-btn:hover { background: var(--surface); box-shadow: var(--shadow-sm); }
.topbar .icon-btn svg { width: 19px; height: 19px; }
.dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); border: 2px solid var(--bg); }

.usermenu { position: relative; margin-left: 6px; }
.usermenu > button { display: flex; align-items: center; gap: 9px; background: transparent; border: 1px solid transparent; padding: 5px 8px; border-radius: 10px; cursor: pointer; color: var(--text); font: inherit; }
.usermenu > button:hover { background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg,#c084fc,#a855f7); color: #fff; display: grid; place-items: center; font-size: .78rem; font-weight: 700; flex: none; }
.usermenu .caret { width: 14px; height: 14px; color: var(--muted); }
.usermenu .menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  box-shadow: var(--shadow-md); padding: 6px; display: none;
}
.usermenu.open .menu { display: block; }
.usermenu .menu a, .usermenu .menu button {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px;
  background: transparent; border: 0; color: var(--text); font: inherit; cursor: pointer;
}
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--surface-2); text-decoration: none; }
.usermenu .menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 2px; }

.main { min-width: 0; }
/* left-aligned against the sidebar (not centred) so content sits right next to
   the nav; the wide cap only bites on ultra-wide monitors */
.content { max-width: 1440px; margin: 0; padding: 16px 28px 44px; }
.content.content-narrow { max-width: 720px; margin: 0 auto; padding-top: 36px; }
.subtitle { color: var(--text-2); margin: 0 0 1.2rem; max-width: 46ch; }

/* ---------- legacy utilities (kept) ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; margin: .65rem 0; box-shadow: var(--shadow-sm); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.muted { color: var(--muted); font-size: .88rem; }

.badge { display: inline-flex; align-items: center; font-size: .74rem; font-weight: 600; padding: .18rem .55rem; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-2); background: var(--surface-2); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.badge.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.badge.bad { background: var(--bad-bg); border-color: transparent; color: var(--bad); }

button, .btn {
  font: inherit; font-weight: 600; font-size: .9rem;
  padding: .5rem .95rem; border-radius: var(--radius-sm); border: 1px solid var(--brand);
  background: var(--brand); color: #fff; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; line-height: 1.1;
}
button:hover, .btn:hover { background: var(--brand-strong); border-color: var(--brand-strong); text-decoration: none; }
button.secondary, .btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
button.secondary:hover, .btn.secondary:hover { background: var(--surface-2); }
button:disabled, .btn:disabled, button[disabled] { opacity: .55; cursor: not-allowed; background: var(--surface-2); color: var(--muted); border-color: var(--border); }

input, select, textarea {
  font: inherit; padding: .5rem .6rem; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
label { font-size: .9rem; font-weight: 550; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
td, th { text-align: left; padding: .5rem .55rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }

/* keeps a wide table from pushing the page sideways: it scrolls inside here */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Recent posts: fixed columns so the free-text "Detail" cell wraps instead of
   stretching the table. The other columns hold short, known-shape values.
   `min-width` keeps the 8 columns legible — on a phone the .table-wrap scrolls
   rather than crushing the headers into each other. */
.posts-table { table-layout: fixed; min-width: 46rem; }
.posts-table th, .posts-table td { vertical-align: top; word-break: normal; }
/* the free-text Detail cell wraps at spaces (splitting a word only when the
   word itself is wider than the column) and is clamped so a long Graph API
   error can't blow up the row height — full text is in the title tooltip */
.posts-table td:nth-child(7) { overflow-wrap: break-word; }
.posts-table .pd-cell {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  overflow: hidden;
}
.posts-table .c-when { width: 5rem; }
.posts-table .c-plat { width: 6rem; }
.posts-table .c-src { width: 5.5rem; }
.posts-table .c-status { width: 6.5rem; }
.posts-table .c-act { width: 6.5rem; }
.post-actions { display: flex; flex-direction: column; gap: 4px; }
.post-actions form { margin: 0; }
.post-actions .btn, .post-actions button { width: 100%; padding: .32rem .4rem; font-size: .8rem; }

/* small hyperlink-style row actions (e.g. Content Planner Edit/Enable/Delete)
   — plain text, no button chrome, no icon: compact inline actions in a table row. */
.row-links { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.row-links form { margin: 0; display: inline; }
.row-links button, .row-links .link-action {
  background: none; border: none; padding: 0; margin: 0; font: inherit;
  font-size: .82rem; font-weight: 600; color: var(--brand); cursor: pointer; text-decoration: none;
}
.row-links button:hover, .row-links .link-action:hover { text-decoration: underline; background: none; }
.row-links .danger { color: var(--bad); }
.row-links .sep { color: var(--border-strong); }
.posts-table .c-acct { width: 15%; }
.posts-table .c-topic { width: 13%; }
/* .c-detail has no width — it absorbs the remaining space and wraps */

.progress { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; height: 9px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ok); }
.empty-state { text-align: center; padding: 2.4rem 1rem; }
.empty-icon { font-size: 2.1rem; }
.empty-steps { display: inline-block; text-align: left; margin: .6rem auto; color: var(--text-2); }

.ratio-picker { border: 1px solid var(--border); border-radius: 10px; padding: .7rem; display: flex; gap: 1rem; align-items: flex-end; }
.ratio-opt { display: flex; flex-direction: column; align-items: center; gap: .3rem; cursor: pointer; text-align: center; }
.ratio-box { border: 2px solid var(--border-strong); border-radius: 4px; display: block; background: var(--surface-2); }
.ratio-opt input { margin: 0; }
.ratio-opt input:checked ~ .ratio-box { border-color: var(--brand); background: var(--brand-tint); }

.media-kind-picker { border: 1px solid var(--border); border-radius: 10px; padding: .7rem .9rem;
  display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; align-items: center; }
.media-kind-picker .mk-opt { display: flex; align-items: center; gap: .35rem; cursor: pointer; white-space: nowrap; }
.media-kind-picker .mk-opt input { margin: 0; }

details > summary { cursor: pointer; }
footer.legal { color: var(--muted); font-size: .85rem; margin-top: 2.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }

/* ---------- hero / greeting ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--hero-grad);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 22px;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px;
}
.hero-emoji {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: rgba(255,255,255,.8); display: grid; place-items: center;
  font-size: 1.35rem; box-shadow: var(--shadow-sm); z-index: 1;
}
.hero-body { flex: 1; min-width: 0; z-index: 1; }
.hero-body h1 { margin: 0 0 .2rem; font-size: 1.45rem; }
.hero-body p { margin: 0; color: var(--text-2); max-width: 60ch; font-size: .9rem; }
.hero-actions { flex: none; z-index: 1; padding-left: 22px; border-left: 1px solid rgba(120,130,160,.25); }
.hero-plats { flex: none; display: flex; align-items: center; gap: 12px; pointer-events: none; }
.hero-plats svg { width: 40px; height: 40px; filter: drop-shadow(0 8px 16px rgba(31,52,120,.18)); }
.hero-plats svg:nth-of-type(1) { transform: rotate(-8deg); }
.hero-plats svg:nth-of-type(2) { transform: translateY(-4px); }
.hero-plats svg:nth-of-type(3) { transform: rotate(8deg); }
.hero-plats .spark { color: var(--brand); opacity: .5; font-size: .8rem; }
:root[data-theme="dark"] .hero-emoji { background: rgba(255,255,255,.12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-emoji { background: rgba(255,255,255,.12); } }
@media (max-width: 1080px) { .hero-plats { display: none; } }
@media (max-width: 720px) {
  .hero { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .hero-actions { flex-basis: 100%; padding-left: 0; border-left: 0; }
  .hero-actions .btn { width: 100%; }
}

/* ---------- theme toggle ---------- */
.theme-toggle span { display: inline-flex; }
.theme-toggle .ti-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .ti-sun  { display: none; }
:root[data-theme="dark"] .theme-toggle .ti-moon { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ti-sun  { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .ti-moon { display: inline-flex; }
}

/* ---------- account card ---------- */
.acct {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: .9rem 2.4rem;
  border: 2px solid var(--border); border-radius: 14px; padding: .9rem 1.15rem;
  margin: .7rem 0;
}
.acct.p-instagram, .acct.p-facebook, .acct.p-pinterest { border-color: transparent; }
.acct.p-instagram {
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(135deg, #FEDA75, #FA7E1E, #D62976, #4F5BD5) border-box;
}
.acct.p-facebook {
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(135deg, #1877F2, #0b5fce) border-box;
}
.acct.p-pinterest {
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(135deg, #e60023, #ff5478) border-box;
}
.acct-info { flex: 1 1 340px; min-width: 0; }
.acct-head { display: flex; align-items: center; gap: 14px; padding-bottom: 10px; }
.acct-head .pi { width: 46px; height: 46px; border-radius: 12px; flex: none; overflow: hidden; }
.acct-head .pi svg { width: 46px; height: 46px; display: block; }
.acct-head .ah-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.acct-head .ah-title { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.acct-head .ah-title strong { font-size: 1.06rem; font-weight: 680; letter-spacing: -.01em; }
.acct-head .ah-handle { color: var(--muted); font-size: .88rem; font-weight: 500; }
.acct-rows { display: flex; flex-direction: column; }
.acct-row { display: flex; align-items: center; gap: 12px; font-size: .92rem; padding: 8px 0; border-top: 1px solid var(--border); }
.acct-row > svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.acct-row .rl { color: var(--text-2); flex: 0 0 190px; }
.acct-row .rv { font-weight: 550; min-width: 0; }
.acct-actions {
  flex: 0 0 260px; display: flex; flex-direction: column; gap: 8px;
}
.acct-actions form { margin: 0; }
.acct-actions > form > button, .acct-actions > button { width: 100%; }
.acct-actions .btn, .acct-actions button { justify-content: center; gap: .5rem; padding: .5rem .7rem; }
.acct-actions .btn > svg, .acct-actions button > svg { width: 15px; height: 15px; flex: none; }
.btn.danger, button.danger { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.btn.danger:hover, button.danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.acct-panel { flex-basis: 100%; }
.acct-panel > .card { margin: .2rem 0 0; }
@media (max-width: 720px) {
  .acct { gap: .6rem 1rem; padding: .85rem .9rem; }
  .acct-info { flex-basis: 100%; }
  .acct-actions { flex: 1 1 100%; }
  .acct-row { gap: 10px; }
  .acct-row .rl { flex-basis: 130px; }
}

/* ---------- plan / billing ---------- */
.plan-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.2rem;
  font-size: .9rem; font-weight: 550; text-decoration: none;
  border: 1px solid var(--border-strong);
}
.plan-banner:hover { text-decoration: none; filter: brightness(1.04); }
.plan-banner .pb-cta { white-space: nowrap; font-weight: 700; }
.plan-banner.info { background: var(--brand-tint); color: var(--brand-strong); border-color: transparent; }
.plan-banner.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.plan-banner.bad  { background: var(--bad-bg);  color: var(--bad);  border-color: transparent; }

.billing-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0; }
.billing-plan { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; background: var(--surface); }
.billing-plan.current { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.billing-plan h3 { margin: 0 0 .3rem; }
.billing-plan .price { font-size: 1.6rem; font-weight: 700; margin: .2rem 0 .6rem; }
.billing-plan ul { margin: .6rem 0 0; padding-left: 1.1rem; color: var(--text-2); line-height: 1.6; font-size: .88rem; }
.pay-methods { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.pay-methods .btn { flex: 1 1 auto; }

/* ---------- connect / accounts page ---------- */
.connect-grid { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }
.platform-list { display: flex; flex-direction: column; gap: 12px; }
.platform-card {
  display: flex; align-items: center; gap: 15px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.platform-card .pi { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; }
.platform-card .pi svg { width: 44px; height: 44px; }
.platform-connect-icon { transition: transform .15s, box-shadow .15s; }
.platform-connect-icon:hover { transform: translateY(-2px); box-shadow: 0 0 0 4px var(--brand-tint); }
.platform-connect-icon:focus-visible { outline: 3px solid var(--brand); outline-offset: 5px; }
.platform-card .platform-soon-icon { padding: 0; border: 0; background: transparent; }
.platform-card .platform-soon-icon:hover { background: var(--brand-tint); }
.platform-soon-icon:focus-visible { outline: 3px solid var(--brand); outline-offset: 5px; }
.platform-card .pc-body .platform-soon-note { color: var(--brand-strong); font-weight: 600; }
.platform-card .pc-body { flex: 1; min-width: 0; }
.platform-card .pc-body strong { font-size: .98rem; font-weight: 640; }
.platform-card .pc-body p { margin: 2px 0 0; color: var(--text-2); font-size: .87rem; }
.platform-card .pc-action { flex: none; }
.platform-card .btn { min-width: 96px; }

.aside-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: var(--shadow-sm); }
.aside-panel h3 { font-size: 1.02rem; margin-bottom: 14px; }
.aside-item { display: flex; gap: 12px; margin-bottom: 16px; }
.aside-item:last-child { margin-bottom: 0; }
.aside-item .ai-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-tint); color: var(--brand-strong); display: grid; place-items: center; flex: none; }
.aside-item .ai-ic svg { width: 17px; height: 17px; }
.aside-item strong { font-size: .88rem; font-weight: 620; display: block; }
.aside-item p { margin: 2px 0 0; font-size: .82rem; color: var(--text-2); line-height: 1.45; }

.hero-illus { width: 100%; height: auto; margin-bottom: 24px; }
.connect-foot { margin-top: 26px; color: var(--text-2); font-size: .9rem; }

/* ---------- admin panel ---------- */
.nav-group { margin: 14px 8px 4px; font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #6f7a92; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--border); }
.admin-nav a { padding: 8px 12px; border-radius: 8px 8px 0 0; font-weight: 550; font-size: .9rem;
  color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-nav a:hover { background: var(--surface); text-decoration: none; }
.admin-nav a.on { color: var(--brand-strong); border-bottom-color: var(--brand); }
.admin-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; margin: 12px 0 22px; }
.admin-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 2px; }
.admin-tile .t-n { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.admin-tile .t-l { font-size: .8rem; color: var(--text-2); }
.admin-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.admin-cols .card { margin: 0; }
.admin-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 16px; }
.admin-table { table-layout: auto; min-width: 760px; }
.admin-table th, .admin-table td { white-space: nowrap; }
.admin-table td.wrap { white-space: normal; overflow-wrap: anywhere; max-width: 30rem; }
.admin-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 12px; font-size: .88rem; }
@media (max-width: 560px) {
  .admin-nav { overflow-x: auto; flex-wrap: nowrap; }
  .admin-nav a { white-space: nowrap; }
}

/* ---------- auth (logged-out) ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-md); padding: 34px 30px; }
.auth-card .brand { justify-content: center; padding: 0 0 8px; font-size: 1.3rem; }
.auth-card h1 { text-align: center; font-size: 1.35rem; }
.auth-card .subtitle { text-align: center; margin: .4rem auto 1.5rem; }
.auth-actions { display: flex; flex-direction: column; gap: 10px; }
.auth-actions .btn { width: 100%; padding: .7rem; }
.auth-plats { display: flex; gap: 10px; justify-content: center; margin: 22px 0 4px; flex-wrap: wrap; }
.auth-plats svg { width: 30px; height: 30px; opacity: .95; }
.auth-fine { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 18px; }
.auth-why { margin-top: 20px; padding: 18px; background: var(--bg); }
.auth-why .aside-item { align-items: center; margin-bottom: 12px; }
.auth-card.auth-home { max-width: 1060px; }
.home-platforms .platform-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-platforms .platform-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: 1fr auto; align-items: start; }
.home-platforms .pc-body p { min-height: 2.6em; }
.home-platforms .pc-action { grid-column: 1 / -1; }
.home-platforms .pc-action .btn, .home-platforms .pc-action button { width: 100%; }
.home-platforms .pc-action .badge { display: block; text-align: center; padding: .6rem; }
.auth-home .auth-why { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.auth-home .auth-why h3 { grid-column: 1 / -1; margin: 0; }
.auth-home .auth-why .aside-item { margin: 0; }
.auth-home-actions { margin-top: 20px; }
.auth-back { text-align: center; font-size: .88rem; }
.connect-label-short { display: none; }
@media (max-width: 759px) {
  .home-platforms .platform-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .auth-home { padding: 24px 12px; }
  .auth-wrap { padding: 16px 10px; }
  .home-platforms .platform-list { gap: 10px; }
  .home-platforms .platform-card { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; padding: 16px 8px; gap: 12px; text-align: center; }
  .home-platforms .platform-card .pi { width: 48px; height: 48px; justify-self: center; }
  .home-platforms .pc-body p:not(.platform-soon-note) { display: none; }
  .home-platforms .pc-body strong { font-size: .88rem; }
  .home-platforms .pc-action .btn, .home-platforms .pc-action button { min-width: 0; padding: .6rem .3rem; font-size: .8rem; }
  .home-platforms .connect-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .home-platforms .connect-label-short { display: inline; }
  .auth-home .auth-why { grid-template-columns: 1fr; }
}

/* ---------- responsive ---------- */
.topbar .menu-toggle { display: none; }
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.open {
    display: flex; position: fixed; top: 0; left: 0; z-index: 40;
    width: 264px; height: 100vh; box-shadow: var(--shadow-md);
  }
  .topbar { justify-content: space-between; padding: 8px 16px 0; }
  .topbar .menu-toggle { display: grid; }
  .connect-grid { grid-template-columns: 1fr; gap: 24px; }
  .content { padding: 14px 16px 44px; }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .content { padding: 12px 12px 40px; }
  h1 { font-size: 1.3rem; }
  h2 { font-size: 1.02rem; margin: 1.1rem 0 .5rem; }
  .hero { padding: 14px; border-radius: 14px; }
  .hero-emoji { width: 40px; height: 40px; font-size: 1.2rem; }
  .hero-body h1 { font-size: 1.25rem; }
  .card { padding: .8rem .85rem; border-radius: 11px; }
  .acct { padding: .8rem .8rem; border-radius: 12px; }
  .acct-head .pi { width: 40px; height: 40px; }
  .acct-head .pi svg { width: 40px; height: 40px; }
  .acct-row { flex-wrap: wrap; gap: 4px 10px; padding: 7px 0; }
  .acct-row .rl { flex-basis: auto; font-size: .82rem; }
  .acct-row .rv { flex-basis: 100%; padding-left: 28px; }
  .usermenu > button > span:not(.avatar) { display: none; }   /* just the avatar on phones */
  .usermenu .caret { display: none; }
  .plan-banner { flex-direction: column; align-items: flex-start; gap: .3rem; }
  .table-wrap { border: 1px solid var(--border); border-radius: 10px; }
  .posts-table { font-size: .82rem; }
  .posts-table th, .posts-table td { padding: .45rem .45rem; }
}
