/* ============================================================================
   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-gallery { display: grid; grid-template-columns: repeat(4, 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.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; }
.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); }
.rsheet { width: max-content; font-size: 12.5px; }
.rsheet td { cursor: default; height: 26px; }
.rsheet tr.sel td { background: var(--sel); }

/* ---------- 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-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-bar { position: absolute; height: 20px; background: #3b82f6; border: 1px solid rgba(255, 255, 255, .25); border-radius: 4px; font-size: 11px; line-height: 13px; padding: 2px 5px; overflow: hidden; cursor: grab; color: #fff; }
.tp-bar span { position: relative; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.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; }

/* 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; }
