/* ==========================================================================
   Social Content Engine — admin styles
   Midtone slate (≈60% black) with a slight blue-green cast. One accent.
   ========================================================================== */

:root {
  --c-canvas: #4f5a5b;
  --c-surface: #576364;
  --c-panel: #626f70;
  --c-panel-2: #6d7b7c;
  --c-panel-3: #788787;
  --c-line: rgba(255, 255, 255, 0.12);
  --c-line-2: rgba(255, 255, 255, 0.22);
  --c-text: #f3f6f5;
  --c-text-2: #d2dbd9;
  --c-text-3: #a8b5b2;
  --c-accent: #8fd6c6;
  --c-accent-2: #6fc4b1;
  --c-on-accent: #0f2320;
  --c-danger: #f19a90;
  --c-danger-bg: rgba(241, 154, 144, 0.16);
  --c-warn: #edcb8c;
  --c-warn-bg: rgba(237, 203, 140, 0.16);
  --c-ok: #b9e692;
  --c-ok-bg: rgba(185, 230, 146, 0.16);
  --c-info: #a3d3f3;
  --c-info-bg: rgba(163, 211, 243, 0.16);
  --r: 8px;
  --r-lg: 12px;
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.25);
  --sh-2: 0 10px 30px rgba(0, 0, 0, 0.3);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar-w: 236px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--c-canvas);
  color: var(--c-text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--c-accent); }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: rgba(143, 214, 198, 0.35); }

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--c-surface);
  border-right: 1px solid var(--c-line);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; height: var(--topbar-h); border-bottom: 1px solid var(--c-line); }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--c-accent); position: relative; flex-shrink: 0; }
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; bottom: 6px; width: 3px; background: var(--c-on-accent); border-radius: 1px;
}
.brand-mark::before { left: 7px; height: 8px; box-shadow: 5px 0 0 var(--c-on-accent), 10px -4px 0 var(--c-on-accent); }
.brand-mark::after { display: none; }
.brand-name { font-size: 13px; font-weight: 700; letter-spacing: 0.01em; line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--c-text-3); }

.nav { padding: 10px; flex: 1; overflow-y: auto; }
.nav-section { margin-top: 14px; }
.nav-section:first-child { margin-top: 2px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--c-text-3); padding: 6px 10px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: 0; color: var(--c-text-2);
  padding: 8px 10px; border-radius: var(--r); text-align: left; font-size: 13.5px;
}
.nav-item .ico { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: var(--c-panel); color: var(--c-text); }
.nav-item.active { background: var(--c-accent); color: var(--c-on-accent); font-weight: 600; }
.nav-item.active .ico { opacity: 1; }
.nav-item .count { margin-left: auto; font-size: 11px; color: var(--c-text-3); }
.nav-item.active .count { color: var(--c-on-accent); opacity: 0.8; }
.sidebar-foot { padding: 12px 18px; border-top: 1px solid var(--c-line); font-size: 11px; color: var(--c-text-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 22px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-line);
  position: sticky; top: 0; z-index: 20;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--c-text-3); margin-left: 6px; min-width: 0; }
