:root {
  --bg: #f4f5f8;
  --panel: #ffffff;
  --panel-2: #f8f9fb;
  --ink: #171a21;
  --muted: #5d6573;
  --faint: #8a92a0;
  --line: #e2e5eb;
  --line-strong: #cfd4dc;
  --accent: #4f5bd5;
  --accent-ink: #ffffff;
  --accent-soft: #eceefc;
  --ok: #1f8a4c;
  --ok-soft: #e5f5ec;
  --warn: #a86400;
  --warn-soft: #fdf2e0;
  --bad: #c2362f;
  --bad-soft: #fcebea;
  --info-soft: #eaf1fb;
  --ig: #d62976;
  --th: #1c1c1c;
  --x: #1c1c1c;
  --shadow: 0 1px 2px rgba(20, 24, 33, 0.06), 0 4px 16px rgba(20, 24, 33, 0.05);
  --radius: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1015;
    --panel: #161920;
    --panel-2: #1b1f27;
    --ink: #e7e9ee;
    --muted: #a0a8b6;
    --faint: #737c8b;
    --line: #262b35;
    --line-strong: #353b47;
    --accent: #7c88f2;
    --accent-ink: #0e1015;
    --accent-soft: #232845;
    --ok: #4cc07f;
    --ok-soft: #15291f;
    --warn: #e2a33f;
    --warn-soft: #2d2413;
    --bad: #f0706a;
    --bad-soft: #321a1a;
    --info-soft: #182236;
    --ig: #f062a2;
    --th: #e7e9ee;
    --x: #e7e9ee;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--font);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
}

[hidden] {
  display: none !important;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand h1 {
  font-size: 16px;
  font-weight: 650;
}

.sub {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  flex: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}

.dot.ok {
  background: var(--ok);
}

.dot.warn {
  background: var(--warn);
}

.dot.bad {
  background: var(--bad);
}

.top-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel);
  font-weight: 550;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--panel-2);
}

.btn:focus-visible,
.icon-btn:focus-visible,
.tab:focus-visible,
.post-item:focus-visible,
.switch input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn.primary:hover {
  filter: brightness(1.06);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn.ghost:hover {
  background: var(--panel-2);
  color: var(--ink);
}

.btn.danger {
  color: var(--bad);
}

.btn.small {
  min-height: 28px;
  padding: 3px 10px;
  font-size: 12.5px;
}

.btn.block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--panel-2);
  color: var(--ink);
}

/* ---------- banner ---------- */

.banner {
  margin: 12px 20px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--info-soft);
  color: var(--ink);
  font-size: 13px;
}

.banner.warn {
  background: var(--warn-soft);
}

/* ---------- layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 100px);
  min-height: 0;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow-x: auto;
}

.tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.tab .count {
  font-size: 11px;
  opacity: 0.8;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 8px;
}

.post-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.post-item:hover {
  border-color: var(--line-strong);
}

.post-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.post-item .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.post-item .when {
  font-size: 12px;
  color: var(--muted);
}

.post-item .topic {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-item .targets {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

/* ---------- pills and badges ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: capitalize;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
}

.pill.scheduled {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.pill.published {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: transparent;
}

.pill.partial {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}

.pill.failed {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: transparent;
}

.pill.cancelled {
  text-decoration: line-through;
}

.pbadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px 1px 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}

.pbadge .mark,
.platform-mark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 9.5px;
  font-weight: 700;
  color: #fff;
  flex: none;
}

.mark.instagram,
.platform-mark.instagram {
  background: linear-gradient(135deg, #f9ce34, #ee2a7b 55%, #6228d7);
}

.mark.threads,
.platform-mark.threads,
.mark.x,
.platform-mark.x {
  background: var(--th);
  color: var(--panel);
}

.platform-mark {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

/* ---------- editor ---------- */

.editor {
  min-width: 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.editor-head h2 {
  font-size: 18px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.editor-head .meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
}

.editor-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field label,
.field .label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.input,
.textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel);
  transition: border-color 0.12s, box-shadow 0.12s;
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input:disabled,
.textarea:disabled {
  background: var(--panel-2);
  color: var(--muted);
}

.textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

.row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.gap {
  gap: 8px;
}

.two {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
}

.hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--faint);
}

/* image */

.image-box {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.image-box img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--line);
  display: block;
}

.image-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
}

.image-meta .path {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-2);
  text-align: center;
  color: var(--muted);
  transition: border-color 0.12s, background 0.12s;
}

.dropzone.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone strong {
  color: var(--ink);
}

.url-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 520px;
}

/* platforms */

.platforms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.platform {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  min-width: 0;
}

.platform.off {
  background: var(--panel-2);
}

.platform-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.platform-head .name {
  font-weight: 650;
  line-height: 1.2;
}

.platform-head .handle {
  font-size: 12px;
  color: var(--muted);
}

.platform-head .grow {
  flex: 1;
  min-width: 0;
}

.platform .textarea {
  min-height: 170px;
}

.platform-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  min-height: 22px;
}

.counter.over {
  color: var(--bad);
  font-weight: 650;
}

.meter {
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.1s;
}

.meter.near span {
  background: var(--warn);
}

.meter.over span {
  background: var(--bad);
}

.off-note {
  font-size: 12.5px;
  color: var(--faint);
  padding: 6px 0;
}

