/* cyrusui.css - CyrusUI 0.5.0 - style after the approved GUI sample 0.4 (doc\CyrusUi-GuiMuster.html)
   Colors are variables; dark mode is set by js/theme.js (html[data-eff]). The colors from the settings
   (package UI-3) and the CI module follow; no inline style is allowed by the CSP. */
:root { --brand:#0f6cbd; --accent:#c77700; --bg:#fafafa; --surface:#ffffff; --text:#242424; --canvas:#e8e8e8; --on-brand:#ffffff;
  --err:#b10e1c; --ok:#2e7d32; }
html[data-eff="dark"] { color-scheme:dark; --brand:#4da3ff; --accent:#f0a030; --bg:#1b1b1b; --surface:#262626; --text:#ececec; --canvas:#111111; --on-brand:#000000; --err:#ff6b78; --ok:#6fcf7a; }
:root, html[data-eff="dark"] {
  --surface2:color-mix(in srgb,var(--surface) 94%,var(--text)); --hover:color-mix(in srgb,var(--surface) 92%,var(--brand));
  --line:color-mix(in srgb,var(--surface) 82%,var(--text)); --line2:color-mix(in srgb,var(--surface) 92%,var(--text));
  --line-strong:color-mix(in srgb,var(--surface) 55%,var(--text)); --mute:color-mix(in srgb,var(--text) 68%,var(--surface));
  --brand-l:color-mix(in srgb,var(--brand) 10%,var(--surface)); --brand-m:color-mix(in srgb,var(--brand) 24%,var(--surface));
  --err-l:color-mix(in srgb,var(--err) 12%,var(--surface)); --warn-l:color-mix(in srgb,var(--accent) 14%,var(--surface)); }
* { box-sizing:border-box; }
body { margin:0; font:13px/1.35 "Segoe UI",Arial,sans-serif; color:var(--text); background:var(--canvas); }
button, input, select, textarea { font:inherit; color:inherit; }
h1 { font-size:18px; margin:0 0 8px; } h2 { font-size:14px; margin:14px 0 6px; } h3 { font-size:13px; margin:0 0 6px; }
.btn { background:var(--surface); border:1px solid var(--line); border-radius:4px; padding:4px 12px; cursor:pointer; }
.btn:hover { background:var(--hover); } .btn.pri { background:var(--brand); color:var(--on-brand); border-color:var(--brand); }
.btn.pri:hover { background:color-mix(in srgb,var(--brand) 80%,black); } .btn.dng { color:var(--err); border-color:var(--err); }
.btn[disabled] { opacity:.5; cursor:default; } .btn.wide { width:100%; }
.fld { display:flex; flex-direction:column; gap:2px; margin-bottom:8px; } .fld label { color:var(--mute); font-size:12px; }
.fld input, .fld select, .fld textarea { border:1px solid var(--line); border-bottom-color:var(--line-strong); border-radius:4px; padding:4px 8px; background:var(--surface); min-width:0; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .btn:focus-visible, th:focus-visible, .tree li:focus-visible { outline:2px solid var(--brand); outline-offset:0; }
.pw { position:relative; display:flex; } .pw input { flex:1; padding-right:30px; }
.eye { position:absolute; right:2px; top:1px; border:0; background:none; cursor:pointer; padding:3px 6px; }
.banner { padding:6px 10px; border-radius:4px; margin-bottom:8px; } .banner.err { background:var(--err-l); color:var(--err); } .banner.warn { background:var(--warn-l); }
.pending, .hint-text { color:var(--mute); padding:8px 12px; margin:0; }
/* login, message and setup pages */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,var(--brand-l),var(--surface)); padding:24px; }
.card { background:var(--surface); border:1px solid var(--line); border-radius:8px; box-shadow:0 2px 8px #0002; padding:20px 24px; width:360px; max-width:100%; }
.card.wide { width:560px; }
.card label { display:block; margin:0 0 10px; color:var(--mute); font-size:12px; }
.card label input, .card label select { display:block; width:100%; margin-top:2px; border:1px solid var(--line); border-bottom-color:var(--line-strong); border-radius:4px; padding:4px 8px; background:var(--surface); }
.card button[type=submit]:not(.btn) { background:var(--brand); color:var(--on-brand); border:1px solid var(--brand); border-radius:4px; padding:4px 12px; cursor:pointer; }
.card .error { color:var(--err); background:var(--err-l); padding:6px 10px; border-radius:4px; }
.brandblock { display:inline-flex; align-items:center; gap:8px; }
.bt { display:inline-flex; flex-direction:column; line-height:1.15; } .bn { font-weight:600; color:var(--brand); font-size:15px; } .pn { color:var(--mute); font-size:11px; }
.card .brandblock { margin-bottom:14px; } .card .bn { font-size:20px; } .card .pn { font-size:12px; }
/* application frame */
.app { display:flex; flex-direction:column; min-height:100vh; background:var(--bg); }
.top { display:flex; align-items:center; gap:12px; background:var(--surface); border-bottom:1px solid var(--line); padding:6px 12px; }
.top .bn { font-size:16px; } .top .co { flex:1; text-align:center; font-weight:600; font-size:15px; color:var(--brand); min-width:0; overflow-wrap:anywhere; } .top .who { margin-left:0; display:flex; align-items:center; gap:12px; color:var(--mute); }
.top .mode select { border:1px solid var(--line); border-radius:4px; padding:2px 6px; background:var(--surface); }
form.inline { margin:0; }
.menu { display:flex; gap:2px; background:var(--surface); border-bottom:1px solid var(--line); padding:0 8px; position:relative; z-index:5; }
.mi { position:relative; } .mt { background:none; border:0; padding:5px 10px; cursor:pointer; border-radius:3px; } .mt:hover, .mt[aria-expanded=true] { background:var(--hover); }
.mp { position:absolute; top:100%; left:0; min-width:180px; background:var(--surface); border:1px solid var(--line); border-radius:4px; box-shadow:0 4px 12px #0003; padding:4px 0; display:flex; flex-direction:column; } .mp[hidden] { display:none; }
.mit { display:block; text-align:left; background:none; border:0; padding:6px 14px; cursor:pointer; color:inherit; text-decoration:none; white-space:nowrap; } .mit:hover:not([disabled]):not(.info) { background:var(--hover); } .mit[disabled] { opacity:.5; cursor:default; } .mit.info { color:var(--mute); cursor:default; }
.mt:focus-visible, .mit:focus-visible { outline:2px solid var(--brand); outline-offset:-2px; }
.navbtn { display:none; }
.tool { display:flex; gap:6px; padding:6px 12px; background:var(--surface2); border-bottom:1px solid var(--line); align-items:center; }
.tool .sep { width:1px; align-self:stretch; background:var(--line); margin:0 4px; }
.body { padding:12px; }
.panel { background:var(--surface); border:1px solid var(--line); border-radius:6px; padding:10px 12px; }
.explorer { display:grid; grid-template-columns:230px 1fr; flex:1; min-height:0; }
.tree { border-right:1px solid var(--line); background:var(--surface); overflow:auto; padding:6px 0; }
.tree ul { list-style:none; margin:0; padding:0 0 0 14px; } .tree > ul { padding-left:4px; }
.tree li { padding:2px 6px; cursor:pointer; border-radius:3px; margin:1px 4px 1px 0; } .tree li:hover { background:var(--hover); }
.tree li.on { background:var(--brand-m); font-weight:600; } .tree li.dom { font-weight:600; cursor:default; }
.tree li.dom:hover { background:none; } .tree li.dom li { font-weight:400; } .tree li.dom li.on { font-weight:600; }
.right { min-width:0; min-height:0; display:flex; flex-direction:column; }
.title { padding:8px 12px 0; font-weight:600; font-size:14px; }
/* narrow screens: tree behind the Navigation button, toolbar and top bar wrap, tables scroll sideways, masks one column */
@media (max-width:900px) {
  .explorer { grid-template-columns:1fr; } .navbtn { display:inline-block; }
  .tree { display:none; border-right:0; border-bottom:1px solid var(--line); max-height:50vh; } .explorer.navopen .tree { display:block; }
  .top { flex-wrap:wrap; row-gap:4px; } .top .co { order:3; flex-basis:100%; } .top .who { order:2; margin-left:auto; flex-wrap:wrap; gap:8px; }
  .tool { flex-wrap:wrap; } .menu { overflow:visible; flex-wrap:wrap; }
}
@media (max-width:700px) {
  body { font-size:14px; } input, select, textarea { font-size:16px; }
  .scroll table { min-width:560px; } .mask .grid { grid-template-columns:1fr; }
  .filters input { width:100%; flex:1 1 140px; } .addrow { flex-wrap:wrap; }
  .card, .card.wide { padding:16px; } .dlg { padding:14px; } .overlay { padding:8px; align-items:flex-start; }
  .btn { padding:7px 14px; } .mt, .mit { padding:9px 14px; }
  .tree li { padding:8px 8px; }
}
/* tables (R60): filters above, sortable heads, one scrolling table */
.filters { display:flex; gap:8px; padding:8px 12px 4px; flex-wrap:wrap; }
.filters input { border:1px solid var(--line); border-radius:4px; padding:3px 8px; width:150px; background:var(--surface); }
.filters input:focus { outline:2px solid var(--brand); outline-offset:0; }
#gridbox { flex:1; min-height:200px; display:flex; flex-direction:column; }
.count { padding:0 12px 2px; color:var(--mute); font-size:12px; }
.scroll { flex:1; overflow:auto; min-height:0; margin:0 12px; border:1px solid var(--line); background:var(--surface); }
table { border-collapse:collapse; width:100%; table-layout:fixed; }
th, td { text-align:left; padding:3px 8px; border-bottom:1px solid var(--line2); overflow-wrap:anywhere; vertical-align:top; }
th { background:var(--surface2); font-weight:600; cursor:pointer; user-select:none; position:sticky; top:0; }
th .arr { color:var(--brand); }
tbody tr { cursor:pointer; } tbody tr:hover { background:var(--hover); } tbody tr.sel { background:var(--brand-m); }
tbody tr:focus-visible { outline:2px solid var(--brand); outline-offset:-2px; }
td.num { text-align:right; } td.empty { color:var(--mute); text-align:center; padding:12px; cursor:default; }
.static th { cursor:default; position:static; } .static tbody tr { cursor:default; }
/* masks (R61) */
.mask { border-top:1px solid var(--line); background:var(--surface); padding:10px 12px; margin-top:8px; max-height:45vh; overflow:auto; }
.mask .grid { display:grid; grid-template-columns:repeat(3,1fr); gap:0 12px; }
.chk { display:flex; gap:6px; align-items:center; margin-bottom:6px; }
.fld input[readonly] { background:var(--surface2); }
/* editing (R61): error at the field, dialogs, alias rows */
.fld .err, .chk .err { color:var(--err); font-size:12px; }
.fld.bad input { border-color:var(--err); background:var(--err-l); }
.nolabel label { display:none; } .nolabel .fld, .nolabel .chk { margin:0; }
.static td { vertical-align:middle; } .static input[type=text] { width:100%; }
#toolbtns { display:contents; }
.addrow { display:flex; gap:8px; align-items:center; margin-top:8px; }
.addrow input { border:1px solid var(--line); border-radius:4px; padding:4px 8px; background:var(--surface); }
.addrow input[name=target] { flex:1; min-width:0; } .addrow input.narrow { width:70px; }
.overlay { position:fixed; inset:0; background:#0006; display:flex; align-items:center; justify-content:center; z-index:10; padding:16px; }
.dlg { background:var(--surface); border:1px solid var(--line); border-radius:8px; box-shadow:0 6px 18px #0004; padding:16px 18px; width:460px; max-width:100%; max-height:100%; overflow:auto; }
.dlg h3 { font-size:15px; } .dlg .act { display:flex; justify-content:flex-end; gap:8px; margin-top:10px; }
.act-small { border:1px solid var(--line); border-radius:4px; background:var(--surface); padding:2px 8px; font:inherit; font-size:12px; cursor:pointer; margin-top:4px; }
.act-small:hover { background:var(--hover); }
.static-text { padding:4px 0; }
.fld .banner { margin:4px 0; }
.banner.ok { background:color-mix(in srgb,var(--ok) 15%,var(--surface)); }
.panel.narrow { max-width:560px; } progress { width:100%; height:8px; }
.years { display:flex; gap:6px; align-items:center; margin-top:4px; } .years input { width:6em; }
.fld textarea { font-family:inherit; resize:vertical; }
.cols { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(340px,100%),1fr)); gap:12px; margin-bottom:8px; }
.logo { width:30px; height:30px; object-fit:contain; } .card .logo { width:40px; height:40px; }
.logo-prev { max-height:40px; max-width:160px; object-fit:contain; background:var(--surface2); border:1px solid var(--line); border-radius:4px; padding:2px; }
.logo-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin:4px 0; } .wide-panel { grid-column:1 / -1; }
#colTab { margin-top:8px; } #colTab .colw { width:22%; } #colTab input[type=color] { width:56px; height:26px; padding:0; border:1px solid var(--line); background:none; cursor:pointer; }.panel .grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(150px,100%),1fr)); gap:0 12px; } .panel h3 { margin-top:12px; } .panel h3:first-child, .panel form > h3:first-child { margin-top:0; }
.chk textarea, .fld textarea { width:100%; }

/* mail rules (UI-6) */
.panel.wide { max-width:980px; }
fieldset.rule { border:1px solid var(--line); border-radius:6px; margin:0 0 10px; padding:8px 10px; min-width:0; } fieldset.rule.off { opacity:.65; }
.ruletop { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:6px; } .ruletop > input { flex:1 1 200px; min-width:0; } .ruletop .chk { margin:0; } .rulen { font-weight:600; min-width:1.5em; }
.rulebtn { display:inline-flex; gap:4px; margin-left:auto; } .rulebtn .btn { padding:2px 8px; }
.cond { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:6px; align-items:center; } .cond > input { flex:1 1 180px; min-width:0; } .cond > input.hname { flex:0 1 130px; } .cond .btn { padding:2px 8px; }
.ruleact { border-top:1px dashed var(--line); margin-top:6px; padding-top:6px; } .ruleact .chks { display:flex; flex-wrap:wrap; gap:4px 16px; margin-bottom:6px; }
.banner ul { margin:0 0 6px; padding-left:18px; }
