/* Виджеты главной вкладки Posta. */

/* Конвейер в правой панели */
.pipeHead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.pipeHead b { font-size: 14px; }
.pipeHead small { font: 11px var(--mono); color: var(--faint); }
.pipe-explainer { margin: 0 0 8px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.pbar { height: 5px; border-radius: 5px; background: var(--panel3); overflow: hidden; margin: 6px 0 10px; }
.pbar i { display: block; height: 100%; background: var(--grad); transition: width .6s ease; }
#sourcePipeDetail, #sourcePipeInsight { overflow-wrap: anywhere; }
.source-pipe-insight { margin: 8px 8px 0; }
#sourcePipe .job { cursor: default; }
#sourcePipe .job:hover { background: transparent; }
.pipe { display: grid; gap: 2px; }
.job { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 9px; align-items: center; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left; font-size: 13px; color: var(--text); }
.job:hover { background: var(--panel2); }
.job.open { background: var(--panel3); box-shadow: inset 2px 0 0 var(--accent); }
.job:focus-visible { outline: 2px solid var(--accent); }
.job.wait { color: var(--faint); }
.job .n { font: 600 12px var(--mono); font-variant-numeric: tabular-nums; }
.job .t { font: 10.5px var(--mono); color: var(--faint); margin-left: 6px; font-weight: 400; }
.dot { width: 14px; height: 14px; border-radius: 4px; flex: none; display: grid; place-items: center; font-size: 10px; line-height: 1; color: var(--bg); font-weight: 700; }
.dot.ok { background: var(--accent); color: #fff; } .dot.wait { border: 1.5px solid var(--line2); }
.dot.active { border: 1.5px solid var(--line2); border-radius: 50%; }
.dot.run { border-radius: 50%; border: 2px solid var(--warm); border-top-color: transparent; animation: spin .8s linear infinite; }
.pool-led { width: 12px; height: 12px; margin: 1px; border-radius: 50%; border: 1px solid #52645f; background: radial-gradient(circle at 35% 30%, #526b61, #23312d 70%); box-shadow: inset 0 1px 2px #0008; transition: background .15s, box-shadow .2s, border-color .15s; }
.pool-led.is-lit { border-color: #a5ffcc; background: radial-gradient(circle at 35% 30%, #edfff3, #69f9a1 42%, #18a85c 78%); box-shadow: 0 0 6px #64fba5, 0 0 14px #36da7a99; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Только что отобрано — в правой панели */
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feed li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 12.5px; }
.feed .th { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--panel3); }
.feed .th img, .feed .th video { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed li { cursor: pointer; }
.feed small { display: block; color: var(--faint); font: 11px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .fline { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Просмотр поста */


.section-head { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 10px; }
.section-head h2 { margin: 0; font-size: 17px; }
.section-head small { color: var(--muted); }
.toolbar { display: flex; gap: 12px; align-items: center; margin: 20px 0 14px; flex-wrap: wrap; }
.toolbar select { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tile { cursor: pointer; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; transition: transform .15s, border-color .15s; }
.tile:hover { transform: translateY(-2px); border-color: rgba(124, 92, 255, .45); }
.tile-media { position: relative; aspect-ratio: 4 / 3; background: #0b0e1c; }
.tile-media img, .tile-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.text-only { padding: 16px; font-size: 13px; color: #c4c8e4; height: 100%; overflow: hidden; }
.badge, .ago { position: absolute; top: 10px; font-size: 11px; padding: 3px 9px; border-radius: 9px; background: rgba(8, 10, 22, .72); backdrop-filter: blur(6px); }
.badge { left: 10px; }
.ago { right: 10px; color: #d6d9ee; }
.card-stats { position: absolute; left: 10px; right: 10px; bottom: 8px; display: flex; gap: 10px; font-size: 12px; text-shadow: 0 1px 4px #000; }
.card-stats .vote { margin-left: auto; }
.tile-body { position: relative; padding: 12px 34px 14px 14px; }
.tile-body b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-body small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-body a { position: absolute; right: 12px; top: 12px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { .dot.run { animation: none; } }

/* Тёплая бумага: та же палитра, что и в приложении. */
:root {
  color-scheme: light;
  --bg: #f5f1e6; --bg2: #eae3d3; --panel: #fffdf7; --panel2: #f1ecdf; --panel3: #eae3d3;
  --line: #ded5c3; --line2: #bdb29e; --text: #27251f; --muted: #716c60; --faint: #716c60;
  --accent: #8a7100; --accent2: #8a7100; --cyan: #315e87; --ok: #286744; --bad: #a52d25;
  --warm: #8a5a00; --grad: #ffda1a;
  color-scheme: light;
}
html, body { background: #f5f1e6; color: #27251f; }
.side { background: #eae3d3; border-color: #ded5c3; }
.brand { gap: 0; padding: 8px 8px 20px; }
.brand-logo { display: inline-flex; align-items: flex-start; padding: .1em .22em .12em .2em; background: #ffda1a; color: #111; font: 900 29px/1 'Jost', 'Futura', 'Century Gothic', sans-serif; letter-spacing: -.045em; white-space: nowrap; }
.brand-logo sup { position: relative; top: .12em; margin-left: .04em; font-size: .46em; letter-spacing: 0; }
.side-nav a:hover, .side-nav .tab-btn:hover, .side-list li:hover { background: rgba(39, 37, 31, .07); }
.side-nav a.is-active, .side-nav .tab-btn.active, .side-list li.is-active { background: #f3e8ae; color: #27251f; }
.side-nav a.is-active em { background: #d9c66e; color: #27251f; }
.cta { background: #ffda1a; color: #27251f; box-shadow: 0 2px 0 rgba(39, 37, 31, .16); }
.cta:hover { background: #f0cb00; }
.tile { background: #fffdf7; }
@media (max-width: 760px) {
  .side .brand { padding: 0 8px 0 2px; }
  .brand-logo { font-size: 21px; }
}

/* Редакционный интерфейс: тёмная оболочка и спокойные блики. */
:root { color-scheme: dark; --bg:#101116; --bg2:#15161c; --panel:#1c1d24; --panel2:#242630; --panel3:#30323b; --surface:#1c1d24; --surface-2:#242630; --surface-3:#30323b; --line:#383a45; --line2:#565966; --line-strong:#565966; --text:#f3f3f5; --muted:#b1b2bc; --faint:#a5a7b2; --accent:#ffda1a; --accent-text:#171717; --link:#c9c2ef; --ok:#84d9aa; --danger:#ff8e8e; --bad:#ff8e8e; --grad:#ffda1a; --shadow-card:none; --modal-dim:rgba(0,0,0,.65); }
html, body { background:var(--bg); color:var(--text); }
.side { background:#14151b; border-color:var(--line); }
.side-nav .tab-btn.active { color:#fff; background:linear-gradient(110deg,#34322a,#292735); box-shadow:inset 0 0 0 1px #8b8294; }
.side-nav .tab-btn:hover, .side-list li:hover { background:#292a32; }
.studio.is-app { grid-template-columns:220px minmax(0,1fr); }
.main { padding:20px 24px 40px; }
.home-tab .top { order:1; margin:0 0 16px; }
.home-tab .top .model-pill { display:none; }
.home-tab .section-head { order:0; margin:0 0 22px; align-items:center; justify-content:space-between; }
.section-head h2 { font-size:30px; letter-spacing:-.03em; }
.section-head small { display:block; margin-top:4px; }
.home-tab .toolbar { order:2; margin:0 0 18px; }
.search,.topic-switch-button,.topic-switch-menu,.activity-console,.account-card,.proposal-card,.cal-card { background:var(--panel); color:var(--text); }
.search input { color:var(--text); }
.cta,.primary-button,.topic-row button { background:#ffda1a; color:#171717; box-shadow:none; }
.cta:hover { background:#ffe55c; }
.chips button { background:#202129; color:var(--muted); border-color:var(--line); }
.chips button.is-active { background:#383742; color:#fff; border-color:#aaa2c3; }
.toolbar select { background:var(--panel); color:var(--text); }
.box { background:linear-gradient(#1e1f27,#1a1b22) padding-box,linear-gradient(120deg,#b7a26b,#776389,#537d86,#8b7960) border-box; border:1px solid transparent; border-radius:16px; }
.tile { background:var(--panel); border-color:var(--line); border-radius:12px; box-shadow:none; }
.tile:hover { transform:none; border-color:#aaa0b5; }.tile-media { background:#272831; }
.tile-body b { color:var(--text); }.tile-body small { color:var(--muted); }
:focus-visible { outline-color:#ffe372; }
@media(max-width:760px) { .studio.is-app { grid-template-columns:1fr; }.main { padding:16px; }.section-head h2 { font-size:24px; }.section-head { gap:10px; }.section-head .cta { font-size:12px; } }
.tile:focus-visible { outline:3px solid #ffe372; outline-offset:3px; }
/* Структура главной: заголовок, поиск, фильтры, материалы и боковая сводка. */
.home-tab .section-head { display:flex; margin:0 0 22px; align-items:center; justify-content:space-between; }
.home-tab .section-head h1 { margin:0; font-size:30px; line-height:1.15; letter-spacing:-.03em; }
.home-tab .section-head p { margin:5px 0 0; color:var(--muted); }
.home-search { max-width:none; margin-bottom:16px; }
.home-search input { min-width:0; border:0 !important; padding:0; background:transparent !important; }
.home-tab .toolbar { margin:0 0 18px; }
.home-tab .grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
.home-tab .tile-body { padding:12px 34px 14px 14px; }
.home-tab .tile-body b { white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:2.8em; }
.side-extra { margin:12px 10px; color:var(--muted); }
.side-extra summary { cursor:pointer; }
@media(max-width:1100px) { .home-tab .grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:760px) { .side-extra { display:none; }.home-tab .section-head h1 { font-size:24px; }.home-tab .grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; } }
@media(max-width:420px) { .home-tab .grid { grid-template-columns:1fr; } }

.tile-video-mark, .tile-media-count { position:absolute; top:8px; z-index:1; padding:4px 7px; border-radius:6px; color:#fff; background:rgba(0,0,0,.72); font-size:11px; line-height:1; }
.tile-video-mark { left:8px; } .tile-media-count { right:8px; }

.home-card-actions { display:flex; gap:8px; margin-top:10px; }
.home-card-action { cursor:pointer; border:1px solid var(--line); border-radius:8px; background:transparent; color:var(--text); min-width:38px; min-height:34px; font-size:16px; }
.home-card-action:hover { border-color:var(--accent, #8b79ff); }
.home-card-action:disabled { opacity:.5; cursor:not-allowed; }


.fline:empty { min-height: 1lh; }

/* Панель всегда занимает одно место рядом с содержимым вкладок. */
.shared-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.shared-layout.has-shared-panel { grid-template-columns: minmax(0, 1fr) 310px; }
.shared-content { min-width: 0; }
.shared-layout #live-panel { grid-column: 2; grid-row: 1; width: auto; min-width: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
#live-panel[hidden] { display: none !important; }
@media (max-width: 1100px) {
  .shared-layout.has-shared-panel { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 760px) {
  .shared-layout.has-shared-panel { grid-template-columns: minmax(0, 1fr); }
  .shared-layout #live-panel { grid-column: 1; grid-row: 1; }
  .shared-layout.has-shared-panel .shared-content { grid-column: 1; grid-row: 2; }
}

/* Ширина шапки и её кнопок не зависит от длины вкладки или текста статуса. */
html { scrollbar-gutter: stable; }
.app-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(180px, 320px); }
.app-top .console-mini { margin-left: 0; min-width: 0; width: 100%; box-sizing: border-box; }
.app-top #future-draft-open { width: auto; white-space: nowrap; }
.app-top #console-mini-status { flex: 1; max-width: none; }
@media (max-width: 760px) {
  .app-top { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
  .app-top #console-mini { width: auto; }
  .app-top #console-mini-status { display: none; }
  .app-top .topic-switch-button { max-width: 100%; }
  .app-top .topic-switch-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.rejected-tab .grid { margin-top: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rejected-reason { margin: 9px 0 4px; color: var(--text); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.rejected-tab .tile-body .rejected-stage { white-space: normal; }
#show-rejected { margin-top: 10px; }
@media (max-width: 1100px) { .rejected-tab .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .rejected-tab .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
@media (max-width: 420px) { .rejected-tab .grid { grid-template-columns: 1fr; } }