.target-error {
  font-size: 12.5px;
  color: var(--bad);
  background: var(--bad-soft);
  padding: 8px 10px;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.target-live {
  font-size: 12.5px;
  color: var(--ok);
  background: var(--ok-soft);
  padding: 8px 10px;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

/* switch */

.switch {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  flex: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.switch span {
  display: block;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative;
  transition: background 0.15s;
}

.switch span::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(16px);
}

.switch input:disabled + span {
  opacity: 0.5;
}

/* notices */

.notice {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.notice ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.notice.warn {
  background: var(--warn-soft);
}

.notice.bad {
  background: var(--bad-soft);
}

.notice.ok {
  background: var(--ok-soft);
}

.notice.info {
  background: var(--info-soft);
}

.notice strong {
  font-weight: 650;
}

/* action bar */

.actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(6px);
  border-radius: 0 0 var(--radius) var(--radius);
}

.actions .left,
.actions .right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.dirty-note {
  font-size: 12px;
  color: var(--warn);
}

/* history */

details.history summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.history ol {
  list-style: none;
  margin: 10px 0 0;
  padding: 0 0 0 12px;
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
}

.history li .t {
  color: var(--faint);
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
}

.history li .d {
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* welcome */

.welcome {
  padding: 48px 32px;
  text-align: center;
}

.welcome h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.welcome p {
  color: var(--muted);
  max-width: 460px;
  margin: 0 auto 18px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 640px;
  margin: 24px auto 0;
  text-align: left;
}

.step {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--muted);
}

.step b {
  display: block;
  color: var(--ink);
  margin-bottom: 2px;
}

/* dialogs */

.dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.dialog.wide {
  width: min(760px, calc(100vw - 32px));
}

.dialog::backdrop {
  background: rgba(10, 12, 18, 0.45);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2,
.dialog-body h2 {
  font-size: 16px;
}

.dialog-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dialog-body h3 {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.dialog-body p {
  margin: 0;
  color: var(--muted);
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}

.checks {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.checks td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.checks td:first-child {
  width: 28px;
}

.checks td:last-child {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.logs {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font: 12px/1.55 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.logs .warn {
  color: var(--warn);
}

.logs .error {
  color: var(--bad);
}

.result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* toasts */

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
}

.toast {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--panel);
  box-shadow: var(--shadow);
  font-size: 13px;
  white-space: pre-line;
  animation: rise 0.18s ease-out;
}

.toast.error {
  background: var(--bad);
  color: #fff;
}

@keyframes rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .platforms {
    grid-template-columns: minmax(0, 1fr);
  }

  .platform .textarea {
    min-height: 120px;
  }
}

@media (max-width: 820px) {
  .topbar {
    flex-wrap: wrap;
    padding: 10px 16px;
  }

  .chips {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .post-list {
    max-height: 320px;
  }

  .two,
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .image-box {
    grid-template-columns: minmax(0, 1fr);
  }

  .image-box img {
    width: 100%;
    height: auto;
    max-height: 280px;
  }
}

/* ---------- media grid ---------- */

.media-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-2);
  transition: border-color 0.12s, background 0.12s;
}

.media-box.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.media-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 7px;
  overflow: hidden;
  background: var(--line);
}

.thumb img,
.thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb .num,
.thumb .dur {
  position: absolute;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.thumb .num {
  top: 6px;
  left: 6px;
}

.thumb .dur {
  right: 6px;
  bottom: 6px;
}

.tile-meta {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-actions {
  display: flex;
  justify-content: space-between;
}

.icon-btn.sm {
  width: 28px;
  height: 26px;
  font-size: 17px;
  line-height: 1;
}

.icon-btn.danger:hover {
  color: var(--bad);
}

.icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.add-tile {
  border-style: dashed;
  background: transparent;
  min-height: 150px;
}

.add-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 7px;
}

.add-label:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.add-label .plus {
  font-size: 28px;
  line-height: 1;
  font-weight: 300;
}

.media-box .url-row {
  max-width: none;
}

/* ---------- Instagram format switch and plan line ---------- */

.segmented {
  display: flex;
  padding: 3px;
  gap: 3px;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.segmented label {
  flex: 1;
  position: relative;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.segmented span {
  display: block;
  padding: 4px 6px;
  border-radius: 6px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.segmented input:checked + span {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.segmented input:disabled + span {
  opacity: 0.5;
}

.format-hint {
  margin-top: 0;
}

.plan {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}

.plan.bad {
  color: var(--bad);
}

.story-note {
  display: none;
  font-size: 12.5px;
  color: var(--faint);
  padding: 6px 0;
}

.platform.story .story-note {
  display: block;
}

.platform.story .textarea,
.platform.story .meter,
.platform.story .counter {
  display: none;
}

.thumb a {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- login ---------- */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.login-card {
  width: min(380px, 100%);
  padding: 28px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-card .brand h1 {
  font-size: 18px;
}

.login-card .hint {
  margin: 0;
  text-align: center;
}

/* ---------- media per platform ---------- */

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.own-media {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.media-box.compact {
  padding: 8px;
  gap: 8px;
}

.media-box.compact .media-grid {
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 6px;
}

.media-box.compact .tile {
  padding: 4px;
  gap: 4px;
}

.media-box.compact .add-tile {
  min-height: 96px;
}

.media-box.compact .add-label .plus {
  font-size: 22px;
}

.media-box.compact .tile-actions .icon-btn.sm {
  width: 22px;
  font-size: 15px;
}

.media-box.compact .url-row .input {
  padding: 5px 9px;
  font-size: 12.5px;
}
