:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #25243a;
  background: #f7f6fa;
  font-synthesis: none;
  --muted: #6b6880;
  --primary: #6538c5;
  --primary-hover: #542ba9;
  --primary-faint: #eee7ff;
  --line: #e6e3ee;
  --white: #fff;
  --radius: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button, input, textarea, select, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #b58dee; outline-offset: 3px; }
a { color: var(--primary); text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.icon { width: 20px; height: 20px; flex: none; display: block; }
.boot { display: grid; min-height: 100vh; place-items: center; color: var(--muted); padding: 20px; }
.layout { display: grid; grid-template-columns: 248px minmax(0,1fr); min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; gap: 34px; padding: 30px 18px 20px; border-right: 1px solid var(--line); background: #fff; }
.brand { display: flex; align-items: center; gap: 12px; color: #282338; }
.sidebar .brand { padding: 0 8px; }
.brand-mark { background: var(--primary); border-radius: 12px; color: #fff; display: grid; width: 42px; height: 42px; flex: none; place-items: center; box-shadow: 0 4px 10px #6538c533; }
.brand-mark .icon { width: 24px; height: 24px; }
.brand-name { font-size: 18px; font-weight: 750; letter-spacing: -.055em; }
.brand-section { color: var(--muted); font-size: 12px; margin-top: 3px; }
.sidebar nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; text-decoration: none; border-radius: 10px; padding: 12px; min-height: 44px; font-size: 14px; font-weight: 600; color: #514c66; }
.nav-link:hover { background: #f7f4fc; }
.nav-link[aria-current="page"] { background: var(--primary-faint); color: #542baa; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 13px; }
.profile { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; align-items: center; border: 0; width: 100%; text-align: left; background: transparent; color: inherit; padding: 8px; border-radius: 10px; }
.profile:hover { background: #f7f4fc; }
.avatar { display: grid; place-items: center; height: 34px; background: #f0e9fc; color: #5931a5; font-weight: 700; border-radius: 50%; }
.profile-name, .profile-email { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-name { font-weight: 650; font-size: 13px; }
.profile-email { color: var(--muted); font-size: 11px; margin-top: 3px; }
.main { min-width: 0; max-width: 1570px; width: 100%; padding: 44px clamp(22px, 4vw, 76px) 38px; margin-inline: auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 25px; }
.page-head h1 { font-size: clamp(28px,3vw,40px); line-height: 1.15; letter-spacing: -.05em; }
.page-head p { font-size: 14px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.btn { min-height: 40px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; padding: 9px 14px; font-size: 14px; border: 1px solid var(--line); border-radius: 10px; color: #342d49; background: #fff; text-decoration: none; font-weight: 650; flex: none; }
.btn:hover { background: #f7f4fc; }
.btn .icon { width: 17px; height: 17px; }
.btn.primary { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: 0 2px 4px #6538c52b; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: #9c263d; border-color: #f0cfd5; }
.btn.danger:hover { background: #fef2f5; }
.btn.icon-only { padding: 8px; min-width: 40px; }
.surface { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 8px #2d204205; }
.calendar-toolbar { padding: 16px 17px; display: flex; align-items: center; justify-content: space-between; gap: 13px; }
.calendar-jump { display: flex; align-items: center; gap: 6px; }
.calendar-toolbar h2 { font-size: 19px; text-transform: capitalize; }
.calendar-scroll { overflow-x: auto; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); min-width: 457px; }
.weekday { color: #646077; background: #fbfaff; border-top: 1px solid var(--line); text-align: left; font-size: 13px; font-weight: 650; padding: 10px; }
.day { min-height: 91px; padding: 6px; border-right: 1px solid var(--line); border-top: 1px solid var(--line); min-width: 0; overflow: hidden; }
.day:nth-child(7n) { border-right: 0; }
.day.outside { background: #fcfbfe; color: #7b758b; }
.day.today { background: #fcfaff; }
.day-number { display: inline-grid; place-items: center; min-width: 28px; height: 28px; font-size: 14px; color: inherit; border-radius: 50%; border: 0; background: transparent; padding: 0; }
.day-number:hover { background: var(--primary-faint); color: #542baa; }
.today .day-number { color: #fff; background: var(--primary); font-weight: 700; }
.day-events { display: grid; gap: 3px; margin-top: 4px; }
.calendar-post { text-align: left; font-size: 12px; border: 0; background: #f0e9fe; color: #542a9b; display: grid; gap: 2px; border-radius: 5px; padding: 4px 6px; overflow: hidden; line-height: 1.2; }
.calendar-post:hover { filter: brightness(.95); }
.calendar-post strong, .calendar-post span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-post[data-tone="success"] { background: #e6f6ee; color: #1e6d52; }
.calendar-post[data-tone="error"] { background: #fde9ef; color: #8e2842; }
.calendar-post[data-tone="warn"] { background: #fff1d5; color: #75510f; }
.calendar-post[data-tone="neutral"] { background: #f0eff3; color: #5a5667; }
.calendar-more { background: transparent; border: 0; padding: 4px; text-align: left; color: var(--primary); font-size: 11px; font-weight: 650; }
.calendar-key { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding: 13px 17px; border-top: 1px solid var(--line); color: #635f74; font-size: 12px; }
.calendar-key span { display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #986de8; }
.dot.success { background: #36a779; }
.dot.error { background: #db6b89; }
.dot.warn { background: #c5892e; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 13px; }
.filter { padding: 7px 14px; border: 1px solid var(--line); color: #534b66; background: #fff; border-radius: 999px; font-size: 13px; min-height: 35px; }
.filter[aria-pressed="true"] { background: var(--primary-faint); color: #542baa; border-color: #decdf9; font-weight: 650; }
.empty { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 56px 24px; }
.empty-mark { display: grid; place-items: center; background: var(--primary-faint); color: var(--primary); width: 48px; height: 48px; border-radius: 14px; margin-bottom: 4px; }
.empty h2 { font-size: 19px; }
.empty p { color: var(--muted); max-width: 380px; font-size: 14px; line-height: 1.55; }
.item { display: flex; align-items: center; gap: 13px; padding: 15px 17px; }
.item + .item { border-top: 1px solid var(--line); }
.item-info { display: grid; gap: 4px; flex: 1; min-width: 0; }
.item-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.item-info small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.item-image, .provider-icon { width: 42px; height: 42px; border-radius: 10px; flex: none; }
.item-image { object-fit: cover; display: block; background: #f5f0fe; }
.provider-icon { display: grid; place-items: center; background: #f0ebfe; color: var(--primary); }
.provider-icon[data-provider="telegram"] { background: #e6f5ff; color: #2069a4; }
.provider-icon[data-provider="vk"], .provider-icon[data-provider="bluesky"] { background: #e8efff; color: #2458bc; }
.provider-icon[data-provider="instagram"] { background: #faeafa; color: #a33579; }
.provider-icon[data-provider="tiktok"] { background: #efedf5; color: #262236; }
.provider-icon[data-provider="yappy"] { background: #e7f6e9; color: #276749; }
.provider-icon[data-provider="ok"] { background: #fff1e6; color: #a34b11; }
.provider-icon[data-provider="max"] { background: #e9e9ff; color: #4e36b0; }
.provider-icon[data-provider="rutube_shorts"] { background: #e8edf6; color: #2a3c65; }
.provider-icon[data-provider="vk_clips"] { background: #e8efff; color: #2458bc; }
.integration-note { display: flex; gap: 12px; align-items: center; padding: 15px 17px; margin-top: 12px; }
.integration-note p { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.badge { background: #f0eaff; color: #572d9e; font-size: 13px; font-weight: 700; white-space: nowrap; border-radius: 999px; padding: 5px 8px; width: fit-content; }
.badge[data-tone="success"] { background: #e6f6ee; color: #1c644b; }
.badge[data-tone="error"] { background: #fce8ee; color: #8e2842; }
.badge[data-tone="warn"] { background: #fff1d5; color: #75510f; }
.badge[data-tone="neutral"] { background: #f0eff3; color: #5a5667; }
.auth { display: grid; min-height: 100vh; place-items: center; padding: 22px; background: radial-gradient(ellipse at 45% 12%, #eae0ff, transparent 62%), #f7f6fa; }
.auth-card { margin: auto; width: min(430px,100%); padding: 30px; }
.auth-card .brand { margin-bottom: 28px; }
.auth-card h1 { font-size: 28px; letter-spacing: -.04em; margin-bottom: 9px; }
.auth-card > p, .dialog-description { color: var(--muted); font-size: 14px; line-height: 1.55; margin-bottom: 16px; }
.field { display: grid; gap: 7px; margin: 0 0 15px; min-width: 0; }
.field > span, legend { font-weight: 650; font-size: 14px; }
.field small, .field-hint { color: var(--muted); line-height: 1.45; font-size: 12px; }
.field input:not([type="checkbox"]), .field textarea, .field select { width: 100%; padding: 10px 12px; border: 1px solid #dcd7e7; border-radius: 9px; color: #272137; background: #fff; }
.field textarea { resize: vertical; min-height: 115px; }
.field input[type="file"] { max-width: 100%; }
.form-error { background: #fce8ee; color: #81273c; font-size: 13px; padding: 11px; margin-bottom: 12px; border-radius: 8px; line-height: 1.45; }
.full { width: 100%; }
dialog { width: min(600px,calc(100% - 28px)); max-height: calc(100dvh - 40px); padding: 0; border-radius: 17px; border: 1px solid var(--line); background: #fff; color: inherit; box-shadow: 0 30px 90px #16102b38; }
dialog::backdrop { background: #22183167; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 20px; letter-spacing: -.025em; }
.dialog-body { padding: 18px 20px; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.actions.split { justify-content: space-between; }
.channels-field { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin: 0 0 15px; min-width: 0; }
.channels-field legend { padding: 0 4px; }
.checkbox { display: flex; align-items: flex-start; gap: 8px; min-height: 32px; padding-block: 5px; font-size: 14px; overflow-wrap: anywhere; }
.checkbox input { accent-color: var(--primary); width: 15px; height: 15px; margin: 1px 0 0; flex: none; }
.checkbox:has(input:disabled) { color: var(--muted); }
.destination-settings { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #faf8ff; margin: 2px 0 9px 23px; }
.destination-settings .field { margin-bottom: 8px; }
.tiktok-creator { margin-bottom: 10px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.tiktok-creator strong { color: #272137; }
.tiktok-options { display: flex; flex-wrap: wrap; gap: 0 14px; }
.tiktok-brand { border-left: 2px solid #ded1fa; padding: 0 0 7px 10px; margin: 0 0 8px 7px; }
.media-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 13px; }
.media-display { max-width: 100%; }
.media-preview { display: block; max-height: 120px; max-width: 190px; object-fit: contain; border-radius: 8px; background: #f8f6fa; border: 1px solid var(--line); }
video.media-preview { width: min(260px, 100%); max-width: 100%; max-height: 230px; background: #22202d; }
.post-image { display: block; max-height: 300px; max-width: 100%; object-fit: contain; border-radius: 8px; }
video.post-image { width: 100%; background: #22202d; }
.post-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 0 0 13px; color: var(--muted); font-size: 13px; }
.post-content { display: grid; gap: 13px; }
.deliveries { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 13px; }
.deliveries h3 { margin-bottom: 6px; font-size: 15px; }
.delivery { display: grid; gap: 5px; padding-block: 8px; overflow-wrap: anywhere; font-size: 14px; }
.delivery small { color: var(--muted); }
.delivery > div { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toast { position: fixed; z-index: 2; bottom: 20px; right: 20px; max-width: min(460px,calc(100vw - 40px)); border-radius: 10px; background: #302347; color: #fff; box-shadow: 0 8px 28px #25203937; padding: 12px 15px; font-size: 14px; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 190px minmax(0,1fr); }
  .sidebar { padding-inline: 12px; }
  .main { padding: 32px 17px; }
}
@media (max-width: 670px) {
  .layout { grid-template-columns: minmax(0,1fr); }
  .sidebar { flex-direction: row; flex-wrap: wrap; gap: 9px; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); align-items: center; justify-content: space-between; }
  .sidebar .brand { padding: 0; }
  .sidebar nav { display: flex; overflow: auto; width: 100%; order: 3; }
  .nav-link { gap: 5px; padding: 8px; font-size: 12px; white-space: nowrap; min-height: 38px; }
  .nav-link .icon { width: 16px; height: 16px; }
  .sidebar-footer { padding: 0; margin: 0; border: 0; }
  .profile { grid-template-columns: 34px; padding: 3px; }
  .profile-text { display: none; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  .main { padding: 23px 12px; }
  .page-head { align-items: flex-start; gap: 8px; margin-bottom: 17px; }
  .page-head .btn { padding-inline: 9px; font-size: 12px; }
  .page-head p { font-size: 13px; }
  .calendar-toolbar { padding: 11px; gap: 8px; }
  .calendar-toolbar h2 { font-size: 15px; }
  .calendar-jump .btn { min-height: 35px; min-width: 29px; padding: 6px; font-size: 11px; }
  .calendar-jump .icon { width: 14px; height: 14px; }
  .calendar-grid { min-width: 0; }
  .weekday { padding: 8px 4px; text-align: center; }
  .calendar-post { font-size: 10px; padding: 3px 2px; }
  .calendar-more { padding: 3px 0; font-size: 10px; }
  .item { flex-wrap: wrap; gap: 8px; padding: 11px; }
  .item-info { flex-basis: 50%; }
  .item .btn { font-size: 12px; min-height: 35px; padding: 5px 8px; }
  .day { min-height: 75px; padding: 4px 2px; }
}
