@font-face { font-family: "IBM Plex Sans"; font-weight: 400; src: url("/post-assets/fonts/IBMPlexSans-Regular.ttf"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; src: url("/post-assets/fonts/IBMPlexSans-Medium.ttf"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; src: url("/post-assets/fonts/IBMPlexSans-Bold.ttf"); }

:root {
  color-scheme: dark;
  --bg: #0E0E0E; --panel: #181818; --field: #111111; --border: #2F2F2F;
  --text: #EEEEEE; --muted: #A0A0A0; --accent: #DBDBDB; --danger: #E5533D; --good: #4ADE80; --warn: #FACC15;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 "IBM Plex Sans", "Segoe UI", Arial, sans-serif; }
h1 { font-size: 20px; margin: 8px 0 18px; }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
label { display: block; color: var(--muted); font-size: 13px; margin: 12px 0 6px; }

input:not([type]), input[type=password], input[type=datetime-local], select, textarea {
  width: 100%; border-radius: 8px; border: 1px solid var(--border); background: var(--field);
  color: var(--text); padding: 9px 12px; font: inherit;
}
textarea { resize: vertical; display: block; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel);
  color: var(--text); font: inherit; font-weight: 500; cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: linear-gradient(#DBDBDB, #F2F2F2); border-color: transparent; color: #0E0E0E; font-weight: 700; }
button.ghost { background: transparent; }
button.danger { color: var(--danger); }

.brand { font-weight: 700; font-size: 18px; }
.brand span { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 10px; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 10px; }
.error.ok { color: var(--good); }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }

/* Вход */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 28px; }
.login button { width: 100%; height: 44px; margin-top: 12px; }

/* Страница */
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; border-bottom: 1px solid var(--border); }
.layout { display: grid; grid-template-columns: minmax(340px, 480px) minmax(0, 1fr); gap: 20px; padding: 20px 24px; max-width: 1500px; margin: 0 auto; align-items: start; }
.editor, .side { display: grid; gap: 14px; min-width: 0; }
.side { position: sticky; top: 12px; }
.block { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; min-width: 0; }
.head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.head h2 { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips + .chips { margin-top: 8px; }
.chips button { min-height: 34px; font-size: 13px; }
.chips button.on { background: var(--accent); color: #0E0E0E; border-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: var(--text); font-size: 14px; cursor: pointer; }
.check.wide { display: flex; margin-top: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg button { flex: 1 1 auto; min-height: 36px; font-size: 13px; padding: 0 10px; }
.seg button.on { background: var(--accent); color: #0E0E0E; border-color: var(--accent); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.toolbar > button { min-height: 32px; padding: 0 10px; font-size: 13px; }
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.swatches button { width: 26px; height: 26px; min-height: 0; padding: 0; border-radius: 6px; border: 1px solid var(--border); }
.swatches button.on { outline: 2px solid var(--text); outline-offset: 1px; }
.swatches input[type=color] { width: 30px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--field); cursor: pointer; }

.preview { background: var(--field); border: 1px solid var(--border); border-radius: 8px; min-height: 200px; display: flex; }
.preview img { width: 100%; height: auto; display: block; border-radius: 8px; }
.preview img:not([src]) { visibility: hidden; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.actions .primary { flex: 1 1 160px; }
.schedule { display: flex; gap: 8px; margin-top: 8px; }
.schedule input { flex: 1; min-width: 0; color-scheme: dark; }
[hidden] { display: none !important; }

.posts { display: grid; gap: 6px; margin-top: 10px; max-height: 320px; overflow-y: auto; }
.post { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 12px; min-height: 52px; background: var(--field); }
.post.active { border-color: var(--accent); }
.post .main { flex: 1; min-width: 0; }
.post .name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post .info { display: block; color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post .info.fail { color: var(--danger); }
.empty { color: var(--muted); font-size: 13px; padding: 8px 2px; }

@media (max-width: 900px) {
  .top { padding: 10px 16px; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .side { position: static; order: -1; }
  .brand span { display: none; }
}
