/* AI assistant screen (js/assistant.js). Tokens come from app.css. */
.as { display: flex; flex-direction: column; min-height: 0; }
.as .as-health { margin-left: auto; font-size: 12px; }
.as .as-health code { font-size: 11px; background: #f1f2f4; padding: 1px 5px; }
.as .kbadge { margin-left: 8px; }
.as-scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 2px 16px 0; display: flex; flex-direction: column; gap: 10px; }

/* input panel */
.as-in { background: #fff; border: 1px solid var(--border); padding: 12px 14px; display: grid; gap: 8px; }
.as-in.drag { border-color: var(--primary); background: var(--primary-bg); }
.as-lbl { font-weight: 700; font-size: 14px; }
.as-text { width: 100%; min-height: 120px; max-height: 38vh; resize: vertical; border: 1px solid var(--border); padding: 10px 12px; font: 14px/1.45 'Manrope', system-ui, sans-serif; outline: none; background: #fff; }
.as-text:focus { border-color: var(--primary); }
.as-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.as-act .as-hints { font-size: 12px; margin-left: auto; }
.as-go { min-width: 150px; }
.as-chip { display: inline-flex; gap: 6px; align-items: center; background: var(--primary-bg); border: 1px solid #f0c9a8; padding: 4px 8px; font-size: 12.5px; }
.as-chip button { border: 0; background: none; color: var(--muted); padding: 0 2px; font-size: 13px; }
.as-chip button:hover { color: var(--bad); }

/* progress */
.as-prog { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--border); padding: 14px 16px; }
.as-prog .btn { margin-left: auto; }
.as-spin { width: 22px; height: 22px; border: 3px solid #f3d3b7; border-top-color: var(--primary); border-radius: 50%; animation: as-rot .9s linear infinite; flex: none; }
@keyframes as-rot { to { transform: rotate(360deg); } }

/* result */
.as-res { display: flex; flex-direction: column; gap: 10px; }
.as-box { background: #fff; border: 1px solid var(--border); border-left: 4px solid #8d939b; padding: 10px 14px; font-size: 13.5px; line-height: 1.5; }
.as-box.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.as-box.bad { border-left-color: var(--bad); background: var(--bad-bg); }
.as-box.ok { border-left-color: var(--ok); background: var(--ok-bg); }
.as-box ol { margin: 6px 0 0; padding-left: 20px; }
.as-box li { margin: 2px 0; }
.as-box a { color: var(--primary); font-weight: 700; }

.as-tw { background: #fff; border: 1px solid #c9c5b3; overflow-x: auto; }
.as-t { width: 100%; border-collapse: collapse; font: 12.5px Tahoma, 'Segoe UI', sans-serif; }
.as-t th { position: sticky; top: 0; z-index: 1; background: #e9e6d6; text-align: left; padding: 4px 8px; border: 1px solid #c9c5b3; white-space: nowrap; font-weight: 600; }
.as-t th.r { text-align: right; }
.as-t th.c, .as-t td.c { width: 28px; text-align: center; }
.as-t td { padding: 3px 6px; border: 1px solid #e3e1d3; vertical-align: top; }
.as-t td.n { width: 30px; color: var(--muted); text-align: right; white-space: nowrap; }
.as-t td.r { text-align: right; white-space: nowrap; }
.as-t tr.rerr td { background: #fdf6f4; }
.as-t tr.rwrn td { background: #fffdf2; }
.as-t tr.done td { background: #eef8f1; color: #5b6b60; }
.as-t tr.done input, .as-t tr.done select { pointer-events: none; opacity: .7; }
.as-t tr.stones td { background: #f5f3ff; }
.as-t .tg { font-size: 10px; font-weight: 700; border: 1px solid #b9bcc2; padding: 0 4px; margin-left: 4px; background: #fff; }
.as-t .tg.te { color: #1d5fb5; border-color: #1d5fb5; }
.as-t input[type=checkbox] { width: 16px; height: 16px; margin-top: 4px; accent-color: var(--primary); }
.as-in-c { width: 100%; height: 26px; border: 1px solid transparent; background: transparent; padding: 0 5px; font: 12.5px Tahoma, 'Segoe UI', sans-serif; outline: none; }
.as-in-c:hover { border-color: #c9c5b3; background: #fff; }
.as-in-c:focus { border-color: #1d5fb5; background: #fff; box-shadow: 0 0 0 1px #1d5fb5; }
.as-in-c.bad { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.as-in-c.s { width: 62px; text-align: right; display: inline-block; }
.as-t td.dt { min-width: 108px; width: 108px; } .as-t td.itm { min-width: 150px; } .as-t td.pur { min-width: 168px; }
.as-t td.amt { min-width: 118px; font-variant-numeric: tabular-nums; }
.as-t td.amt .sg { display: inline-block; width: 12px; font-weight: 700; }
.as-t td.amt input[data-f=amount] { width: calc(100% - 16px); text-align: right; font-variant-numeric: tabular-nums; }
.as-t .nm { color: var(--muted); font-size: 11px; line-height: 1.25; padding: 0 5px; min-height: 0; }
.as-t .neg, .as-foot .neg { color: #b4281a; } .as-t .pos, .as-foot .pos { color: #1a7a43; }
.as-t td.chk { min-width: 250px; font-size: 12px; line-height: 1.35; }
.as-t td.chk .cf { display: inline-block; font-weight: 700; font-size: 10.5px; padding: 0 6px; border: 1px solid; margin-right: 6px; background: #fff; }
.as-t td.chk .cf.ok { color: #1a7a43; border-color: #1a7a43; } .as-t td.chk .cf.warn { color: #9a6a10; border-color: #c9a227; } .as-t td.chk .cf.bad { color: #b4281a; border-color: #b4281a; }
.as-t td.chk .rs { color: #555; }
.as-t td.chk .e { color: #b4281a; font-weight: 700; margin-top: 2px; }
.as-t td.chk .w { color: #8a5a00; margin-top: 2px; }
.as-t td.chk .sl { color: #8d939b; font-size: 11px; margin-top: 2px; word-break: break-word; }
.as-t td.chk .tag.ok { color: #1a7a43; border: 1px solid #1a7a43; background: #eaf7ee; padding: 0 5px; font-size: 11px; font-weight: 700; }

.as-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border); padding: 8px 12px; box-shadow: 0 -4px 10px rgba(0,0,0,.05); z-index: 3; }
.as-foot .as-sum { margin-right: auto; font-size: 13px; }
.as-foot.hasfix { background: var(--bad-bg); }
.as-skip { background: #fff; border: 1px solid var(--border); padding: 6px 12px; font-size: 13px; }
.as-skip summary { cursor: pointer; font-weight: 700; }
.as-skip td.src { color: #555; width: 55%; }
.as-cost { font-size: 11.5px; padding: 0 2px; }

.as-sugg { position: fixed; z-index: 1000; background: #fff; border: 1px solid #7f9db9; box-shadow: 0 6px 18px rgba(0,0,0,.18); min-width: 300px; max-width: 420px; }
.as-sugg button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 4px 8px; font: 12.5px Tahoma, 'Segoe UI', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-sugg button.on, .as-sugg button:hover { background: #316ac5; color: #fff; }

.as-t td select[data-f=ledger] { min-width: 112px; }
.as-t td.cm { min-width: 150px; }
