/* EOS Middleware Console — layout & components on top of theme.css tokens. */
.app { display: grid; height: 100vh; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: 44px minmax(0, 1fr) 24px;
  grid-template-areas: "title title" "side main" "status status"; }
.app.collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.app.collapsed .sidebar { visibility: hidden; }

/* title bar */
.titlebar { grid-area: title; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
.titlebar .logo { height: 22px; width: auto; }
.product { display: flex; flex-direction: column; line-height: 1.1; }
.product b { font-size: 13.5px; font-weight: 800; }
.product span { font-size: 11px; color: var(--muted); font-weight: 600; }
.client-badge { margin-left: 8px; font-size: 11.5px; font-weight: 700; color: var(--text-2); background: var(--surface-3); border-radius: 99px; padding: 3px 10px; }
.sep { flex: 1 1 auto; }
.env { font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-soft); border-radius: 99px; padding: 3px 9px; }
.user { position: relative; display: flex; align-items: center; gap: 8px; padding: 3px 8px; border-radius: var(--r); cursor: pointer; }
.user:hover, .user:focus-within { background: var(--hover); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.user-tx { display: flex; flex-direction: column; line-height: 1.1; }
.user-tx b { font-size: 12.5px; } .user-tx small { font-size: 10.5px; color: var(--muted); }
.menu { display: none; position: absolute; right: 0; top: 38px; min-width: 180px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-2); padding: 4px; z-index: 60; }
.user.open .menu { display: block; }
.menu-h { font-size: 10.5px; font-weight: 800; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; padding: 6px 8px 4px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.menu button:hover { background: var(--hover); }
.menu button.on { color: var(--accent); font-weight: 700; }

/* sidebar explorer */
.sidebar { grid-area: side; background: var(--sidebar); border-right: 1px solid var(--border); overflow-y: auto; padding: 8px 6px 16px; }
.nav-group { margin-top: 6px; }
.nav-gh { display: flex; align-items: center; gap: 4px; width: 100%; border: 0; background: transparent; cursor: pointer; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 6px 4px; }
.nav-gh .ic { width: 12px; height: 12px; transition: transform .12s; }
.nav-group.closed .nav-gh .ic { transform: rotate(-90deg); }
.nav-group.closed .nav-items { display: none; }
.nav-item { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; padding: 6px 10px 6px 14px; border-radius: var(--r); font-size: 13px; color: var(--text-2); }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.on { background: var(--selected); color: var(--text); font-weight: 700; box-shadow: inset 2px 0 0 var(--accent); }
.nav-item .badge { margin-left: auto; font-size: 10.5px; font-weight: 800; min-width: 20px; text-align: center; padding: 0 6px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); }
.nav-item .badge.danger { background: var(--danger-soft); color: var(--danger); }
.nav-item .badge.violet { background: var(--violet-soft); color: var(--violet); }

