:root {
  color-scheme: dark;
  --bg: #101012; --sidebar: #111113; --surface: #19191c; --raised: #212124;
  --line: #2c2c30; --text: #f4f2ef; --muted: #a5a3aa; --orange: #ff913e;
  --green: #7ed398; --red: #fa878a; --radius: 15px;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 2.5vw, 2.05rem); letter-spacing: -.035em; line-height: 1.15; }
h2 { font-size: 1.18rem; letter-spacing: -.018em; }
h3 { font-size: 1rem; }
svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, .button { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--raised); color: var(--text); padding: 9px 14px; min-height: 40px; border-radius: 11px; font-weight: 600; }
button:hover, .button:hover { border-color: #595151; }
button:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.primary { color: #1b110a; border-color: #ff9c55; background: linear-gradient(115deg, #ffac61, #ff8334 82%); box-shadow: 0 4px 18px #fe813723; }
.quiet { background: transparent; }
.danger { color: var(--red); }
.icon-button { display: inline-grid; place-items: center; width: 40px; min-width: 40px; height: 40px; padding: 0; border-radius: 11px; }
.icon-button svg { width: 19px; height: 19px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 230px; display: flex; flex-direction: column; padding: 30px 17px 19px; border-right: 1px solid #242427; background: var(--sidebar); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-size: 1.3rem; font-weight: 760; letter-spacing: -.035em; line-height: 1.05; }
.brand img { width: 36px; height: 36px; }
.brand small { display: block; color: #b5b2b4; margin-top: 5px; font-size: .73rem; font-weight: 500; letter-spacing: 0; }
.sidebar .brand { padding-left: 11px; margin-bottom: 37px; }
.side-nav, .side-bottom { display: grid; gap: 5px; }
.side-nav a, .side-bottom a { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 10px 12px; color: #cbc8cd; border-radius: 9px; font-weight: 570; }
.side-nav a:hover, .side-bottom a:hover { background: #1c1b1e; }
.side-nav a[aria-current], .side-bottom a[aria-current] { color: #ffac69; background: linear-gradient(95deg, #4d2c19, #332317); }
.side-nav a svg, .side-bottom a svg { width: 19px; height: 19px; }
.side-bottom { margin-top: auto; }
.badge { margin-left: auto; background: var(--orange); color: #21140e; border-radius: 12px; padding: 1px 7px; font-size: .72rem; }
.workspace { margin-left: 230px; padding: 36px clamp(26px, 4vw, 70px) 65px; min-width: 0; }
#page { max-width: 1250px; margin: 0 auto; }
.mobile-header, .mobile-nav, .quick-grid, .mobile-profile { display: none; }
.page-head, .section-head, .toolbar, .row, .sheet-head, .actions, .breadcrumbs { display: flex; align-items: center; gap: 10px; }
.page-head, .section-head, .sheet-head { justify-content: space-between; }
.page-head { margin-bottom: 25px; }
.disk-head > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.disk-storage, .storage-details { --storage-accent: var(--orange); }
.disk-storage[data-status="warning"], .storage-details[data-status="warning"] { --storage-accent: #ffc477; }
.disk-storage[data-status="critical"], .storage-details[data-status="critical"] { --storage-accent: var(--red); }
.disk-storage { flex: 0 0 auto; }
.storage-desktop {
  width: 238px;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: .86rem;
}
.storage-caption { display: flex; justify-content: space-between; gap: 8px; }
.storage-note { color: var(--muted); font-size: .78rem; }
.storage-warning { color: var(--storage-accent); font-size: .78rem; }
.storage-bar { width: 100%; height: 4px; appearance: none; border: 0; border-radius: 9px; background: var(--raised); overflow: hidden; }
.storage-bar::-webkit-progress-bar { background: var(--raised); }
.storage-bar::-webkit-progress-value { background: var(--storage-accent); border-radius: 9px; }
.storage-bar::-moz-progress-bar { background: var(--storage-accent); border-radius: 9px; }
.storage-mobile { display: none; }
.storage-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--storage-accent); }
.storage-details .row { justify-content: space-between; }
.subtitle, .muted, .hint, small, .counter { color: var(--muted); }
.subtitle { margin-top: 7px; font-size: .9rem; }
.section-head { margin: 24px 0 11px; }
.section-head a { color: var(--orange); font-weight: 650; font-size: .86rem; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.metric, .panel, .record, .quick-tile, .create-item, .profile-card, .version { background: linear-gradient(145deg, #212124, #18181b 70%); border: 1px solid #29292d; border-radius: var(--radius); }
.metric { padding: 17px; min-height: 92px; display: flex; align-items: center; gap: 12px; }
.metric strong { display: block; margin-top: 4px; font-size: 1.3rem; }
.metric small { font-size: .8rem; }
.glyph { width: 42px; height: 42px; flex: none; border-radius: 11px; display: grid; place-items: center; background: #2a2729; color: #ffac72; }
.glyph.green { color: var(--green); background: #223129; }
.glyph.violet { color: #d1aafa; background: #2c2439; }
.panel { padding: 17px; min-width: 0; }
.empty { background: #18181a; border: 1px solid #29292d; border-radius: var(--radius); padding: 24px; color: #c1bdc1; }
.empty strong { display: block; color: var(--text); margin-bottom: 8px; }
.empty button { margin-top: 14px; }
.records { display: grid; gap: 8px; }
.record { width: 100%; display: flex; text-align: left; align-items: center; gap: 12px; min-width: 0; min-height: 70px; padding: 9px 12px; }
button.record { justify-content: flex-start; }
.record .record-copy { flex: 1; overflow: hidden; min-width: 0; }
.record strong, .record small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record small { margin-top: 4px; font-weight: 450; }
.record .thumb { width: 49px; height: 49px; flex: none; border-radius: 10px; object-fit: cover; background: #29272a; display: grid; place-items: center; color: #ffad74; }
.record video.thumb { display: block; }
.record .thumb svg { width: 22px; height: 22px; }
.record time { color: #d9d4d6; font-size: .84rem; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 8px; border-radius: 14px; font-size: .72rem; background: #333237; color: #dbd6da; font-weight: 650; white-space: nowrap; }
.pill.scheduled { background: #392a52; color: #d9bcff; }
.pill.published, .pill.verified { background: #20382a; color: var(--green); }
.pill.error, .pill.reconnect { background: #45282c; color: #ffb2b5; }
.pill.running { background: #493223; color: #ffd0a2; }
.platform { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.platform svg { width: 15px; height: 15px; }
.instagram { color: #f58fc4; } .telegram { color: #86caff; } .youtube { color: #ff898b; } .threads { color: #d5d1d4; }
.toolbar { flex-wrap: wrap; margin-bottom: 13px; }
.toolbar .grow { flex: 1 1 180px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 13px; background: #232326; }
.segmented button { background: transparent; border: none; min-height: 32px; padding: 5px 11px; border-radius: 10px; font-size: .82rem; }
.segmented button[aria-pressed=true] { background: var(--orange); color: #21140d; }
.breadcrumbs { flex-wrap: wrap; margin: 4px 0 14px; }
.breadcrumbs button { min-height: 32px; padding: 4px 9px; }
.compact .record { min-height: 53px; }
.compact .thumb { width: 34px; height: 34px; }
.folder-grid { display: grid; gap: 8px; margin-bottom: 16px; grid-template-columns: repeat(auto-fit, minmax(min(245px, 100%), 1fr)); }
.folder-grid .record { min-height: 61px; }
.folder-grid .record .icon-button { background: transparent; border-color: transparent; }
.profile-card { display: flex; align-items: center; text-align: left; justify-content: flex-start; padding: 11px; width: 100%; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #3a2b23; color: #ffb781; font-size: .75rem; font-weight: 720; flex: none; }
.profile-card small, .create-item small { display: block; margin-top: 4px; }
.profile-card .chevron { margin-left: auto; color: var(--muted); }
.calendar-shell { padding: 0; overflow: hidden; }
.calendar-labels, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-labels { background: #212124; color: #c6c1c3; text-align: center; font-size: .76rem; }
.calendar-labels span { padding: 10px 0; }
.calendar-day { min-width: 0; min-height: 103px; border-top: 1px solid #2d2c2f; border-right: 1px solid #2d2c2f; padding: 5px; display: flex; flex-direction: column; gap: 4px; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside { color: #8b848b; background: #151517; }
.calendar-day.chosen { background: #241c18; box-shadow: inset 0 0 0 1px #e28245; }
.day-button { min-height: 28px; width: 28px; background: transparent; border: 0; padding: 0; color: inherit; border-radius: 50%; }
.calendar-day.today .day-button, .calendar-day.chosen .day-button { background: var(--orange); color: #21140d; }
.calendar-event { min-height: 24px; width: 100%; overflow: hidden; justify-content: flex-start; background: #2b2930; padding: 3px 5px; border: 0; font-size: .69rem; border-radius: 6px; gap: 4px; }
.calendar-event svg { width: 12px; height: 12px; }
.calendar-event.instagram { background: #482440; color: #f6a0d4; }
.calendar-event.telegram { background: #1c3449; color: #a0d8ff; }
.calendar-event.youtube { background: #492829; color: #ffb0ae; }
.calendar-event span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-grid .calendar-day { min-height: 36px; align-items: center; justify-content: center; }
.dots { display: none; }
.calendar-toolbar .period { min-width: 140px; text-align: center; }
.settings { display: grid; gap: 12px; }
.settings .panel > h2, .settings .panel > p + p { margin-bottom: 10px; }
.settings .panel > p { margin-bottom: 8px; }
.account-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; border-top: 1px solid var(--line); padding: 10px 0; }
.account-row:first-child { border-top: none; }
.account-row .platform { overflow-wrap: anywhere; }
.analytics .metric strong { font-size: 1.13rem; }
dialog { background: #18181b; color: var(--text); border: 1px solid #39383b; border-radius: 21px; padding: 0; width: min(calc(100% - 30px), 600px); max-height: min(92dvh, 950px); overflow: auto; }
dialog::backdrop { background: #0009; backdrop-filter: blur(3px); }
.sheet-head { position: sticky; top: 0; z-index: 2; background: #18181b; border-bottom: 1px solid #29292d; padding: 14px 19px; }
#sheet-body { padding: 16px 19px 20px; }
.sheet-head h2 { overflow-wrap: anywhere; }
.create-menu { display: grid; gap: 7px; }
.create-item { width: 100%; justify-content: flex-start; text-align: left; padding: 9px; }
.create-item small { font-weight: 440; }
.create-item:first-child { background: linear-gradient(120deg, #34302e, #232326); border-color: #514236; }
label { display: grid; gap: 5px; min-width: 0; color: #ded9dc; font-size: .87rem; font-weight: 550; }
input:not([type=checkbox]), textarea, select { width: 100%; min-width: 0; background: #242427; color: var(--text); border: 1px solid #38373b; padding: 10px 11px; border-radius: 9px; }
textarea { resize: vertical; min-height: 94px; }
form, .stack { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.actions { justify-content: flex-end; flex-wrap: wrap; }
.error { color: var(--red); overflow-wrap: anywhere; }
.counter, .hint { font-size: .8rem; }
.version { padding: 12px; display: grid; gap: 9px; }
.version .section-head { margin: 0; }
.drop-zone { border: 1px dashed #594438; min-height: 90px; display: grid; justify-items: center; place-content: center; gap: 8px; text-align: center; border-radius: 12px; background: #27201c; cursor: pointer; padding: 12px; }
.drop-zone.dragging { background: #423023; border-color: var(--orange); }
progress { width: 100%; accent-color: var(--orange); }
.preview { max-height: 300px; border-radius: 10px; max-width: 100%; background: #111113; display: block; margin-inline: auto; }
.create-preview { white-space: pre-wrap; overflow-wrap: anywhere; background: #252529; padding: 11px; border-radius: 10px; max-height: 230px; overflow: auto; }
#toast { position: fixed; bottom: 20px; right: 20px; z-index: 6; padding: 12px 15px; border: 1px solid #504238; border-radius: 12px; background: #262221; max-width: min(420px, calc(100vw - 38px)); overflow-wrap: anywhere; }
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-form { width: min(100%, 400px); padding: 25px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.login-form h1 { font-size: 1.55rem; margin: 8px 0; }
@media (max-width: 820px) {
  .storage-desktop { display: none; }
  .disk-storage { flex: 0 1 auto; max-width: 58%; }
  .storage-mobile { display: inline-flex; min-height: 38px; padding: 6px 9px; text-align: left; font-size: .8rem; }
  .disk-storage[data-status="warning"] .storage-mobile, .disk-storage[data-status="critical"] .storage-mobile { color: var(--storage-accent); }
  .sidebar, .desktop-create { display: none; }
  .workspace { margin: 0; padding: 16px 15px calc(94px + env(safe-area-inset-bottom)); }
  .mobile-header { display: flex; align-items: center; justify-content: space-between; padding: calc(9px + env(safe-area-inset-top)) 15px 6px; }
  .mobile-header .brand { font-size: 1.1rem; }
  .mobile-header .brand img { width: 30px; height: 30px; }
  .mobile-header .icon-button { width: 38px; min-width: 38px; background: #1c1c1f; border: 1px solid var(--line); }
  .mobile-nav { position: fixed; z-index: 3; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; inset: auto 0 0; padding: 7px 7px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #151517f5; backdrop-filter: blur(12px); }
  .mobile-nav a, .mobile-nav .nav-create { display: grid; justify-items: center; align-content: center; min-height: 44px; gap: 3px; padding: 0; color: #c9c4c8; font-size: .68rem; }
  .mobile-nav a[aria-current] { color: var(--orange); }
  .mobile-nav svg { width: 19px; height: 19px; }
  .mobile-nav .nav-create { color: #201309; border-radius: 50%; width: 44px; margin: 0 auto 4px; }
  .mobile-nav .nav-create svg { width: 25px; height: 25px; }
  .mobile-profile { display: block; margin-bottom: 12px; }
  .quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
  .quick-tile { display: grid; justify-items: center; align-content: center; gap: 7px; min-height: 85px; font-size: .79rem; font-weight: 650; }
  .quick-tile svg { width: 25px; height: 25px; }
  .quick-tile:first-child svg { color: #ffb26c; }
  .home-metrics, .home-title { display: none; }
  .page-head { margin-bottom: 15px; }
  .section-head { margin-top: 18px; }
  .record { padding: 7px 8px; gap: 7px; min-height: 61px; }
  .record .thumb { width: 40px; height: 40px; }
  .record time { display: none; }
  .record strong { font-size: .88rem; }
  .record small { font-size: .73rem; }
  .record .pill { font-size: .65rem; padding-inline: 6px; }
  .calendar-toolbar .period { min-width: 120px; }
  .calendar-day { min-height: 48px; padding: 3px 0; align-items: center; gap: 1px; border-color: #242427; }
  .calendar-event, .calendar-more { display: none; }
  .dots { display: flex; justify-content: center; gap: 3px; }
  .dots i { width: 4px; height: 4px; background: currentColor; border-radius: 50%; }
  .metrics { gap: 8px; }
  .analytics .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { min-height: 74px; padding: 10px; gap: 6px; }
  .metric .glyph { width: 29px; height: 29px; }
  .metric .glyph svg { width: 16px; height: 16px; }
  dialog { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 90dvh; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  #sheet-body, .sheet-head { padding-inline: 14px; }
  input:not([type=checkbox]), select, textarea { font-size: 16px; }
  #toast { bottom: calc(65px + env(safe-area-inset-bottom)); right: 11px; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: show-sheet 160ms ease-out; }
  @keyframes show-sheet { from { opacity: 0; transform: translateY(12px); } }
}
