/* Interactas IETP browser shell: the desktop layout in HTML. Palette as the JavaFX theme. */
:root {
  --ink: #222; --ink-2: #5f6368; --ink-3: #9e9e9e; --line: #e0e0e0; --line-2: #eeeeee;
  --paper: #fff; --paper-2: #fafafa; --hover: rgba(0,0,0,.06); --brand: #f9a01b; --brand-soft: #fff1d6;
  --header-h: 64px; --footer-h: 34px; --left-w: 380px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 13px/1.4 Roboto, "Helvetica Neue", Arial, system-ui, sans-serif; color: var(--ink); background: var(--paper); }
button { font: inherit; color: inherit; background: none; border: 1px solid var(--line); border-radius: 4px; padding: 5px 12px; cursor: pointer; }
button:hover { background: var(--hover); }
button.primary { background: var(--brand); border-color: var(--brand); color: #222; font-weight: 600; }
button.icon { border: none; border-radius: 22px; width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); }
button.icon.small { width: 30px; height: 30px; border-radius: 15px; }
button.icon:hover { background: var(--hover); }
button.icon:disabled { opacity: .3; background: none; cursor: default; }
button:disabled, button.primary:disabled { opacity: .45; cursor: default; }
button.icon.active { color: var(--brand); }
input[type=text], input[type=password], select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
a { color: var(--ink-2); }
a:hover { color: var(--ink); }
.hidden { display: none !important; }

