:root {
  color-scheme: light;
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color: #231c36;
  background: #f8f7fc;
  font-weight: 500;
  --ink: #231c36;
  --muted: #655f75;
  --line: #e8e4ef;
  --purple: #5528b8;
  --sidebar: #211833;
  --lavender: #efe8ff;
  --white: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: wait; opacity: .55; }
a { color: inherit; }
:focus-visible { outline: 3px solid #9867f2; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
svg { width: 19px; height: 19px; flex-shrink: 0; vertical-align: middle; }
.layout { display: grid; min-height: 100vh; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar {
  background: var(--sidebar); color: #f8f5ff; padding: 34px 20px 22px;
  display: flex; flex-direction: column; gap: 35px; position: sticky; top: 0; height: 100dvh;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; line-height: 1.12; font-size: 15px; }
.brand strong { font-size: 21px; letter-spacing: -.05em; }
.brand-icon {
  width: 45px; height: 45px; display: grid; place-items: center;
  border-radius: 14px; background: #d8c4ff; color: #36205b;
}
.brand-icon svg { width: 25px; height: 25px; }
.workspace label { display: block; font-size: 13px; color: #c7b8de; margin: 0 0 8px 3px; }
.workspace select {
  width: 100%; padding: 10px 32px 10px 11px; color: #fff; border: 1px solid #5a4b6d; border-radius: 9px;
  color-scheme: dark; background: #312343;
}
.workspace select option { background: #312343; }
#nav { display: grid; gap: 5px; }
#nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 9px;
  text-decoration: none; color: #d4c9e3; font-size: 14px; font-weight: 650;
}
#nav a:hover { background: #392c4b; color: #fff; }
#nav [aria-current="page"] { background: #483364; color: #fff; }
#nav a svg { color: #d9c2ff; }
.sidebar-foot { margin-top: auto; border-top: 1px solid #4e405f; padding: 17px 3px 0; color: #c7b8de; font-size: 12px; line-height: 1.5; }
.env { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; color: #fff; font-weight: 720; font-size: 13px; }
.env i { width: 8px; height: 8px; background: #c7afff; border-radius: 50%; }
.env.live i { background: #8fe5aa; }
.topbar {
  height: 70px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(22px, 4vw, 54px); border-bottom: 1px solid var(--line); background: #fdfbff;
}
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.breadcrumb strong { color: var(--ink); }
.breadcrumb svg { width: 13px; height: 13px; }
.page { margin: auto; max-width: 1580px; padding: 34px clamp(22px, 4vw, 54px) 55px; }
.headline { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0 0 25px; }
h1 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 780; line-height: 1.1; letter-spacing: -.055em; }
.headline p { color: var(--muted); margin-top: 8px; font-size: 14px; }
.button {
  border: 1px solid transparent; border-radius: 9px; min-height: 40px; padding: 8px 14px; display: inline-flex;
  gap: 8px; align-items: center; justify-content: center; font-size: 13px; font-weight: 720; white-space: nowrap;
  text-decoration: none;
}
.button.primary { color: #fff; background: var(--purple); }
.button.primary:hover { background: #461d9d; }
.button.quiet { border-color: #ded8e9; background: #fff; color: #3a3050; }
.button.quiet:hover { background: #f3edff; }
.button.text { color: var(--purple); background: transparent; padding-inline: 5px; }
.button.icon { padding: 8px; }
.button svg { width: 16px; height: 16px; }
.hero {
  border: 1px solid #e3d7fa; background: #ece3ff; border-radius: 18px;
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(250px, 1fr); align-items: center;
  gap: clamp(22px, 4vw, 55px); padding: clamp(21px, 3vw, 35px); margin-bottom: 17px;
}
.eyeline { color: #513582; display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 750; }
.eyeline svg { width: 16px; height: 16px; }
.hero h2 { font-size: clamp(21px, 2.55vw, 33px); font-weight: 780; letter-spacing: -.045em; line-height: 1.16; margin: 9px 0 6px; overflow-wrap: anywhere; }
.hero p { color: #5e5076; font-size: 13px; line-height: 1.5; }
.hero .button { margin-top: 12px; }
.week { background: #f8f3ff; padding: 13px 13px 15px; border: 1px solid #e0d2f6; border-radius: 13px; }
.week header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 1px 10px; }
.week header strong { font-size: 13px; }
.week header a { color: #5528a0; font-weight: 700; font-size: 12px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.day {
  display: grid; place-items: center; gap: 4px; text-decoration: none; color: #393047;
  padding: 7px 1px 6px; border-radius: 8px; font-size: 13px; background: #efe7fc; border: 1px solid transparent;
}
.day span { font-size: 10px; color: #5c4f73; }
.day.today { border-color: #a88bdb; background: #fff; }
.day:hover { border-color: #9061d7; }
.day i { height: 5px; width: 5px; border-radius: 50%; background: transparent; }
.day i.marked { background: #6539ba; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 23px; }
.metric {
  border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 13px 14px;
  display: flex; align-items: center; gap: 11px; text-align: left; color: var(--ink);
}
.metric:hover, .metric[aria-pressed="true"] { border-color: #bda2ed; background: #fdfaff; }
.metric-icon, .account-icon { width: 37px; height: 37px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; color: #6336a9; background: #f0e8fe; }
.metric.scheduled .metric-icon { background: #e9edff; color: #4745a6; }
.metric.published .metric-icon { background: #e6f4eb; color: #266446; }
.metric.attention .metric-icon { background: #fff2d8; color: #87520b; }
.metric b { display: block; font-size: 21px; line-height: 1.07; letter-spacing: -.04em; }
.metric small { color: var(--muted); font-size: 12px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.panel-head { padding: 18px 19px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
h2 { font-size: 21px; letter-spacing: -.035em; }
.panel-head p, .muted { color: var(--muted); font-size: 13px; }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.controls input, .controls select { min-width: 0; max-width: 100%; }
.field, .controls input, .controls select {
  color: var(--ink); background: #fff; border: 1px solid #ded8e9; border-radius: 8px;
  padding: 8px 10px; min-height: 38px; font-size: 13px;
}
.table-scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; min-width: 610px; text-align: left; font-size: 13px; }
th { background: #f7f4fb; color: #5c546d; font-weight: 700; }
th, td { padding: 11px 12px; border-top: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 19px; }
th:last-child, td:last-child { padding-right: 19px; text-align: right; }
tr:hover td { background: #fdfaff; }
.post-cell { display: flex; align-items: center; gap: 10px; }
.cover { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: #efe8ff; flex-shrink: 0; }
span.cover { color: #6336a9; display: grid; place-items: center; }
.cell-title { font-weight: 750; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: clamp(130px, 23vw, 370px); }
.cell-note { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 20px; background: #f0ebf7; color: #4d405f; font-size: 11px; font-weight: 750; white-space: nowrap; }
.pill::before { content: ''; background: currentColor; border-radius: 50%; width: 5px; height: 5px; }
.pill.scheduled, .pill.preparing { background: #e9edff; color: #413993; }
.pill.published, .pill.connected { background: #e6f4eb; color: #266446; }
.pill.failed, .pill.review, .pill.uncertain, .pill.reconnect_required, .pill.reconnect_soon { background: #fff2d8; color: #80500b; }
.empty { padding: 34px 20px; text-align: center; border-top: 1px solid var(--line); }
.empty p { color: var(--muted); font-size: 13px; margin: 6px auto 13px; }
.calendar-scroll { overflow: auto; }
.calendar-grid { min-width: 580px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekday, .calendar-date { border-top: 1px solid var(--line); border-right: 1px solid var(--line); padding: 8px; min-width: 0; }
.weekday:nth-child(7n), .calendar-date:nth-child(7n) { border-right: none; }
.weekday { color: var(--muted); font-size: 12px; text-align: center; background: #f7f4fb; }
.calendar-date { min-height: 108px; }
.calendar-date.outside { background: #faf9fc; color: var(--muted); }
.calendar-date.selected { background: #f1e9ff; }
.date-num { display: grid; place-items: center; width: 23px; height: 23px; font-size: 12px; font-weight: 750; }
.date-num.today { border-radius: 50%; background: var(--purple); color: white; }
.calendar-post { text-align: left; display: block; width: 100%; margin: 3px 0; border-radius: 5px; border: 0; background: #efe8fa; color: #4e297c; font-size: 11px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-post:hover { background: #e4d3fa; }
.calendar-post.published { color: #276344; background: #e6f4eb; }
.calendar-post.review, .calendar-post.failed, .calendar-post.uncertain { color: #80500b; background: #fff2d8; }
.calendar-post.draft { color: #504760; background: #f0edf5; }
.account-list { display: grid; gap: 13px; }
.account-card { padding: 19px; }
.account-title { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.account-title .pill { margin-left: auto; }
.account-card dl, .detail-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 12px; margin: 12px 0; }
dt { color: var(--muted); font-size: 12px; }
dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 13px; }
.account-card p { margin: 8px 0; }
.dialog-layout { display: grid; grid-template-columns: minmax(220px, .85fr) minmax(260px, 1fr); gap: 20px; }
dialog { padding: 0; width: min(780px, calc(100% - 24px)); max-height: calc(100dvh - 30px); border: 1px solid var(--line); border-radius: 17px; color: var(--ink); }
dialog::backdrop { background: #211833a0; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 21px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 20px; }
.dialog-body p { font-size: 14px; line-height: 1.5; }
.dialog-body label { font-size: 13px; font-weight: 720; display: grid; gap: 5px; margin-bottom: 11px; }
.dialog-body .field { width: 100%; }
textarea { resize: vertical; min-height: 100px; }
.dialog-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 13px; }
.dialog-form { display: grid; gap: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.media-preview { border: 1px solid var(--line); border-radius: 11px; background: #f5f0fc; width: 100%; min-height: 135px; max-height: 400px; object-fit: contain; display: block; }
.media-nav { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.media-nav button { padding: 4px 8px; min-height: 28px; }
.media-nav [aria-pressed="true"] { background: #ece1ff; border-color: #b798e8; }
.caption { white-space: pre-wrap; overflow-wrap: anywhere; margin: 11px 0; }
.inset { background: #f7f2ff; border: 1px solid #e8dcfa; border-radius: 9px; padding: 12px; margin-top: 11px; }
.inset h3 { font-size: 14px; margin-bottom: 4px; }
.error { color: #8e2937; overflow-wrap: anywhere; margin: 9px 0; }
.toast { position: fixed; bottom: 18px; right: 20px; padding: 12px 16px; background: #302146; color: #fff; border-radius: 9px; max-width: calc(100% - 40px); font-size: 14px; z-index: 2; }
@media (max-width: 970px) {
  .layout { grid-template-columns: 175px minmax(0, 1fr); }
  .sidebar { padding-inline: 14px; }
  .metric { padding-inline: 8px; gap: 6px; }
  .metric-icon { width: 32px; height: 32px; }
}
@media (max-width: 700px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 15px; }
  .brand strong { font-size: 17px; }
  .brand-icon { width: 37px; height: 37px; }
  #nav { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #nav a { justify-content: center; gap: 5px; padding: 7px 3px; font-size: 12px; }
  #nav svg { width: 15px; height: 15px; }
  .sidebar-foot { grid-column: 1 / -1; margin: 0; padding: 8px 2px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  .env { margin-bottom: 0; }
  .topbar { height: 54px; padding-inline: 15px; }
  .page { padding: 22px 15px 30px; }
  .headline { margin-bottom: 18px; }
  .headline p { font-size: 12px; }
  .hero { grid-template-columns: 1fr; gap: 16px; padding: 17px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .panel-head { padding: 13px; }
  .dialog-layout { grid-template-columns: 1fr; }
  .dialog-body, .dialog-head { padding: 14px; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.upload-preview { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 8px; }
.upload-preview > div { flex: 0 0 96px; min-width: 0; font-size: 11px; }
.upload-preview img, .upload-preview svg { width: 100%; height: 64px; object-fit: cover; border-radius: 6px; background: var(--lavender); }
.upload-preview svg { padding: 18px; }
.upload-preview span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 970px) {
  table { min-width: 480px; }
  th, td { padding-inline: 7px; }
  th:first-child, td:first-child { padding-left: 12px; }
  th:last-child, td:last-child { padding-right: 12px; }
}
@media (max-width: 535px) {
  table { min-width: 0; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody, tr, td { display: block; }
  tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-top: 1px solid var(--line); padding: 10px 12px; gap: 5px 9px; align-items: center; }
  td, td:first-child, td:last-child { padding: 0; border: 0; }
  td:first-child { grid-column: 1; grid-row: 1; }
  td:nth-child(2) { grid-column: 1; grid-row: 2; }
  td:nth-child(3) { grid-column: 2; grid-row: 2; text-align: right; }
  td:nth-child(4) { grid-column: 1; grid-row: 3; color: var(--muted); }
  td:nth-child(5) { grid-column: 2; grid-row: 1; }
  .post-cell > div { min-width: 0; }
  .cell-title { max-width: none; }
  .headline { align-items: flex-start; }
  .headline .button { white-space: normal; text-align: center; }
}
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: #eee6fb; }
.login-panel { width: min(100%, 412px); padding: 30px; border: 1px solid #dfd4f1; border-radius: 16px; background: #fff; }
.login-brand { color: var(--purple); font-size: 14px; font-weight: 750; margin-bottom: 16px; }
.login h1 { font-size: 34px; }
.login form { display: grid; gap: 9px; margin-top: 21px; }
.login label { font-size: 13px; font-weight: 720; }
.login .button { margin-top: 5px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