.crumbs .sep { opacity: 0.5; }
.crumbs a { color: var(--c-text-3); text-decoration: none; }
.crumbs a:hover { color: var(--c-text); }
.crumbs b { color: var(--c-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }

.content { padding: 26px 30px 60px; max-width: 1480px; width: 100%; }
.page { display: none; }
.page.active { display: block; }

/* --------------------------------------------------------------------------
   Typography helpers
   -------------------------------------------------------------------------- */
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-text-3); font-weight: 700; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.page-sub { color: var(--c-text-3); font-size: 13px; margin-top: 4px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--c-text-3); font-weight: 700; margin: 26px 0 10px; }
.section-title:first-child { margin-top: 0; }
.muted { color: var(--c-text-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.hint { color: var(--c-text-3); font-size: 12px; margin-top: 6px; line-height: 1.4; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--c-panel-2); color: var(--c-text);
  border: 1px solid var(--c-line-2); border-radius: var(--r);
  padding: 7px 13px; font-size: 13px; font-weight: 600; line-height: 1.2;
  white-space: nowrap; transition: background 0.12s, border-color 0.12s, transform 0.05s;
}
.btn .ico { width: 14px; height: 14px; }
.btn:hover { background: var(--c-panel-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--c-accent); color: var(--c-on-accent); border-color: transparent; }
.btn.primary:hover { background: var(--c-accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--c-text-2); }
.btn.ghost:hover { background: var(--c-panel); color: var(--c-text); }
.btn.outline { background: transparent; }
.btn.danger { background: transparent; color: var(--c-danger); border-color: rgba(241, 154, 144, 0.4); }
.btn.danger:hover { background: var(--c-danger-bg); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.xs { padding: 3px 8px; font-size: 11.5px; border-radius: 6px; }
.btn.icon { padding: 7px; width: 32px; height: 32px; }
.btn.icon.sm { width: 28px; height: 28px; padding: 5px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-row .spacer { flex: 1; }

.ico { display: inline-block; width: 16px; height: 16px; vertical-align: middle; }
.ico svg { width: 100%; height: 100%; display: block; }

/* --------------------------------------------------------------------------
   Inputs
   -------------------------------------------------------------------------- */
.input, .select, .textarea,
.field input[type="text"], .field input[type="password"], .field input[type="email"], .field select, .field textarea {
  width: 100%;
  background: var(--c-surface);
  border: 1px solid var(--c-line-2);
  color: var(--c-text);
  border-radius: var(--r);
  padding: 8px 11px;
  font-size: 13.5px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus, .select:focus, .textarea:focus,
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(143, 214, 198, 0.18);
}
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--c-text-3); }
.select, .field select { appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d2dbd9' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 14px; }
.input.sm, .select.sm { padding: 6px 9px; font-size: 12.5px; }
.select.sm { padding-right: 26px; }
textarea, .field textarea { resize: vertical; min-height: 44px; }
textarea.auto { field-sizing: content; overflow: hidden; resize: none; }
input[readonly], .field input[readonly] { color: var(--c-text-3); }
.field { display: block; }
.field label, .label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-3); font-weight: 700; margin-bottom: 6px; }
.field.check label { text-transform: none; letter-spacing: 0; font-weight: 500; display: flex; align-items: center; gap: 8px; color: var(--c-text); font-size: 13px; margin: 0; }
.form-grid { display: grid; gap: 14px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid .span-2 { grid-column: 1 / -1; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; }
.checks label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--c-text); text-transform: none; letter-spacing: 0; font-weight: 500; margin: 0; }
.checks.vertical { flex-direction: column; gap: 8px; }
input[type="checkbox"] { accent-color: var(--c-accent); width: 15px; height: 15px; }
.search-wrap { position: relative; }
.search-wrap .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--c-text-3); width: 14px; height: 14px; }
.search-wrap .input, .search-wrap .input.sm { padding-left: 30px; }
.save-status { font-size: 12.5px; color: var(--c-ok); opacity: 0; transition: opacity 0.2s; }
.save-status.show { opacity: 1; }

/* --------------------------------------------------------------------------
   Cards / panels / tables / badges
   -------------------------------------------------------------------------- */
