/* ==========================================================================
   AutoIG — Personal Instagram Content Studio
   Design system: modern productivity tool. Neutral + one accent.
   ========================================================================== */

:root {
  /* Neutrals */
  --bg:          #ffffff;
  --canvas:      #f7f7f6;
  --surface:     #ffffff;
  --surface-2:   #fbfbfa;
  --border:      #e7e7e4;
  --border-str:  #d6d6d2;

  /* Text */
  --ink:         #16161a;
  --ink-2:       #43434a;
  --ink-3:       #76767f;
  --ink-4:       #a0a0a8;

  /* Accent */
  --accent:      #4f46e5;
  --accent-h:    #4338ca;
  --accent-soft: #eef0fe;
  --accent-ring: rgba(79, 70, 229, .18);

  /* Status */
  --draft:       #8a8a93;
  --draft-bg:    #f1f1ef;
  --sched:       #b45309;
  --sched-bg:    #fdf3e3;
  --pub:         #15803d;
  --pub-bg:      #e9f6ed;
  --fail:        #b91c1c;
  --fail-bg:     #fdecec;

  /* Shape */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(16,16,20,.04);
  --shadow:    0 1px 3px rgba(16,16,20,.06), 0 8px 24px -12px rgba(16,16,20,.12);
  --shadow-lg: 0 24px 60px -20px rgba(16,16,20,.25);

  --sidebar-w: 244px;
  --topbar-h:  60px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

/* --------------------------------------------------------------- reset -- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,h2,h3,h4,h5 { margin: 0; font-weight: 600; letter-spacing: -.015em; color: var(--ink); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }
::selection { background: var(--accent-soft); }

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

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
}
.brand-mark {
  width: 32px; height: 32px; flex: none;
  border-radius: 9px;
  background: linear-gradient(140deg, #5b52ea, #3b31c9);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; letter-spacing: -.02em;
  box-shadow: 0 2px 8px -2px var(--accent-ring);
}
.brand-name { font-weight: 650; font-size: 14.5px; letter-spacing: -.02em; line-height: 1.2; }
.brand-sub  { font-size: 11.5px; color: var(--ink-4); line-height: 1.2; margin-top: 1px; }

.nav { padding: 6px 10px; flex: 1; overflow-y: auto; }
.nav-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-4);
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r);
  color: var(--ink-2); font-weight: 500; font-size: 13.5px;
  transition: background .13s ease, color .13s ease;
}
.nav-item .ico { color: var(--ink-4); flex: none; transition: color .13s ease; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item:hover .ico { color: var(--ink-2); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-h); font-weight: 600; }
.nav-item.active .ico { color: var(--accent); }
.nav-count {
  margin-left: auto; font-size: 11px; font-weight: 600;
  color: var(--ink-4); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 20px; padding: 0 6px;
}
.nav-item.active .nav-count { background: #fff; border-color: transparent; color: var(--accent); }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.ig-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border: 1px solid var(--border);
  border-radius: var(--r); background: var(--surface-2);
}
.ig-av {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg,#f9ce34,#ee2a7b 45%,#6228d7);
  display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700;
}
.ig-name { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.ig-state { font-size: 11px; color: var(--ink-4); display: flex; align-items: center; gap: 4px; line-height: 1.3; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pub); flex: none; }
.dot.off { background: var(--ink-4); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 16px; font-weight: 620; letter-spacing: -.02em; }
.topbar .sub { font-size: 12.5px; color: var(--ink-4); }
.topbar .spacer { flex: 1; }

.page { padding: 26px; max-width: 1320px; width: 100%; }
.page.narrow { max-width: 880px; }

/* ------------------------------------------------------------ buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: var(--r); border: 1px solid var(--border-str);
  background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-weight: 550; letter-spacing: -.005em;
  cursor: pointer; white-space: nowrap;
  transition: background .13s, border-color .13s, box-shadow .13s, transform .05s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); border-color: #c5c5c0; }
.btn:active { transform: translateY(.5px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(79,70,229,.24);
}
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); }

.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; border-color: #000; }

.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }

.btn-lg { height: 44px; padding: 0 20px; font-size: 14.5px; border-radius: var(--r); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); gap: 5px; }
.btn-icon { width: 34px; padding: 0; }
.btn-block { width: 100%; }

/* -------------------------------------------------------------- cards -- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 14px; font-weight: 620; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-body.tight { padding: 10px; }
.card-body.flush { padding: 0; }

.section-title {
  font-size: 11px; font-weight: 650; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-4); margin-bottom: 10px;
}

/* --------------------------------------------------------------- grid -- */
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.split { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 16px; align-items: start; }
.split-wide { display: grid; grid-template-columns: 400px minmax(0,1fr); gap: 16px; align-items: start; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }

@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .split, .split-wide { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 720px) {
  .g-4, .g-3, .g-2 { grid-template-columns: minmax(0,1fr); }
  .page { padding: 18px; }
  .sidebar { display: none; }
}

/* --------------------------------------------------------------- stat -- */
.stat { padding: 16px 18px; }
.stat-label { font-size: 12px; color: var(--ink-3); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 30px; font-weight: 650; letter-spacing: -.03em; margin-top: 6px; line-height: 1; }
.stat-hint { font-size: 12px; color: var(--ink-4); margin-top: 7px; }

/* ------------------------------------------------------------- badges -- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; letter-spacing: -.005em;
  background: var(--surface-2); color: var(--ink-3);
  border: 1px solid var(--border);
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.draft     { background: var(--draft-bg); color: var(--draft); border-color: transparent; }
.badge.scheduled { background: var(--sched-bg); color: var(--sched); border-color: transparent; }
.badge.published { background: var(--pub-bg);   color: var(--pub);   border-color: transparent; }
.badge.failed    { background: var(--fail-bg);  color: var(--fail);  border-color: transparent; }
.badge.accent    { background: var(--accent-soft); color: var(--accent-h); border-color: transparent; }

.pill {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  border-radius: 20px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; color: var(--ink-2); font-weight: 500;
}

/* -------------------------------------------------------------- forms -- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); letter-spacing: -.005em; }
.hint  { font-size: 12px; color: var(--ink-4); }

.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-str); border-radius: var(--r);
  background: var(--surface); font-size: 13.5px;
  transition: border-color .13s, box-shadow .13s;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
.select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2376767f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}

/* Segmented option grid (content type, objective, style) */
.opts { display: grid; gap: 8px; }
.opts.c2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.opts.c4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.opt {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border: 1px solid var(--border-str); border-radius: var(--r);
  background: var(--surface); cursor: pointer; text-align: left;
  transition: border-color .13s, background .13s, box-shadow .13s;
}
.opt:hover { border-color: #c5c5c0; background: var(--surface-2); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt-t { font-size: 13px; font-weight: 580; }
.opt-d { font-size: 11.5px; color: var(--ink-4); line-height: 1.35; }
.opt:has(input:checked) {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}
.opt:has(input:checked) .opt-t { color: var(--accent-h); }

.range-row { display: flex; align-items: center; gap: 12px; }
input[type="range"] { flex: 1; accent-color: var(--accent); height: 4px; }
.range-val {
  min-width: 60px; text-align: center; font-weight: 620; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 4px 8px;
}

/* Tag input (topics, audience, tone) */
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  border: 1px solid var(--border-str); border-radius: var(--r);
  padding: 7px 8px; background: var(--surface); min-height: 38px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 24px;
  padding: 0 4px 0 9px; border-radius: 20px;
  background: var(--accent-soft); color: var(--accent-h);
  font-size: 12px; font-weight: 550;
}
.tag button {
  border: 0; background: transparent; cursor: pointer; color: inherit;
  opacity: .55; padding: 0 2px; line-height: 1; font-size: 14px;
}
.tag button:hover { opacity: 1; }
.tags input { border: 0; outline: none; flex: 1; min-width: 90px; height: 24px; font-size: 13px; background: transparent; }

/* Switch */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; background: #d6d6d2; border-radius: 20px;
  cursor: pointer; transition: background .16s;
}
.switch span::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: transform .16s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }

/* -------------------------------------------------------------- table -- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; font-weight: 650; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-4);
  padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.t-title { font-weight: 580; letter-spacing: -.01em; }
.t-sub { font-size: 12px; color: var(--ink-4); margin-top: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ list row -- */
.lrow {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r);
  transition: background .12s; cursor: pointer;
}
.lrow:hover { background: var(--surface-2); }
.lrow + .lrow { border-top: 1px solid var(--border); border-radius: var(--r); }
.ltime {
  width: 52px; flex: none; text-align: center;
  font-variant-numeric: tabular-nums;
}
.ltime b { display: block; font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.ltime i { display: block; font-style: normal; font-size: 11px; color: var(--ink-4); text-transform: uppercase; letter-spacing: .04em; }
.lthumb {
  width: 40px; height: 50px; flex: none; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--ink-4); overflow: hidden;
}
.lmain { min-width: 0; flex: 1; }
.lmain .t { font-weight: 550; font-size: 13.5px; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmain .m { font-size: 12px; color: var(--ink-4); margin-top: 2px;
  display: flex; align-items: center; gap: 6px; }
.lmain .m .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); opacity: .6; }

/* ------------------------------------------------------------- empty -- */
.empty { text-align: center; padding: 40px 20px; }
.empty .ei {
  width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--ink-4);
}
.empty h3 { font-size: 14px; font-weight: 600; }
.empty p { font-size: 12.5px; color: var(--ink-4); margin-top: 4px; }

