/* Пятница в Студио — панель справа, как Copilot / Codex в VS Code */
:root { --fp-w: 400px; }
body.fp-open main { width: calc(100% - var(--sidebar) - var(--fp-w)); transition: width .25s ease; }
body.fp-open .toolbar { flex-wrap: wrap; row-gap: 14px; }
body.fp-open .toolbar .project-heading { flex: 1 1 240px; min-width: 0; }
body.fp-open .toolbar-description { display: none; }
body.fp-open .toolbar .actions { flex-wrap: wrap; justify-content: flex-end; }
body.fp-open #toast { left: calc(50% + var(--sidebar) / 2 - var(--fp-w) / 2); }

.fp-toggle { margin: 0 14px 0 auto; height: 36px; padding: 0 14px 0 11px !important; border-radius: 999px !important; font-size: 13px !important; gap: 8px !important; border-color: #3a3a3a !important; background: linear-gradient(135deg, #2b2b2b, #242424) !important; color: #ececec !important; }
.fp-toggle svg { width: 16px !important; height: 16px !important; transition: transform .4s; }
.fp-toggle:hover svg { transform: rotate(90deg) scale(1.08); }
.fp-toggle.on { background: #f2f2f2 !important; color: #141414 !important; border-color: #f2f2f2 !important; }

.fp { position: fixed; top: 0; right: 0; bottom: 0; z-index: 20; width: var(--fp-w); display: flex; flex-direction: column; background: #141414; border-left: 1px solid #262626; color: #e9e9e9; font: 14px/1.6 "Segoe UI Variable Text", "Segoe UI", Inter, Arial, sans-serif; animation: fp-in .28s cubic-bezier(.2, .8, .2, 1); box-shadow: -30px 0 60px -40px rgba(0, 0, 0, .9); }
@keyframes fp-in { from { transform: translateX(24px); opacity: 0; } }
.fp svg { width: 17px; height: 17px; flex: none; }
.fp button { font: inherit; box-shadow: none; }

.fp-head { display: flex; align-items: center; gap: 9px; height: 56px; padding: 0 10px 0 16px; border-bottom: 1px solid #222; flex: none; }
.fp-head > b { font-size: 14.5px; font-weight: 650; letter-spacing: -.01em; }
.fp-logo { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: #f2f2f2; color: #111; }
.fp-logo svg { width: 16px; height: 16px; }
.fp-badge { padding: 2px 8px; border: 1px solid #3a3a3a; border-radius: 999px; color: #bdbdbd; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; margin-right: auto; }
.fp-ib { width: 34px; height: 34px; padding: 0 !important; display: grid !important; place-items: center; border: 0 !important; border-radius: 9px !important; background: none !important; color: #9a9a9a !important; text-decoration: none; }
.fp-ib:hover { background: #222 !important; color: #fff !important; }

.fp-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2c2c2c transparent; }
.fp-thread { padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 18px; }

/* приветствие */
.fp-hello { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 36px 6px 12px; animation: fp-up .4s ease-out; }
@keyframes fp-up { from { transform: translateY(8px); opacity: 0; } }
.fp-orb { position: relative; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; background: radial-gradient(circle at 30% 25%, #ffffff, #cfcfcf 60%, #9c9c9c); color: #111; box-shadow: 0 18px 50px -12px rgba(255, 255, 255, .25); }
.fp-orb::after { content: ''; position: absolute; inset: -8px; border-radius: 26px; border: 1px solid rgba(255, 255, 255, .08); animation: fp-pulse 2.6s ease-in-out infinite; }
@keyframes fp-pulse { 50% { inset: -14px; opacity: 0; } }
.fp-orb svg { width: 30px; height: 30px; }
.fp-hello h3 { margin: 22px 0 6px; font-size: 20px; font-weight: 650; letter-spacing: -.02em; color: #fafafa; }
.fp-hello p { margin: 0 0 20px; color: #9b9b9b; font-size: 13.5px; max-width: 300px; }
.fp-ideas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.fp-ideas button { justify-content: flex-start !important; text-align: left; padding: 11px 12px !important; min-height: 46px; border: 1px solid #262626 !important; border-radius: 12px !important; background: #1a1a1a !important; color: #d6d6d6 !important; font-size: 12.5px !important; font-weight: 550; line-height: 1.35; }
.fp-ideas button:hover { border-color: #3a3a3a !important; background: #202020 !important; color: #fff !important; }
.fp-pay ul { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 9px; text-align: left; width: 100%; max-width: 300px; }
.fp-pay li { display: flex; gap: 10px; align-items: center; color: #cfcfcf; font-size: 13px; }
.fp-pay li svg { color: #7ddc9a; width: 16px; height: 16px; }
.fp-cta { width: 100%; max-width: 300px; height: 44px; border: 0 !important; border-radius: 12px !important; background: #f2f2f2 !important; color: #111 !important; font-weight: 650 !important; font-size: 14px !important; }
.fp-cta:hover { background: #fff !important; }
.fp-pay small { margin-top: 10px; color: #6f6f6f; font-size: 11.5px; }
.fp-note { color: #f0b45b; font-size: 13px; }

/* сообщения */
.fp-msg { animation: fp-up .25s ease-out; }
.fp-msg.user { align-self: flex-end; max-width: 88%; }
.fp-bubble { padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: #262626; color: #f2f2f2; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }
.fp-body { min-width: 0; }
.fp-md { color: #dcdcdc; font-size: 13.5px; overflow-wrap: anywhere; }
.fp-md p { margin: 0 0 8px; } .fp-md p:last-child { margin-bottom: 0; }
.fp-md h4 { margin: 12px 0 6px; font-size: 14px; color: #fff; }
.fp-md ul, .fp-md ol { margin: 4px 0 8px; padding-left: 20px; } .fp-md li { margin: 2px 0; }
.fp-md code { padding: 1px 5px; border-radius: 5px; background: #222; font: 12.5px Consolas, monospace; }
.fp-md pre { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: #0e0e0e; border: 1px solid #222; overflow-x: auto; }
.fp-md pre code { padding: 0; background: none; }
.fp-md.caret > :last-child::after, .fp-md.caret:empty::after { content: ''; display: inline-block; width: 7px; height: 14px; margin-left: 2px; vertical-align: -2px; border-radius: 2px; background: #e8e8e8; animation: fp-blink 1s steps(1) infinite; }
@keyframes fp-blink { 50% { opacity: 0; } }
.fp-mut { color: #777; font-size: 12.5px; }
.fp-err { margin-top: 8px; padding: 9px 12px; border: 1px solid #4a2b28; border-radius: 10px; background: #1d1716; color: #ff9a90; font-size: 12.5px; }

/* размышления */
.fp-reason { margin-bottom: 10px; }
.fp-reason summary { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px 0 8px; border: 1px solid #262626; border-radius: 999px; background: #1a1a1a; color: #bdbdbd; font-size: 12.5px; font-weight: 600; list-style: none; cursor: pointer; user-select: none; }
.fp-reason summary::-webkit-details-marker { display: none; }
.fp-reason summary:hover { border-color: #333; color: #eee; }
.fp-reason summary svg { width: 14px; height: 14px; color: #777; transition: transform .2s; }
.fp-reason[open] summary svg { transform: rotate(180deg); }
.fp-reason.empty summary { border-color: transparent; background: none; padding-left: 0; cursor: default; color: #808080; }
.fp-reason.empty summary svg { display: none; }
.fp-rs { color: #7d7d7d; font-weight: 500; font-variant-numeric: tabular-nums; }
.fp-dots { display: inline-flex; gap: 3px; } .fp-dots i { width: 3px; height: 3px; border-radius: 50%; background: #7d7d7d; }
.fp-reason.live .fp-dots i { background: #eee; animation: fp-dot 1.2s ease-in-out infinite; }
.fp-reason.live .fp-dots i:nth-child(2) { animation-delay: .15s; } .fp-reason.live .fp-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes fp-dot { 40% { transform: translateY(-3px); opacity: 1; } 0%, 100% { opacity: .4; } }
.fp-reason.live .fp-rt { background: linear-gradient(90deg, #808080, #f5f5f5, #808080); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: fp-sh 1.8s linear infinite; }
@keyframes fp-sh { to { background-position: -200% 0; } }
.fp-rbody { margin: 8px 0 0 5px; padding: 0 0 0 13px; border-left: 2px solid #2c2c2c; color: #8d8d8d; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow-y: auto; scrollbar-width: thin; }
.fp-reason.live .fp-rbody { max-height: 150px; -webkit-mask-image: linear-gradient(transparent, #000 30px); mask-image: linear-gradient(transparent, #000 30px); }
.fp-rbody:empty { display: none; }

/* лента действий */
.fp-act { margin-top: 12px; padding: 13px 14px; border: 1px solid #2a2a2a; border-radius: 14px; background: linear-gradient(160deg, #1d1d1d, #171717); animation: fp-up .3s ease-out; }
.fp-act-head { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.fp-act-head b { font-weight: 650; color: #f4f4f4; }
.fp-act-head span:last-child:not(.fp-spin) { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: #262626; color: #aaa; font-size: 11.5px; }
.fp-act-head.ok svg { color: #7ddc9a; }
.fp-act-head.bad b { color: #ff9a90; }
.fp-act p { margin: 6px 0 0; color: #a4a4a4; font-size: 12.5px; }
.fp-spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid #333; border-top-color: #f2f2f2; animation: fp-rot .8s linear infinite; }
@keyframes fp-rot { to { transform: rotate(360deg); } }
.fp-act ol, .fp-act ul { list-style: none; margin: 11px 0 0; padding: 0; display: grid; gap: 7px; }
.fp-act ol li { display: flex; align-items: center; gap: 9px; color: #8a8a8a; font-size: 12.5px; animation: fp-up .25s ease-out; }
.fp-act ol li svg { width: 14px; height: 14px; color: #7ddc9a; }
.fp-act ol li i { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid #333; border-top-color: #e8e8e8; animation: fp-rot .8s linear infinite; }
.fp-act ol li.now { color: #ececec; }
.fp-act ul li { display: flex; gap: 9px; align-items: baseline; font-size: 12.5px; color: #cdcdcd; animation: fp-up .25s ease-out both; }
.fp-act ul li:nth-child(2) { animation-delay: .05s; } .fp-act ul li:nth-child(3) { animation-delay: .1s; } .fp-act ul li:nth-child(4) { animation-delay: .15s; } .fp-act ul li:nth-child(n+5) { animation-delay: .2s; }
.fp-act ul li em { width: 18px; height: 18px; flex: none; display: grid; place-items: center; border-radius: 5px; font: 700 12px/1 Consolas, monospace; font-style: normal; background: #262626; color: #bbb; transform: translateY(3px); }
.fp-act ul li.add em { background: rgba(125, 220, 154, .14); color: #7ddc9a; }
.fp-act ul li.del em { background: rgba(255, 122, 112, .14); color: #ff8a80; }
.fp-act ul li.edit em { background: rgba(240, 180, 91, .14); color: #f0b45b; }
.fp-act-row { display: flex; align-items: center; gap: 10px; margin-top: 13px; }
.fp-undo, .fp-apply { height: 32px; padding: 0 12px !important; gap: 6px !important; border: 1px solid #333 !important; border-radius: 9px !important; background: #222 !important; color: #e8e8e8 !important; font-size: 12.5px !important; font-weight: 600 !important; }
.fp-undo:hover, .fp-apply:hover { background: #2a2a2a !important; border-color: #444 !important; }
.fp-apply { background: #f2f2f2 !important; color: #111 !important; border-color: #f2f2f2 !important; }
.fp-undo svg { width: 14px; height: 14px; }
.fp-saved { color: #6f6f6f; font-size: 11.5px; }
.fp-act.undone ul { opacity: .45; text-decoration: line-through; }

/* поле ввода */
.fp-box { flex: none; margin: 8px 12px 12px; padding: 10px 10px 8px 12px; border: 1px solid #2c2c2c; border-radius: 16px; background: #1b1b1b; transition: border-color .15s, box-shadow .15s; }
.fp-box:focus-within { border-color: #444; box-shadow: 0 0 0 4px rgba(255, 255, 255, .03); }
.fp-ctx { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 24px; padding: 0 9px; margin-bottom: 6px; border: 1px solid #2c2c2c; border-radius: 7px; background: #151515; color: #a8a8a8; font-size: 11.5px; font-weight: 600; }
.fp-ctx svg { width: 13px; height: 13px; }
.fp-ctx span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fp-box textarea { display: block; width: 100%; min-height: 24px; max-height: 220px; padding: 2px 0; border: 0; outline: 0; resize: none; background: none; color: #f2f2f2; font: 14px/1.55 inherit; font-family: inherit; }
.fp-box textarea::placeholder { color: #666; }
.fp-box textarea:disabled { cursor: not-allowed; }
.fp-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.fp-hint { flex: 1; min-width: 0; color: #5f5f5f; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fp-send { width: 32px; height: 32px; padding: 0 !important; display: grid !important; place-items: center; border: 0 !important; border-radius: 10px !important; background: #f2f2f2 !important; color: #111 !important; transition: transform .15s, opacity .15s; }
.fp-send:hover:not(:disabled) { transform: scale(1.06); }
.fp-send:disabled { opacity: .25; cursor: default; }
.fp-send svg { width: 16px; height: 16px; }

@media (max-width: 1100px) {
  body.fp-open main { width: calc(100% - var(--sidebar)); }
  .fp { width: min(420px, 100vw); box-shadow: -30px 0 80px rgba(0, 0, 0, .7); }
}
@media (max-width: 570px) { .fp { width: 100vw; } .fp-toggle span { display: none; } }
@media (prefers-reduced-motion: reduce) { .fp, .fp * { animation: none !important; transition: none !important; } }