.card { background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card.pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--c-line); }
.card-title { font-size: 14px; font-weight: 700; }
.card-body { padding: 18px 20px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.toolbar .spacer { flex: 1; }
.toolbar .select, .toolbar > .input, .modal-head .select, .modal-head .input { width: auto; }
.toolbar .search-wrap .input, .modal-head .search-wrap .input { width: 100%; }
.toolbar .search-wrap.grow .input { width: 100%; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--c-line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  color: var(--c-text-3); padding: 9px 12px; font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.tabs button:hover { color: var(--c-text); }
.tabs button.active { color: var(--c-text); border-bottom-color: var(--c-accent); }
.tabs button .count { margin-left: 6px; font-size: 11px; color: var(--c-text-3); background: var(--c-panel); padding: 1px 6px; border-radius: 10px; }
.pills { display: inline-flex; gap: 4px; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 999px; padding: 3px; }
.pills button { background: transparent; border: 0; color: var(--c-text-3); padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.pills button.active { background: var(--c-panel-2); color: var(--c-text); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.5; background: var(--c-panel-2); color: var(--c-text-2); }
.badge.draft { background: var(--c-warn-bg); color: var(--c-warn); }
.badge.deployed, .badge.sending, .badge.in_progress { background: var(--c-info-bg); color: var(--c-info); }
.badge.posted, .badge.sent, .badge.connected, .badge.ok { background: var(--c-ok-bg); color: var(--c-ok); }
.badge.failed, .badge.error, .badge.blocked, .badge.danger { background: var(--c-danger-bg); color: var(--c-danger); }
.badge.partial { background: var(--c-warn-bg); color: var(--c-warn); }
.badge.not_started { background: var(--c-panel-2); color: var(--c-text-3); }
.badge.scheduled { background: var(--c-info-bg); color: var(--c-info); }
.badge.publishing { background: var(--c-warn-bg); color: var(--c-warn); }
.badge.mallorcadata { background: var(--c-info-bg); color: var(--c-info); }
.badge.gym-qr { background: var(--c-ok-bg); color: var(--c-ok); }
.badge.intelagencia { background: rgba(200, 180, 255, 0.16); color: #cfc0ff; }
.tag { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--c-surface); border: 1px solid var(--c-line); color: var(--c-text-3); }

.table-wrap { overflow-x: auto; background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 11px 14px; font-size: 13px; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-3); background: var(--c-surface); font-weight: 700; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.03); }
.table td.actions { white-space: nowrap; text-align: right; }
.table td.actions .btn { margin-left: 4px; }
.table td.num { font-variant-numeric: tabular-nums; }
.table .cell-strong { font-weight: 600; color: var(--c-text); }
.table .cell-sub { font-size: 12px; color: var(--c-text-3); }

.empty { color: var(--c-text-3); font-size: 13.5px; padding: 42px 20px; text-align: center; border: 1px dashed var(--c-line-2); border-radius: var(--r-lg); }
.empty .btn { margin-top: 12px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r); padding: 12px 14px; }
.stat-num { font-size: 22px; font-weight: 700; color: var(--c-accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-text-3); margin-top: 4px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--c-text-3); }
.kv dd { margin: 0; }

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.dash-card .card-body { display: flex; flex-direction: column; gap: 14px; }
.dash-card .stat-grid { grid-template-columns: repeat(2, 1fr); }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Project
   -------------------------------------------------------------------------- */
.project-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.project-head .btn-row { align-items: center; }

/* Overview */
.ov-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.acct-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--c-line); font-size: 13px; }
.acct-row:last-child { border-bottom: 0; }
.acct-row .acct-name { flex: 1; min-width: 0; }
.acct-row .acct-name b { display: block; font-size: 13px; }
.acct-row .acct-name span { font-size: 12px; color: var(--c-text-3); }
.acct-row a { font-size: 12px; text-decoration: none; }
.platform-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #eef1f0; flex-shrink: 0; }
.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); background: var(--c-surface); border: 1px solid var(--c-line); cursor: pointer; }
.recent-row:hover { border-color: var(--c-line-2); }
.recent-row .thumb { width: 36px; height: 36px; border-radius: 6px; background: var(--c-panel-2); overflow: hidden; flex-shrink: 0; }
.recent-row .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recent-row .text { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Knowledge */
.kb-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; max-width: 1100px; }
.kb-form .span-2 { grid-column: 1 / -1; }
.kb-form .form-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.field.guard textarea { border-color: rgba(241, 154, 144, 0.5); background: rgba(241, 154, 144, 0.06); }
.field.gaps textarea { border-color: rgba(237, 203, 140, 0.5); background: rgba(237, 203, 140, 0.06); }