/* frame */
.app { display: grid; grid-template-rows: var(--header-h) 1fr var(--footer-h); height: 100vh; }
.header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; padding: 0 12px; border-bottom: 1px solid #e9e9e9; background: var(--paper); }
.header .center { text-align: center; font-size: 13px; line-height: 1.3; }
.header .center .code { font-weight: 500; }
.header .right { display: flex; align-items: center; gap: 6px; }
.user { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 20px; cursor: pointer; color: var(--ink-2); }
.user:hover { background: var(--hover); }
.main { display: flex; min-height: 0; }
.left { width: var(--left-w); min-width: 240px; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: var(--paper); }
.center-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.doc-title { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line-2); }
.doc-title .titles { text-align: center; line-height: 1.3; }
.doc-title .actions { display: flex; gap: 4px; }
.doc-frame { flex: 1; border: none; width: 100%; background: #fff; }
.footer { display: flex; align-items: center; justify-content: space-between; padding: 0 10px; background: var(--paper-2); border-top: 1px solid #e9e9e9; font-size: 12px; color: var(--ink-2); }
.footer .powered { display: inline-flex; align-items: center; gap: 6px; }
.footer img { height: 24px; }

/* tabs */
.tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--paper-2); overflow-x: auto; }
.tab { padding: 10px 16px; cursor: pointer; color: var(--ink-2); border-bottom: 3px solid transparent; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tab:hover { background: var(--hover); }
.tab.selected { color: var(--ink); border-bottom-color: var(--brand); font-weight: 500; }
.tab .close { opacity: .5; font-size: 12px; }
.tab .close:hover { opacity: 1; }
.tab-body { flex: 1; overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 12px; align-items: center; }
.field label { display: block; color: var(--ink-2); font-size: 12px; margin-bottom: 4px; }
.field select, .field input[type=text] { width: 100%; }
.section-label { color: var(--ink-2); font-size: 12px; }

/* tree */
.tree { border: 1px solid var(--line); flex: 1; overflow: auto; padding: 4px 0; }
.tree-row { display: flex; align-items: center; gap: 6px; padding: 4px 8px; cursor: pointer; white-space: nowrap; }
.tree-row:hover { background: var(--hover); }
.tree-row.selected { background: var(--brand-soft); }
.tree-row .twisty { width: 16px; color: var(--ink-2); display: inline-flex; }
.tree-row svg { color: var(--ink-2); flex: none; }

/* tables */
table.grid { width: 100%; border-collapse: collapse; border: 1px solid var(--line); font-size: 13px; }
table.grid th { background: var(--paper-2); color: var(--ink-2); font-weight: 600; font-size: 12px; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-2); }
table.grid td { padding: 7px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
table.grid tr.clickable { cursor: pointer; }
table.grid tr.clickable:hover td { background: #f7f7f7; }
table.grid tr.selected td { background: var(--brand-soft); }
.muted { color: var(--ink-3); }

/* menus and overlays */
.menu { position: absolute; top: 56px; right: 12px; background: var(--paper); border: 1px solid #e6e6e6; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.18); padding: 6px; min-width: 240px; z-index: 20; }
.menu .item { padding: 7px 14px 7px 12px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.menu .item:hover { background: #f2f2f2; }
.menu .item.disabled { color: var(--ink-3); cursor: default; }
.menu .item.disabled:hover { background: none; }
.menu .sep { border-top: 1px solid var(--line-2); margin: 4px 0; }
.menu .radio { width: 10px; height: 10px; border-radius: 5px; border: 1px solid var(--ink-3); display: inline-block; }
.menu .radio.on { background: var(--brand); border-color: var(--brand); }
.menu .head { padding: 6px 12px; color: var(--ink-3); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.overlay { position: absolute; inset: 0; background: rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; z-index: 30; }
.dialog { background: var(--paper); border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.25); min-width: 420px; max-width: 640px; overflow: hidden; }
.dialog .banner { height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; border-bottom: 1px solid #e9e9e9; font-weight: 600; }
.dialog .body { padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.dialog .buttons { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 20px; }
.about-product { font-size: 22px; font-weight: 600; }
.about-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; }
.about-grid .k { font-weight: 600; color: #444; }
.comment-box { position: absolute; top: 56px; right: 20px; width: 300px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.18); padding: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 15; }
.comment-box textarea { min-height: 100px; resize: vertical; }
.error { color: orangered; }

/* login */
.login { height: 100vh; display: flex; flex-direction: column; align-items: center; }
.login .banner { padding: 24px; }
.login .banner img { height: 64px; }
.login .card { width: 420px; display: flex; flex-direction: column; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: 8px; margin-top: 24px; }
.login .card h1 { margin: 0; font-size: 18px; text-align: center; }
.login .grid { display: grid; grid-template-columns: auto 1fr; gap: 12px 10px; align-items: center; }

/* ---- increment 2: splitters, right pane, responsive search, dialogs, filter editor ---- */
.splitter { width: 6px; cursor: col-resize; background: transparent; flex: none; border-left: 1px solid var(--line); }
.splitter:hover, .splitter.active { background: var(--brand-soft); }
.drag-shield { position: absolute; inset: 0; z-index: 50; cursor: col-resize; }
.right-pane { width: 360px; min-width: 240px; flex: none; border-left: 1px solid var(--line); display: flex; flex-direction: column; background: var(--paper); }
.left { flex: none; }
.contexts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }
.contexts label { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .spacer { flex: 1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.kv .k { font-weight: 600; color: #444; white-space: nowrap; }
.card { border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: var(--paper-2); }
.card .title { font-weight: 600; margin-bottom: 4px; }
.card.warn { border-color: #ef6c00; }
.dialog.wide { min-width: 720px; max-width: 96vw; max-height: 92vh; display: flex; flex-direction: column; }
.dialog.wide .body { overflow: auto; }
.form-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; }
.form-grid input[type=text], .form-grid input[type=password], .form-grid select { width: 100%; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--brand-soft); font-size: 11px; }
.status-ok { color: #2e7d32; } .status-bad { color: #c62828; }
.filter-editor { display: flex; flex-direction: column; gap: 10px; }
.assert-row { display: grid; grid-template-columns: 110px 1fr 1fr auto; gap: 6px; align-items: center; }
.rule { border: 1px solid var(--line); border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.rule .head { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.pill-radio { display: inline-flex; gap: 12px; }
@media print { .header, .left, .footer, .right, .doc-title, .splitter { display: none !important; } .doc-frame { height: 100vh; } }

/* ---- the search panel rethought (T-066) ---- */
.search-panel { gap: 8px; }
.search-field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px 6px 10px; background: var(--paper); color: var(--ink-2); }
.search-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-field input[type=text] { flex: 1; min-width: 0; border: 0; padding: 4px 0; font-size: 15px; background: transparent; }
.search-field input[type=text]:focus { outline: none; }
.search-field button.clear { border: 0; padding: 2px; border-radius: 12px; color: var(--ink-3); display: inline-flex; }
.search-field button.clear:hover { color: var(--ink); background: var(--hover); }
.search-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; }
.search-scope label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.search-scope label.look-in select { padding: 3px 6px; }
.search-scope .advanced-link { margin-left: auto; font-size: 12px; color: var(--ink-2); text-decoration: none; border-bottom: 1px dotted var(--ink-3); }
.search-advanced { border: 1px dashed var(--line); border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.search-advanced .head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-weight: 600; }
.search-advanced .head label { font-weight: 400; display: inline-flex; align-items: center; gap: 4px; }
.search-advanced .head label:first-of-type { margin-left: auto; }
.search-advanced .hint { color: var(--ink-3); }
.search-advanced .contexts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 3px 10px; color: var(--ink-2); }
.search-advanced .contexts label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.search-status { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 2px; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); font-size: 12px; font-weight: 600; }
.search-status .muted { font-weight: 400; text-align: right; }
.search-empty { padding: 12px 2px 16px; color: var(--ink-2); }
.search-results { list-style: none; margin: 0; padding: 0; overflow: auto; }
.search-results li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 9px 8px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.search-results li:hover { background: var(--paper-2); }
.search-results .t { font-weight: 600; line-height: 1.3; }
.search-results .c { grid-column: 1; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.search-results .s { grid-column: 1 / -1; margin-top: 3px; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.search-results .s .where { color: var(--ink-3); font-size: 11.5px; margin-right: 6px; }
.search-results .s.q { border-left: 3px solid #2e7d4f; padding-left: 8px; }
.search-results .mark { background: #ffe9a8; border-radius: 2px; padding: 0 1px; }
.search-results .badge { grid-column: 2; grid-row: 1; align-self: start; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; border-radius: 3px; padding: 2px 6px; white-space: nowrap; background: none; }
.search-results .badge.src-answer { color: #2e7d4f; background: #e6f3eb; }
.search-results .badge.src-words { color: #3a5fa8; background: #e8eef9; }

/* ---- conversations (T-068): the panel, the composer, the list ---- */
.cv-tab { padding: 0; gap: 0; }
.cv-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cv-empty { padding: 20px; text-align: center; }
.cv-thread { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cv-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; position: relative; }
.cv-title { display: flex; align-items: flex-start; gap: 4px; }
.cv-title b { font-weight: 500; font-size: 14px; flex: 1; line-height: 1.3; }
.cv-title button.icon.small { width: 28px; height: 28px; flex: none; }
.cv-anchor { font-size: 12px; color: var(--ink-2); border-left: 3px solid var(--brand); padding: 3px 8px; background: var(--paper-2); border-radius: 0 4px 4px 0; display: flex; flex-direction: column; gap: 2px; }
.cv-anchor .where { color: var(--ink-3); font-size: 11px; }
.cv-anchor.clickable:hover { background: var(--brand-soft); }
.cv-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11px; }
.cv-own { display: inline-flex; align-items: center; gap: 5px; }
.cv-av { border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 500; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; font-size: 11px; }
.chip.lbl { border: none; color: #fff; font-weight: 500; }
.chip.pick { cursor: pointer; }
.chip.pick.sel, .chip.pick:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--ink); }
.chip .sw, .sw { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chip .x { cursor: pointer; opacity: .6; }
.state { padding: 2px 8px; border-radius: 10px; font-weight: 500; font-size: 11px; }
.state.open { background: #e3f4e8; color: #1e7a3e; }
.state.closed { background: #f1f3f4; color: var(--ink-2); }
.state.small { font-size: 10px; }
.cv-menu { top: 40px; right: 10px; min-width: 220px; }
.cv-feedback:empty { display: none; }
.cv-feedback { padding: 6px 12px 0; }
.cv-chat { flex: 1; overflow: auto; padding: 10px 10px 4px; display: flex; flex-direction: column; gap: 6px; background: var(--paper-2); }
.cv-day { align-self: center; font-size: 11px; color: var(--ink-3); padding: 2px 8px; background: var(--paper); border-radius: 8px; margin: 6px 0; }
.cv-msg { max-width: 86%; padding: 7px 10px 4px; border-radius: 10px; background: #f1f3f4; position: relative; font-size: 13px; display: flex; flex-direction: column; }
.cv-msg .who { font-size: 11px; font-weight: 500; color: var(--ink-2); margin-bottom: 2px; }
.cv-msg .body { white-space: pre-wrap; word-break: break-word; }
.cv-msg .tm { text-align: right; font-size: 10px; color: var(--ink-3); margin-top: 2px; }
.cv-msg.me { align-self: flex-end; background: var(--brand-soft); border-bottom-right-radius: 3px; }
.cv-msg.th { align-self: flex-start; border-bottom-left-radius: 3px; }
.cv-del { position: absolute; top: 2px; right: 4px; border: none; background: none; color: var(--ink-3); font-size: 12px; padding: 0 3px; display: none; cursor: pointer; }
.cv-msg:hover .cv-del { display: inline; }
.cv-reply { border-top: 1px solid var(--line-2); padding: 8px 10px; display: flex; gap: 6px; align-items: flex-end; background: var(--paper); }
.cv-reply textarea { flex: 1; resize: none; border-radius: 18px; padding: 8px 12px; min-height: 36px; max-height: 120px; }
.cv-reply.off { color: var(--ink-3); font-size: 12px; justify-content: center; padding: 12px; font-style: italic; }
.cv-send { width: 36px; height: 36px; border-radius: 18px; background: var(--brand); border: none; color: #222; font-weight: 700; cursor: pointer; flex: none; padding: 0; }
.cv-composer { position: absolute; left: 60px; top: 60px; width: 480px; max-width: calc(100% - 80px); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.18); padding: 12px 14px; z-index: 15; }
.cv-composer .cv-text { border: none; border-bottom: 1px solid var(--line); border-radius: 0; padding: 6px 2px; resize: none; min-height: 60px; outline: none; }
.cv-composer .cv-text:focus { border-bottom-color: var(--brand); outline: none; }
.cv-actions { display: flex; justify-content: flex-end; gap: 6px; align-items: center; }
.cv-actions .muted { margin-right: auto; font-size: 11px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.seg > span { padding: 4px 10px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.seg > span.on { background: var(--brand-soft); color: var(--ink); font-weight: 500; }
.tog { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.tog i { width: 28px; height: 16px; border-radius: 8px; background: var(--line); position: relative; display: inline-block; }
.tog i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 6px; background: #fff; transition: left .15s; }
.tog.on i { background: #2e9e5b; }
.tog.on i::after { left: 14px; }
.cv-audience { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; position: relative; }
.cv-audience input { border: none; outline: none; background: transparent; min-width: 140px; flex: 1; }
.cv-choices { position: absolute; top: 100%; left: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.14); z-index: 5; min-width: 200px; }
.cv-choices:empty { display: none; }
.cv-choices .item { padding: 6px 10px; cursor: pointer; }
.cv-choices .item:hover { background: var(--hover); }
.cv-labels { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.cv-newlabel { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cv-swatches { display: inline-flex; gap: 4px; }
.cv-swatches .sw { width: 16px; height: 16px; cursor: pointer; border: 2px solid transparent; box-sizing: border-box; }
.cv-swatches .sw.on { border-color: var(--ink); }
.cv-list { padding: 0; gap: 0; }
.cv-search { margin: 10px 12px 6px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 18px; padding: 6px 12px; color: var(--ink-3); }
.cv-search input { border: none; outline: none; flex: 1; background: transparent; padding: 0; }
.cv-filters { display: flex; gap: 6px; padding: 4px 12px 8px; flex-wrap: wrap; }
.cv-filters .badge { margin-left: 4px; background: var(--brand); color: #222; font-weight: 700; padding: 0 5px; }
.cv-rows { overflow: auto; flex: 1; }
.cv-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; align-items: start; }
.cv-row:hover { background: var(--hover); }
.cv-row.sel { background: var(--brand-soft); }
.cv-rowbody { min-width: 0; }
.cv-row .tt { font-weight: 500; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cv-row .dm { font-size: 11px; color: var(--ink-3); }
.cv-row .last { color: var(--ink-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-rowright { display: grid; justify-items: end; gap: 4px; font-size: 11px; color: var(--ink-3); }
.cv-rowright .badge { background: var(--brand); color: #222; font-weight: 700; padding: 0 6px; }
.lbl-mini { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lock { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.tab .badge { margin-left: 2px; background: var(--brand); color: #222; font-weight: 700; padding: 0 6px; }
.right-pane .tab { padding: 10px 8px; font-size: 12px; }
.seg > span, .tog { white-space: nowrap; }
.cv-composer .row { flex-wrap: wrap; row-gap: 6px; }
.seg { flex: none; }
