/* Добавки ИИ-анализа поверх app.css (общего с claudeweb/ollamaweb) */
:root { --accent: #5fa8d3; --accent2: #4a8fb8; }
[hidden] { display: none !important; }
.small { font-size: 12px; }
.tabs { display: flex; gap: 4px; background: var(--bg2); border-radius: 10px; padding: 3px; }
.tabs button { flex: 1; border: 0; background: none; color: var(--muted); padding: 7px 4px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.tabs button.on { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.note-line { margin: 0; font-size: 13px; color: var(--yellow); line-height: 1.4; }
.login-card .link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 6px 0; font-size: 13px; }

.page { max-width: 1000px; margin: 0 auto; padding: 18px 16px 40px; }
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.top .brand { text-decoration: none; color: var(--text); font-weight: 700; font-size: 18px; }
.top .sp { flex: 1; }
.chip { display: inline-block; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 13px; cursor: pointer; text-decoration: none; }
.chip:hover { border-color: var(--accent); }
.chip.danger { color: var(--red); }
.chip.ok { color: var(--green); }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.box h3 { margin: 0 0 10px; font-size: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.row input, .row select { padding: 7px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); }
.msg { min-height: 1.2em; font-size: 13px; }
.msg.bad { color: var(--red); }
.msg.good { color: var(--green); }
.mlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.mlist div { background: var(--bg2); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.mlist b { display: block; font-size: 14px; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { color: var(--muted); font-weight: 500; font-size: 12px; }
table.t tr.pending td { background: rgba(224, 178, 92, .08); }
.st { font-size: 12px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--line); white-space: nowrap; }
.st.pending { color: var(--yellow); border-color: var(--yellow); }
.st.allowed { color: var(--green); border-color: var(--green); }
.st.blocked { color: var(--red); border-color: var(--red); }
.acts { display: flex; gap: 6px; flex-wrap: wrap; }
.set { display: grid; grid-template-columns: 240px 1fr; gap: 8px 14px; align-items: center; }
.set input { padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); }
.scroll { overflow-x: auto; }
.code-big { font: 26px var(--mono); letter-spacing: 4px; }
@media (max-width: 760px) { .set { grid-template-columns: 1fr; } .hide-m { display: none; } }

/* этап 3: файлы */
.page.wide { max-width: 1300px; }
.work { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: start; }
.side { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.side-h { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.fold { padding: 6px 8px; border-radius: 7px; cursor: pointer; display: flex; justify-content: space-between; gap: 6px; font-size: 14px; }
.fold:hover { background: var(--bg2); }
.fold.on { background: var(--bg2); color: var(--accent); }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.drop.over { border-color: var(--accent); background: rgba(95, 168, 211, .07); }
table.files a { color: var(--text); text-decoration: none; }
table.files a:hover { color: var(--accent); }
table.files tr.error td { background: rgba(231, 125, 125, .06); }
.nowrap { white-space: nowrap; }
.bad { color: var(--red); }
.warn { color: var(--yellow); }
.tog { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 6px 0 0; font-size: 12px; }
.viewer { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.viewer-in { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; width: min(1100px, 100%); max-height: 100%; overflow: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.viewer-h { position: sticky; top: -14px; background: var(--bg); padding-top: 4px; z-index: 1; }
.vtext { white-space: pre-wrap; word-break: break-word; font: 13px/1.5 var(--mono); background: var(--bg2); border-radius: 8px; padding: 12px; margin: 0; }
.vimg { max-width: 100%; max-height: 60vh; object-fit: contain; border-radius: 8px; background: #fff; align-self: center; }
.vtab { margin-bottom: 8px; }
.vtab table.t td, .vtab table.t th { font-size: 12px; padding: 4px 6px; }
@media (max-width: 760px) { .work { grid-template-columns: 1fr; } .viewer { padding: 0; } .viewer-in { border-radius: 0; height: 100%; } }

/* этап 4: анализ */
.askbox { position: sticky; bottom: 8px; margin-top: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.askbox textarea, #anAsk { width: 100%; box-sizing: border-box; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; resize: vertical; margin: 6px 0; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.presets .chip.on { border-color: var(--accent); color: var(--accent); }
select { padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); max-width: 100%; }
.primary-btn { padding: 8px 16px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.primary-btn:disabled { opacity: .5; cursor: default; }
.hist { padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; line-height: 1.3; }
.hist:hover, .hist.on { background: var(--bg2); }
.hist .muted { font-size: 11px; }
.antitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.amsg { margin: 10px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); }
.amsg.user { background: var(--bg2); white-space: pre-wrap; }
.amsg.assistant { background: var(--panel); }
.amsg .meta { font-size: 11px; color: var(--muted); margin-top: 8px; }
.md h1, .md h2, .md h3 { margin: .6em 0 .3em; font-size: 1.1em; }
.md table { border-collapse: collapse; margin: 8px 0; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 4px 8px; font-size: 13px; }
.md pre { background: var(--bg2); padding: 10px; border-radius: 8px; overflow-x: auto; }
.md code { font-family: var(--mono); font-size: 12.5px; }
.md p { margin: .4em 0; }
.anstatus { min-height: 24px; }
td.sel { width: 22px; }
.prrow { border-bottom: 1px solid var(--line); padding: 8px 0; } .prrow textarea { padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; }

/* этап 6: поиск */
.searchrow { margin: 4px 0 8px; }
.searchrow input { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); }
#qRes { margin-bottom: 10px; }
.hit { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; cursor: pointer; }
.hit:hover { border-color: var(--accent); }
.hit .small { white-space: pre-wrap; margin-top: 4px; line-height: 1.45; }
mark { background: rgba(224, 178, 92, .35); color: inherit; border-radius: 2px; }
.srcs { font-size: 12px; margin-top: 8px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.srcs .src { color: var(--accent); text-decoration: none; }

/* этап 8: выгрузка, пакет, отличия */
.exp { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.exp .chip { text-decoration: none; }
#bTask { margin: 8px 0; }
#bItems td { vertical-align: top; }
#bItems a { color: var(--accent); text-decoration: none; }
#vDiff { font: 13px/1.5 var(--mono); }
.dch { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; background: var(--bg2); white-space: pre-wrap; word-break: break-word; }
.dch > .muted { display: block; margin-bottom: 2px; font-family: var(--font, inherit); }
.dadd { background: rgba(110, 190, 120, .22); border-radius: 3px; }
.ddel { background: rgba(231, 125, 125, .22); border-radius: 3px; text-decoration: line-through; }
div.dadd, div.ddel { padding: 2px 4px; margin: 2px 0; }