/* Accounts */
.accounts-list { display: grid; gap: 12px; max-width: 1100px; }
.account-card { background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 14px 16px; }
.account-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.account-head .label-input { flex: 1; background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--c-text); font-weight: 600; font-size: 14px; padding: 4px 8px; }
.account-head .label-input:hover, .account-head .label-input:focus { border-color: var(--c-line-2); background: var(--c-surface); outline: none; }
.account-head .select { width: auto; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.account-grid .span-2 { grid-column: 1 / -1; }
.password-row { display: flex; gap: 6px; }
.password-row input { flex: 1; }

/* Media */
.upload-panel { margin-bottom: 18px; }
.dropzone { border: 2px dashed var(--c-line-2); border-radius: var(--r-lg); padding: 34px 20px; text-align: center; cursor: pointer; background: var(--c-surface); transition: border-color 0.15s, background 0.15s; }
.dropzone:hover, .dropzone.dragover { border-color: var(--c-accent); background: rgba(143, 214, 198, 0.06); }
.dropzone .ico { width: 26px; height: 26px; color: var(--c-accent); margin-bottom: 6px; }
.dropzone-title { font-size: 14px; font-weight: 600; }
.dropzone-sub { font-size: 12.5px; color: var(--c-text-3); margin-top: 2px; }
.dropzone-sub u { color: var(--c-accent); text-decoration: underline; cursor: pointer; }
.pending-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pending-file { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--c-surface); border: 1px solid var(--c-line); }
.pending-file img, .pending-file video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pending-file .remove { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0, 0, 0, 0.65); color: #fff; border: 0; font-size: 12px; line-height: 1; padding: 0; display: flex; align-items: center; justify-content: center; }
.upload-options { margin-top: 14px; display: grid; gap: 12px; }
.batch-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--c-panel); border: 1px solid var(--c-accent); border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px; }
.batch-bar .count { font-weight: 700; color: var(--c-accent); white-space: nowrap; font-size: 13px; }
.batch-bar .input { width: 220px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.media-card { position: relative; background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); transition: transform 0.12s, box-shadow 0.12s; }
.media-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.media-card .thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--c-surface); cursor: zoom-in; }
.media-card video.thumb { cursor: default; }
.media-card .select { position: absolute; top: 8px; left: 8px; z-index: 2; }
.media-card .body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.media-card .name { font-size: 12px; color: var(--c-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-card .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.media-card .acts { display: flex; gap: 4px; margin-top: 2px; }
.media-card .acts .btn { flex: 1; padding: 4px 6px; font-size: 11.5px; }

/* Posts list */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.post-card { position: relative; background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--sh-1); transition: border-color 0.12s; }
.post-card:hover { border-color: var(--c-line-2); }
.post-card .badge.corner { position: absolute; top: 10px; right: 10px; z-index: 1; }
.post-card .ref-tag { position: absolute; top: 10px; left: 10px; z-index: 1; background: var(--c-panel); border: 1px solid var(--c-line); border-radius: var(--r-sm, 6px); padding: 2px 7px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: var(--c-text-2); }
.post-card .img { position: relative; width: 100%; padding-top: 62.5%; background: var(--c-surface); flex-shrink: 0; cursor: pointer; overflow: hidden; }
.post-card .img img, .post-card .img video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card .img.empty-img::after { content: "No image"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--c-text-3); font-size: 12px; }
.post-card .body { padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; cursor: pointer; }
.post-card .text { font-size: 13px; color: var(--c-text); white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; line-height: 1.4; }
.post-card .meta { font-size: 11.5px; color: var(--c-text-3); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.post-card .platforms { display: flex; gap: 4px; flex-wrap: wrap; }
.post-card .foot { display: flex; gap: 4px; padding: 8px 10px; border-top: 1px solid var(--c-line); background: var(--c-surface); }
.post-card .foot .btn { flex: 1; }
.post-card .foot .btn.icon { flex: 0 0 auto; }

/* Editor */
.editor-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.editor-head .title { font-size: 16px; font-weight: 700; }
.editor-layout { display: grid; grid-template-columns: 340px calc(70vh * 0.4615 + 16px) 1fr; gap: 22px; align-items: start; }
.editor-copy textarea { min-height: 280px; max-width: 320px; padding-bottom: 26px; }
/* Live mobile preview: a fixed 70vh screen at a modern phone ratio (9:19.5), content scrolls
   inside instead of stretching the frame. 16px = the frame's 2 x 8px border. */
.editor-mobile { min-width: 0; }
.editor-mobile .phone-frame { width: calc(70vh * 0.4615 + 16px); max-width: 100%; }
.editor-mobile .phone-screen { height: 70vh; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.editor-mobile .mobile-image.has-video { aspect-ratio: 9 / 16; background: #000; }
.editor-mobile .mobile-image.has-video video { width: 100%; height: 100%; object-fit: contain; display: block; }
.editor-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.image-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.image-strip .th { width: 74px; height: 74px; border-radius: 8px; border: 2px solid var(--c-line); background: var(--c-surface); overflow: hidden; cursor: pointer; }
.image-strip .th img, .image-strip .th video { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-strip .th.selected { border-color: var(--c-accent); box-shadow: 0 0 0 2px rgba(143, 214, 198, 0.35); }
.image-strip .th.add { display: flex; align-items: center; justify-content: center; color: var(--c-text-3); border-style: dashed; }
.image-strip .th.add:hover { color: var(--c-accent); border-color: var(--c-accent); }
.phone-frame { width: 300px; border-radius: 30px; border: 8px solid #2a2f31; background: #000; overflow: hidden; box-shadow: var(--sh-2); }
.phone-screen { background: #fff; color: #111; min-height: 380px; }

/* Real device size — Google Pixel 9 Pro, ~412x920 CSS px — so the preview shows
   exactly how much of the post is visible on an actual phone before scrolling. */
.phone-frame.device { width: calc(70vh * 0.4478); max-width: 100%; flex-shrink: 0; }
.phone-screen.device { width: 100%; max-width: 100%; height: 70vh; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.phone-screen.device.fullbleed { overflow: hidden; }
.phone-screen.device.fullbleed .mk-tiktok { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
.phone-screen.device.fullbleed { position: relative; }

.mk-skel { padding: 0; opacity: 0.6; }
.mk-skel-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.mk-skel-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.mk-skel-bar { height: 10px; border-radius: 5px; background: linear-gradient(90deg, #e8e9eb 25%, #f4f5f6 37%, #e8e9eb 63%); background-size: 400% 100%; animation: mk-shimmer 1.6s ease-in-out infinite; width: 70%; }
.mk-skel-bar.round { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; }
.mk-skel-bar.short { width: 40%; }
.mk-skel-media { width: 100%; aspect-ratio: 1.91 / 1; background: linear-gradient(90deg, #e8e9eb 25%, #f4f5f6 37%, #e8e9eb 63%); background-size: 400% 100%; animation: mk-shimmer 1.6s ease-in-out infinite; }
.mk-skel-media.tall { aspect-ratio: 9 / 16; }
@keyframes mk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.mobile-image { width: 100%; aspect-ratio: 1.91 / 1; background: #eceff0; display: flex; align-items: center; justify-content: center; color: #999; font-size: 12px; }
.mobile-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mobile-text { padding: 12px 14px 20px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; color: #111; }
.desktop-frame { border-radius: 10px; border: 1px solid #2a2f31; background: #f3f4f5; overflow: hidden; box-shadow: var(--sh-2); width: 440px; max-width: 100%; }
.desktop-bar { background: #e6e8ea; padding: 8px 12px; display: flex; gap: 6px; }
.desktop-bar span { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.desktop-bar .r { background: #ff5f57; } .desktop-bar .y { background: #febc2e; } .desktop-bar .g { background: #28c840; }
.desktop-screen { background: #fff; color: #111; min-height: 300px; }

/* Mockups (light, inside phone/desktop frames) */
.mk { font-family: var(--font); }
.mk-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.mk-avatar { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; }
.mk-avatar.sq { border-radius: 6px; }
.mk-name { font-weight: 600; font-size: 14px; color: #111; }
.mk-sub { font-size: 12px; color: #65676b; }
.mk-text { padding: 0 14px 12px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; color: #111; }
.mk-caption { padding: 6px 12px 14px; font-size: 13px; line-height: 1.4; white-space: pre-wrap; color: #111; }
.mk-caption b { margin-right: 6px; }
.mk-image { width: 100%; aspect-ratio: 1.91 / 1; background: #e9ebed; display: flex; align-items: center; justify-content: center; color: #8a8f94; font-size: 12px; }
.mk-image.square { aspect-ratio: 1 / 1; }
.mk-image.rounded { border-radius: 14px; overflow: hidden; margin: 0 14px 10px; width: calc(100% - 28px); }
.mk-image.pin { aspect-ratio: 2 / 3; border-radius: 16px 16px 0 0; }
.mk-image.fill { position: absolute; inset: 0; aspect-ratio: auto; }
.mk-image img, .mk-image video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* X (Twitter) / Threads actions row */
.mk-actions.x { justify-content: space-between; padding: 8px 16px 14px; border-top: 0; }
.mk-action-ic { display: flex; color: #65676b; }

/* YouTube */
.mk-yt-thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.mk-yt-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff; display: flex; align-items: center; justify-content: center; }
.mk-yt-duration { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,0.8); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 5px; border-radius: 3px; }
.mk-yt-info { display: flex; gap: 10px; padding: 12px 14px; align-items: flex-start; }
.mk-yt-title { font-weight: 600; font-size: 14px; color: #111; line-height: 1.35; margin-bottom: 3px; }

/* Pinterest */
.mk-pin-info { padding: 10px 14px 14px; }
.mk-save-btn { position: absolute; top: 12px; right: 12px; background: #e60023; color: #fff; border: 0; border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 13px; }

/* Reddit */
.mk-reddit-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; font-size: 12.5px; color: #65676b; }
.mk-reddit-head .mk-name { font-size: 13px; }
.mk-reddit-title { padding: 4px 14px 10px; font-weight: 700; font-size: 15px; color: #111; line-height: 1.35; }
.mk-reddit-foot { display: flex; gap: 18px; padding: 10px 14px 14px; font-size: 12.5px; font-weight: 600; color: #65676b; }
.mk-vote { display: flex; align-items: center; gap: 5px; }

/* TikTok — full-bleed 9:16 with overlay chrome */
.mk-tiktok { position: relative; width: 100%; aspect-ratio: 9 / 16; background: #000; overflow: hidden; }
.mk-tiktok-overlay { position: absolute; left: 0; right: 64px; bottom: 0; padding: 14px 12px 16px; background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0)); color: #fff; }
.mk-tiktok-handle { font-weight: 700; font-size: 14px; margin-bottom: 5px; }
.mk-tiktok-caption { font-size: 13px; line-height: 1.35; margin-bottom: 8px; }
.mk-tiktok-music { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.mk-tiktok-rail { position: absolute; right: 8px; bottom: 16px; display: flex; flex-direction: column; align-items: center; gap: 16px; color: #fff; }
.mk-tiktok-action { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; }
.mk-actions { display: flex; justify-content: space-around; padding: 9px 8px; border-top: 1px solid #e5e7e9; font-size: 12.5px; color: #65676b; font-weight: 600; }
.mk-actions.ig { justify-content: flex-start; gap: 16px; border-top: 0; padding: 10px 12px 2px; }
.preview-grid { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.preview-grid.row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; }
.preview-grid.row .preview-card { flex-shrink: 0; }
.preview-card { display: flex; flex-direction: column; gap: 8px; }
.preview-card .meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--c-text-2); }
.preview-card .meta .badge { margin-left: auto; }

/* --------------------------------------------------------------------------
   Per-platform schedule rows (editor "Deployed" card)
   -------------------------------------------------------------------------- */
.schedule-row { border: 1px solid var(--c-line-2); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.schedule-row .schedule-row-head { display: flex; align-items: center; gap: 8px; }
.schedule-row .schedule-row-head .platform-name { font-size: 13px; font-weight: 600; color: var(--c-text); flex: 1; }
.schedule-row .schedule-row-controls { display: flex; align-items: center; gap: 8px; }
.schedule-row .schedule-row-controls .input { flex: 1; }
.schedule-row .schedule-row-error { color: var(--c-danger); font-size: 12px; }
.schedule-row .schedule-row-when { font-size: 12px; color: var(--c-text-3); }

/* --------------------------------------------------------------------------
   Modals / toasts
   -------------------------------------------------------------------------- */
.modal { position: fixed; inset: 0; background: rgba(15, 20, 21, 0.62); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-dialog { background: var(--c-panel); border: 1px solid var(--c-line-2); border-radius: 14px; box-shadow: var(--sh-2); width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-dialog.md { max-width: 760px; }
.modal-dialog.lg { max-width: 980px; }
.modal-dialog.xl { max-width: 1360px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--c-line); }
.modal-head h3 { font-size: 15px; font-weight: 700; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--c-line); background: var(--c-surface); }
.modal-foot .spacer { flex: 1; }
.modal-foot .result { font-size: 12.5px; color: var(--c-text-3); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.gallery-grid .g { position: relative; width: 100%; padding-top: 100%; border-radius: 8px; border: 2px solid var(--c-line); overflow: hidden; cursor: pointer; background: var(--c-surface); }
.gallery-grid .g img, .gallery-grid .g video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-grid .g:hover { border-color: var(--c-accent); }
.recipient-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--c-line-2); border-radius: var(--r); padding: 6px; background: var(--c-surface); }
.recipient-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; font-size: 12.5px; border-radius: 6px; }
.recipient-row:hover { background: var(--c-panel); }
.recipient-row .sub { color: var(--c-text-3); }
.media-modal-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; align-items: start; }
.media-modal-grid img, .media-modal-grid video { max-width: 100%; max-height: 62vh; border-radius: 10px; display: block; background: #000; }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--c-surface); border: 1px solid var(--c-line-2); border-left: 3px solid var(--c-accent); color: var(--c-text); padding: 10px 14px; border-radius: var(--r); font-size: 13px; box-shadow: var(--sh-2); min-width: 220px; max-width: 380px; animation: toast-in 0.18s ease-out; }
.toast.error { border-left-color: var(--c-danger); }
.toast.warn { border-left-color: var(--c-warn); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--c-line-2); border-top-color: var(--c-accent); animation: spin 0.8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .editor-layout { grid-template-columns: 1fr 1fr; }
  .editor-side { grid-column: 1 / -1; }
  .ov-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .content { padding: 18px 16px 48px; }
  .editor-layout, .kb-form, .grid-2, .grid-3, .form-grid.cols-2 { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .media-modal-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Editor: platform versions, settings, cover, checks
   -------------------------------------------------------------------------- */
.variant-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.variant-head .name { font-weight: 700; font-size: 13px; }
.variant-head .spacer { flex: 1; }
.counter { font-size: 12px; color: var(--c-text-3); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--c-danger); font-weight: 700; }
.variant textarea { min-height: 70px; }
.settings-group { display: flex; flex-direction: column; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--c-line); }
.settings-group:last-child { border-bottom: 0; padding-bottom: 0; }
.settings-group .name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.settings-sub { margin-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.consent { font-size: 12px; color: var(--c-text-3); line-height: 1.4; }
.cover-preview { width: 100%; max-width: 180px; aspect-ratio: 9 / 16; background: #000; border-radius: var(--r); overflow: hidden; border: 1px solid var(--c-line-2); }
.cover-preview video, .cover-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cover-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.cover-controls { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 10px; }
input[type="range"] { width: 100%; accent-color: var(--c-accent); }
.chk-group { display: flex; flex-direction: column; gap: 6px; }
.chk-group .name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.chk-item { font-size: 12.5px; line-height: 1.4; padding-left: 26px; }
.chk-item.error { color: var(--c-danger); }
.chk-item.warn { color: var(--c-warn); }
.chk-item.ok { color: var(--c-ok); }

.nav-label { display: flex; align-items: center; justify-content: space-between; }
.nav-label .nav-add { width: 22px; height: 22px; padding: 3px; }
