/* Marathi and Hindi text (Noto Sans Devanagari, SIL Open Font License: fonts/OFL-Noto.txt) */
@font-face { font-family: "Noto Sans Devanagari"; src: url("fonts/NotoSansDevanagari-Regular.ttf") format("truetype"); font-display: swap; }
/* Kraftoz Naksha: the same look as Kraftoz (colours, toolbox, docker, dialogs). */
:root {
  --bg: #e6e8ec;
  --panel: #f5f6f8;
  --panel-2: #ffffff;
  --border: #c9cdd4;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #1473e6;
  --accent-soft: #dbeafe;
  --hover: #e3e8f0;
  --menubar: #2b2f36;
  --menubar-text: #e5e7eb;
  --ok: #15803d;
  --bad: #b91c1c;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font: 12px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  user-select: none;
}
.hidden { display: none !important; }

#app { display: grid; height: 100vh; grid-template-rows: auto minmax(0, 1fr) auto auto; }

/* ---------- menu bar ---------- */
#menubar {
  display: flex; align-items: center; gap: 2px;
  background: var(--menubar); color: var(--menubar-text);
  height: 30px; padding: 0 8px;
}
.brand { display: flex; align-items: center; gap: 7px; font-weight: 700; letter-spacing: .3px; margin-right: 8px; white-space: nowrap; flex: none; }
#menubar > button, .menu > button { white-space: nowrap; flex: none; }
@media (max-width: 900px) { .brand-name { display: none; } }
.logo { width: 18px; height: 18px; background: url(logo-small.svg) center / contain no-repeat; }
#menubar button {
  height: 100%; padding: 0 10px; background: none; border: 0; color: inherit; font: inherit; cursor: default;
}
#menubar button:hover:not(:disabled) { background: #3d434d; }
#menubar button:disabled { opacity: .4; }
.menu { position: relative; height: 100%; }
.menu-list {
  display: none; position: absolute; top: 100%; left: 0; z-index: 50; min-width: 220px;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 4px 0; border-radius: 0 0 6px 6px;
}
.menu.open > .menu-list { display: block; }
.menu.open > button { background: #3d434d; }
.menu-item { display: flex; justify-content: space-between; gap: 24px; padding: 5px 14px; cursor: default; white-space: nowrap; }
.menu-item:hover { background: var(--accent); color: #fff; }
.menu-item .key { color: var(--muted); }
.menu-item:hover > .key { color: #dbeafe; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.menu-item .alias { color: var(--muted); font-size: 11px; }
.menu-item:hover > .alias { color: #dbeafe; }
.menu-item.has-sub { position: relative; }
.menu-item.has-sub::after { content: "▸"; color: var(--muted); }
.menu-item.has-sub:hover::after { color: #fff; }
.menu-list.submenu { top: -5px; left: 100%; border-radius: 6px; }
.menu-item.has-sub:hover > .menu-list.submenu { display: block; }
.help-list { max-height: 60vh; overflow-y: auto; display: grid; grid-template-columns: auto auto 1fr; gap: 3px 14px; font-size: 12px; }
.help-list b { font-family: ui-monospace, Menlo, Consolas, monospace; }
.doc-title { margin-left: auto; color: #9ca3af; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- workspace: toolbox, canvas, docker ---------- */
#workspace { display: grid; min-height: 0; grid-template-columns: 44px minmax(0, 1fr) 44px 250px; }
#menus { display: flex; height: 100%; }
.toolbar {
  background: var(--panel);
  display: flex; flex-direction: column; align-items: center; padding: 6px 0; gap: 2px; overflow-y: auto;
}
#toolbox { border-right: 1px solid var(--border); }
#modbox { border-left: 1px solid var(--border); }
.toolbar .tsep { width: 26px; height: 1px; background: var(--border); margin: 3px 0; }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 32px; padding: 0;
  border: 1px solid transparent; border-radius: 5px; background: none; color: var(--text); cursor: default;
}
.icon-btn:hover { background: var(--hover); border-color: var(--border); }
.icon-btn.active { background: var(--accent-soft); border-color: var(--accent); }
.icon-btn:disabled { opacity: .35; }
.icon-btn svg { width: 20px; height: 20px; }

#canvas-wrap { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#canvas { position: absolute; inset: 0 0 26px 0; width: 100%; height: calc(100% - 26px); display: block; cursor: none; touch-action: none; }
/* Model and layout tabs, along the bottom of the drawing (as AutoCAD) */
#layout-tabs { position: absolute; left: 0; right: 0; bottom: 0; height: 26px; display: flex; align-items: stretch; gap: 1px; padding: 0 6px; background: var(--panel); border-top: 1px solid var(--border); overflow-x: auto; }
#layout-tabs button { border: none; background: none; padding: 0 12px; font: inherit; font-size: 12px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
#layout-tabs button:hover { background: var(--hover); color: var(--text); }
#layout-tabs button.on { color: var(--text); font-weight: 600; background: var(--panel-2); border-bottom-color: var(--accent); }
#layout-tabs .add { font-size: 15px; padding: 0 9px; }
.ctx-menu { position: fixed; z-index: 50; min-width: 170px; padding: 4px 0; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.ctx-menu div { padding: 5px 14px; cursor: default; }
.ctx-menu div:hover { background: var(--accent); color: #fff; }
.ctx-menu hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.tb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.tb-grid .row > span:first-child { width: 96px; }


#docker { background: var(--panel); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
#docker .tabs { display: flex; border-bottom: 1px solid var(--border); }
#docker .tabs button {
  flex: 1; padding: 7px 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; cursor: default;
}
#docker .tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-body { flex: 1; overflow-y: auto; padding: 10px; }

.section { margin-bottom: 16px; }
.section h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.row > span:first-child { width: 78px; color: var(--muted); flex: none; }
.row input, .row select {
  flex: 1; min-width: 0; height: 24px; border: 1px solid var(--border); border-radius: 4px; font: inherit; padding: 0 4px;
  background: var(--panel-2); color: var(--text);
}
.row input:focus, .row select:focus { outline: none; border-color: var(--accent); }
.row .val { flex: 1; min-width: 0; padding: 0 5px; font-variant-numeric: tabular-nums; }
.row .sw { width: 14px; height: 14px; border: 1px solid rgba(0,0,0,.35); flex: none; }
.props-head { font-weight: 600; margin-bottom: 10px; }
.hint { color: var(--muted); font-size: 11px; line-height: 1.5; }

/* ---------- layers ---------- */
.om-tools { display: flex; gap: 2px; margin-bottom: 8px; }
.om-tools .icon-btn { width: 28px; height: 26px; }
.om-tools .icon-btn svg { width: 16px; height: 16px; }
.layer-list { margin-bottom: 14px; }
.layer-row {
  display: flex; align-items: center; gap: 4px; padding: 3px 4px; border-radius: 4px; margin-top: 2px;
  border: 1px solid transparent;
}
.layer-row:hover { background: var(--hover); }
.layer-row.picked { background: var(--accent-soft); border-color: #93c5fd; }
.layer-row .cur { width: 16px; height: 16px; border: 0; background: none; padding: 0; color: var(--ok); display: grid; place-items: center; }
.layer-row .cur svg { width: 14px; height: 14px; }
.layer-row .cur:not(.on) svg { opacity: 0; }
.layer-row:hover .cur:not(.on) svg { opacity: .3; color: var(--muted); }
.layer-row .sw { width: 13px; height: 13px; border: 1px solid rgba(0,0,0,.35); flex: none; }
.layer-row .lname { flex: 1; min-width: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.layer-row.current .lname::after { content: " (current)"; color: var(--accent); font-weight: 400; font-size: 11px; }
.layer-row .lname input { width: 100%; height: 20px; font: inherit; border: 1px solid var(--accent); border-radius: 3px; padding: 0 3px; }
.layer-row .count { color: var(--muted); font-size: 11px; }
.layer-row .flag { width: 20px; height: 20px; border: 0; background: none; padding: 0; opacity: .75; cursor: pointer; color: var(--text); display: grid; place-items: center; }
.layer-row .flag.off { opacity: .25; }
.layer-row .flag svg { width: 15px; height: 15px; }
.layer-row.dim .lname { color: var(--muted); font-style: italic; }

/* ---------- command line ---------- */
#cmdline { background: var(--panel-2); border-top: 1px solid var(--border); font-family: ui-monospace, Menlo, Consolas, monospace; }
#history { height: 54px; overflow-y: auto; padding: 3px 8px 0; color: var(--muted); white-space: pre-wrap; user-select: text; }
.cmd-row { display: flex; align-items: center; gap: 8px; padding: 3px 8px 4px; }
#prompt { white-space: nowrap; }
#cmd { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 3px; padding: 3px 6px; font: inherit; color: var(--text); background: var(--panel-2); }
#cmd:focus { outline: none; border-color: var(--accent); }

/* ---------- status bar ---------- */
#statusbar {
  display: flex; min-width: 0; overflow: hidden; align-items: center; gap: 10px; height: 26px; padding: 0 8px;
  background: var(--panel); border-top: 1px solid var(--border); color: var(--muted);
}
#statusbar > * { flex: none; white-space: nowrap; }
#coords { font-variant-numeric: tabular-nums; color: var(--text); min-width: 170px; }
#statusbar .engine { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tog { height: 20px; padding: 0 7px; border: 1px solid transparent; border-radius: 4px; background: none; font: inherit; font-weight: 600; font-size: 11px; color: var(--muted); cursor: default; }
.tog:hover { background: var(--hover); }
.tog.on { color: var(--accent); background: var(--accent-soft); border-color: #93c5fd; }
#statusbar .spacer { flex: 1 1 0; }
.engine.ok { color: var(--ok); }
.engine.bad { color: var(--bad); }

/* ---------- dialogs (as in Kraftoz) ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); display: grid; place-items: center; z-index: 200; }
.modal { background: var(--panel-2); border-radius: 10px; padding: 18px 20px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal h3 { margin: 0 0 14px; font-size: 15px; }
.modal .row > span:first-child { width: 100px; }
.dlg-text { white-space: pre-line; line-height: 1.5; }
.modal-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.modal-btns button { padding: 6px 16px; border: 1px solid var(--border); border-radius: 5px; background: #fff; font: inherit; }
.modal-btns button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.modal.wide { width: min(760px, calc(100vw - 32px)); }
.plot-body { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; }
.plot-body .row > span:first-child { width: 86px; }
.plot-body select, .plot-body input[type=number] { flex: 1; min-width: 0; }
.plot-prev { background: #e5e7eb; border-radius: 6px; min-height: 280px; position: relative; }
.plot-prev canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.plot-info { margin-top: 8px; line-height: 1.5; }
.plot-info .warn { color: #b45309; }
.check { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.snap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; margin-bottom: 8px; }
.pat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-bottom: 12px; }
.pat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font: inherit; font-size: 11px; cursor: pointer; }
.pat canvas { width: 96px; height: 56px; border: 1px solid #e5e7eb; }
.pat:hover { background: var(--hover); }
.pat.on { border-color: var(--accent); background: var(--accent-soft); }
.aci-grid { display: grid; grid-template-columns: repeat(24, 1fr); gap: 1px; margin: 8px 0 4px; }
.aci-grid button { aspect-ratio: 1; border: 1px solid rgba(0,0,0,.25); padding: 0; cursor: pointer; min-width: 0; }
.aci-grid.aci-std { grid-template-columns: repeat(16, 1fr); width: 66%; margin-top: 10px; }
.aci-grid button.on { outline: 2px solid var(--accent); outline-offset: 1px; }

@media (max-width: 760px) {
  #workspace { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  #docker { display: none; }
}

/* Insert dialog: the block's preview */
.ins-preview { margin: 4px 0 10px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; line-height: 0; }
.ins-preview canvas { width: 100%; height: auto; display: block; }
.row button { flex: none; }

/* First start: millimetres or feet and inches */
.units-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.units-pick button { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); font: inherit; text-align: left; cursor: pointer; }
.units-pick button:hover { border-color: var(--accent); background: var(--accent-soft); }
.units-pick b { font-size: 15px; }
.units-pick span { color: var(--muted); font-size: 12px; }

/* Sanction check report */
.check-table { max-height: 52vh; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.check-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.check-table th, .check-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.check-table th { position: sticky; top: 0; background: var(--panel); font-weight: 600; }
.check-table td.st { font-weight: 700; white-space: nowrap; }
.check-table td.ok { color: var(--ok); }
.check-table td.bad { color: var(--bad); }
.hint .warn { color: #b45309; font-weight: 600; }

/* Blocks library tab */
#tab-library select { width: 100%; margin-bottom: 8px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
.lib-item { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 4px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-2); font: inherit; font-size: 11px; cursor: pointer; text-align: center; }
.lib-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.lib-item canvas { width: 100%; height: auto; border-radius: 4px; }

/* Bill of quantities */
.boq-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.boq-opts .row > span:first-child { width: 110px; }
.boq-table td.num, .boq-table th.num { text-align: right; white-space: nowrap; }
.boq-table input { width: 90px; text-align: right; padding: 2px 4px; border: 1px solid var(--border); border-radius: 4px; font: inherit; }
.boq-table i.sample { display: block; font-size: 10px; color: #b45309; }
.boq-table tr.total td { font-weight: 700; }

/* ---------- start-up splash (as Kraftoz's): a drawing made in Kraftoz Naksha ---------- */
#splash { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: var(--bg); transition: opacity .4s ease; }
#splash.done { opacity: 0; pointer-events: none; }
#splash.ready { cursor: pointer; }
#splash.ready #splash-status { color: #e2e8f0; }
.splash-card { position: relative; width: min(760px, 100%); aspect-ratio: 5 / 3; border-radius: 14px; overflow: hidden; background: #0b1120; box-shadow: 0 24px 60px rgba(15, 23, 42, .35), 0 2px 8px rgba(15, 23, 42, .2); animation: splash-in .5s ease both; }
.splash-card img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.splash-head { position: absolute; left: 6%; top: 8%; color: #fff; text-shadow: 0 2px 12px rgba(2, 6, 23, .6); }
.splash-title { display: flex; align-items: center; gap: 12px; font: 700 clamp(28px, 6vw, 46px)/1.1 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: -.02em; }
.splash-title .logo { background-image: url(logo.svg); width: clamp(30px, 5.5vw, 46px); height: clamp(30px, 5.5vw, 46px); filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
.splash-tag { margin-top: 8px; font: 400 clamp(12px, 2vw, 15px)/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; color: #cbd5e1; max-width: 34ch; }
.splash-card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26%; background: linear-gradient(to top, rgba(2, 6, 23, .75), rgba(2, 6, 23, 0)); pointer-events: none; }
.splash-foot { position: absolute; z-index: 1; left: 6%; right: 6%; bottom: 6%; color: #94a3b8; font: 400 12px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
.splash-bar { height: 3px; border-radius: 3px; background: rgba(148, 163, 184, .25); overflow: hidden; margin-bottom: 8px; }
.splash-bar i { display: block; height: 100%; width: 35%; border-radius: 3px; background: linear-gradient(90deg, #fb923c, #a3e635, #22d3ee, #a855f7); animation: splash-run 1.3s ease-in-out infinite; }
.splash-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#splash.failed .splash-bar { display: none; }
#splash.failed #splash-status { color: #fecaca; }
/* Narrow screens: the title above the picture, the status below it. */
@media (max-width: 560px) {
  .splash-card { aspect-ratio: auto; display: flex; flex-direction: column; }
  .splash-card img { position: static; height: auto; order: 1; }
  .splash-head { position: static; order: 0; padding: 22px 20px 16px; }
  .splash-foot { position: static; order: 2; padding: 14px 20px 18px; }
  .splash-card::after { display: none; }
}
@keyframes splash-run { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@keyframes splash-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .splash-bar i, .splash-card { animation: none; } #splash { transition: none; } }

/* Point Style (DDPTYPE) */
.pt-grid { display: grid; grid-template-columns: repeat(5, 44px); gap: 6px; margin-bottom: 12px; }
.pt-cell { width: 44px; height: 40px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; color: inherit; cursor: pointer; padding: 0; }
.pt-cell.on { border-color: var(--accent); background: rgba(76,141,255,.18); }

/* Multiline text editor */
.mtext-area { width: 100%; box-sizing: border-box; min-height: 120px; resize: vertical; font: 14px/1.45 Arial, "Noto Sans Devanagari", sans-serif; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-2); color: var(--text); margin-top: 6px; }

/* Text Style and Find dialogs */
.style-grid { display: grid; grid-template-columns: 170px 1fr; gap: 16px; }
.style-grid select[size] { width: 100%; height: 160px; }
.modal-btns.left { justify-content: flex-start; flex-wrap: wrap; }
.style-sample { margin-top: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 26px; white-space: nowrap; overflow: hidden; }
.style-sample span { display: inline-block; transform-origin: left center; }
.find-list { max-height: 180px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; margin: 8px 0; }
.find-list:empty { display: none; }
.find-row { display: grid; grid-template-columns: 90px 1fr 90px; gap: 8px; padding: 4px 8px; font-size: 12px; cursor: default; }
.find-row:hover { background: var(--hover); }
.find-row.on { background: var(--accent-soft); }
.find-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.find-row i { color: var(--muted); font-style: normal; overflow: hidden; text-overflow: ellipsis; }

/* Layer states, dynamic input */
.ls-list { width: 100%; height: 150px; }
#dyn { position: absolute; z-index: 5; display: none; gap: 4px; align-items: center; pointer-events: none; font: 12px system-ui, sans-serif; white-space: nowrap; }
#dyn .dyn-p { background: rgba(43,47,54,.92); color: #e5e7eb; padding: 2px 6px; border-radius: 3px; }
#dyn .dyn-in { background: #fff; color: #111; border: 1px solid #8fb4ff; padding: 1px 6px; border-radius: 3px; min-width: 40px; }

/* 3D view (3DORBIT) */
#v3d { position: absolute; inset: 0; z-index: 8; display: grid; grid-template-rows: auto 1fr; background: #2b3038; }
.v3d-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.v3d-bar .spacer { flex: 1; }
.v3d-bar .check { margin: 0; }
.v3d-sun { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted, #64748b); }
.v3d-sun[hidden] { display: none; }
.v3d-sun input { width: 80px; }
.v3d-canvas { width: 100%; height: 100%; display: block; min-height: 0; cursor: grab; touch-action: none; }
.v3d-canvas:active { cursor: grabbing; }
.v3d-side { position: absolute; right: 10px; top: 52px; width: 250px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.v3d-side.hidden { display: none; }
.v3d-side h4 { margin: 0 0 6px; }
.v3d-side .row input { width: 80px; }
.v3d-info { position: absolute; left: 10px; bottom: 34px; padding: 4px 8px; border-radius: 4px; background: rgba(20,22,26,.75); color: #e5e7eb; font: 12px system-ui, sans-serif; pointer-events: none; max-width: calc(100% - 20px); }
@media (max-width: 560px) { .v3d-side { left: 10px; right: 10px; width: auto; } }
.v3d-cube { position: absolute; right: 12px; top: 52px; width: 120px; height: 120px; cursor: pointer; }

/* External References palette */
.xr-attach, .xr-btns { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.xr-btns { margin: 10px 0 6px; }
.xr-wrap { max-height: 240px; overflow: auto; border: 1px solid var(--line, rgba(127,127,127,.3)); border-radius: 6px; }
.xr-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.xr-table th { text-align: left; font-weight: 600; padding: 6px 8px; position: sticky; top: 0; background: var(--panel-2); border-bottom: 1px solid var(--line, rgba(127,127,127,.3)); }
.xr-table td { padding: 5px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.xr-table tr[data-n] { cursor: pointer; }
.xr-table tr.on td { background: #1473e6; color: #fff; }
.xr-bad { color: #e5484d; }
.xr-fade input { flex: 1; }
.xa-path { opacity: .8; overflow: hidden; text-overflow: ellipsis; }

/* Getting Started */
.tour { margin: 6px 0 12px; padding-left: 22px; max-height: 52vh; overflow: auto; }
.tour li { margin: 0 0 8px; }
.tour li > div { display: inline-block; width: calc(100% - 70px); vertical-align: middle; }
.tour li > button { vertical-align: middle; float: right; }

/* Recent Drawings and Drawing Recovery */
.recent { max-height: 56vh; overflow: auto; display: grid; gap: 6px; margin-bottom: 10px; }
.recent-row { display: grid; grid-template-columns: 96px 1fr auto auto; gap: 10px; align-items: center; padding: 6px; border-radius: 6px; border: 1px solid var(--line, rgba(127,127,127,.25)); }
.recent-row img, .recent-row .noimg { width: 96px; height: 60px; object-fit: cover; border-radius: 4px; background: #1e2229; }
.recent-row > div { display: flex; flex-direction: column; min-width: 0; }
.recent-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recover { display: flex; gap: 12px; align-items: center; }
.recover img { width: 160px; height: 100px; border-radius: 6px; background: #1e2229; }
