/* Медиацентр — светлая тема в цветах колледжа. Тёмной темы нет намеренно. */
:root {
  color-scheme: light;
  --bg: #f5f7fb; --surface: #ffffff; --ink: #172033; --ink-2: #3b475c; --muted: #66748a;
  --line: #e3e8f0; --line-2: #eef1f6;
  --brand: #12294a; --primary: #1f5fd6; --primary-h: #194fb4; --primary-soft: #eaf1fe;
  --draft-bg: #eef1f6; --draft: #526078;
  --wait-bg: #e6eeff; --wait: #1f4fb8;
  --return-bg: #fff1cf; --return: #8a5a00;
  --ok-bg: #dff3e7; --ok: #17643a;
  --bad-bg: #fde8e8; --bad: #a12525;
  --radius: 10px; --shadow: 0 1px 2px rgba(23,32,51,.05), 0 4px 14px rgba(23,32,51,.05);
  --side: 252px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
a { color: var(--primary); }
h1 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 1.1rem; margin: 28px 0 12px; }
h3 { font-size: 1rem; margin: 18px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }

/* ── каркас ── */
.navtoggle { position: absolute; opacity: 0; pointer-events: none; }
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 12px; display: flex; flex-direction: column; }
.brandbox { display: flex; align-items: center; gap: 11px; padding: 2px 8px 14px; text-decoration: none; color: var(--brand); }
.brandbox img { width: 40px; height: 38px; object-fit: contain; }
.brandbox b { font-size: 1.1rem; line-height: 1.1; display: block; }
.brandbox small { display: block; color: var(--muted); font-size: .74rem; margin-top: 2px; }
.navlabel { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 16px 10px 6px; font-weight: 600; }
.side a.nav { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .95rem; }
.side a.nav:hover { background: var(--bg); }
.side a.nav.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.count { margin-left: auto; background: var(--primary); color: #fff; border-radius: 10px; padding: 0 7px; font-size: .72rem; font-weight: 700; line-height: 18px; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.me { padding: 4px 10px 8px; }
.me b { display: block; font-size: .92rem; }
.me span { color: var(--muted); font-size: .8rem; }
button.navbtn { width: 100%; background: none; border: 0; text-align: left; cursor: pointer; font: inherit; }
.bar { display: none; }
.scrim { display: none; }
.content { max-width: 1120px; width: 100%; margin: 0 auto; padding: 30px 30px 56px; }
.foot { color: var(--muted); font-size: .8rem; padding-top: 32px; }

.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.pagehead p { color: var(--muted); margin: 6px 0 0; max-width: 62ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── кнопки ── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--primary); background: var(--primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 40px; line-height: 1.2; }
.btn:hover { background: var(--primary-h); border-color: var(--primary-h); }
.btn.secondary { background: var(--surface); color: var(--ink-2); border-color: #cfd7e3; }
.btn.secondary:hover { background: var(--bg); }
.btn.danger { background: var(--surface); color: var(--bad); border-color: #e5b4b4; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.small { padding: 5px 12px; min-height: 34px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid rgba(31,95,214,.45); outline-offset: 2px; }
button.link { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; text-decoration: underline; }
form.inline { display: inline; margin: 0; }
.seg { display: inline-flex; border: 1px solid #cfd7e3; border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg a { padding: 7px 14px; text-decoration: none; color: var(--ink-2); font-size: .9rem; font-weight: 500; border-right: 1px solid #cfd7e3; }
.seg a:last-child { border-right: 0; }
.seg a.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ── сообщения, карточки, плитки ── */
.messages { list-style: none; margin: 0 0 18px; padding: 0; }
.msg { padding: 11px 15px; border-radius: var(--radius); margin-bottom: 8px; background: var(--surface); border: 1px solid var(--line); border-left-width: 4px; }
.msg.success { border-left-color: #2f9e5f; background: var(--ok-bg); color: var(--ok); }
.msg.error { border-left-color: #d24545; background: var(--bad-bg); color: var(--bad); }
.msg.warning { border-left-color: #d9a21b; background: var(--return-bg); color: var(--return); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.notice { background: var(--return-bg); color: var(--return); padding: 12px 15px; border-radius: var(--radius); margin-bottom: 16px; }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.info { background: var(--wait-bg); color: var(--wait); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border-top: 3px solid var(--line); text-decoration: none; color: inherit; display: block; }
.tile .n { font-size: 2rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.tile .l { color: var(--muted); font-size: .86rem; margin-top: 7px; }
.tile.blue { border-top-color: var(--primary); } .tile.amber { border-top-color: #e0a91f; }
.tile.green { border-top-color: #2f9e5f; } .tile.red { border-top-color: #d24545; }
a.tile:hover { border-color: #c5d0e2; }
.empty { text-align: center; padding: 36px 18px; color: var(--muted); background: var(--surface); border: 1px dashed #cfd7e3; border-radius: var(--radius); }
.empty b { display: block; color: var(--ink); font-size: 1.02rem; margin-bottom: 4px; }

/* ── статусы ── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.st-draft, .st-muted { background: var(--draft-bg); color: var(--draft); }
.st-wait { background: var(--wait-bg); color: var(--wait); }
.st-return { background: var(--return-bg); color: var(--return); }
.st-ok { background: var(--ok-bg); color: var(--ok); }
.st-bad { background: var(--bad-bg); color: var(--bad); }

/* ── таблицы ── */
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 16px; }
table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t th { background: #fafbfd; font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
table.t tbody tr:hover td { background: #fafcff; }
table.t tr:last-child td { border-bottom: 0; }
.dayrow td { background: var(--bg) !important; font-weight: 600; color: var(--ink-2); }
tr.late td:first-child { box-shadow: inset 3px 0 0 #d24545; }
tr.mine td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.tablewrap .t { margin: 0; }

/* ── формы ── */
label { display: block; font-weight: 600; margin: 16px 0 5px; font-size: .92rem; color: var(--ink-2); }
input[type=text], input[type=url], input[type=email], input[type=date], input[type=time], input[type=number], input[type=datetime-local], input[type=password], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #cfd7e3; border-radius: 8px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; margin: 0 8px 0 0; accent-color: var(--primary); flex: none; }
label.check { font-weight: 500; display: flex; align-items: center; margin: 14px 0 4px; color: var(--ink); }
.helptext { color: var(--muted); font-size: .84rem; margin-top: 4px; }
.errorlist { list-style: none; padding: 0; margin: 5px 0 0; color: var(--bad); font-size: .88rem; }
.formcard { max-width: 640px; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.formgrid .wide { grid-column: 1 / -1; }
.formgrid.single { grid-template-columns: 1fr; }
ul.checks { list-style: none; padding: 0; margin: 0; }
ul.checks label { font-weight: 500; margin: 6px 0; display: flex; align-items: center; }

/* ── карточка поста ── */
.grid2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; }
.steps { display: flex; list-style: none; margin: 0 0 22px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 8px 14px; }
.steps li { flex: 1; position: relative; text-align: center; font-size: .86rem; color: var(--muted); padding: 0 4px; }
.steps li::before { content: attr(data-n); display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: 0 auto 7px; border-radius: 50%; background: var(--draft-bg); border: 2px solid var(--line); font-weight: 700; color: var(--muted); position: relative; z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 15px; left: calc(50% + 20px); right: calc(-50% + 20px); height: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li.done::before { content: "✓"; background: #2f9e5f; border-color: #2f9e5f; color: #fff; }
.steps li.done::after { background: #2f9e5f; }
.steps li.current::before { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-soft); }
.steps li.current { color: var(--ink); font-weight: 600; }
.steps li.return::before { background: #e0a91f; border-color: #e0a91f; color: #fff; box-shadow: 0 0 0 4px var(--return-bg); }
.steps li.stopped::before { content: "×"; background: var(--draft-bg); }
.steps small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.postbody { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; background: var(--surface); overflow-wrap: anywhere; box-shadow: var(--shadow); }
.postbody blockquote { margin: 8px 0; padding: 4px 12px; border-left: 3px solid #c5d0e2; color: var(--muted); }
.postbody pre { background: var(--bg); padding: 10px; border-radius: 6px; overflow-x: auto; }
.postbody code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.spoiler { background: var(--ink); color: var(--ink); border-radius: 3px; cursor: pointer; }
.spoiler:hover, .spoiler:focus { color: #fff; }
.postimg { max-width: 100%; max-height: 420px; border-radius: var(--radius); border: 1px solid var(--line); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-block; background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 2px 11px; font-size: .84rem; font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 4px 0 14px 16px; border-left: 2px solid var(--line); margin-left: 5px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.toolbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.toolbar button { padding: 4px 10px; min-width: 34px; min-height: 32px; border: 1px solid #cfd7e3; background: #fff; color: var(--ink-2); border-radius: 6px; cursor: pointer; font: inherit; }
.toolbar button:hover { background: var(--bg); }
.counter { text-align: right; font-size: .84rem; color: var(--muted); }
.counter.over { color: var(--bad); font-weight: 600; }
.tabs { display: inline-flex; gap: 0; margin-bottom: 8px; border: 1px solid #cfd7e3; border-radius: 8px; overflow: hidden; }
.tabs button { padding: 6px 16px; border: 0; background: #fff; color: var(--ink-2); cursor: pointer; font: inherit; }
.tabs button + button { border-left: 1px solid #cfd7e3; }
.tabs button[aria-pressed=true] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ── календарь ── */
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 16px; }
.cal-head, .cal-body { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 9px 10px; font-size: .74rem; font-weight: 700; color: var(--muted); background: #fafbfd; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .05em; }
.cal-cell { min-height: 124px; padding: 6px 6px 4px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { background: #fafbfd; }
.cal-cell.out .d { opacity: .4; }
.cal-cell.off { background: #fbfbfd; }
.cal-cell .d { font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.cal-cell.today .d span { background: var(--primary); color: #fff; border-radius: 999px; padding: 1px 8px; }
.wd { display: none; font-weight: 500; color: var(--muted); }
.chip { display: block; font-size: .78rem; line-height: 1.3; padding: 4px 7px; border-radius: 6px; margin-bottom: 4px; text-decoration: none; border-left: 3px solid; color: var(--ink); overflow: hidden; }
.chip b { font-weight: 600; }
.chip small { display: block; color: inherit; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip:hover { filter: brightness(.97); }
.chip.c-none { background: #fff; border: 1px dashed #aab6c8; border-left: 3px dashed #aab6c8; color: var(--ink-2); }
.chip.c-plan { background: var(--draft-bg); border-left-color: #98a4b8; color: var(--draft); }
.chip.c-draft { background: var(--draft-bg); border-left-color: #98a4b8; color: var(--draft); }
.chip.c-wait { background: var(--wait-bg); border-left-color: #3b78e7; color: var(--wait); }
.chip.c-return { background: var(--return-bg); border-left-color: #e0a91f; color: var(--return); }
.chip.c-ok { background: var(--ok-bg); border-left-color: #2f9e5f; color: var(--ok); }
.chip.c-bad { background: var(--bad-bg); border-left-color: #d24545; color: var(--bad); }
.chip.c-mine { box-shadow: 0 0 0 2px rgba(31,95,214,.35); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: 0 0 14px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ── вход ── */
.loginpage { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(160deg, #f5f7fb 0%, #e9f0fc 100%); }
.login { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 30px; box-shadow: 0 10px 40px rgba(18,41,74,.10); }
.login img { display: block; width: 84px; margin: 0 auto 12px; }
.login h1 { text-align: center; font-size: 1.4rem; }
.login .sub { text-align: center; color: var(--muted); margin: 6px 0 8px; }

/* ── адаптив ── */
@media (max-width: 1000px) {
  .app { display: block; }
  .bar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 14px; }
  .bar .burger { display: inline-flex; padding: 7px; border: 1px solid #cfd7e3; border-radius: 8px; cursor: pointer; color: var(--ink-2); }
  .bar .ttl { font-weight: 700; color: var(--brand); }
  .bar .bell { margin-left: auto; position: relative; color: var(--ink-2); display: inline-flex; padding: 7px; }
  .bar .bell .count { position: absolute; top: -2px; right: -2px; margin: 0; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 280px; max-width: 86vw; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(18,41,74,.25); }
  .navtoggle:checked ~ .app .side { transform: translateX(0); }
  .navtoggle:checked ~ .app .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(18,41,74,.35); }
  .content { padding: 20px 16px 48px; }
  .grid2 { grid-template-columns: 1fr; }
  .formgrid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  h1 { font-size: 1.35rem; }
  .steps li small { display: none; }
  .steps li { font-size: .74rem; }
  .cal-head { display: none; }
  .cal-body { display: block; }
  .cal-cell { display: none; min-height: 0; border-right: 0; padding: 10px 12px; }
  .cal-cell.has, .cal-cell.today { display: block; }
  .cal-cell.out { display: none !important; }
  .cal-cell .wd { display: inline; }
  .tablewrap { border: 0; background: transparent; box-shadow: none; }
  table.t, table.t thead, table.t tbody, table.t tr, table.t td { display: block; width: 100%; }
  table.t thead { display: none; }
  table.t tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 0; box-shadow: var(--shadow); }
  table.t td { border: 0; padding: 4px 14px; }
  table.t td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .82rem; }
  table.t tbody tr:hover td { background: transparent; }
  .dayrow { background: transparent !important; border: 0 !important; box-shadow: none !important; margin: 14px 0 6px !important; padding: 0 !important; }
  .dayrow td { padding: 0 2px !important; }
}

/* ── редактор поста ── */
.editbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.editbar .tabs { margin-bottom: 0; }
.save-state { font-size: .85rem; color: var(--muted); }
.save-state.ok { color: var(--ok); }
.save-state.warn { color: var(--return); }
.save-state.bad { color: var(--bad); font-weight: 600; }
.tabbadge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; background: var(--draft-bg); color: var(--draft); margin-left: 4px; }
.tabbadge.bad { background: var(--return-bg); color: var(--return); }
.tabbadge.ok { background: var(--ok-bg); color: var(--ok); }
.rich { min-height: 260px; padding: 12px 14px; border: 1px solid #cfd7e3; border-radius: 8px; background: #fff; outline: none; overflow-wrap: anywhere; line-height: 1.55; }
.rich:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,95,214,.15); }
.rich blockquote { margin: 6px 0; padding: 2px 12px; border-left: 3px solid #c5d0e2; color: var(--muted); }
.rich pre { background: var(--bg); padding: 8px 10px; border-radius: 6px; white-space: pre-wrap; }
.rich code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.rich .spoiler { background: #dfe6f2; color: inherit; border-radius: 3px; padding: 0 3px; }
.rich ul, .rich ol { margin: 4px 0; padding-left: 24px; }
#pane-md textarea { font-family: ui-monospace, Consolas, monospace; font-size: .95rem; }
.emojiwrap { position: relative; display: inline-block; }
.emoji-pop { position: absolute; z-index: 30; top: 40px; left: 0; width: min(340px, 86vw); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(18,41,74,.18); padding: 10px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 200px; overflow-y: auto; margin-top: 8px; }
.emoji-grid .emo { font-size: 1.35rem; line-height: 1; padding: 5px 0; border: 0; background: none; border-radius: 6px; cursor: pointer; min-width: 0; min-height: 0; }
.emoji-grid .emo:hover { background: var(--primary-soft); }
.tones { display: flex; gap: 2px; margin-top: 8px; }
.tones button { min-width: 0; padding: 2px 6px; border: 1px solid transparent; background: none; border-radius: 6px; cursor: pointer; font-size: 1rem; }
.tones button[aria-pressed=true] { border-color: var(--primary); background: var(--primary-soft); }

/* ── площадки: предпросмотр и результат ── */
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.pcard-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.previews { display: grid; gap: 8px; margin-top: 8px; }
.bubble { background: #f4f7fc; border: 1px solid #e1e8f3; border-radius: 12px; padding: 10px 12px; max-width: 560px; }
.bubble-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.bubble-img { background: #dbe4f3; color: var(--ink-2); border-radius: 8px; padding: 26px 10px; text-align: center; margin-bottom: 6px; font-size: .88rem; }
.bubble-text { overflow-wrap: anywhere; }
.postbody-lite p { margin: 0 0 8px; }
.postbody-lite h4 { margin: 0 0 6px; }
.e-bold { font-weight: 700; } .e-italic { font-style: italic; } .e-underline { text-decoration: underline; }
.e-strikethrough { text-decoration: line-through; } .e-code, .e-pre { font-family: ui-monospace, Consolas, monospace; background: #e7edf6; border-radius: 4px; padding: 0 3px; }
.e-spoiler { background: #b9c4d6; color: transparent; border-radius: 3px; } .e-spoiler:hover { color: inherit; background: #e7edf6; }
.e-blockquote { display: inline-block; border-left: 3px solid #b7c4d9; padding-left: 8px; color: var(--ink-2); }
details.custom { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
details.custom summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: .92rem; }
.notice.small { font-size: .9rem; padding: 9px 12px; }

/* ── сворачиваемая панель настроек ── */
details.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
details.panel > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-weight: 600; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.panel[open] > summary::before { transform: rotate(90deg); }
details.panel > summary .sub { font-weight: 400; color: var(--muted); font-size: .88rem; }
details.panel > .panel-body { padding: 4px 18px 18px; border-top: 1px solid var(--line-2); max-width: 760px; }

/* ── справочная система ── */
.helpbar { display: flex; justify-content: flex-end; margin: -10px 0 10px; }
.helpbar a { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--muted); text-decoration: none; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.helpbar a:hover { color: var(--primary); border-color: #c5d0e2; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 8px; }
.guide-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); margin-bottom: 10px; }
.guide-grid .guide-card { margin-bottom: 0; }
.guide-card b { display: block; color: var(--brand); margin-bottom: 4px; }
.guide-card span { color: var(--muted); font-size: .9rem; }
.guide-card:hover { border-color: #c5d0e2; }
.guide-card.featured { border-top: 3px solid var(--primary); }
.guide-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.guide-nav { position: sticky; top: 16px; font-size: .92rem; max-height: calc(100vh - 32px); overflow-y: auto; }
.guide-nav summary { list-style: none; cursor: pointer; margin-bottom: 4px; }
.guide-nav summary::-webkit-details-marker { display: none; }
.guide-nav a { display: block; padding: 5px 8px; border-radius: 6px; color: var(--ink-2); text-decoration: none; }
.guide-nav a:hover { background: var(--primary-soft); }
.guide-nav a.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.guide-nav summary a { padding-left: 0; color: var(--primary); font-weight: 600; }
.guide-article { max-width: 800px; }
.guide-article h1 { margin-bottom: 6px; }
.guide-article .lead { color: var(--muted); font-size: 1.05rem; margin-bottom: 20px; }
.guide-article h2 { margin: 26px 0 10px; font-size: 1.1rem; }
.callout { border-radius: var(--radius); padding: 12px 15px; margin: 14px 0; border-left: 4px solid; }
.callout.tip { background: var(--wait-bg); border-color: #3b78e7; color: var(--wait); }
.callout.warn { background: var(--return-bg); border-color: #e0a91f; color: var(--return); }
.gsteps { list-style: none; counter-reset: step; padding: 0; margin: 14px 0; }
.gsteps li { counter-increment: step; position: relative; padding: 2px 0 14px 46px; }
.gsteps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.gsteps li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 34px; bottom: 4px; width: 2px; background: var(--line); }
.gs-link { margin-top: 6px; }
.glist { padding-left: 22px; margin: 10px 0; }
.glist li { margin-bottom: 6px; }
.guide-pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 1000px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-nav { position: static; max-height: none; }
  .helpbar { margin-top: 0; }
}
