:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #08090c;
  color: #eaf2f4;
  font-synthesis: none;

  --thinking: #37e0d4;
  --waiting: #ffb23d;
  --error: #ff4d6a;
  --completed: #6ee787;
  --idle: #5c6a70;
  --claude: #ff7a45;
  --codex: #8ef0c8;
}
* { box-sizing: border-box; }
body { margin: 0; background:
  radial-gradient(70rem 45rem at 85% -15%, rgba(55,224,212,.10), transparent 60%),
  radial-gradient(55rem 35rem at -10% 10%, rgba(255,122,69,.09), transparent 58%),
  #08090c; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 2px solid var(--thinking); outline-offset: 3px; }
main { max-width: 1220px; margin: auto; padding: 36px 32px 24px; }

.brandline { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.brandline img { width: 22px; height: 22px; }
.brandline span { margin-left: auto; color: #6d7d82; font-size: 10px; font-weight: 600; }
h1 { margin: 26px 0 10px; font-size: clamp(30px,5vw,44px); font-weight: 800; line-height: 1.02; letter-spacing: -.03em; font-style: italic; text-transform: uppercase; }
h1 em { font-style: italic; background: linear-gradient(97deg, var(--claude), var(--waiting) 45%, var(--thinking)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-header p { margin: 0; max-width: 700px; color: #93a3a8; font-size: 13px; line-height: 1.7; }

.controls { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; padding: 16px 0; margin: 26px 0 0; border-block: 1px solid #1d2428; }
.segments { display: flex; padding: 3px; gap: 2px; border-radius: 4px; background: #121719; border: 1px solid #222b2e; }
.segments button { background: transparent; border: 0; border-radius: 2px; color: #8b9a9e; padding: 6px 16px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.segments button[aria-pressed=true] { background: linear-gradient(180deg,#2a3538,#1c2427); color: #eaf6f6; box-shadow: inset 0 0 0 1px #3c4a4e; }
.controls label { display: flex; align-items: center; gap: 7px; color: #9fadb1; font-size: 11px; cursor: pointer; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
input[type=checkbox] { width: 14px; height: 14px; margin: 0; accent-color: var(--thinking); cursor: pointer; }

.options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; margin-top: 26px; }
.option { min-width: 0; }
.option-head { display: flex; align-items: baseline; gap: 9px; }
.number { color: #52636a; font-size: 10px; font-weight: 800; }
.option-head h2 { font-size: 17px; font-weight: 800; margin: 0; letter-spacing: -.01em; text-transform: uppercase; font-style: italic; }
.description { color: #8b999e; font-size: 12px; line-height: 1.55; margin: 7px 0 14px; min-height: 62px; }

.sidebar { position: relative; display: flex; flex-direction: column; height: 556px; border: 1px solid #242e32; border-radius: 10px; background: #0d1114; overflow: hidden; }
.sidebar-head { display: flex; align-items: center; gap: 9px; padding: 11px 12px 9px; }
.product { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; letter-spacing: .02em; }
.product img { width: 22px; height: 22px; }
.add-project { width: 29px; height: 29px; margin-left: auto; display: grid; place-items: center; border: 1px solid #2b373b; border-radius: 4px; background: transparent; color: #9fb0b4; }
.add-project:hover { border-color: var(--thinking); color: var(--thinking); }

.icon { display: inline-block; flex: 0 0 auto; width: 14px; height: 14px; background: currentColor; mask: var(--icon) center/contain no-repeat; -webkit-mask: var(--icon) center/contain no-repeat; }

.view-tabs { display: flex; margin: 0 12px 8px; gap: 3px; padding: 3px; background: #121719; border-radius: 4px; }
.view-tabs button { flex: 1; min-height: 25px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 2px; color: #7b8b90; background: transparent; font-size: 10px; font-weight: 700; letter-spacing: .07em; }
.view-tabs button .icon { width: 12px; height: 12px; }
.view-tabs button[aria-pressed=true] { background: #222c30; color: #e6f4f4; }

.sidebar-scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 9px 12px; scrollbar-width: thin; scrollbar-color: #37474c transparent; }
.sidebar-scroll::-webkit-scrollbar { width: 5px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: #37474c; border-radius: 4px; }
.list-heading { display: flex; justify-content: space-between; margin: 0 5px 6px; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #5f7176; line-height: 18px; }

.thread { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 22px; align-items: center; margin: 2px 0; padding: 5px 4px 6px 9px; border: 1px solid transparent; border-radius: 5px; background: #ffffff04; transition: background-color 140ms ease, border-color 140ms ease, transform 140ms cubic-bezier(.2,0,.2,1); overflow: hidden; }
.thread:hover { background: #ffffff09; }
.row-content { min-width: 0; position: relative; z-index: 2; }

.project { display: flex; align-items: center; gap: 5px; min-width: 0; height: 17px; color: #e6eeee; }
.project > .icon { width: 12px; height: 12px; color: #9a8a63; }
.project-name { min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; font-size: 12px; font-weight: 800; line-height: 17px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.org { margin-left: auto; padding-left: 6px; font-size: 8px; line-height: 12px; color: #5b6c71; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }

.identity { display: grid; grid-template-columns: 17px minmax(0,1fr); gap: 5px; align-items: center; height: 18px; }
.provider { position: relative; display: grid; place-items: center; width: 17px; height: 17px; padding: 0; border: 0; border-radius: 4px; background: #ffffff08; color: #9fb0b4; }
.provider .icon { width: 11px; height: 11px; }
.provider.claude { color: var(--claude); box-shadow: inset 0 0 0 1px rgba(255,122,69,.25); }
.provider.codex { color: var(--codex); box-shadow: inset 0 0 0 1px rgba(142,240,200,.2); }
.provider.claude .icon { width: 12px; height: 12px; }
.title { border: 0; padding: 0; min-width: 0; background: transparent; text-align: left; color: #93a3a8; font-size: 11px; line-height: 18px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.more { position: relative; z-index: 2; display: grid; place-items: center; height: 22px; width: 22px; border: 0; padding: 0; border-radius: 4px; background: transparent; color: #66777c; opacity: 0; transition: opacity 140ms ease; }
.more .icon { width: 12px; height: 12px; }
.thread:hover .more, .more:focus-visible { opacity: 1; }
.more:hover { color: #d6e4e6; }

/* энергетическая полоса заряда для активных */
.charge { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 2px; background: #ffffff10; overflow: hidden; }
.charge i { position: absolute; inset: 0; width: 40%; border-radius: 2px; background: linear-gradient(90deg, transparent, currentColor, transparent); animation: chargeRun 1.9s cubic-bezier(.45,0,.55,1) infinite; }
@keyframes chargeRun { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
.thread[data-state=thinking] .charge { color: var(--thinking); }
.thread[data-state=waiting] .charge { color: var(--waiting); }
.thread:not([data-state=thinking]):not([data-state=waiting]):not(.unseen) .charge { display: none; }

.group { margin-top: 9px; }
.group:first-child { margin-top: 0; }
.group-toggle { display: flex; align-items: center; gap: 6px; padding: 3px 5px 4px; width: 100%; border: 0; color: #e3ecec; background: transparent; text-align: left; }
.group-toggle .icon { color: #9a8a63; width: 12px; height: 12px; }
.group-name { font-size: 11.5px; font-weight: 800; line-height: 18px; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.group-toggle .count { margin-left: auto; color: #5f7176; font-size: 10px; font-weight: 700; }
.group-toggle[aria-expanded=false] .chevron { transform: rotate(-90deg); }
.group .thread { margin-left: 10px; }

.user { display: flex; align-items: center; gap: 8px; padding: 9px 12px; min-height: 46px; border-top: 1px solid #1d2629; font-size: 12px; font-weight: 600; }
.avatar { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: linear-gradient(150deg, var(--claude), #b83f7a); color: #fff; font-size: 11px; font-weight: 800; }
.user small { color: var(--waiting); margin-left: auto; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.user > span:last-child { display: flex; align-items: center; flex: 1; min-width: 0; }

.tradeoff { color: #8b999e; font-size: 12px; line-height: 1.7; margin: 16px 0 0; }
.tradeoff strong { color: #d6e6e8; font-weight: 700; }

/* ===== A · HUD ===== */
.variant-a .thread.selected { border-color: rgba(55,224,212,.5); background: linear-gradient(90deg, rgba(55,224,212,.12), transparent 70%); }
.variant-a .thread.selected:before, .variant-a .thread.selected:after {
  content: ''; position: absolute; width: 9px; height: 9px; border: 1.5px solid var(--thinking); z-index: 3;
}
.variant-a .thread.selected:before { left: 2px; top: 2px; border-right: 0; border-bottom: 0; }
.variant-a .thread.selected:after { right: 2px; bottom: 2px; border-left: 0; border-top: 0; }
.variant-a .thread[data-state=thinking] { border-color: rgba(55,224,212,.28); }
.variant-a .scan { position: absolute; left: 0; right: 0; top: 0; height: 100%; z-index: 1; pointer-events: none; background: linear-gradient(180deg, transparent, rgba(55,224,212,.13), transparent); transform: translateY(-100%); animation: scanRun 2.8s linear infinite; }
@keyframes scanRun { to { transform: translateY(100%); } }
.variant-a .thread:not([data-state=thinking]) .scan { display: none; }
.variant-a .status { font-size: 8px; }

/* ===== B · SHONEN ===== */
.variant-b .thread { border-radius: 4px; }
.variant-b .thread.selected { background: linear-gradient(100deg, rgba(255,122,69,.18), rgba(255,178,61,.06) 55%, transparent); border-color: rgba(255,122,69,.55); transform: translateX(2px); }
.variant-b .thread.selected .project-name { font-style: italic; }
.variant-b .thread.selected .project-name { font-style: italic; }
.variant-b .thread.selected:before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--claude), var(--waiting)); }
.variant-b .speed { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(103deg, transparent 0 9px, rgba(255,255,255,.055) 9px 10px);
  animation: speedRun 1.6s linear infinite; }
@keyframes speedRun { to { background-position: 40px 0; } }
.variant-b .thread:not([data-state=thinking]):not([data-state=waiting]) .speed { display: none; }
.variant-b .status { font-style: italic; letter-spacing: .12em; }
.variant-b .thread[data-state=error] { border-color: rgba(255,77,106,.45); }

/* ===== C · COMIC ===== */
.variant-c .sidebar { background: #0c0f12; }
.variant-c .thread { border-radius: 3px; border-color: #1f292d; background: #10151800; }
.variant-c .thread.selected { border-color: #e9f2f3; background: #171d21; box-shadow: 3px 3px 0 0 rgba(255,122,69,.85); }
.variant-c .status { gap: 0; }
.variant-c .status .label { padding: 2px 7px; border-radius: 2px; color: #0b0f10; background: currentColor; font-weight: 900; }
.variant-c .status.thinking .label { background: var(--thinking); }
.variant-c .status.waiting .label { background: var(--waiting); }
.variant-c .status.error .label { background: var(--error); }
.variant-c .status.completed .label { background: var(--completed); }
.variant-c .status .dots { margin-right: 3px; }
.variant-c .halftone { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .5;
  background-image: radial-gradient(currentColor 1px, transparent 1.2px); background-size: 6px 6px; color: rgba(255,255,255,.07); }
.variant-c .thread:not(.selected) .halftone { display: none; }
.variant-c .charge { height: 2px; }

.dots { display: flex; gap: 3px; align-items: center; }
.dots i { width: 3px; height: 3px; background: currentColor; border-radius: 50%; animation: pop 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes pop { 0%,100% { transform: scale(.65); opacity: .45; } 50% { transform: scale(1.25); opacity: 1; } }

/* перегрузка */
body[data-overdrive=on] .thread[data-state=thinking],
body[data-overdrive=on] .thread[data-state=waiting] { animation: rageFrame 1.25s ease-in-out infinite; }
body[data-overdrive=on] .thread[data-state=thinking] { --rage: 55,224,212; }
body[data-overdrive=on] .thread[data-state=waiting] { --rage: 255,178,61; }
@keyframes rageFrame {
  0%,100% { border-color: rgba(var(--rage),.3); box-shadow: 0 0 0 0 rgba(var(--rage),0); }
  50% { border-color: rgba(var(--rage),.95); box-shadow: 0 0 18px 0 rgba(var(--rage),.3), inset 0 0 12px -6px rgba(var(--rage),.5); }
}
body[data-overdrive=on] .avatar { animation: rageFrame 1.25s ease-in-out infinite; --rage: 255,122,69; }

body[data-motion=off] *, body[data-motion=off] *:before, body[data-motion=off] *:after { animation: none !important; }

footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-top: 1px solid #1d2428; padding-top: 18px; margin-top: 30px; color: #6f8085; font-size: 11px; line-height: 1.6; }

#tooltip { position: fixed; z-index: 20; max-width: 260px; border: 1px solid #2f3d41; border-radius: 4px; padding: 9px 12px; background: #131a1d; color: #dff0f1; font-size: 12px; line-height: 1.6; pointer-events: none; }
#tooltip small { display: block; color: #8fa2a6; font-size: 11px; }

@media(min-width:850px) and (max-width:1100px) { main { padding-inline:20px; } .options { gap:14px; } .org { display:none; } .description { min-height:76px; } }
@media(max-width:849px) { main { padding:24px 16px; } .options { grid-template-columns:1fr; gap:34px; } .option { width:100%; max-width:390px; margin:auto; } .description { min-height:0; } }
@media(prefers-reduced-motion:reduce) { *,*:before,*:after { animation:none!important; } }

.reset { border: 1px solid #2b373b; background: transparent; color: #9fadb1; border-radius: 4px; padding: 6px 12px; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.reset:hover { border-color: var(--completed); color: var(--completed); }

/* ===== COMPLETED, КОТОРЫЙ ТРЕБУЕТ ОТКРЫТЬ ===== */
.files { padding: 1px 5px; border-radius: 3px; background: currentColor; color: #07130c; font-weight: 900; font-size: 8.5px; letter-spacing: .06em; }
.thread.unseen .status.completed { color: var(--completed); }
.thread.unseen .status.completed .label { font-weight: 900; }
.thread.unseen .files { background: var(--completed); color: #06130b; }
.thread.unseen .project-name { color: #ffffff; }
.thread.unseen .title { color: #b7c6ca; }
.thread.unseen .charge { display: block; color: var(--completed); }
.thread.unseen .charge i { animation-duration: 3.4s; }

.variant-a .thread.unseen { border-color: rgba(110,231,135,.4); }
.variant-a .thread.unseen:before {
  content: ''; position: absolute; left: 2px; top: 2px; width: 9px; height: 9px;
  border: 1.5px solid var(--completed); border-right: 0; border-bottom: 0; z-index: 3;
  animation: unseenBlink 2.2s ease-in-out infinite;
}
.variant-a .thread.unseen:after {
  content: ''; position: absolute; right: 2px; bottom: 2px; width: 9px; height: 9px;
  border: 1.5px solid var(--completed); border-left: 0; border-top: 0; z-index: 3;
  animation: unseenBlink 2.2s ease-in-out infinite;
}
@keyframes unseenBlink { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

.variant-b .thread.unseen { border-color: rgba(110,231,135,.5); background: linear-gradient(100deg, rgba(110,231,135,.16), transparent 62%); }
.variant-b .thread.unseen:before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--completed), #2fbf6b); }
.variant-b .thread.unseen .sheen { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(110,231,135,.22) 50%, transparent 65%);
  background-size: 260% 100%; animation: sheenRun 3.6s ease-in-out infinite; }
@keyframes sheenRun { 0% { background-position: 140% 0; } 55%,100% { background-position: -40% 0; } }

.variant-c .thread.unseen { border-color: var(--completed); box-shadow: 3px 3px 0 0 rgba(110,231,135,.9); }
.variant-c .thread.unseen .status.completed .label { background: var(--completed); color: #06130b; animation: unseenBlink 2.4s ease-in-out infinite; }

body[data-overdrive=on] .thread.unseen { --rage: 110,231,135; animation: rageFrame 1.25s ease-in-out infinite; }
body[data-motion=off] .thread.unseen .sheen { animation: none; }
