:root {
  --bg: #ffffff; --fg: #1d2330; --muted: #667085; --line: #e4e7ec; --soft: #f5f7fa; --panel: #ffffff;
  --accent: #1f6feb; --accent-soft: #dbe8ff; --bar: #4b8df8; --prog: #1b4fb8; --sum: #2b3445;
  --crit: #d92d20; --crit-bar: #f97066; --crit-soft: #fde4e1; --base: #b8bfcc; --sel: #fff6d6; --today: #f79009;
  --rowline: #f0f2f5; --odd: #fbfcfd; --we: #eef1f5; --text2: #344054; --text3: #475467; --link: #8a94a6;
  --drop-bg: #f7faff; --drop-line: #b2c6ee; --done: #12b76a; --shadow: 0 8px 24px rgba(16,24,40,.12);
  --row: 26px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1218; --fg: #e6e9ef; --muted: #98a2b3; --line: #2a303b; --soft: #171b23; --panel: #161a22;
    --accent: #5b9cff; --accent-soft: #1b2a44; --bar: #3d7ff0; --prog: #8db8ff; --sum: #c3cad6;
    --crit: #ff6b5e; --crit-bar: #c4473d; --crit-soft: #3a1f1d; --base: #59606d; --sel: #2d2a17; --today: #f7a53b;
    --rowline: #1d222b; --odd: #12161d; --we: #1a1f28; --text2: #cfd5df; --text3: #b4bcc9; --link: #6c7686;
    --drop-bg: #131a26; --drop-line: #34507f; --done: #32d583; --shadow: 0 8px 24px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1218; --fg: #e6e9ef; --muted: #98a2b3; --line: #2a303b; --soft: #171b23; --panel: #161a22;
  --accent: #5b9cff; --accent-soft: #1b2a44; --bar: #3d7ff0; --prog: #8db8ff; --sum: #c3cad6;
  --crit: #ff6b5e; --crit-bar: #c4473d; --crit-soft: #3a1f1d; --base: #59606d; --sel: #2d2a17; --today: #f7a53b;
  --rowline: #1d222b; --odd: #12161d; --we: #1a1f28; --text2: #cfd5df; --text3: #b4bcc9; --link: #6c7686;
  --drop-bg: #131a26; --drop-line: #34507f; --done: #32d583; --shadow: 0 8px 24px rgba(0,0,0,.5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; color: var(--fg); background: var(--bg); display: flex; flex-direction: column; }
a { color: var(--accent); }
.muted { color: var(--muted); }

.top { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--fg); text-decoration: none; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.badge.pro { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.btn { font: inherit; border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: 5px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.btn.ghost:hover { background: var(--soft); }

.landing { max-width: 760px; margin: 0 auto; padding: 48px 16px 24px; overflow: auto; flex: 1 1 auto; width: 100%; }
.landing h1 { font-size: 28px; line-height: 1.25; margin: 0 0 8px; }
.sub { color: var(--muted); font-size: 16px; margin: 0 0 24px; }
.drop { display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; text-align: center; border: 2px dashed var(--drop-line); background: var(--drop-bg); border-radius: 12px; padding: 48px 16px; cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { font-size: 17px; }
.drop span { color: var(--muted); font-size: 13px; }
.note { margin-top: 16px; padding: 12px; border-radius: 8px; background: var(--accent-soft); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.points { margin: 28px 0 0; padding-left: 18px; color: var(--text2); }
.points li { margin: 6px 0; }
.foot { margin-top: 40px; color: var(--muted); font-size: 13px; }

.viewer { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.title { display: flex; flex-direction: column; min-width: 0; }
.title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48vw; }
.title .muted { font-size: 12px; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tools input[type=search], .tools select { font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--fg); }
.tools input[type=search] { width: 180px; }
.chk { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; color: var(--text2); white-space: nowrap; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: 110%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 20; display: flex; flex-direction: column; min-width: 160px; padding: 4px; }
.menu-list button { font: inherit; color: var(--fg); text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.menu-list button:hover { background: var(--soft); }

.grid-wrap { flex: 1 1 auto; display: flex; min-height: 0; }
.table { flex: 0 0 46%; display: flex; flex-direction: column; min-width: 160px; overflow: hidden; }
.gantt { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.splitter { flex: 0 0 5px; cursor: col-resize; background: var(--line); }
.splitter:hover, .splitter:focus-visible { background: var(--accent); outline: none; }

.thead, .ghead { position: relative; height: 44px; flex: 0 0 44px; border-bottom: 1px solid var(--line); background: var(--soft); }
.th { position: absolute; top: 0; height: 44px; padding: 0 6px; display: flex; align-items: flex-end; padding-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--text3); border-right: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.tbody, .gbody { position: relative; flex: 1 1 auto; overflow: auto; }
.tbody { overflow-y: hidden; }
.spacer { width: 1px; }
.tr, .gr { position: absolute; left: 0; height: var(--row); border-bottom: 1px solid var(--rowline); }
.tr { width: 100%; min-width: var(--table-w, 958px); }
.tr.odd, .gr.odd { background: var(--odd); }
.gr { width: 100%; }
.tr.sel, .gr.sel { background: var(--sel); }
.tr.sum .td { font-weight: 600; }
.tr.crit .nm { color: var(--crit); }
.td { position: absolute; top: 0; height: var(--row); line-height: var(--row); padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; border-right: 1px solid var(--rowline); cursor: default; }
.td.num { text-align: right; color: var(--muted); }
.tog { width: 16px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); font-size: 11px; }
.tog-sp { display: inline-block; width: 16px; }
.ms-dot { color: var(--sum); font-size: 10px; margin-right: 4px; }

.tl-top, .tl-bot { position: absolute; left: 0; right: 0; height: 22px; }
.tl-top { top: 0; } .tl-bot { top: 22px; }
.tl-cell { position: absolute; top: 0; height: 22px; line-height: 22px; font-size: 12px; color: var(--text3); padding-left: 4px; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.tl-cell.sm { font-size: 11px; color: var(--muted); }
.tl-cell.we { background: var(--we); }
.ghead { overflow: visible; }
.gantt .ghead { will-change: transform; }

.bar, .sbar { position: absolute; top: 6px; height: 14px; border-radius: 3px; background: var(--bar); overflow: hidden; }
.bar .prog { height: 100%; background: var(--prog); }
.bar.crit { background: var(--crit-bar); } .bar.crit .prog { background: var(--crit); }
.sbar { top: 8px; height: 8px; background: var(--sum); border-radius: 1px; overflow: visible; }
.sbar::before, .sbar::after { content: ""; position: absolute; bottom: -5px; border: 5px solid transparent; border-top-color: var(--sum); }
.sbar::before { left: -5px; } .sbar::after { right: -5px; }
.sbar.crit { background: var(--crit); }
div.ms { position: absolute; top: 7px; width: 12px; height: 12px; background: var(--sum); transform: rotate(45deg); }
div.ms.crit { background: var(--crit); }
.base { position: absolute; top: 20px; height: 4px; background: var(--base); border-radius: 2px; }
.lbl { position: absolute; top: 0; line-height: var(--row); font-size: 11px; color: var(--muted); white-space: nowrap; }
.today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--today); opacity: .6; height: 100000px; pointer-events: none; }

.detail { position: fixed; right: 16px; bottom: 16px; width: min(400px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px; z-index: 15; }
.detail h3 { margin: 0 24px 10px 0; font-size: 15px; }
.detail h4 { margin: 12px 0 4px; font-size: 13px; }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.detail .notes { white-space: pre-wrap; font: inherit; font-size: 13px; background: var(--soft); padding: 8px; border-radius: 6px; margin: 0; }
.detail .x { position: absolute; right: 8px; top: 6px; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }

.overlay { position: fixed; inset: 0; background: color-mix(in srgb, var(--bg) 78%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 50; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; background: #1d2330; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 60; max-width: calc(100vw - 32px); }

dialog { border: 0; background: var(--panel); color: var(--fg); border-radius: 12px; padding: 0; box-shadow: 0 24px 48px rgba(16,24,40,.24); width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(16,24,40,.4); }
.dlg { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.dlg h2 { margin: 0; font-size: 19px; }
.dlg p { margin: 0; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plans.three { grid-template-columns: 1fr 1fr 1fr; }
.plan { position: relative; text-align: center; }
.plan .tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px; font-weight: 600; background: var(--accent); color: #fff; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
@media (max-width: 420px) { .plans.three { grid-template-columns: 1fr; } }
.plan { display: flex; flex-direction: column; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--fg); }
.plan b { font-size: 22px; }
.plan span { color: var(--muted); font-size: 12px; }
.plan.best { border-color: var(--accent); background: var(--drop-bg); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text2); }
.field input { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }
.row { display: flex; gap: 8px; justify-content: flex-end; }

.rate { position: fixed; left: 16px; bottom: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 36px 10px 14px; font-size: 13px; z-index: 14; max-width: calc(100vw - 32px); }
.rate .x { position: absolute; right: 6px; top: 4px; border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
#print-view { display: none; }
@media print {
  @page { size: landscape; margin: 10mm; }
  body.printing > *:not(#print-view) { display: none !important; }
  body.printing #print-view { display: block; }
  #print-view h1 { font-size: 16px; margin: 0 0 2px; }
  #print-view p { font-size: 11px; margin: 0 0 8px; }
  #print-view table { border-collapse: collapse; width: 100%; font-size: 10px; }
  #print-view th, #print-view td { border-bottom: 1px solid #ddd; padding: 2px 4px; text-align: left; white-space: nowrap; }
  #print-view td:nth-child(2) { white-space: normal; max-width: 70mm; }
  #print-view tr.sum td { font-weight: 700; }
  #print-view .num { text-align: right; }
  #print-view .gcell { position: relative; width: 45%; min-width: 80mm; }
  #print-view .pbar, #print-view .psum { position: absolute; top: 4px; height: 7px; background: #4b8df8; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print-view .psum { background: #2b3445; height: 4px; top: 5px; }
  #print-view .pbar.crit { background: #d92d20; }
  #print-view .pms { position: absolute; top: 3px; width: 7px; height: 7px; background: #2b3445; transform: rotate(45deg); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print-view tr { page-break-inside: avoid; }
  #print-view thead { display: table-header-group; }
  #print-view .ghead-p { height: 16px; }
  #print-view .tick { position: absolute; top: 2px; font-size: 8px; font-weight: 400; color: #555; border-left: 1px solid #bbb; padding-left: 2px; white-space: nowrap; }
  #print-view .pbar { overflow: hidden; border-radius: 1px; }
  #print-view .pprog { height: 100%; background: #1b4fb8; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print-view .pbase { position: absolute; top: 11px; height: 2px; background: #999; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print-view .pfoot { margin-top: 8px; font-size: 9px; color: #777; }
  body.printing { display: block; background: #fff; color: #000; }
}

/* ---- v2 additions ---- */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--soft); color: var(--fg); }
.btn.small { padding: 3px 9px; font-size: 13px; }
.btn:focus-visible, .icon-btn:focus-visible, .tabs button:focus-visible, .drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop { transition: border-color .15s, background .15s; }
.drop:hover { border-color: var(--accent); }
.drop-ico { color: var(--accent); margin-bottom: 4px; }
.formats b { color: var(--fg); font-weight: 600; margin-left: 6px; }
.formats b:first-child { margin-left: 0; }
.or { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.subbar { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--soft); }
.tabs { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.tabs button { font: inherit; font-size: 13px; border: 0; background: none; color: var(--muted); padding: 4px 12px; border-radius: 6px; cursor: pointer; }
.tabs button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg { display: inline-flex; gap: 4px; align-items: center; }
.grid-wrap.table-only .splitter, .grid-wrap.table-only .gantt { display: none; }
.grid-wrap.table-only .table { flex: 1 1 auto; }
.grid-wrap.table-only .tbody { overflow-y: auto; }
.empty { padding: 24px; color: var(--muted); text-align: center; position: relative; }
.bar.done { background: var(--done); } .bar.done .prog { background: var(--done); }
.status { position: absolute; top: 0; width: 0; border-left: 2px dotted var(--accent); opacity: .7; height: 100000px; pointer-events: none; }
.links { position: absolute; left: 0; overflow: visible; pointer-events: none; z-index: 1; }
.links .link { fill: none; stroke: var(--link); stroke-width: 1.2; }
.links .link.crit { stroke: var(--crit); }
.links .arrow-head { fill: var(--link); }
.gr .bar, .gr .sbar, .gr .ms, .gr .lbl { z-index: 2; }
.linkbtn { font: inherit; background: none; border: 0; padding: 1px 0; color: var(--accent); cursor: pointer; text-align: left; }
.linkbtn:hover { text-decoration: underline; }
.rel { font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.pane { flex: 1 1 auto; overflow: auto; padding: 12px 16px 24px; min-height: 0; }
.hint { margin: 0 0 8px; font-size: 13px; }
.rtable { border-collapse: collapse; width: 100%; font-size: 13px; }
.rtable th { text-align: left; font-size: 12px; color: var(--text3); font-weight: 600; background: var(--soft); position: sticky; top: 0; }
.rtable th, .rtable td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rtable td.num { text-align: right; }
.rtable tbody tr:hover { background: var(--soft); }
.cal-nav { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.cal-nav strong { min-width: 130px; text-align: center; font-size: 16px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-h { font-size: 12px; color: var(--muted); padding: 4px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--soft); }
.cal-d { min-height: 108px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-d.out { background: var(--soft); opacity: .6; }
.cal-d.we { background: var(--odd); }
.cal-d.today-d .cal-n { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 6px; align-self: flex-start; }
.cal-n { font-size: 12px; color: var(--muted); }
.cal-t { font: inherit; font-size: 12px; text-align: left; border: 0; border-left: 3px solid var(--bar); background: var(--accent-soft); color: var(--fg); padding: 1px 4px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-t.ms { border-left-color: var(--sum); background: var(--soft); }
.cal-t.crit { border-left-color: var(--crit); background: var(--crit-soft); }
.cal-more { font: inherit; font-size: 11px; color: var(--accent); background: none; border: 0; text-align: left; padding: 0 4px; cursor: pointer; }
.cols-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.keys dt { font-family: ui-monospace, Menlo, monospace; background: var(--soft); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; justify-self: start; }
.keys dd { margin: 0; }
.toast { box-shadow: var(--shadow); }
body.dragging .viewer::after { content: "Drop to open"; position: fixed; inset: 12px; border: 3px dashed var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--bg) 80%, transparent); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; color: var(--accent); z-index: 40; pointer-events: none; }

.net-pane { padding: 0; display: flex; flex-direction: column; }
.net-pane:not([hidden]) { display: flex; }
.net-bar { display: flex; gap: 6px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.net-wrap { flex: 1 1 auto; overflow: auto; min-height: 0; background: var(--odd); }
.net .node rect { fill: var(--panel); stroke: var(--bar); stroke-width: 1.5; }
.net .node.ms rect { stroke: var(--sum); }
.net .node.done rect { stroke: var(--done); }
.net .node.crit rect { stroke: var(--crit); stroke-width: 2.5; fill: var(--crit-soft); }
.net .node.sel rect { fill: var(--sel); }
.net .node rect.pc { fill: var(--prog); stroke: none; }
.net .node { cursor: pointer; }
.net .node:focus { outline: none; } .net .node:focus rect { stroke: var(--accent); stroke-width: 3; }
.net .nt { font-size: 12px; font-weight: 600; fill: var(--fg); }
.net .nd { font-size: 11px; fill: var(--muted); }
.net .link { fill: none; stroke: var(--link); stroke-width: 1.3; }
.net .link.crit { stroke: var(--crit); stroke-width: 2; }
.net .arrow-head { fill: var(--link); }
.load-wrap { overflow: auto; max-height: calc(100vh - 240px); border: 1px solid var(--line); border-radius: 8px; }
.ltable { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.ltable th, .ltable td { padding: 4px 6px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--rowline); white-space: nowrap; text-align: center; min-width: 46px; }
.ltable thead th { position: sticky; top: 0; background: var(--soft); color: var(--text3); font-weight: 600; z-index: 1; }
.ltable .lname { position: sticky; left: 0; background: var(--panel); text-align: left; min-width: 160px; z-index: 2; }
.ltable thead .lname { z-index: 3; background: var(--soft); }
.ltable td.on { background: color-mix(in srgb, var(--bar) calc(var(--a) * 45%), transparent); }
.ltable td.over { background: var(--crit-soft); color: var(--crit); font-weight: 700; }

@media (max-width: 720px) {
  .table { flex-basis: 55%; }
  .tools input[type=search] { width: 120px; }
  .title strong { max-width: 90vw; }
  .landing h1 { font-size: 22px; }
  .landing { padding-top: 28px; }
  .toolbar, .subbar { padding: 6px 8px; }
  .subbar .chk { font-size: 12px; }
  .cal-d { min-height: 72px; }
  .cal-t { font-size: 10px; }
  .tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs button { padding: 4px 9px; white-space: nowrap; flex: none; }
  .detail { right: 8px; left: 8px; bottom: 8px; width: auto; max-height: 55vh; }
}

/* language picker, free trial, right-to-left languages */
.lang { font: inherit; font-size: 13px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); max-width: 150px; }
.trial-left { margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 14px; }
.trial-left:empty { display: none; }
[dir="rtl"] .grid-wrap, [dir="rtl"] .net-wrap, [dir="rtl"] .load-wrap, [dir="rtl"] #print-view .pgantt, [dir="rtl"] .tl-row { direction: ltr; }
[dir="rtl"] .grid-wrap .td, [dir="rtl"] .grid-wrap .th, [dir="rtl"] .ltable td.lname { unicode-bidi: plaintext; text-align: start; }
[dir="rtl"] .grid-wrap .td.num { text-align: right; }
[dir="rtl"] .detail { left: 16px; right: auto; }
[dir="rtl"] .detail .x { left: 8px; right: auto; }
[dir="rtl"] .detail h3 { margin: 0 0 10px 24px; }
@media (max-width: 640px) { .lang { max-width: 72px; padding: 3px 2px; } .top .badge { display: none; } .top-actions { gap: 6px; } }
[dir="rtl"] .tl-cell, [dir="rtl"] .lbl, [dir="rtl"] .net text { unicode-bidi: plaintext; }
.ai-link { margin: 18px 0 0; font-size: 14px; } .ai-link a { color: var(--accent); }

/* install button on the landing page (shown when the Marketplace URL is configured) */
.install { margin: 14px 0 0; }
.install .btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; font-size: 15px; text-decoration: none; }
/* language picker: globe + select; on phones only the globe shows, the select sits invisibly on top */
.lang-wrap { position: relative; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.lang-ico { flex: 0 0 auto; }
@media (max-width: 640px) {
  .lang-wrap { width: 32px; height: 32px; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
  .lang-wrap .lang { position: absolute; inset: 0; width: 100%; max-width: none; opacity: 0; cursor: pointer; }
  .top { gap: 10px; padding: 8px 12px; }
  .brand { white-space: nowrap; min-width: 0; font-size: 15px; overflow: hidden; }
  .brand-name { overflow: hidden; text-overflow: ellipsis; }
  .brand img { flex: 0 0 auto; }
  #btn-help { display: none; } /* keyboard shortcuts: not useful on phones */
}
.foot-extra { margin: 6px 0 0; font-size: 12px; color: var(--muted); } .foot-extra a { color: inherit; }
