/* ============================================================================
   Application shell: title bar, ribbon, backstage, status bar and views.
   Colours come from the tokens in styles.css.
   ========================================================================== */
html, body { overflow: hidden; }
body { display: flex; flex-direction: column; height: 100vh; background: var(--bg); }

/* ---------- icons (Lucide line icons, tinted by tone) ---------- */
.ic { flex: none; }
.ic.t-emerald { color: var(--t-emerald); } .ic.t-sky { color: var(--t-sky); } .ic.t-amber { color: var(--t-amber); }
.ic.t-rose { color: var(--t-rose); } .ic.t-violet { color: var(--t-violet); } .ic.t-slate { color: var(--t-slate); }

/* ---------- title bar ---------- */
#titlebar { height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--chrome); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); flex: none; position: relative; z-index: 35; user-select: none; }
.app-badge { background: var(--brand); color: #fff; font-weight: 700; font-size: 11px; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
#qa { display: flex; gap: 2px; padding-right: 8px; border-right: 1px solid var(--line); }
.qa { background: transparent; border: 0; padding: 4px; border-radius: 6px; display: inline-flex; color: var(--text); }
.qa:hover:not(:disabled) { background: var(--hover); filter: none; }
.qa:disabled { opacity: .35; }
#app-title { font-size: 12px; font-weight: 500; color: var(--text); margin-left: 4px; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); padding: 4px 11px; font-size: 12px; font-weight: 500; border-radius: 8px; }
.tb-btn:hover { border-color: var(--accent-line); filter: none; }
.tb-btn.on { background: linear-gradient(90deg, #059669, #0d9488); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(16, 185, 129, .3); }
.tb-btn.on .ic { color: #d1fae5; }
.tb-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; padding: 0; border-radius: 7px; background: var(--panel); border: 1px solid var(--line-strong); color: var(--text); }
.tb-icon:hover { border-color: var(--accent-line); filter: none; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: #3b6e52; color: #fff; border: 0; padding: 0; font-size: 11px; font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }

/* ---------- ribbon tabs ---------- */
#rb-tabs { display: flex; align-items: flex-end; gap: 1px; padding: 4px 8px 0; background: var(--ribbon); border-bottom: 1px solid var(--line); height: 34px; flex: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
#rb-tabs::-webkit-scrollbar { display: none; }
#rb-tabs a { padding: 6px 12px; font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; text-decoration: none; white-space: nowrap; transition: color .12s, background-color .12s; }
#rb-tabs a:hover { color: var(--text); }
#rb-tabs a.active { border-bottom-color: var(--accent); color: var(--accent-text); font-weight: 600; background: var(--accent-weak); border-radius: 6px 6px 0 0; }
#rb-tabs a.ctx { color: var(--accent-text); }
#rb-tabs a.rb-file { background: var(--brand); color: #fff; margin: 0 6px 3px 0; border-radius: 6px; padding: 4px 14px; font-weight: 600; border: 0; }
#rb-tabs a.rb-file:hover { background: #388e3c; }
.tellme { margin-left: 14px; display: flex; align-items: center; position: relative; padding-bottom: 4px; flex: none; }
.tellme .ic { position: absolute; left: 9px; top: 50%; transform: translateY(calc(-50% - 2px)); color: var(--muted); pointer-events: none; }
.tellme input { width: 240px; height: 24px; font-size: 12px; padding: 0 10px 0 28px; border-radius: 7px; background: var(--input-bg); border: 1px solid var(--line); }
.rb-toggle { margin-left: auto; align-self: center; display: inline-flex; padding: 3px; border-radius: 6px; cursor: pointer; color: var(--muted); flex: none; }
.rb-toggle:hover { background: var(--hover); color: var(--text); }

/* ---------- ribbon body ---------- */
#ribbon { display: flex; align-items: stretch; background: var(--ribbon); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); min-height: 84px; padding: 5px 6px 0; flex: none; overflow-x: auto; overflow-y: hidden; position: relative; user-select: none; }
.rb-group { display: flex; flex-direction: column; border-right: 1px solid var(--line); padding: 0 8px; flex: none; }
.rb-group:last-of-type { border-right: 0; }
.rb-items { display: flex; align-items: center; gap: 3px; flex: 1; }
.rb-glabel { text-align: center; font-size: 9.5px; font-weight: 500; letter-spacing: .03em; color: var(--faint); padding: 3px 0 4px; position: relative; white-space: nowrap; }
.rb-launch { position: absolute; right: -6px; bottom: 3px; font-size: 10px; cursor: pointer; color: var(--faint); text-decoration: none; }
.rb-launch:hover { color: var(--accent-text); }
.rb-big { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: transparent; color: var(--text-2); border: 1px solid transparent; padding: 4px 6px; min-width: 52px; max-width: 84px; font-size: 11px; font-weight: 500; line-height: 12.5px; height: 58px; border-radius: 9px; }
.rb-big span { text-align: center; }
.rb-small { display: flex; align-items: center; gap: 6px; background: transparent; color: var(--text-2); border: 1px solid transparent; padding: 2px 7px; font-size: 11px; font-weight: 500; border-radius: 6px; white-space: nowrap; height: 21px; }
.rb-big:hover:not(:disabled), .rb-small:hover:not(:disabled), .rb-mini:hover { background: var(--hover); border-color: transparent; color: var(--text); filter: none; }
.rb-big.on, .rb-small.on { background: var(--accent-weak); border-color: var(--accent-line); color: var(--accent-text); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12); }
.rb-big:disabled, .rb-small:disabled { opacity: .35; cursor: default; }
.rb-arr { font-size: 8px; margin-left: 2px; color: var(--faint); }
.rb-col { display: flex; flex-direction: column; gap: 1px; justify-content: center; }
.rb-row { display: flex; gap: 3px; align-items: center; }
.rb-mini { background: transparent; color: var(--text-2); border: 1px solid transparent; padding: 2px 5px; min-width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.rb-pct { flex-direction: column; height: 30px; min-width: 34px; padding: 2px 3px; gap: 2px; border: 1px solid var(--line); background: var(--input-bg); }
.rb-pct:hover { border-color: var(--accent-line) !important; }
.rb-pct .pbar { display: block; width: 22px; height: 5px; border-radius: 2px; background: var(--line-strong); overflow: hidden; }
.rb-pct .pbar i { display: block; height: 100%; background: var(--t-sky); }
.rb-pct small { font-size: 9px; line-height: 9px; font-family: var(--mono); font-weight: 500; color: var(--muted); }
.rb-fontbox { display: flex; flex-direction: column; gap: 5px; justify-content: center; }
.rb-font { width: 124px; height: 23px; padding: 0 5px; font-size: 11px; border-radius: 6px; }
.rb-size { width: 56px; height: 23px; padding: 0 4px; font-size: 11px; margin-left: 3px; border-radius: 6px; }
.rb-color { position: relative; overflow: hidden; }
.rb-color span { width: 14px; height: 14px; border: 1px solid var(--line-strong); border-radius: 3px; display: inline-block; }
.rb-color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rb-sched { display: flex; flex-direction: column; gap: 5px; justify-content: center; }
.rb-data { display: flex; flex-direction: column; gap: 3px; padding: 0 4px; font-size: 11px; justify-content: center; }
.rb-data label { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 11px; white-space: nowrap; }
.rb-data select { height: 22px; padding: 0 5px; font-size: 11px; max-width: 170px; border-radius: 6px; }
.rb-data input[type=checkbox] { margin: 0; width: auto; flex: none; }
.rb-status { display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.rb-status .rb-small { font-family: var(--mono); font-size: 10.5px; height: 24px; border: 1px solid var(--line); background: var(--input-bg); }
.rb-mini.on { background: var(--accent-weak); border-color: var(--accent-line); color: var(--accent-text); }
.rb-mini:disabled { opacity: .45; cursor: default; }
.rb-gallery { display: grid; grid-template-columns: repeat(8, 36px); gap: 4px; align-content: center; }
.rb-sw { width: 36px; height: 30px; padding: 5px; background: var(--input-bg); border: 1px solid var(--line-strong); border-radius: 7px; display: flex; flex-direction: column; justify-content: center; gap: 3px; position: relative; }
.rb-sw span { height: 5px; display: block; border-radius: 2px; }
.rb-sw span + span { width: 75%; }
.rb-sw i { position: absolute; right: 4px; bottom: 3px; border-style: solid; border-width: 0 3px 5px; }
.rb-sw:hover { border-color: var(--accent-line); filter: none; }
.rb-sw.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-weak); }
.rb-collapse { display: none; }

/* ---------- main area & vertical view label ---------- */
#layout { flex: 1; min-height: 0; height: auto; }
#main { position: relative; padding-left: 22px; }
#main::before { content: attr(data-vlabel); position: absolute; left: 0; top: 0; bottom: 0; width: 22px; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center;
  color: var(--accent); font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: .28em; background: var(--bg); border-left: 1px solid var(--line); display: flex; align-items: center; justify-content: center; z-index: 6; }
#main[data-vlabel=""]::before, #main:not([data-vlabel])::before { display: none; }
#main:not([data-vlabel]), #main[data-vlabel=""] { padding-left: 0; }
.vbody { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.vbody > .page, #main > .page { height: 100%; overflow: auto; }

/* ---------- status bar ---------- */
#statusbar { height: 28px; display: flex; align-items: center; gap: 14px; padding: 0 12px; background: var(--bg); border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); flex: none; user-select: none; }
#statusbar > span:first-child { color: var(--accent-text); font-weight: 600; }
#statusbar a { cursor: pointer; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; border-radius: 5px; }
#statusbar a:hover { color: var(--text); }
#statusbar .muted { font-family: var(--mono); font-size: 10.5px; }
#statusbar .sb-view { padding: 3px 4px; }
#statusbar .sb-view .ic { color: inherit; }
#statusbar .sb-view.on { background: var(--accent-weak); color: var(--accent-text); }
#statusbar .sb-views { display: inline-flex; gap: 2px; padding: 0 8px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
#statusbar input[type=range] { width: 96px; height: 4px; }
.sb-zoom { padding: 0 4px; font-weight: 700; }

/* ---------- timeline strip ---------- */
.timeline { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 6px; border-bottom: 1px solid var(--line); background: var(--panel-3); flex: none; position: relative; }
.tl-label { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 8.5px; font-family: var(--mono); color: var(--faint); letter-spacing: .22em; padding-left: 4px; border-left: 1px solid var(--line-strong); }
.tl-end { display: flex; flex-direction: column; justify-content: center; font-size: 11px; min-width: 76px; font-family: var(--mono); }
.tl-end span { color: var(--muted); font-size: 10.5px; }
.tl-end:last-child { text-align: right; }
.timeline svg .tl-band { fill: var(--tl-bg); stroke: var(--line-strong); }
.timeline svg .tl-tick { stroke: var(--line); }
.timeline svg .tl-mon { fill: var(--muted); font-family: var(--mono); }
.timeline svg .tl-hint { fill: var(--faint); }
.timeline svg .tl-ms { fill: var(--accent); }

/* ---------- grid in MS Project style ---------- */
.rowid { width: 34px; min-width: 34px; max-width: 34px; background: var(--panel-3); color: var(--faint); text-align: right; padding-right: 6px !important; border-right: 1px solid var(--line) !important; font-size: 11px; font-family: var(--mono); }
.s-row.sel .rowid, .s-row.multi .rowid { background: var(--accent-weak); color: var(--accent-text); }
.s-head .rowid { background: var(--panel-2); }
.s-cols .hcol.addcol { width: 118px; min-width: 118px; color: var(--faint); font-weight: 500; cursor: pointer; }
.s-cols .hcol.addcol:hover { color: var(--accent-text); }
.s-cols .hcol.csel { background: var(--accent-weak); color: var(--accent-text); }
.s-cols .hcol .ind-h { display: inline-block; width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--t-sky); color: var(--t-sky); text-align: center; font-weight: 700; font-size: 10px; line-height: 12px; font-style: normal; }
.s-row.hlrow { background: var(--hl-row); }
.s-row.inactive > div { color: var(--faint) !important; text-decoration: line-through; }
.s-row .onum { color: var(--muted); font-size: 10.5px; font-family: var(--mono); }
.s-row .al-left { text-align: left; } .s-row .al-center { text-align: center; } .s-row .al-right { text-align: right; }
.s-row.tall { align-items: flex-start; }
/* Format > Drawing: shapes on the Gantt chart */
#g-body.drawmode, #g-body.drawmode * { cursor: crosshair !important; }
#g-body .drw { cursor: move; }
#g-body .drsel { fill: none; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 2; pointer-events: none; }
#g-body .drh { fill: var(--panel); stroke: var(--accent); stroke-width: 1.5; cursor: nwse-resize; }
.s-row.newrow { color: var(--faint); }
.s-row.newrow input::placeholder { color: var(--faint); font-style: italic; }
#sched-wrap.nogrid .s-row, #sched-wrap.nogrid .s-row > div { border-color: transparent !important; }
#sched-wrap .s-row.sel { background: var(--sel); }

/* ---------- usage tables, resource sheet ---------- */
.usage-wrap { flex: 1; overflow: auto; min-height: 0; }
.usage-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); flex: none; }
.usage-bar .muted { margin-right: 4px; font-size: 12px; }
.utbl { width: max-content; font-size: 12px; }
.utbl th, .utbl td { white-space: nowrap; padding: 4px 8px; }
.utbl td.num { font-family: var(--mono); font-size: 11.5px; }
.utbl .ufix { position: sticky; left: 0; background: var(--panel); z-index: 1; min-width: 240px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.utbl .ufix2 { position: sticky; left: 240px; background: var(--panel); z-index: 1; min-width: 90px; }
.utbl .ufix3 { position: sticky; left: 330px; background: var(--panel-3); z-index: 1; min-width: 60px; color: var(--muted); }
.utbl th.ufix, .utbl th.ufix2, .utbl th.ufix3 { z-index: 2; background: var(--panel-2); }
.utbl .ufx { position: sticky; background: var(--panel); z-index: 1; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; }
.utbl .ufx.udet { background: var(--panel-3); color: var(--muted); border-right: 1px solid var(--line-strong); }
.utbl th.ufx { z-index: 2; background: var(--panel-2); }
.utbl tr.urow1 td.ufx:not(.udet) { background: var(--wbs-row); }
.utbl tr.urow1 td { background: var(--wbs-row); }
.utbl tr.urow1 td.ufix, .utbl tr.urow1 td.ufix2 { background: var(--wbs-row); }
.utbl td.over { background: rgba(244, 63, 94, .15) !important; color: var(--crit); font-weight: 600; }
.utbl tr.overrow td.ufix { color: var(--crit); }
/* Task / Resource Usage as in MS Project: sheet | splitter | timephased grid, each with its own scroll bar across */
.tu { flex: 1; min-height: 0; display: flex; font-size: 12px; outline: none; border-top: 1px solid var(--line); }
.tu-l { display: flex; flex-direction: column; min-width: 120px; flex: none; }
.tu-r { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tu-split { width: 5px; flex: none; cursor: col-resize; background: var(--panel-3); border-left: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); }
.tu-split:hover { background: var(--accent-weak); }
.tu-lh, .tu-rh { height: 44px; flex: none; overflow: hidden; background: var(--panel-2); border-bottom: 1px solid var(--line-strong); }
.tu-rh { padding-right: 20px; }
.tu-lb { flex: 1; min-height: 0; overflow-x: scroll; overflow-y: hidden; }
.tu-rb { flex: 1; min-height: 0; overflow: scroll; }
.tu-hrow { display: flex; height: 44px; }
.tu-h { flex: none; box-sizing: border-box; height: 44px; padding: 0 6px 5px; display: flex; align-items: flex-end; border-right: 1px solid var(--line); color: var(--text-2); font-size: 11.5px; line-height: 1.15; }
.tu-h.num { justify-content: flex-end; }
.tu-h.on, .tu-t2.on { background: var(--accent-weak); color: var(--accent-text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.tu-h.tu-det { position: sticky; left: 0; z-index: 2; background: var(--panel-2); border-right: 1px solid var(--line-strong); }
.tu-tiers { display: flex; flex-direction: column; }
.tu-tier { display: flex; height: 22px; }
.tu-t1, .tu-t2 { flex: none; box-sizing: border-box; height: 22px; line-height: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; font-size: 11px; color: var(--text-2); }
.tu-t1 { padding-left: 4px; }
.tu-t2 { text-align: center; }

.tu-sp { position: relative; }
.tu-slice { position: absolute; left: 0; right: 0; }
.tu-row, .tu-ln { display: flex; box-sizing: border-box; }
.tu-ln { height: 22px; }
.tu-c { flex: none; box-sizing: border-box; height: 100%; line-height: 21px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); position: relative; }
.tu-row .tu-c { line-height: 21px; }
.tu-c.tu-id { background: var(--panel-3); color: var(--muted); text-align: right; font-family: var(--mono); font-size: 11px; }
.tu-c.tu-work, .tu-c.tu-dur, .tu-v { text-align: right; font-family: var(--mono); font-size: 11.5px; }
.tu-c.tu-ind, .tu-c.tu-mode { text-align: center; padding: 0; }
.tu-c.tu-mode svg, .tu-c.tu-ind svg { vertical-align: -2px; }
.tu-c.tu-det { position: sticky; left: 0; z-index: 1; background: var(--panel-3); color: var(--text-2); border-right: 1px solid var(--line-strong); }
.tu-v.nw, .tu-t2.nw { background: rgba(120, 130, 150, .14); }
.tu-v.over { color: var(--crit); font-weight: 600; background: rgba(244, 63, 94, .13); }
.tu-b .tu-c:not(.tu-id):not(.tu-det):not(.nw) { background: var(--wbs-row); }
.tu-b .tu-name, .tu-b .tu-work { font-weight: 600; }
.tu-task .tu-name { font-weight: 500; }
.tu-asg .tu-name, .tu-rasg .tu-name { color: var(--text-2); }
.tu-asg .tu-start, .tu-asg .tu-finish { color: var(--muted); }
.tu-tw { display: inline-block; width: 14px; color: var(--muted); cursor: pointer; user-select: none; }
.tu-c.ed { cursor: cell; }
.tu-c.tu-sel { box-shadow: inset 0 0 0 2px var(--accent); z-index: 2; }
.tu-c .tu-pend { color: var(--accent-text); }  /* a value typed and being saved: the totals follow in a moment */
.tu-c .tu-in { position: absolute; inset: 1px; width: calc(100% - 2px); box-sizing: border-box; font: inherit; padding: 0 4px; border: 1px solid var(--accent); background: var(--input-bg); color: var(--text); outline: none; }
.tu-c .tu-in.num { text-align: right; }
.tu .uedited { color: var(--accent); font-size: 11px; }
/* Detail Styles dialog */
.ds-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.ds-lists { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 10px; align-items: center; }
.ds-lists select { width: 100%; min-width: 170px; }
.ds-mid { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.ds-set { margin-top: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; display: grid; gap: 8px; }
.rsheet { width: max-content; font-size: 12.5px; }
.rsheet td { cursor: default; height: 26px; }
.rsheet tr.sel td { background: var(--sel); }
.rsheet td.saving { opacity: .55; }

/* ---------- team planner ---------- */
.tp-wrap { flex: 1; overflow: auto; min-height: 0; position: relative; background: var(--panel); }
.tp-head { display: flex; position: sticky; top: 0; z-index: 3; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.tp-name { width: 220px; min-width: 220px; padding: 5px 8px; border-right: 1px solid var(--line); position: sticky; left: 0; background: var(--panel); z-index: 2; font-size: 12px; }
.tp-head .tp-name { background: var(--panel-2); font-weight: 600; }
.tp-name[data-rsel] { cursor: pointer; }
.tp-name.sel { background: var(--sel); }
.tp-scale { position: relative; height: 26px; }
.tp-tick { position: absolute; top: 6px; font-size: 10px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 3px; font-family: var(--mono); }
.tp-row { display: flex; border-bottom: 1px solid var(--line2); }
.tp-row.drop { background: var(--accent-weak); }
.tp-lane { position: relative; }
.tp-name .tp-rn { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 16px; }
.tp-name .tp-rc { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 15px; }
.tp-bar { position: absolute; height: 20px; background: #3b82f6; border: 1px solid rgba(255, 255, 255, .25); border-radius: 4px; font-size: 11px; line-height: 14px; padding: 1px 5px; overflow: hidden; cursor: grab; color: #fff; }
.tp-bar.tp-mini { padding: 0; }
.tp-bar span { position: relative; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.tp-lbl { position: absolute; font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.tp-lbl.over { color: #ef4444; }
.tp-bar .tp-done { position: absolute; left: 0; top: 0; bottom: 0; opacity: .55; }
.tp-bar.over { border: 2px solid #ef4444; box-shadow: 0 0 0 1px #7f1d1d; }
.tp-bar.sel { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.tp-uns { width: 140px; min-width: 140px; border-right: 1px solid var(--line); padding: 3px 4px; position: sticky; left: 220px; background: var(--panel); z-index: 2; }
.tp-uhead { background: var(--panel-2); font-weight: 600; font-size: 12px; padding: 5px 8px; }
.tp-ubar { font-size: 11px; background: var(--panel-3); border: 1px dashed var(--line-strong); border-radius: 4px; padding: 1px 5px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-sep { position: sticky; left: 0; background: var(--panel-2); border-top: 1px solid var(--line-strong); padding: 5px 10px; font-size: 12px; font-weight: 600; }
.tp-un .tp-name { color: var(--muted); }

/* ---------- calendar view ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--panel-2); border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.cal-dow div { padding: 5px 6px; }
.cal-grid { flex: 1; overflow: auto; background: var(--panel); }
.cal-week { position: relative; min-height: 120px; border-bottom: 1px solid var(--line); }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); position: absolute; inset: 0; }
.cal-day { border-right: 1px solid var(--line2); padding: 2px 6px; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.cal-day.other { background: var(--panel-3); color: var(--faint); }
.cal-bars { position: relative; height: 100%; min-height: 120px; }
.cal-bar { position: absolute; height: 16px; background: #3b82f6; border: 1px solid #60a5fa; color: #fff; border-radius: 3px; font-size: 10.5px; padding: 0 4px; overflow: hidden; white-space: nowrap; cursor: pointer; box-sizing: border-box; }
.cal-bar.crit { background: #dc2626; border-color: #f87171; }
.cal-bar.ms { background: var(--accent-strong); border-color: var(--accent); }

/* ---------- task board ---------- */
.board { display: flex; gap: 14px; padding: 14px; flex: 1; overflow: auto; min-height: 0; align-items: flex-start; }
.lane { width: 290px; min-width: 260px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 200px; }
.lane.drop { background: var(--accent-weak); border-color: var(--accent-line); }
.lane-h { font-weight: 700; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent-text); }
.bcard { padding: 9px 11px; margin-bottom: 8px; cursor: grab; border-left: 3px solid #3b82f6; border-radius: 10px; background: var(--panel-2); }
.bcard:hover { border-color: var(--accent-line); }
.bcard.crit { border-left-color: var(--crit); }
.bprog { height: 4px; background: var(--line-strong); margin: 6px 0 3px; border-radius: 2px; overflow: hidden; }
.bprog div { height: 4px; background: var(--accent); }

/* ---------- dashboards, working time ---------- */
.dash .chart { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; max-width: 100%; }
.wt-grid { display: grid; grid-template-columns: repeat(7, 34px); gap: 3px; margin-top: 8px; text-align: center; font-size: 12px; font-family: var(--mono); }
.wt-day { padding: 6px 0; border: 1px solid var(--line); cursor: pointer; border-radius: 6px; }
.wt-day.off { background: var(--panel-2); color: var(--faint); }
.wt-day.hol { background: rgba(244, 63, 94, .14); color: var(--crit); text-decoration: underline; }
.wt-day:hover { outline: 2px solid var(--accent); }

/* ---------- File backstage ---------- */
#backstage { position: fixed; inset: 40px 0 0 0; z-index: 30; display: flex; background: var(--bg); background-image: radial-gradient(var(--dots) 1px, transparent 1px); background-size: 20px 20px; }
#backstage[hidden] { display: none; }
.bs-nav { width: 208px; background: linear-gradient(180deg, #174921, #133a1b 55%, #0d2612); color: #fff; display: flex; flex-direction: column; padding: 8px 0 12px; flex: none; border-right: 1px solid rgba(6, 78, 59, .6); }
:root[data-theme="light"] .bs-nav { background: #2e6f30; }
.bs-nav a { color: rgba(255, 255, 255, .9); padding: 9px 20px; cursor: pointer; font-size: 12.5px; font-weight: 500; text-decoration: none; border-left: 3px solid transparent; transition: background-color .12s; }
.bs-nav a:hover { background: rgba(0, 0, 0, .16); }
.bs-nav a.active { background: rgba(0, 0, 0, .26); font-weight: 600; border-left-color: #6ee7b7; color: #fff; }
.bs-nav a.dis { opacity: .4; cursor: default; }
.bs-nav a.bs-back { display: flex; align-items: center; gap: 10px; padding: 10px 18px 14px; font-size: 12px; opacity: .85; }
.bs-nav a.bs-back .ic { color: #fff; }
.bs-nav hr { border: 0; border-top: 1px solid rgba(255, 255, 255, .2); width: calc(100% - 28px); margin: 8px 14px; }
.bs-main { flex: 1; overflow: auto; padding: 32px 44px; }
.bs-main > * { max-width: 1040px; }
.bs-main h1 { font-weight: 300; font-size: 30px; letter-spacing: -.02em; margin: 0 0 24px; }
.bs-main h2 { font-weight: 600; font-size: 14px; margin: 30px 0 10px; }
.bs-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.bs-tile { min-height: 176px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 18px; cursor: pointer; text-align: center; color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.bs-tile b { font-size: 12.5px; font-weight: 600; }
.bs-tile .muted { font-size: 11px; line-height: 1.4; }
.bs-tile > .ic { box-sizing: content-box; padding: 12px; border-radius: 13px; background: color-mix(in srgb, currentColor 11%, transparent); border: 1px solid color-mix(in srgb, currentColor 32%, transparent); transition: transform .15s; }
.bs-tile:hover { border-color: var(--accent-line); box-shadow: 0 10px 30px rgba(16, 185, 129, .08); }
.bs-tile:hover > .ic { transform: scale(1.06); }
.bs-tile.ai-tile { background: linear-gradient(135deg, rgba(6, 78, 59, .38), var(--panel) 50%, rgba(49, 46, 129, .35)); border-color: var(--accent-line); }
:root[data-theme="light"] .bs-tile.ai-tile { background: linear-gradient(135deg, #ecfdf5, #fff 50%, #eef2ff); }
.bs-item { display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-radius: 12px; cursor: pointer; color: var(--text); text-decoration: none; }
.bs-item b { font-size: 12.5px; }
.bs-item .muted { font-size: 11.5px; }
.bs-item > span.muted { font-family: var(--mono); font-size: 11px; }
.bs-item > .ic { color: var(--t-emerald); }
.bs-item div { flex: 1; }
.bs-item:hover { background: var(--hover-row); }
.bs-btn { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; max-width: 560px; color: var(--text); text-decoration: none; margin-bottom: 6px; }
.bs-btn > .ic { box-sizing: content-box; padding: 9px; border-radius: 10px; background: color-mix(in srgb, currentColor 11%, transparent); }
.bs-btn:hover { border-color: var(--accent-line); background: var(--panel); }
.bs-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.menu { max-height: 70vh; overflow: auto; }

@media print {
  #titlebar, #rb-tabs, #ribbon, #statusbar, #backstage, #chat, .timeline, #detail { display: none !important; }
  body, html { overflow: visible; height: auto; background: #fff; }
  #main::before { display: none; }
  #main { padding-left: 0; background: none; }
  #sched-wrap { overflow: visible !important; }
}

#sched-wrap .s-left { overflow: hidden; }
.s-lin { will-change: transform; }
.s-split { position: absolute; top: 0; right: -2px; bottom: 0; width: 6px; cursor: col-resize; z-index: 8; background: transparent; }
.s-split:hover { background: var(--accent-line); }
.s-lin .rowid { position: relative; z-index: 3; }
/* frozen ID columns take the row's tint over an opaque base (views.js applyFrozen) */
#sched-wrap .s-row.wbs { --frz-tint: var(--wbs-row); } #sched-wrap .s-row.hlrow { --frz-tint: var(--hl-row); }
#sched-wrap .s-row.multi { --frz-tint: var(--multi); } #sched-wrap .s-row:hover { --frz-tint: var(--hover-row); }
#sched-wrap .s-row.sel, #sched-wrap .s-row.sel.wbs { --frz-tint: var(--sel); }

/* grid cell selection and in-place editing (MS Project) */
#sched-wrap .s-row [data-c] { position: relative; }
#sched-wrap .s-row .cellsel { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--panel); }
#sched-wrap .s-row .editing { padding: 0 !important; overflow: visible; outline: 2px solid var(--accent); outline-offset: -2px; background: var(--input-bg); z-index: 3; }
#sched-wrap .s-row .editing input.cell, #sched-wrap .s-row .editing select.cell { width: 100%; height: 100%; border: 0; outline: 0; padding: 0 4px; font: inherit; background: var(--input-bg); color: var(--text); box-sizing: border-box; box-shadow: none; border-radius: 0; }
#sched-wrap .s-row .editing .cell-dd { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 16px; padding: 0; border: 0; border-radius: 3px; background: var(--panel-2); color: var(--muted); font-size: 10px; cursor: pointer; }
#sched-wrap .s-row .editing .cell-pick { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; }
#sched-wrap .s-row .rowid { cursor: pointer; }

/* sign-in page */
#auth-form { border-radius: 18px; padding: 28px; box-shadow: var(--shadow-lg); }
#auth-form h2 { font-size: 20px; font-weight: 700; margin-bottom: 18px; }
#auth-form .auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
#auth-form .auth-brand .app-badge { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; }
#auth-form .auth-brand b { display: block; color: var(--accent-text); font-size: 12px; }
#auth-form .auth-brand span { display: block; color: var(--muted); font-size: 11px; }
#auth-form button { padding: 9px; background: linear-gradient(90deg, #1e62a8, #2574c4); border-color: transparent; font-weight: 600; }

/* over-allocation indicator (red person) and its status-bar counter */
.ind-oa { cursor: pointer; display: inline-flex; vertical-align: middle; }
.ind-oa:hover { filter: brightness(1.2); }
#statusbar a.sb-over { color: #e5484d; font-weight: 600; }

/* ---------- File > Options (MS Project layout: categories on the left) ---------- */
.opt-wrap { display: flex; gap: 16px; align-items: flex-start; max-width: 1040px; }
.opt-nav { width: 190px; flex: none; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px 0; position: sticky; top: 0; }
.opt-nav a { padding: 7px 14px; cursor: pointer; font-size: 12.5px; color: var(--text); border-left: 3px solid transparent; }
.opt-nav a:hover { background: var(--hover); }
.opt-nav a.on { background: var(--accent-weak); border-left-color: var(--accent); font-weight: 600; }
.opt-nav hr { border: 0; border-top: 1px solid var(--line); margin: 5px 10px; }
.opt-pane { flex: 1; min-width: 0; }
.opt-h { margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.opt-pane form > .opt-h:first-child, .opt-pane .opt-h:first-of-type { margin-top: 0; }
.opt-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.opt-row > span { flex: 0 0 auto; min-width: 150px; color: var(--text); }
.opt-row > select, .opt-row > input { flex: 1; min-width: 0; max-width: 340px; }
.opt-chk { display: flex; align-items: flex-start; gap: 7px; margin: 5px 0; color: var(--text); cursor: pointer; }
.opt-chk input { width: auto; margin-top: 2px; flex: none; }
.row .opt-chk { display: inline-flex; margin: 0 6px; }
.opt-note { font-size: 11.5px; margin: 4px 0 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 14px; }
.grid3 .opt-row > span { min-width: 60px; }
.opt-tree { columns: 2; column-gap: 24px; }
.opt-tab { break-inside: avoid; margin-bottom: 10px; }
.opt-groups { margin-left: 22px; }
.opt-qat { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; margin-bottom: 10px; }
.opt-qat select { width: 100%; }
.opt-qat-mid { display: flex; flex-direction: column; gap: 6px; padding-top: 70px; }
.qa-lab { gap: 4px; font-size: 11.5px; align-items: center; }
.qa-custom span { white-space: nowrap; }
#qa-below { display: flex; padding: 2px 8px; border-bottom: 1px solid var(--line); background: var(--bg); }
#qa-below #qa { border-right: 0; }
body.no-statusbar #statusbar { display: none; }
body.no-scrollbars * { scrollbar-width: none; }
body.no-scrollbars *::-webkit-scrollbar { display: none; }
@media (max-width: 760px) {
  .opt-wrap { flex-direction: column; }
  .opt-nav { width: 100%; flex-direction: row; flex-wrap: wrap; position: static; }
  .opt-nav hr { display: none; }
  .opt-row { flex-direction: column; align-items: stretch; }
  .opt-row > select, .opt-row > input { max-width: none; }
  .grid3, .opt-qat { grid-template-columns: 1fr; }
  .opt-tree { columns: 1; }
}

/* Resource & Cost Analysis */
.an-bar { flex-wrap: wrap; row-gap: 6px; }
.an-bar select { max-width: 340px; }
.an-seg { display: inline-flex; gap: 2px; margin: 0 6px 0 2px; }
.an-page { padding-top: 12px; }
.an-crumbs { font-size: 12px; color: var(--muted); }
.an-crumbs a, .an-tbl a { color: var(--accent-text); text-decoration: none; }
.an-crumbs a:hover, .an-tbl a:hover { text-decoration: underline; }
.an-title { margin: 2px 0 10px; }
.an-kpis { margin-bottom: 14px; }
.an-page h3 { margin: 18px 0 8px; }
.an-h { font-weight: 400; font-size: 12px; margin-left: 6px; }
.an-opts { gap: 6px; margin-bottom: 8px; flex-wrap: wrap; align-items: center; }
.an-opts label { display: inline-flex; flex-direction: row; gap: 6px; align-items: center; font-size: 12px; margin: 0 0 0 8px; white-space: nowrap; width: auto; }
.an-opts label input[type=checkbox] { width: auto; margin: 0; }
.an-ptbl td.an-cost { background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-position: right 8px bottom 3px; }
.an-scroll { max-height: 62vh; overflow: auto; }
.an-tbl { font-size: 12px; width: max-content; min-width: 100%; }
.an-tbl th { position: sticky; top: 0; z-index: 2; background: var(--panel-2); vertical-align: bottom; white-space: nowrap; }
.an-tbl td { white-space: nowrap; padding: 4px 8px; }
.an-tbl td.num { font-family: var(--mono); font-size: 11.5px; }
.an-sub { font-size: 10.5px; color: var(--muted); font-weight: 400; }
.an-ptbl tr.an-prow td { border-top: 1px solid var(--line); }
.an-ptbl tr.an-click { cursor: pointer; }
.an-ptbl tr.an-click:hover td { background: var(--panel-2); }
.an-ptbl tr.an-quiet td { color: var(--faint); }
.an-ptbl tr.an-arow td { background: var(--panel-3); font-size: 11.5px; }
.an-ptbl tr.an-arow td:first-child { padding-left: 26px; }
.an-tw { display: inline-block; width: 14px; color: var(--muted); }
.an-tbl tr.an-total td { font-weight: 700; border-top: 2px solid var(--line-strong); background: var(--wbs-row); position: sticky; bottom: 0; }
.an-tbl td.over { background: rgba(244, 63, 94, .15) !important; color: var(--crit); font-weight: 600; }
.an-tbl td.an-bad { color: var(--crit); font-weight: 600; }
.an-mtbl .an-fix { position: sticky; left: 0; z-index: 1; background: var(--panel); max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.an-mtbl th.an-fix { z-index: 3; background: var(--panel-2); }
.an-mtbl tr.an-total td.an-fix { background: var(--wbs-row); }
.an-res { white-space: normal !important; min-width: 240px; }
.an-res .pill { margin: 1px 0; }
.an-note { margin-top: 18px; font-size: 11.5px; max-width: 980px; }
@media print { .an-scroll { max-height: none; overflow: visible; } .an-bar { display: none; } }

/* AutoFilter: arrow on a column heading, its menu */
.hcol .af-btn { display: inline-block; margin-left: 4px; padding: 0 3px; border-radius: 4px; font-size: 10px; color: var(--muted); cursor: pointer; line-height: 14px; }
.hcol .af-btn:hover { background: var(--hover); color: var(--text); }
.hcol .af-btn.on { color: var(--accent-text); background: var(--accent-weak); }
.af-menu { min-width: 240px; max-width: 320px; padding: 8px; }
.af-menu > button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 5px 6px; font-weight: 400; }
.af-menu > button:hover { background: var(--hover); filter: none; }
.af-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.af-menu .af-q { width: 100%; margin: 2px 0 6px; }
.af-menu .af-list { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
.af-menu .af-list label { display: flex; align-items: center; gap: 6px; padding: 2px 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.af-menu .af-list input { width: auto; margin: 0; }
.af-menu .af-list .muted { margin-left: auto; font-size: 11px; }

/* Customize Ribbon tree: the selected tab / group / command */
.rb-tree { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.rb-node { border-radius: 5px; padding: 1px 4px; cursor: pointer; }
.rb-node.on { background: var(--accent-weak); outline: 1px solid var(--accent-line); }
.rb-node.rb-cmd { font-size: 12px; padding: 2px 6px; }
.opt-rb { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.2fr); }

/* File menu: quick access to recent projects */
.bs-nav .bs-recent a { font-size: 12px; font-weight: 400; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* View > Split View: Timeline / Details with the view each pane shows */
.rb-split label { justify-content: space-between; }
.rb-split select { width: 110px; margin-left: 6px; }
.rb-split select:disabled { opacity: .55; }
/* View > Window > Hide: the project window is hidden, the ribbon stays */
body.win-hidden #layout { display: none; }
#win-hidden { flex: 1; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--text-2); background: var(--bg-2, #e9ecef); min-height: 300px; }
#win-hidden[hidden] { display: none; }

/* ------------------------------------------------------------ Report > New Report: the report designer (report_design.js) */
.rd-wrap { flex: 1; min-height: 0; display: flex; }
.rd-scroll { flex: 1; min-width: 0; overflow: auto; background: var(--bg); padding: 28px 40px 60px; }
.rd-canvas { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .06); color: #000; user-select: none; }
.rd-item { position: absolute; box-sizing: border-box; cursor: move; }
.rd-item.rd-text, .rd-item.rd-shape { display: flex; }
.rd-item.rd-chart > svg, .rd-item.rd-image > img { display: block; width: 100%; height: 100%; }
.rd-item.rd-image > img { object-fit: fill; pointer-events: none; }
.rd-item.rd-shape { overflow: visible; }
.rd-item.rd-shape > svg { pointer-events: none; }
.rd-txt { position: relative; flex: 1; display: flex; flex-direction: column; padding: 4.8px 9.6px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.2; overflow: hidden; min-width: 0; }
.rd-txt.editing { cursor: text; outline: none; user-select: text; display: block; overflow: auto; }
.rd-ph { color: #a6a6a6; font-style: italic; }
.rd-item.rd-text:not(.sel):hover, .rd-item.rd-title:not(.sel) { outline: 1px solid #d0d0d0; }
.rd-item.sel { outline: 1px solid #7f7f7f; }
.rd-h { position: absolute; width: 9px; height: 9px; border: 1px solid #5f5f5f; background: #fff; border-radius: 50%; z-index: 5; box-sizing: border-box; }
.rd-h.nw { left: -5px; top: -5px; cursor: nwse-resize; } .rd-h.n { left: calc(50% - 5px); top: -5px; cursor: ns-resize; } .rd-h.ne { right: -5px; top: -5px; cursor: nesw-resize; }
.rd-h.e { right: -5px; top: calc(50% - 5px); cursor: ew-resize; } .rd-h.se { right: -5px; bottom: -5px; cursor: nwse-resize; } .rd-h.s { left: calc(50% - 5px); bottom: -5px; cursor: ns-resize; }
.rd-h.sw { left: -5px; bottom: -5px; cursor: nesw-resize; } .rd-h.w { left: -5px; top: calc(50% - 5px); cursor: ew-resize; }
.rd-side { position: absolute; right: -40px; top: -42px; display: flex; flex-direction: column; gap: 6px; z-index: 6; }
.rd-side button { width: 28px; height: 28px; padding: 3px; background: #fff; border: 1px solid #8a8a8a; border-radius: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.rd-side button:hover { background: #e8eef7; filter: none; }
.rd-brk { position: absolute; pointer-events: none; z-index: 900; }
.rd-brk.v { top: 0; bottom: 0; border-left: 1px dashed #7f7f7f; }
.rd-brk.h { left: 0; right: 0; border-top: 1px dashed #7f7f7f; }
.rd-tbl { border-collapse: collapse; width: 100%; table-layout: auto; color: #000; }
.rd-tbl th, .rd-tbl td { padding: 3px 6px; vertical-align: top; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.rd-tbl-load { padding: 10px; color: #7f7f7f; }
/* Field List pane */
.rd-pane { width: 270px; flex: none; border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.rd-pane[hidden] { display: none; }
.rd-pane-h { display: flex; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.rd-pane-b { padding: 8px 10px 14px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.rd-pane-note { margin: 0; font-size: 11px; }
.rd-cat { display: flex; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; flex: none; }
.rd-cat button { flex: 1; background: transparent; color: var(--text-2); border: 0; border-radius: 0; padding: 4px 6px; font-size: 11.5px; }
.rd-cat button + button { border-left: 1px solid var(--line-strong); }
.rd-cat button.on { background: var(--accent-weak); color: var(--accent-text); font-weight: 600; }
.rd-fq { width: 100%; flex: none; }
.rd-ftree { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; max-height: 260px; min-height: 120px; overflow: auto; background: var(--input-bg); flex: none; }
.rd-fg > a { display: block; font-weight: 600; cursor: pointer; padding: 3px 0; color: var(--text); }
.rd-fg label, .rd-side-pop label, .rd-hcats label { display: flex; align-items: center; gap: 6px; padding: 1px 0 1px 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.rd-fg input, .rd-side-pop input, .rd-pc input { width: auto; margin: 0; }
.rd-psec { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.rd-fsel { display: flex; flex-direction: column; gap: 2px; }
.rd-fs { display: flex; align-items: center; gap: 2px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 5px; background: var(--input-bg); }
.rd-fs span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-fs button { background: transparent; border: 0; color: var(--muted); padding: 0 4px; font-size: 10px; height: 18px; }
.rd-fs button:hover:not(:disabled) { color: var(--text); background: var(--hover); filter: none; }
.rd-pl { display: flex; flex-direction: column; gap: 2px; color: var(--text-2); font-size: 11.5px; }
.rd-pc { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 11.5px; }
/* popups and galleries */
.rd-pop { padding: 8px; max-height: 80vh; overflow: auto; }
.rd-pop-foot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; display: flex; justify-content: flex-end; }
.rd-pop-foot a { cursor: pointer; padding: 3px 6px; }
.rd-newgal { display: grid; grid-template-columns: repeat(2, 120px); gap: 10px; padding: 4px; }
.rd-newk { display: flex; flex-direction: column; align-items: center; gap: 4px; background: transparent; border: 1px solid transparent; padding: 6px; color: var(--text); border-radius: 6px; font-weight: 500; }
.rd-newk:hover { border-color: var(--accent-line); background: var(--hover); filter: none; }
.rd-gal-h { font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 2px; }
.rd-thg { display: grid; grid-template-columns: repeat(4, 96px); gap: 6px; }
.rd-thg button { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff; color: #000; border: 1px solid #ccc; border-radius: 4px; padding: 6px 4px; }
.rd-thg button span { font-size: 22px; line-height: 26px; }
.rd-thg button i, .rd-colg i { display: flex; gap: 1px; }
.rd-thg button i b { width: 12px; height: 6px; display: block; }
.rd-thg button small, .rd-efg small { font-size: 10px; color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.rd-thg button.on, .rd-efg button.on, .rd-csg button.on, .rd-ts.on { outline: 2px solid var(--accent); }
.rd-colg a, .rd-fontg a { display: flex; align-items: center; gap: 10px; padding: 3px 6px; cursor: pointer; border-radius: 4px; color: var(--text); white-space: nowrap; }
.rd-colg a:hover, .rd-fontg a:hover, .rd-ccrow:hover { background: var(--hover); }
.rd-colg a.on, .rd-fontg a.on, .rd-ccrow.on { background: var(--accent-weak); }
.rd-colg i b { width: 14px; height: 14px; display: block; border: 1px solid rgba(0, 0, 0, .15); }
.rd-fontg .rd-aa { font-size: 24px; width: 36px; text-align: center; border: 1px solid var(--line); background: #fff; color: #000; }
.rd-fontg a > span:last-child { display: flex; flex-direction: column; font-size: 12px; }
.rd-fontg small { color: var(--muted); font-size: 10px; }
.rd-efg { display: grid; grid-template-columns: repeat(4, 84px); gap: 6px; }
.rd-efg button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; background: #fff; border: 1px solid #ccc; border-radius: 4px; }
.rd-efg i { width: 34px; height: 24px; background: #4472C4; border-radius: 3px; display: block; }
.rd-shg { display: flex; flex-wrap: wrap; gap: 2px; }
.rd-shg button { width: 30px; height: 30px; padding: 2px; background: transparent; color: var(--text); border: 1px solid transparent; border-radius: 4px; }
.rd-shg button:hover { border-color: var(--accent-line); background: var(--hover); filter: none; }
.rd-csg { display: grid; grid-template-columns: repeat(4, auto); gap: 4px; }
.rd-csg.rb { grid-template-columns: repeat(8, auto); align-content: center; }
.rd-csg button { padding: 1px; background: transparent; border: 1px solid var(--line); border-radius: 3px; line-height: 0; }
.rd-csg.rb button svg { width: 46px; height: 30px; }
.rd-csg button:hover:not(:disabled) { border-color: var(--accent-line); filter: none; }
.rd-side-pop { display: flex; flex-direction: column; gap: 3px; min-width: 210px; }
.rd-side-pop > b { font-size: 11px; letter-spacing: .04em; margin-top: 4px; }
.rd-ccrow { display: flex; gap: 2px; padding: 3px 4px; cursor: pointer; border-radius: 4px; }
.rd-ccrow i { width: 16px; height: 12px; display: block; }
.rd-hcats { max-height: 220px; overflow: auto; }
.rd-qlg { display: grid; grid-template-columns: repeat(4, auto); gap: 4px; }
.rd-qlg button { padding: 1px; background: transparent; border: 1px solid var(--line); line-height: 0; }
/* colour picker */
.rd-cp { width: 230px; }
.rd-cp-h { font-size: 11px; font-weight: 700; color: var(--muted); margin: 4px 0 3px; }
.rd-cp-g { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px 4px; }
.rd-sw { width: 18px; height: 16px; padding: 0; border: 1px solid rgba(0, 0, 0, .18); border-radius: 0; cursor: pointer; }
.rd-sw:hover, .rd-sw.on { outline: 2px solid #f0a30a; filter: none; }
.rd-cp > a { display: block; padding: 4px 4px; cursor: pointer; color: var(--text); border-radius: 4px; }
.rd-cp > a:hover, .rd-cp-w a:hover { background: var(--hover); }
.rd-cp-w a { display: flex; align-items: center; gap: 8px; padding: 2px 4px; cursor: pointer; color: var(--text); border-radius: 4px; font-size: 11.5px; }
.rd-cp-w a.on { background: var(--accent-weak); }
.rd-cp-w i { width: 60px; display: block; }
/* ribbon parts of the report tabs */
.rd-ssg, .rd-wag, .rd-tsg { display: flex; align-items: center; gap: 4px; }
.rd-ss { width: 38px; height: 30px; font-size: 11px; border: 1.5px solid; border-radius: 3px; padding: 0; font-family: Calibri, "Segoe UI", sans-serif; }
.rd-wa { width: 36px; height: 40px; font-size: 30px; line-height: 30px; font-family: Calibri, "Segoe UI", sans-serif; background: transparent; border: 1px solid transparent; padding: 0; font-weight: 400; }
.rd-ss:hover, .rd-wa:hover { outline: 2px solid var(--accent-line); filter: none; }
.rd-more { height: 40px; width: 16px; padding: 0; background: transparent; border: 1px solid var(--line); color: var(--muted); font-size: 10px; border-radius: 4px; }
.rd-ts { display: flex; flex-direction: column; width: 44px; height: 38px; padding: 2px; background: #fff; border: 1px solid #ccc; border-radius: 3px; gap: 0; }
.rd-ts i { flex: 1; display: block; box-sizing: border-box; }
.rd-tsg + .rd-tsg { margin-top: 2px; }
.rd-topts { display: grid !important; grid-template-columns: auto auto; gap: 1px 12px; }
.rd-size input { width: 64px; height: 22px; padding: 0 4px; font-size: 11.5px; }
.rd-cursel select { width: 170px; }
.rd-font { gap: 4px !important; }
.rd-frow { display: flex; align-items: center; gap: 3px; }
.rd-frow select[data-rdf=font] { width: 150px; }
.rd-frow select[data-rdf=size] { width: 52px; }
.rd-frow select[data-rdf=valign] { width: 76px; }
/* Insert Chart / Change Chart Type */
.rd-ctd { display: flex; gap: 12px; min-height: 340px; }
.rd-ctd-l { display: flex; flex-direction: column; gap: 2px; width: 110px; border-right: 1px solid var(--line); padding-right: 8px; }
.rd-ctd-l a { padding: 5px 8px; cursor: pointer; border-radius: 5px; color: var(--text); }
.rd-ctd-l a:hover { background: var(--hover); }
.rd-ctd-r { flex: 1; max-height: 420px; overflow: auto; }
.rd-ctd-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.rd-ctd-row button { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 112px; padding: 6px; background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 6px; font-size: 11px; font-weight: 500; }
.rd-ctd-row button.on { border-color: var(--accent); background: var(--accent-weak); }
.rd-org { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; margin-bottom: 8px; }
.rd-org label { color: var(--text); gap: 8px; }
/* printing a report: its pages only */
#rd-print { display: none; }
@media print {
  body.rd-printing > *:not(#rd-print) { display: none !important; }
  body.rd-printing #rd-print { display: block; }
  .rd-ppage { position: relative; overflow: hidden; break-after: page; page-break-after: always; }
  .rd-ppage:last-child { break-after: auto; page-break-after: auto; }
  .rd-pin { position: absolute; }
  .rd-pin .rd-canvas { box-shadow: none; margin: 0; }
  .rd-pin .rd-item { outline: none !important; }
  .rd-ppage * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