/* main */
.main { grid-area: main; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.crumbs { display: flex; align-items: center; gap: 6px; padding: 8px 22px 0; font-size: 12px; color: var(--muted); }
.crumbs b { color: var(--text-2); }
.view { flex: 1; overflow-y: auto; padding: 10px 22px 28px; }
.page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head .hico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.page-head .hico .ic { width: 20px; height: 20px; }
.page-head h1 { font-size: 21px; font-weight: 800; margin: 0; line-height: 1.2; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; max-width: 760px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* statusbar */
.statusbar { grid-area: status; display: flex; align-items: center; gap: 16px; padding: 0 12px; background: var(--statusbar); color: #fff; font-size: 11.5px; font-weight: 600; }
.statusbar span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.statusbar .ic { width: 13px; height: 13px; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: #7CF0B5; display: inline-block; }
.dot-live.off { background: #FFB4B4; }

/* grid + cards */
.grid { display: grid; gap: 12px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mt { margin-top: 12px; }
@media (max-width: 1200px) { .g-4, .g-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-21 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .g-2, .g-3, .g-4, .g-5 { grid-template-columns: 1fr; } .app { grid-template-columns: 0 1fr; } .sidebar { visibility: hidden; } .app.open-side .sidebar { visibility: visible; position: fixed; z-index: 70; top: 44px; bottom: 24px; width: 248px; box-shadow: var(--shadow-3); } .user-tx, .client-badge, .env { display: none; } .view { padding: 10px 14px 24px; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-h h3 { margin: 0; font-size: 14px; font-weight: 700; }
.card-h .sub { font-size: 12px; color: var(--muted); }
.card-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 12px 14px; }
.kpi { display: flex; gap: 12px; align-items: flex-start; padding: 14px; }
.kpi .ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.kpi .lab { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.kpi .val { font-size: 25px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .subl { font-size: 12px; color: var(--text-2); }
.kpi.click { cursor: pointer; } .kpi.click:hover { background: var(--hover); }

/* status distribution */
.sdist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sbox { --t: var(--muted); border: 1px solid color-mix(in srgb, var(--t) 30%, var(--border)); background: color-mix(in srgb, var(--t) 7%, var(--surface)); border-radius: var(--r); padding: 9px 10px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.sbox:hover { background: color-mix(in srgb, var(--t) 14%, var(--surface)); }
.sbox .n { font-size: 21px; font-weight: 800; color: var(--t); font-variant-numeric: tabular-nums; line-height: 1.1; }
.sbox .l { font-family: var(--mono); font-size: 10.5px; color: var(--text-2); }
.sbox .bar { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--t) 18%, transparent); overflow: hidden; margin-top: 3px; }
.sbox .bar span { display: block; height: 100%; background: var(--t); }

/* pipeline */
.pipe { display: flex; gap: 0; align-items: stretch; overflow-x: auto; padding: 4px 2px; }
.pipe .ps { flex: 1; min-width: 96px; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; text-align: center; }
.pipe .ps:not(:last-child)::after { content: ""; position: absolute; top: 15px; left: calc(50% + 17px); right: calc(-50% + 17px); height: 2px; background: var(--border-2); }
.pipe .ps .c { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; color: #fff; background: var(--t, var(--accent)); z-index: 1; }
.pipe .ps .c.zero { background: var(--surface-3); color: var(--muted); }
.pipe .ps b { font-family: var(--mono); font-size: 10px; color: var(--text-2); font-weight: 600; }

/* table */
.tbl-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border: 1px solid var(--border-2); background: var(--surface); border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--text-2); cursor: pointer; }
.chip em { font-style: normal; color: var(--muted); font-weight: 600; }
.chip:hover { background: var(--hover); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tbl-tools .search { margin-left: auto; position: relative; }
.tbl-tools .search .ic { position: absolute; left: 9px; top: 8px; color: var(--muted); }
.tbl-tools .search input { padding-left: 30px; width: 230px; }
.tbl-wrap { overflow: auto; max-height: calc(100vh - 290px); }
.tbl-wrap.short { max-height: 380px; }
table.dt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.dt th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; z-index: 1; }
table.dt td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
table.dt tbody tr:hover { background: var(--hover); }
table.dt tbody tr.click { cursor: pointer; }
table.dt td.num, table.dt th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.dt td.mono { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
table.dt td.wrap { white-space: normal; min-width: 240px; max-width: 460px; color: var(--text-2); font-size: 12.5px; }
table.dt td .muted, .muted { color: var(--muted); }
.tbl-info { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 12px; color: var(--muted); }
.tbl-info .pg { margin-left: auto; display: flex; gap: 4px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.empty .ic { width: 28px; height: 28px; display: block; margin: 0 auto 8px; }

/* method + code tags */
.m { display: inline-block; min-width: 50px; text-align: center; font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: #fff; border-radius: 4px; padding: 2px 6px; }
.m.GET { background: var(--info); } .m.POST { background: var(--accent); } .m.DELETE { background: var(--danger); } .m.PUT { background: var(--warn); }
.code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 1px 6px; border-radius: 4px; }
.http { font-family: var(--mono); font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 4px; }
.http.ok { background: var(--ok-soft); color: var(--ok); } .http.warn { background: var(--warn-soft); color: var(--warn); } .http.bad { background: var(--danger-soft); color: var(--danger); }

/* drawer + modal */
.scrim { position: fixed; inset: 0; background: rgba(20, 30, 45, .35); opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 80; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100%); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-3); transform: translateX(102%); transition: transform .2s ease; z-index: 90; display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.drawer.wide { width: min(980px, 100%); }
.dr-h { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px 12px; border-bottom: 1px solid var(--border); }
.dr-h h2 { margin: 0; font-size: 17px; font-weight: 800; }
.dr-h .sub { font-size: 12px; color: var(--muted); margin-top: 2px; font-family: var(--mono); }
.dr-h .x { margin-left: auto; }
.tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 9px 12px; font-size: 13px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.dr-b { flex: 1; overflow-y: auto; padding: 14px 18px; }
.dr-f { display: flex; gap: 8px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.dr-f .grow { flex: 1 1 280px; font-size: 12.5px; color: var(--text-2); }
.modal-host { position: fixed; inset: 0; display: none; place-items: center; z-index: 95; background: rgba(20, 30, 45, .35); }
.modal-host.on { display: grid; }
.modal { width: min(520px, calc(100% - 32px)); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); border: 1px solid var(--border); }
.modal .mh { padding: 14px 16px 6px; font-size: 16px; font-weight: 800; }
.modal .mb { padding: 6px 16px 14px; font-size: 13px; color: var(--text-2); display: grid; gap: 10px; }
.modal .mf { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* kv + forms */
dl.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--muted); font-size: 12px; font-weight: 700; }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sec-t { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
.sec-t:first-child { margin-top: 0; }
.fld { display: grid; gap: 4px; }
.fld label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.fld .hint { font-size: 11.5px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

/* issues + timeline */
.issue { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: var(--r); font-size: 12.5px; margin-bottom: 6px; }
.issue.E { background: var(--danger-soft); color: var(--danger); } .issue.W { background: var(--warn-soft); color: var(--warn); }
.issue .code { background: transparent; font-weight: 800; padding: 0; color: inherit; }
.issue .p { color: var(--text-2); font-family: var(--mono); font-size: 11px; display: block; }
.issue .t { color: var(--text); }
.callout { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--accent-soft); color: var(--text); font-size: 12.5px; align-items: flex-start; }
.callout.warn { background: var(--warn-soft); } .callout.danger { background: var(--danger-soft); } .callout.ok { background: var(--ok-soft); }
.callout .ic { margin-top: 1px; flex: none; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; }
.tl .mk { display: flex; flex-direction: column; align-items: center; }
.tl .mk i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); margin-top: 5px; }
.tl li:first-child .mk i { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tl .mk b { flex: 1; width: 2px; background: var(--border); }
.tl li:last-child .mk b { display: none; }
.tl .tx { padding-bottom: 12px; font-size: 12.5px; }
.tl .tx .s { font-family: var(--mono); font-size: 11.5px; font-weight: 700; }
.tl .tx small { color: var(--muted); display: block; }

/* json */
pre.json { margin: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; font-family: var(--mono); font-size: 11.5px; line-height: 1.55; overflow: auto; max-height: 560px; white-space: pre; }
pre.json .k { color: var(--accent); } pre.json .s { color: var(--ok); } pre.json .n { color: var(--violet); } pre.json .b { color: var(--warn); }
.mono { font-family: var(--mono); }

/* misc */
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tree-mbl { border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 10px; overflow: hidden; }
.tree-mbl .h { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.drop { border: 2px dashed var(--border-2); border-radius: var(--r-lg); padding: 30px; text-align: center; background: var(--surface); transition: all .12s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .ic { width: 28px; height: 28px; color: var(--accent); }
.steps-h { display: flex; gap: 0; margin-bottom: 14px; }
.steps-h .st { flex: 1; display: flex; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--border); }
.steps-h .st .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 11.5px; }
.steps-h .st.on { color: var(--accent); border-color: var(--accent); }
.steps-h .st.on .n, .steps-h .st.done .n { background: var(--accent); color: #fff; }
.steps-h .st.done { color: var(--text-2); border-color: var(--accent); }
.mapping td:nth-child(2) { color: var(--muted); }
.prog { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.prog span { display: block; height: 100%; background: var(--ok); }
.endpoint-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.endpoint-row:last-child { border-bottom: 0; }
.endpoint-row code { font-family: var(--mono); font-size: 12.5px; }
.endpoint-row .d { font-size: 12px; color: var(--muted); }
.secret { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 2px 6px; border-radius: 4px; overflow-wrap: anywhere; }
.btn.primary.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:not(.primary) { border-color: color-mix(in srgb, var(--danger) 40%, var(--border-2)); }
.btn.danger:not(.primary):hover { background: var(--danger-soft); }
.input.bad { border-color: var(--danger); background: var(--danger-soft); }
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--text-2); cursor: not-allowed; }
input[type=number].input { text-align: right; font-variant-numeric: tabular-nums; }
.page-head > div:nth-child(2) { flex: 1 1 320px; min-width: 0; }
.page-head .actions { margin-left: 0; }
@media (min-width: 900px) { .page-head .actions { margin-left: auto; } }
.skel { display: grid; gap: 12px; padding-top: 6px; }
.skel i, .skel b { display: block; height: 22px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface-3), var(--hover), var(--surface-3)); background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; }
.skel-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.skel-row b { height: 84px; } .skel-card { height: 280px !important; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (max-width: 760px) {
  .g-4, .g-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 11px; gap: 9px; flex-direction: column; }
  .kpi .ico { width: 30px; height: 30px; }
  .kpi .val { font-size: 22px; }
  .kpi .subl { font-size: 11.5px; }
  .page-head .hico { display: none; }
  .page-head h1 { font-size: 19px; }
  .product span { display: none; }
  .statusbar { overflow-x: auto; }
  .statusbar #sbJobs, .statusbar #sbOffice { display: none; }
  .tbl-tools .search { margin-left: 0; width: 100%; }
  .tbl-tools .search input { width: 100%; }
  dl.kv { grid-template-columns: 1fr; gap: 2px 0; }
  dl.kv dd { margin-bottom: 8px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1200px) { .g-5 > :last-child:nth-child(odd) { grid-column: 1 / -1; } }

/* ---------- sidebar: flat toggle + icon rail ---------- */
.sidebar { display: flex; flex-direction: column; padding: 0; overflow: hidden; transition: width .15s; }
.nav-scroll { flex: 1; overflow-y: auto; padding: 8px 6px 12px; }
.nav-toggle { display: flex; align-items: center; gap: 9px; margin: 0; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 700; padding: 10px 16px; cursor: pointer; text-align: left; }
.nav-toggle:hover { background: var(--hover); color: var(--text); }
.nav-toggle .ic { width: 18px; height: 18px; }
.app.rail { grid-template-columns: 56px minmax(0, 1fr); }
.app.rail .nav-scroll { padding: 8px 6px; }
.app.rail .nav-gh { justify-content: center; padding: 8px 0 4px; font-size: 0; cursor: default; }
.app.rail .nav-gh .ic, .app.rail .nav-gh span { display: none; }
.app.rail .nav-gh::after { content: ""; display: block; width: 24px; height: 1px; background: var(--border-2); }
.app.rail .nav-group:first-child .nav-gh::after { display: none; }
.app.rail .nav-group.closed .nav-items { display: block; }
.app.rail .nav-item { justify-content: center; padding: 8px 0; position: relative; }
.app.rail .nav-item .ic { width: 18px; height: 18px; }
.app.rail .nav-item .lbl, .app.rail .nav-toggle .lbl { display: none; }
.app.rail .nav-item .badge { position: absolute; top: 2px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 9.5px; line-height: 16px; }
.app.rail .nav-item.on { box-shadow: inset 2px 0 0 var(--accent); }
.app.rail .nav-toggle { justify-content: center; padding: 10px 0; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }
.statusbar span.warn { background: rgba(255, 255, 255, .18); border-radius: 4px; padding: 0 6px; }
.switch { position: relative; width: 34px; height: 20px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: var(--border-2); border-radius: 99px; transition: background .12s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .12s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(14px); }
.switch input:disabled + i { opacity: .45; cursor: not-allowed; }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.cbx { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.cbx:disabled { cursor: not-allowed; opacity: .35; }
table.matrix th, table.matrix td { text-align: center; }
table.matrix th:first-child, table.matrix td:first-child { text-align: left; }
table.matrix tr.grp td { background: var(--surface-2); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px 12px; }
table.matrix tr.off td:not(:first-child):not(:nth-child(2)) { opacity: .45; }
.na { color: var(--faint); }
.stat-line { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.stat-line b { color: var(--text); }
.lic-hero { display: flex; gap: 16px; align-items: center; padding: 16px; }
.lic-hero .seal { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); flex: none; }
.lic-hero .seal .ic { width: 28px; height: 28px; }
.lic-hero h2 { margin: 0; font-size: 17px; font-weight: 800; }
.key { font-family: var(--mono); font-size: 13px; letter-spacing: .04em; background: var(--surface-3); padding: 3px 8px; border-radius: 4px; }
.meter { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.meter.warn span { background: var(--warn); } .meter.bad span { background: var(--danger); }
.pw-rules { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.pw-rules .ok { color: var(--ok); }
.app.rail .nav-scroll { scrollbar-width: none; }
.app.rail .nav-scroll::-webkit-scrollbar { display: none; }

/* ---------- sign-in ---------- */
.login { position: fixed; inset: 0; z-index: 200; background: var(--bg); overflow-y: auto; }
.lg-wrap { min-height: 100%; display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); }
.lg-brand { background: var(--surface); border-right: 1px solid var(--border); padding: 44px 40px; display: flex; flex-direction: column; gap: 14px; }
.lg-logo { width: 92px; height: auto; }
.lg-brand h1 { margin: 8px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.lg-tag { margin: 0; color: var(--muted); font-size: 13.5px; }
.lg-flow { display: grid; gap: 4px; margin-top: 18px; }
.lg-node { display: flex; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2); }
.lg-node b { display: block; font-size: 13.5px; } .lg-node small { color: var(--muted); font-size: 12px; }
.lg-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.lg-arrow { display: flex; justify-content: center; color: var(--faint); height: 14px; align-items: center; }
.lg-lic { margin-top: auto; display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-2); padding-top: 20px; border-top: 1px solid var(--border); }
.lg-lic .ic { color: var(--ok); }
.lg-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px 18px; gap: 18px; }
.lg-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px 26px 20px; box-shadow: var(--shadow-2); }
.lg-head { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.lg-head h2 { margin: 0; font-size: 20px; font-weight: 800; } .lg-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.lg-logo-sm { width: 42px; height: auto; display: none; }
#lgForm, #chForm { display: grid; gap: 14px; }
.lg-input { position: relative; }
.lg-input > .ic { position: absolute; left: 11px; top: 11px; color: var(--muted); pointer-events: none; }
.lg-input .input { width: 100%; height: 40px; padding-left: 36px; font-size: 14px; }
.lg-eye { position: absolute; right: 5px; top: 5px; }
.lg-input .input#lgPass { padding-right: 40px; }
#chForm .input { height: 40px; font-size: 14px; }
.lg-remember { font-size: 12.5px; color: var(--text-2); gap: 8px; cursor: pointer; }
.lg-submit { height: 42px; justify-content: center; font-size: 14px; }
.lg-err { display: flex; gap: 8px; align-items: center; padding: 9px 11px; border-radius: var(--r); background: var(--danger-soft); color: var(--danger); font-size: 12.5px; font-weight: 600; }
.lg-demo { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border-2); display: grid; gap: 6px; }
.lg-demo-h { display: flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 800; color: var(--text-2); margin-bottom: 2px; }
.lg-acc { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--r); padding: 6px 9px; cursor: pointer; }
.lg-acc:hover { border-color: var(--accent); background: var(--accent-soft); }
.lg-acc .tx { flex: 1; min-width: 0; } .lg-acc .tx b { display: block; font-size: 12.5px; font-family: var(--mono); } .lg-acc .tx small { color: var(--muted); font-size: 11.5px; }
.lg-acc .pw { font-size: 11.5px; color: var(--text-2); }
.lg-acc-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.lg-company { margin: 3px 0 0; display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 700; color: var(--text-2); }
.lg-company .ic { color: var(--accent); flex: none; }
.lg-company span { overflow-wrap: anywhere; }
.lg-foot { font-size: 11.5px; color: var(--muted); }
.shake { animation: shake .32s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.menu-user { padding: 8px 10px 6px; } .menu-user b { display: block; font-size: 13px; } .menu-user small { color: var(--muted); font-size: 11.5px; }
.menu button.danger { color: var(--danger); }
@media (max-width: 860px) { .lg-wrap { grid-template-columns: 1fr; } .lg-brand { display: none; } .lg-logo-sm { display: block; } .lg-card { padding: 22px 18px 16px; } }
.view.full { padding: 10px 14px 12px; display: flex; flex-direction: column; overflow: hidden; }
.view.full > .c3host { flex: 1; min-height: 0; }