/* ----------------------------------------------------------- calendar -- */
.cal-head {
  display: grid; grid-template-columns: repeat(7, minmax(0,1fr));
  border-bottom: 1px solid var(--border);
}
.cal-head div {
  padding: 9px 10px; font-size: 11px; font-weight: 650; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-4);
}
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.cal-cell {
  min-height: 116px; padding: 7px; border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-grid > .cal-cell:nth-last-child(-n+7) { border-bottom: 0; }
.cal-cell.out { background: var(--surface-2); }
.cal-cell.out .cal-day { color: var(--ink-4); opacity: .6; }
.cal-day {
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%;
  font-variant-numeric: tabular-nums;
}
.cal-cell.today .cal-day { background: var(--accent); color: #fff; }
.cal-ev {
  display: block; padding: 5px 7px; border-radius: var(--r-sm);
  font-size: 11.5px; line-height: 1.3; cursor: pointer;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft); color: var(--accent-h);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: filter .12s;
}
.cal-ev:hover { filter: brightness(.97); }
.cal-ev b { font-weight: 650; font-variant-numeric: tabular-nums; }
.cal-ev.published { background: var(--pub-bg); color: var(--pub); border-left-color: var(--pub); }
.cal-ev.draft { background: var(--draft-bg); color: var(--draft); border-left-color: var(--draft); }
.cal-ev.failed { background: var(--fail-bg); color: var(--fail); border-left-color: var(--fail); }

/* week view */
.wk { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.wk-col { border-right: 1px solid var(--border); min-height: 460px; padding: 8px; }
.wk-col:last-child { border-right: 0; }
.wk-h { text-align: center; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.wk-h .d { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-4); font-weight: 650; }
.wk-h .n { font-size: 19px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; }
.wk-h.today .n { color: var(--accent); }

/* -------------------------------------------------------------- slides -- */
.slide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.slide-card {
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); overflow: hidden; cursor: pointer;
  transition: border-color .13s, box-shadow .13s, transform .13s;
}
.slide-card:hover { border-color: var(--border-str); box-shadow: var(--shadow); transform: translateY(-1px); }
.slide-canvas {
  aspect-ratio: 4 / 5; padding: 16px; display: flex; flex-direction: column;
  background: #fff; position: relative; overflow: hidden;
}
.slide-num {
  position: absolute; top: 8px; right: 9px; font-size: 10px; font-weight: 650;
  color: var(--ink-4); background: rgba(255,255,255,.85);
  border-radius: 20px; padding: 1px 6px; letter-spacing: .04em;
}
.slide-kicker { font-size: 8.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.slide-head { font-size: 14px; font-weight: 700; letter-spacing: -.025em; line-height: 1.18; margin-top: auto; }
.slide-body { font-size: 9.5px; line-height: 1.45; color: var(--ink-3); margin-top: 7px; }
.slide-rule { width: 26px; height: 3px; background: var(--accent); border-radius: 3px; margin-top: 10px; }
.slide-meta {
  padding: 8px 10px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px;
}

/* ------------------------------------------------------------- IG prev -- */
.ig-phone {
  width: 100%; max-width: 360px; margin: 0 auto;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: #fff; overflow: hidden; box-shadow: var(--shadow);
}
.ig-top { display: flex; align-items: center; gap: 9px; padding: 10px 12px; }
.ig-top .n { font-size: 13px; font-weight: 620; }
.ig-media {
  aspect-ratio: 4 / 5; background: var(--surface-2);
  position: relative; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 26px 24px;
}
.ig-count {
  position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.62);
  color: #fff; font-size: 11px; font-weight: 600; border-radius: 20px; padding: 2px 9px;
}
.ig-dots { display: flex; justify-content: center; gap: 4px; padding: 9px 0 4px; }
.ig-dots i { width: 5px; height: 5px; border-radius: 50%; background: #d6d6d2; }
.ig-dots i.on { background: var(--accent); }
.ig-acts { display: flex; gap: 14px; padding: 4px 12px 6px; color: var(--ink); }
.ig-cap { padding: 0 12px 14px; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; }
.ig-cap .u { font-weight: 620; }
.ig-tags { color: var(--accent-h); }

/* -------------------------------------------------------------- media -- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 14px; }
.media-item {
  border: 1px solid var(--border); border-radius: var(--r); overflow: hidden;
  background: var(--surface); cursor: pointer; transition: box-shadow .13s, border-color .13s;
}
.media-item:hover { box-shadow: var(--shadow); border-color: var(--border-str); }
.media-thumb {
  aspect-ratio: 1; display: grid; place-items: center; position: relative;
  color: rgba(255,255,255,.9); font-size: 11px; font-weight: 600;
}
.media-kind {
  position: absolute; top: 7px; left: 7px; background: rgba(0,0,0,.5); color: #fff;
  font-size: 10px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px;
}
.media-meta { padding: 9px 11px; }
.media-meta .n { font-size: 12.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-meta .s { font-size: 11.5px; color: var(--ink-4); margin-top: 1px; }

.dropzone {
  border: 1.5px dashed var(--border-str); border-radius: var(--r-lg);
  padding: 30px; text-align: center; background: var(--surface-2);
  transition: border-color .13s, background .13s;
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }

/* --------------------------------------------------------------- tabs -- */
.tabs { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 3px; }
.tab {
  padding: 5px 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 550;
  color: var(--ink-3); cursor: pointer; border: 0; background: transparent; transition: all .13s;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }

/* -------------------------------------------------------------- misc -- */
.kv { display: grid; grid-template-columns: 132px minmax(0,1fr); gap: 10px 14px; align-items: baseline; }
.kv dt { font-size: 12.5px; color: var(--ink-4); }
.kv dd { margin: 0; font-size: 13.5px; font-weight: 500; }

.note {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r);
  background: var(--sched-bg); border: 1px solid #f3ddb6; color: #7c4a06; font-size: 12.5px; line-height: 1.5;
}
.note.info { background: var(--accent-soft); border-color: #d7d9fb; color: #37318f; }
.note .ico { flex: none; margin-top: 1px; }
.note b { font-weight: 650; }

.progress { height: 6px; border-radius: 20px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 20px; }

.mut { color: var(--ink-4); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.center { text-align: center; }
.mt-0{margin-top:0}.mt-1{margin-top:6px}.mt-2{margin-top:12px}.mt-3{margin-top:18px}.mt-4{margin-top:24px}
.mb-2{margin-bottom:12px}.mb-3{margin-bottom:18px}

/* skeleton / loading */
.gen-anim { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.sk { height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, #f1f1ef 25%, #e7e7e4 37%, #f1f1ef 63%);
  background-size: 400% 100%; animation: sh 1.3s ease infinite; }
@keyframes sh { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }

/* toast */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 90;
  display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r);
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: up .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes up { from { opacity: 0; transform: translateY(8px) } }

/* modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(16,16,20,.34); z-index: 80;
  display: grid; place-items: center; padding: 24px;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0 } }
.modal {
  background: var(--surface); border-radius: var(--r-xl); width: 100%; max-width: 560px;
  box-shadow: var(--shadow-lg); max-height: 88vh; display: flex; flex-direction: column;
  animation: pop .2s cubic-bezier(.2,.8,.3,1);
}
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px) } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 15px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }

[hidden] { display: none !important; }

/* status kalender: scheduled */
.cal-ev.scheduled { background: var(--sched-bg); color: var(--sched); border-left-color: var(--sched); }

/* toast varian error + auto-hide dari server */
.toast.err { background: var(--fail); }
.toast.ok  { background: #15803d; }

/* form inline di tabel */
.inline-form { display: inline; }

/* pratinjau media asli */
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-thumb.has-file { background: var(--surface-2) !important; }

/* picker media di editor slide */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px,1fr)); gap: 8px; max-height: 260px; overflow-y: auto; padding: 2px; }
.pick { border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 1; background: var(--surface-2); }
.pick img { width: 100%; height: 100%; object-fit: cover; }
.pick.on { border-color: var(--accent); }
