/* golgari-monitor: NetBox-flavoured theme on top of Tabler */
:root {
  --gm-sidebar: #0f1a2e;
  --gm-sidebar-accent: #2f6fed;
  --gm-diff-add: rgba(47, 158, 68, .18);
  --gm-diff-del: rgba(224, 49, 49, .18);
}
[data-bs-theme="light"] body { background: #f4f6fa; }

.gm-sidebar { background: var(--gm-sidebar) !important; border-right: 1px solid rgba(255,255,255,.06); }
.gm-sidebar .nav-link { border-radius: 6px; margin: 1px 8px; padding: .45rem .75rem; }
.gm-sidebar .nav-item.active > .nav-link { background: var(--gm-sidebar-accent); color: #fff; }
.gm-sidebar .nav-link:hover { background: rgba(255,255,255,.07); }
.gm-nav-head { font-size: .66rem; letter-spacing: .09em; text-transform: uppercase; color: #7b8aa8; padding: 1rem 1.3rem .25rem; }
.gm-sidebar-foot { padding: 1rem; margin-top: auto; }
.gm-brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 500; font-size: 1.15rem; color: #e9eef9 !important; letter-spacing: .01em; }
.gm-brand i { font-size: 1.6rem; color: #4c8dff; }
.gm-brand b { color: #4c8dff; font-weight: 700; }
.gm-brand-lg { font-size: 1.8rem; }
.gm-brand-lg i { font-size: 2.4rem; }
.gm-login .card { border-top: 3px solid var(--gm-sidebar-accent); }

.gm-kpi .h1 { font-size: 1.65rem; font-variant-numeric: tabular-nums; }
.gm-unit { font-size: .9rem; color: var(--tblr-secondary); margin-left: .2rem; }
.gm-stat { border: 1px solid var(--tblr-border-color); border-radius: 8px; padding: .5rem .7rem; }
.gm-meter { margin-bottom: .7rem; }
.gm-meter .progress { height: .45rem; }
.gm-alert { border-left-width: 4px; }
.gm-chart-wrap { position: relative; width: 100%; }
.gm-table td, .gm-table th { white-space: nowrap; }
.table td.text-end, .table th.text-end { font-variant-numeric: tabular-nums; }
.gm-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 3px; margin-right: .4rem; vertical-align: middle; }
.gm-inline-form .form-select { width: 9rem; }
.gm-inline-form .form-control { width: 10rem; }
.gm-legend { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .78rem; color: var(--tblr-secondary); }
.gm-legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.gm-legend i.gm-empty { border: 1px dashed #868e96; }
.gm-head-stat { border-left: 3px solid var(--gm-sidebar-accent); padding-left: .7rem; }
.gm-tabs .nav-link { font-weight: 500; }
.gm-details summary { cursor: pointer; }
.gm-disabled td { text-decoration: line-through; opacity: .65; }
.gm-add-row { background: rgba(47,111,237,.05); }
.gm-matrix td, .gm-matrix th { vertical-align: middle; min-width: 8.5rem; }
.gm-matrix .gm-cell { display: block; text-decoration: none; line-height: 1.9; }
.gm-matrix td.gm-changed { box-shadow: inset 0 0 0 2px #f59f00; }
.gm-code { font-size: .8rem; line-height: 1.45; tab-size: 4; }
.gm-countdown { font-variant-numeric: tabular-nums; color: #f59f00; }
.gm-invoice .table td { vertical-align: top; }

/* diffs */
.gm-diff { margin: 0; padding: .75rem 1rem; font-size: .78rem; line-height: 1.5; max-height: 560px; overflow: auto; background: transparent; white-space: pre; }
.gm-diff .diff-add { background: var(--gm-diff-add); display: inline-block; width: 100%; }
.gm-diff .diff-del { background: var(--gm-diff-del); display: inline-block; width: 100%; }
.gm-diff .diff-hunk { color: #4c8dff; }

/* chassis drawings */
.gm-svg-body { padding: .75rem; }
.gm-scroll-x { overflow-x: auto; }
svg.chassis { width: 100%; height: auto; display: block; }
svg.chassis .bay rect { transition: filter .15s; }
svg.chassis a:hover .bay rect { filter: brightness(1.25); }
.svg-logo { fill: #c7d0e0; font: 700 15px var(--tblr-font-sans-serif); letter-spacing: .08em; }
.svg-ear { fill: #9aa6bd; font: 600 12px var(--tblr-font-sans-serif); letter-spacing: .05em; }
.svg-bay-title { fill: #fff; font: 600 13px var(--tblr-font-sans-serif); }
.svg-bay-text { fill: rgba(255,255,255,.85); font: 400 11px var(--tblr-font-sans-serif); }
.svg-bay-muted { fill: #7b8aa8; font: 500 12px var(--tblr-font-sans-serif); }
.svg-caption { fill: #9aa6bd; font: 500 10.5px var(--tblr-font-sans-serif); }
.svg-dimm { fill: #0b0e15; font: 700 10px var(--tblr-font-sans-serif); }

/* topology */
svg.topology { min-width: 1080px; width: 100%; height: auto; }
.topo-title { fill: #7b8aa8; font: 600 11px var(--tblr-font-sans-serif); text-transform: uppercase; letter-spacing: .08em; }
.topo-edge { fill: none; stroke: #4c8dff; stroke-opacity: .45; stroke-width: 1.4; }
.topo-node rect { fill: #1b2436; stroke: #33405a; }
[data-bs-theme="light"] .topo-node rect { fill: #fff; stroke: #cfd6e4; }
.topo-label { fill: var(--tblr-body-color); font: 600 12px var(--tblr-font-sans-serif); }
.topo-sub { fill: #8b97ad; font: 400 10.5px var(--tblr-font-monospace); }
.topo-node.up rect { stroke: #2f9e44; stroke-width: 2; }
.topo-node.down rect { stroke-dasharray: 4 3; opacity: .7; }
.topo-node.bridge rect { stroke: #4c8dff; }
.topo-node.vlan rect { stroke: #ae3ec9; }
.topo-node.host rect { stroke-dasharray: 2 2; }
.topo-node.guest.running rect { stroke: #2f9e44; }
.topo-node.guest.stopped rect { opacity: .55; }
.topo-node:hover rect { filter: brightness(1.2); }

@media print {
  .gm-sidebar, .page-header .col-auto, .alert { display: none !important; }
  .page-wrapper { margin: 0 !important; }
}

/* ------------------------------------------------------------------ components */
.gm-noscroll { overflow: hidden; }
.gm-hidden { display: none !important; }

/* toasts */
.gm-toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 3000; display: flex; flex-direction: column; gap: .5rem; max-width: 30rem; }
.gm-toast { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border-radius: 8px; background: var(--tblr-bg-surface); border: 1px solid var(--tblr-border-color);
  border-left: 4px solid #2f9e44; box-shadow: 0 8px 28px rgba(0,0,0,.35); animation: gm-in .18s ease-out; }
.gm-toast-err { border-left-color: #e03131; }
.gm-toast i { font-size: 1.25rem; color: #2f9e44; }
.gm-toast-err i { color: #e03131; }
.gm-toast-body { flex: 1; font-size: .875rem; }
.gm-toast-x { background: none; border: 0; color: var(--tblr-secondary); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.gm-toast.gm-out { opacity: 0; transform: translateY(6px); transition: all .2s; }
@keyframes gm-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* modal */
.gm-modal-back { position: fixed; inset: 0; background: rgba(5,10,20,.6); z-index: 2000; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem; overflow-y: auto; backdrop-filter: blur(2px); }
.gm-modal { background: var(--tblr-bg-surface); border: 1px solid var(--tblr-border-color); border-radius: 10px; width: 100%; max-width: 34rem; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: gm-in .15s ease-out; }
.gm-modal-wide { max-width: 52rem; }
.gm-modal-head { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.1rem; border-bottom: 1px solid var(--tblr-border-color); }
.gm-modal-head h3 { margin: 0; font-size: 1.05rem; }
.gm-modal-x { background: none; border: 0; font-size: 1.5rem; line-height: 1; color: var(--tblr-secondary); cursor: pointer; padding: 0 .25rem; }
.gm-modal-body { padding: 1.1rem; }
.gm-modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .8rem 1.1rem; border-top: 1px solid var(--tblr-border-color); }

/* drawer */
.gm-drawer-back { position: fixed; inset: 0; background: rgba(5,10,20,.45); z-index: 1900; opacity: 0; transition: opacity .18s; }
.gm-drawer-back.open { opacity: 1; }
.gm-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(46rem, 96vw); background: var(--tblr-bg-surface); z-index: 1950; border-left: 1px solid var(--tblr-border-color);
  transform: translateX(100%); transition: transform .18s ease-out; display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(0,0,0,.4); }
.gm-drawer.open { transform: none; }
.gm-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-bottom: 1px solid var(--tblr-border-color); }
.gm-drawer-head h3 { margin: 0; font-size: 1.1rem; }
.gm-drawer-body { padding: 1.1rem 1.2rem; overflow-y: auto; flex: 1; }

/* collapsible cards */
.gm-collapse-head { cursor: pointer; user-select: none; }
.gm-collapse-icon { margin-right: .5rem; transition: transform .15s; color: var(--tblr-secondary); }
.gm-collapsed .gm-collapse-icon { transform: rotate(-90deg); }
.gm-collapsed > :not(.card-header) { display: none !important; }

/* interactive tables */
.gm-tbar { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; padding: .6rem .75rem; border-bottom: 1px solid var(--tblr-border-color); }
.gm-tsearch { position: relative; flex: 0 1 16rem; }
.gm-tsearch i { position: absolute; left: .55rem; top: 50%; transform: translateY(-50%); color: var(--tblr-secondary); }
.gm-tsearch input { padding-left: 1.8rem; }
.gm-tfilters { display: flex; flex-wrap: wrap; gap: .35rem .9rem; order: 3; flex: 1 1 100%; }
.gm-tfilters:empty { display: none; }
.gm-chipgrp { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.gm-chipgrp-l { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tblr-secondary); margin-right: .15rem; }
.gm-fchip { border: 1px solid var(--tblr-border-color); background: transparent; color: var(--tblr-body-color); border-radius: 999px; padding: .1rem .55rem; font-size: .78rem; cursor: pointer; }
.gm-fchip small { color: var(--tblr-secondary); margin-left: .25rem; }
.gm-fchip.on { background: var(--gm-sidebar-accent); border-color: var(--gm-sidebar-accent); color: #fff; }
.gm-fchip.on small { color: rgba(255,255,255,.75); }
.gm-tright { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.gm-tcount { font-size: .78rem; color: var(--tblr-secondary); margin-right: .35rem; }
.gm-pager { display: flex; align-items: center; justify-content: flex-end; gap: .25rem; padding: .5rem .75rem; }
.gm-pager:empty { display: none; }
.gm-psize { width: auto; margin-left: .5rem; }
.gm-itable thead th { position: sticky; top: 0; z-index: 2; background: var(--tblr-bg-surface-secondary, var(--tblr-bg-surface)); }
.gm-sortable { cursor: pointer; white-space: nowrap; }
.gm-sortable::after { content: "↕"; opacity: .25; margin-left: .3rem; font-size: .8em; }
.gm-sortable.gm-asc::after { content: "↑"; opacity: .9; }
.gm-sortable.gm-desc::after { content: "↓"; opacity: .9; }
.gm-itable tbody tr:hover { background: rgba(76,141,255,.06); }
tr.gm-selected { background: rgba(76,141,255,.12) !important; }
.gm-flash-row { animation: gm-flash 2.4s ease-out; }
@keyframes gm-flash { 0%, 30% { background: rgba(250,176,5,.25); } 100% { background: transparent; } }
.gm-collist { display: grid; grid-template-columns: repeat(2, 1fr); gap: .3rem 1rem; }

/* bulk action bar */
.gm-bulkbar { position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 150%); z-index: 1500; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  background: var(--tblr-bg-surface); border: 1px solid var(--gm-sidebar-accent); border-radius: 12px; padding: .6rem .9rem; box-shadow: 0 12px 40px rgba(0,0,0,.45); transition: transform .2s; max-width: 96vw; }
.gm-bulkbar.gm-show { transform: translate(-50%, 0); }
.gm-bulk-n { font-weight: 700; color: var(--gm-sidebar-accent); }

/* chips input */
.gm-chips { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; min-height: 2.35rem; height: auto; padding: .25rem .4rem; cursor: text; }
.gm-chip { display: inline-flex; align-items: center; gap: .3rem; background: rgba(76,141,255,.16); border: 1px solid rgba(76,141,255,.35); border-radius: 6px; padding: .05rem .2rem .05rem .5rem; font-family: var(--tblr-font-monospace); font-size: .82rem; }
.gm-chip small { font-family: var(--tblr-font-sans-serif); color: var(--tblr-secondary); }
.gm-chip-x { background: none; border: 0; color: var(--tblr-secondary); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .2rem; }
.gm-chip-x:hover { color: #e03131; }
.gm-chips-in { border: 0; outline: 0; background: transparent; color: inherit; flex: 1; min-width: 6rem; font-family: var(--tblr-font-monospace); font-size: .85rem; }
.gm-chips-in.is-invalid { color: #e03131; }

/* wizards */
.gm-steps { display: flex; list-style: none; padding: 0; margin: 0 0 1.1rem; counter-reset: s; gap: .25rem; overflow-x: auto; }
.gm-steps li { flex: 1; display: flex; align-items: center; gap: .45rem; padding: .45rem .55rem; border-radius: 8px; font-size: .82rem; color: var(--tblr-secondary); cursor: pointer; white-space: nowrap; border-bottom: 3px solid var(--tblr-border-color); }
.gm-steps li.on { color: var(--tblr-body-color); border-bottom-color: var(--gm-sidebar-accent); font-weight: 600; }
.gm-steps li.done { border-bottom-color: #2f9e44; }
.gm-step-n { display: inline-flex; align-items: center; justify-content: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: var(--tblr-border-color); font-size: .75rem; font-weight: 700; }
.gm-steps li.on .gm-step-n { background: var(--gm-sidebar-accent); color: #fff; }
.gm-steps li.done .gm-step-n { background: #2f9e44; color: #fff; }
.gm-wiz-foot { display: flex; align-items: center; gap: .5rem; margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--tblr-border-color); }
section[data-step] { min-height: 12rem; }
.gm-choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: .5rem; }
.gm-choice label { display: flex; gap: .55rem; align-items: flex-start; border: 1px solid var(--tblr-border-color); border-radius: 8px; padding: .6rem .7rem; cursor: pointer; transition: border-color .12s, background .12s; }
.gm-choice label:hover { border-color: var(--gm-sidebar-accent); }
.gm-choice input { margin-top: .2rem; }
.gm-choice label:has(input:checked) { border-color: var(--gm-sidebar-accent); background: rgba(76,141,255,.10); }
.gm-choice b { display: block; font-size: .88rem; }
.gm-choice small { color: var(--tblr-secondary); font-size: .76rem; }
.gm-summary td:first-child { width: 40%; }

/* command palette */
.gm-pal-list { max-height: 55vh; overflow-y: auto; margin-top: .6rem; }
.gm-pal-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--tblr-secondary); padding: .5rem .4rem .2rem; }
.gm-pal-item { display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem; border-radius: 6px; color: var(--tblr-body-color); text-decoration: none; }
.gm-pal-item.on, .gm-pal-item:hover { background: var(--gm-sidebar-accent); color: #fff; text-decoration: none; }
.gm-pal-item.on .gm-pal-s, .gm-pal-item:hover .gm-pal-s { color: rgba(255,255,255,.75); }
.gm-pal-t { font-weight: 600; }
.gm-pal-s { color: var(--tblr-secondary); font-size: .8rem; margin-left: auto; }
.gm-pal-hint { font-size: .72rem; color: var(--tblr-secondary); margin-top: .5rem; }

/* top bar, page header */
.gm-topbar { display: flex; align-items: center; gap: .6rem; padding: .55rem 1.5rem; border-bottom: 1px solid var(--tblr-border-color); background: var(--tblr-bg-surface); position: sticky; top: 0; z-index: 1000; }
.gm-search-btn { display: flex; align-items: center; gap: .5rem; min-width: 18rem; justify-content: flex-start; color: var(--tblr-secondary); border: 1px solid var(--tblr-border-color); background: transparent; border-radius: 8px; padding: .35rem .7rem; font-size: .85rem; }
.gm-search-btn kbd { margin-left: auto; font-size: .7rem; }
.gm-crumbs { font-size: .78rem; color: var(--tblr-secondary); margin-bottom: .15rem; }
.gm-crumbs a { color: var(--tblr-secondary); }
.page-header { margin-top: 1rem; }
.gm-chart-wrap.gm-loading::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(76,141,255,.08), transparent); background-size: 200% 100%; animation: gm-shimmer 1.2s infinite; border-radius: 6px; }
@keyframes gm-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.gm-chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--tblr-secondary); font-size: .85rem; pointer-events: none; }

/* page tabs */
.gm-ptabs { display: flex; gap: .15rem; border-bottom: 1px solid var(--tblr-border-color); margin-bottom: 1rem; overflow-x: auto; }
.gm-ptabs a { padding: .55rem .9rem; color: var(--tblr-secondary); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; font-weight: 500; }
.gm-ptabs a:hover { color: var(--tblr-body-color); }
.gm-ptabs a.active { color: var(--tblr-body-color); border-bottom-color: var(--gm-sidebar-accent); }
.gm-ptabs .badge { margin-left: .35rem; }

/* empty states, key-value lists */
.gm-empty { text-align: center; padding: 2rem 1rem; color: var(--tblr-secondary); }
.gm-empty i { font-size: 2.2rem; display: block; margin-bottom: .5rem; opacity: .6; }
.gm-kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: .875rem; }
.gm-kv dt { color: var(--tblr-secondary); font-weight: 400; }
.gm-kv dd { margin: 0; }

/* firewall map */
svg.gm-fwmap { width: 100%; height: auto; display: block; }
.fw-zone rect { fill: #1b2436; stroke: #3a4a68; stroke-width: 1.5; }
[data-bs-theme="light"] .fw-zone rect { fill: #fff; stroke: #c3cde0; }
.fw-zone-fw rect { stroke: #4c8dff; stroke-width: 2.5; }
.fw-zone-wan rect { stroke: #e8590c; }
.fw-zone-vpns rect { stroke: #ae3ec9; }
.fw-zone-lan rect { stroke: #2f9e44; }
.fw-zone-t { fill: var(--tblr-body-color); font: 600 14px var(--tblr-font-sans-serif); }
.fw-zone-s { fill: #8b97ad; font: 400 11px var(--tblr-font-monospace); }
.fw-flow { fill: none; stroke: #4c8dff; stroke-width: 2.4; opacity: .75; cursor: pointer; transition: opacity .12s, stroke-width .12s; }
.fw-flow:hover { opacity: 1; stroke-width: 3.6; }
.fw-flow.ch { stroke: #f59f00; stroke-dasharray: 6 4; }
.fw-arrowhead { fill: #4c8dff; }
.fw-arrowhead.ch { fill: #f59f00; }
.fw-label rect { fill: var(--tblr-bg-surface); stroke: #4c8dff; stroke-opacity: .6; }
.fw-label.ch rect { stroke: #f59f00; }
.fw-label text { fill: var(--tblr-body-color); font: 500 11px var(--tblr-font-monospace); }
.fw-label, .fw-self { cursor: pointer; }
.fw-label:hover rect { stroke-opacity: 1; stroke-width: 2; }
.fw-self rect { fill: rgba(76,141,255,.15); stroke: #4c8dff; stroke-opacity: .5; }
.fw-self text { fill: var(--tblr-body-color); font: 500 10.5px var(--tblr-font-sans-serif); }
.gm-legend-line { display: inline-block; width: 26px; height: 0; border-top: 2.5px solid #4c8dff; vertical-align: middle; margin-right: .4rem; }
.gm-legend-line.ch { border-top: 2.5px dashed #f59f00; }
.gm-choice-1 { grid-template-columns: 1fr; }

/* sticky draft bar */
.gm-draftbar { position: sticky; bottom: 0; z-index: 900; margin-top: 1rem; display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  padding: .75rem 1rem; border: 1px solid #f59f00; border-radius: 10px; background: var(--tblr-bg-surface); box-shadow: 0 -6px 24px rgba(0,0,0,.35); }
.gm-draftbar > i { color: #f59f00; }

/* power schedules: weekly usage map and rule editor */
.gm-heat { display: grid; grid-template-columns: 2.2rem repeat(24, minmax(0, 1fr)); gap: 2px; font-size: .68rem; }
.gm-heat-h { text-align: left; color: var(--tblr-secondary); }
.gm-heat-d { color: var(--tblr-secondary); align-self: center; }
.gm-heat-c { display: block; height: 1.25rem; border-radius: 3px; background: color-mix(in srgb, #2f9e44 calc(var(--idle, 0) * 100%), #f76707); opacity: .85; position: relative; }
.gm-heat-c.none { background: var(--tblr-border-color); opacity: .5; }
.gm-heat-c.off { box-shadow: inset 0 0 0 2px var(--tblr-body-color); }
.gm-heat-c.sug::after { content: ""; position: absolute; inset: 35% 35%; border-radius: 50%; background: rgba(255,255,255,.85); }
.gm-heat-c.bk { background-image: repeating-linear-gradient(45deg, rgba(76,141,255,.95) 0 3px, transparent 3px 6px); }
.gm-heat-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.gm-heat-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.gm-heat-legend i.gm-heat-c { width: 1rem; height: .8rem; }
.gm-rule { border: 1px solid var(--tblr-border-color); border-radius: 8px; padding: .5rem .6rem; margin-bottom: .5rem; }
.gm-days { display: flex; flex-wrap: wrap; gap: .25rem; }
.gm-days label { cursor: pointer; }
.gm-days input { position: absolute; opacity: 0; pointer-events: none; }
.gm-days span { display: inline-block; min-width: 2.4rem; text-align: center; padding: .15rem .35rem; border: 1px solid var(--tblr-border-color); border-radius: 6px; font-size: .78rem; }
.gm-days input:checked + span { background: var(--gm-sidebar-accent); border-color: var(--gm-sidebar-accent); color: #fff; }
.gm-days input:focus-visible + span { outline: 2px solid var(--gm-sidebar-accent); outline-offset: 1px; }

/* contracts: PDF previews, LaTeX editor */
.gm-pdf iframe { width: 100%; height: 75vh; border: 0; display: block; background: #525659; }
.gm-pdf.short iframe { height: 60vh; }
.gm-latexlog { max-height: 60vh; overflow: auto; font-size: .75rem; padding: .75rem; margin: 0; white-space: pre-wrap; }
.CodeMirror { font-size: .82rem; border-top: 1px solid var(--tblr-border-color); border-bottom: 1px solid var(--tblr-border-color); }
.gm-diff .diff-add { color: #2f9e44; }
.gm-diff .diff-del { color: #e03131; }
.gm-diff { max-height: 50vh; overflow: auto; padding: .75rem; }
.gm-lines td { vertical-align: top; }
.gm-lines input, .gm-lines select { min-width: 4.5rem; }
.gm-oplist li { margin-bottom: .35rem; }

/* visual contract editor: the page looks like the printed document */
.gm-docwrap { background: #e9ecef; padding: 1.25rem; max-height: 78vh; overflow: auto; }
[data-bs-theme=dark] .gm-docwrap { background: #2b2f36; }
.gm-doc { max-width: 21cm; margin: 0 auto; background: #fff; color: #1a1a1a; padding: 1.8cm 2cm; box-shadow: 0 2px 10px rgba(0,0,0,.25);
  font-family: "TeX Gyre Pagella", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; font-size: 10.5pt; line-height: 1.45; }
.gm-doc .gm-b { position: relative; border-radius: 4px; padding: 1px 4px; margin: 0 -4px 3px; }
.gm-doc .gm-b:hover, .gm-doc .gm-b:focus-within { background: rgba(76,141,255,.06); outline: 1px dashed rgba(76,141,255,.35); }
.gm-btools { position: absolute; right: 100%; top: -2px; margin-right: 6px; display: none; flex-direction: column; align-items: flex-end; gap: 1px; background: #fff; border-radius: 6px; padding: 2px; box-shadow: 0 1px 4px rgba(0,0,0,.2); z-index: 5; }
.gm-doc .gm-b:hover > .gm-btools, .gm-doc .gm-b:focus-within > .gm-btools { display: flex; }
.gm-btools .btn { color: #555; }
.gm-btype { font: 600 .62rem/1 system-ui, sans-serif; color: #888; text-transform: uppercase; padding: 2px; white-space: nowrap; }
.gm-ed { outline: none; min-height: 1.3em; }
.gm-ed:empty::before { content: attr(data-placeholder); color: #aaa; font-style: italic; }
.gm-chip { display: inline-block; font: 500 .74em/1.5 system-ui, sans-serif; padding: 0 .45em; margin: 0 1px; border-radius: 999px; vertical-align: baseline; cursor: default; user-select: all; }
.gm-chip-var { background: #e7f0ff; color: #1c4fb5; border: 1px solid #b6ccf5; }
.gm-chip-raw { background: #f3f0ff; color: #6741d9; border: 1px solid #d0bfff; font-family: ui-monospace, monospace; cursor: pointer; }
.gm-b-titolo .gm-ed { text-align: center; font: 700 1.15rem/1.3 "TeX Gyre Heros", Helvetica, Arial, sans-serif; margin: .3rem 0; }
.gm-b-sottotitolo .gm-ed, .gm-b-riferimento .gm-ed { text-align: center; font-family: Helvetica, Arial, sans-serif; color: #6b6b6b; }
.gm-b-riferimento .gm-ed { font-size: .85em; }
.gm-b-centrato .gm-ed { text-align: center; font-weight: 700; margin: .4rem 0; }
.gm-b-parte .gm-ed { text-align: center; font-family: Helvetica, Arial, sans-serif; color: #6b6b6b; margin-top: .7rem; }
.gm-b-nota .gm-ed { font: .85em Helvetica, Arial, sans-serif; color: #6b6b6b; }
.gm-b-paragrafo .gm-ed { text-align: justify; margin: .2rem 0; }
.gm-art { font: 700 1rem Helvetica, Arial, sans-serif; color: #2e2e2e; margin-top: .6rem; display: flex; gap: .1rem; }
.gm-art .gm-ed { display: inline-block; }
.gm-cl { display: flex; gap: .4rem; text-align: justify; }
.gm-cl-num { flex: 0 0 2.4em; font-variant-numeric: tabular-nums; }
.gm-cl-text { flex: 1; }
.gm-list { margin: .2rem 0 .2rem 1.4rem; padding: 0; }
.gm-table { width: 100%; border-collapse: collapse; margin: .4rem 0; font-size: .95em; }
.gm-table td, .gm-table th { border-top: 1px solid #d0d0d0; padding: .3rem .4rem; vertical-align: top; }
.gm-table tr:first-child td, .gm-table tr:first-child th { border-top: 1.5px solid #333; }
.gm-campi td:first-child { width: 34%; font: 700 .85em Helvetica, Arial, sans-serif; }
.gm-table tr.gm-rep { background: #fff8e1; }
.gm-rowtools { width: 1.8rem; border: 0 !important; opacity: 0; }
.gm-table tr:hover .gm-rowtools { opacity: 1; }
.gm-tabbar { display: flex; gap: .25rem; align-items: center; margin-bottom: .3rem; font-family: system-ui, sans-serif; }
.gm-signs { display: flex; justify-content: space-between; gap: 2rem; margin: 1rem 0 .4rem; font-family: Helvetica, Arial, sans-serif; }
.gm-sign { flex: 0 0 44%; text-align: center; }
.gm-sign-title { font-weight: 700; font-size: .9em; }
.gm-sign-role { margin: .25rem auto; width: auto; font-size: .75rem; }
.gm-sign-box { height: 16mm; border: 1.5px dashed #c92a2a; border-radius: 4px; color: #c92a2a; font-size: .72rem; display: flex; align-items: center; justify-content: center; margin: .2rem 0; background: rgba(201,42,42,.04); }
.gm-sign-cap { font-size: .78em; color: #6b6b6b; }
.gm-letterhead { font-family: Helvetica, Arial, sans-serif; border-bottom: 1px solid #bfbfbf; padding-bottom: .4rem; margin-bottom: .6rem; }
.gm-lh-name { font-weight: 700; font-size: 1.25rem; }
.gm-lh-sub, .gm-lh-line { color: #6b6b6b; font-size: .78rem; }
.gm-lh-note { font-size: .68rem; color: #1c4fb5; margin-top: .2rem; }
.gm-raw { font-size: .78rem; }
.gm-varpick { width: 24rem; padding: .5rem; }
.gm-varlist { max-height: 18rem; overflow: auto; margin-top: .4rem; }
.gm-varitem { display: block; padding: .25rem .4rem; border-radius: 4px; font-size: .8rem; text-decoration: none; color: inherit; }
.gm-varitem:hover { background: rgba(76,141,255,.12); }
.gm-varitem span { font-size: .72rem; margin-left: .3rem; }
.gm-addmenu { min-width: 15rem; }
