:root {
  color-scheme: dark;
  --bg: #07181b;
  --card: #10272a;
  --card-strong: #0b2023;
  --gold: #c8a55f;
  --text: #eef1e9;
  --muted: #a9c1bd;
  --line: rgba(200, 165, 95, .36);
  --danger: #bc6c62;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); }
html.mar-local-tools,html.mar-local-tools body { background: #06111d; }/* mar-local-black-fix: solid until docked over MAR */
html.mar-local-tools.mar-local-docked,html.mar-local-tools.mar-local-docked body { background: transparent; }
/* mar-local-docked-force: never paint opaque full-window chrome over live PACS */
html.mar-local-tools.mar-local-docked,
html.mar-local-tools.mar-local-docked body,
html.mar-local-tools.mar-local-docked #workspace {
  background: transparent !important;
}

html.mar-local-tools #workspace { background: transparent; }
html.mar-local-tools #rdpFrame,html.mar-local-tools #reconnectRdp,html.mar-local-tools #clipboardButton { display: none !important; }
/* mar-local: no Willy topbar � End/Tools/Fullscreen/Settings live elsewhere (close window, edge tools, controls/AppStream, right drawer). */
html.mar-local-tools #workspace > .topbar { display: none !important; }
button, input, select, textarea { font: inherit; }
button { border: 1px solid var(--line); border-radius: 8px; background: #183337; color: var(--text); padding: 10px 14px; cursor: pointer; }
button:hover:not(:disabled), button:focus-visible { border-color: var(--gold); filter: brightness(1.08); }
button:disabled { opacity: .42; cursor: not-allowed; }
input, select, textarea, .report-editor { width: 100%; border: 1px solid rgba(200,165,95,.28); border-radius: 8px; background: #081a1d; color: var(--text); padding: 12px; outline: none; }
input:focus, select:focus, textarea:focus, .report-editor:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(200,165,95,.16); }
textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
label { display: grid; gap: 8px; margin: 15px 0; color: #dce8e5; font-size: 13px; }
p { color: var(--muted); line-height: 1.5; }
h1 { font-size: 30px; margin: 10px 0; }
h2 { font-size: 19px; margin: 0; }

.center-view { height: 100%; min-height: 0; display: flex; flex-direction: column; align-items: center; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; padding: 28px; background: radial-gradient(circle at 50% 30%, #153236 0, var(--bg) 62%); }
.center-view > .card { flex: 0 0 auto; margin-block: auto; }
#landingServerCards, #workspaceServerCards { max-height: min(44vh, 420px); overflow-y: auto; scrollbar-gutter: stable; padding-right: 8px; }
#landingServerCards:focus-visible, #workspaceServerCards:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.server-status-card button { display: block; margin-top: 8px; width: 100%; white-space: normal; }
.server-power-off { color: #ffd0c8; border-color: var(--danger); }
.center-view.starting-server { background-image: linear-gradient(90deg,rgba(3,15,17,.45),rgba(3,15,17,.76) 48%,rgba(3,15,17,.92)),url('/server-startup-bg.webp'); background-position: center; background-size: cover; }
.center-view.starting-server .landing-card { background: rgba(9,31,34,.89); backdrop-filter: blur(12px); }
.card { width: min(440px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 12px; background: rgba(16,39,42,.98); box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.landing-card { width: min(500px, 100%); }
.eyebrow { margin: 0 0 5px; font-size: 10px; letter-spacing: .22em; color: #e0c68d; }
.primary { background: var(--gold); color: #07181b; font-weight: 750; }
.secondary { background: #183337; }
.wide { width: 100%; padding: 13px; }
.text-button { padding: 8px 0; border: 0; background: transparent; color: #e0c68d; }
.danger-text { color: #e9a39a; }
.status { min-height: 20px; margin-top: 10px; color: #ddc896; font-size: 13px; }
.muted { color: var(--muted); }
.small-copy { font-size: 12px; }
.app-version { margin: 14px 0 0; text-align: center; color: #78928f; font-size: 11px; letter-spacing: .05em; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 20px 0 14px; }
.auth-tabs button { background: #0b2023; color: var(--muted); }
.auth-tabs button.active { border-color: var(--gold); background: #2a3e36; color: #f2d99f; }
.specialty-choice { margin: 16px 0; padding: 12px 14px; border: 1px solid rgba(200,165,95,.28); border-radius: 8px; }
.specialty-choice legend { padding: 0 6px; color: #e0c68d; font-size: 12px; font-weight: 700; }
.specialty-choice label { display: flex; align-items: center; gap: 9px; margin: 9px 0; }
.specialty-choice input { width: auto; margin: 0; }
.startup-progress { margin-top: 15px; padding: 14px; border: 1px solid rgba(200,165,95,.35); border-radius: 9px; background: rgba(7,24,27,.72); }
.startup-progress-heading { display: flex; justify-content: space-between; gap: 12px; color: #f0dfba; font-size: 13px; }
.startup-progress-track { height: 8px; margin-top: 10px; overflow: hidden; border-radius: 5px; background: rgba(255,255,255,.1); }
.startup-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#9f7e3f,#ebc977); transition: width .35s ease; }
.startup-progress p { margin: 9px 0 0; font-size: 12px; }

#workspace { position: fixed; inset: 0; overflow: hidden; background: #000; }
#rdpFrame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.topbar { position: absolute; z-index: 46; top: 0; left: 50%; transform: translateX(-50%); height: 30px; width: auto; min-width: 58px; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 2px 7px; border: 1px solid rgba(200,165,95,.3); border-top: 0; border-radius: 0 0 9px 9px; background: rgba(7,24,27,.75); backdrop-filter: blur(10px); box-shadow: 0 4px 14px rgba(0,0,0,.38); opacity: .42; transition: opacity .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .12s ease; user-select: none; touch-action: none; }
.topbar:hover, .topbar:focus-within, .topbar.is-dragging { opacity: 1; background: rgba(7,24,27,.97); border-color: rgba(225,189,120,.68); box-shadow: 0 6px 20px rgba(0,0,0,.6), 0 0 10px rgba(225,189,120,.25); }
.topbar-drag-handle { display: flex; align-items: center; justify-content: center; width: 15px; height: 22px; cursor: grab; color: rgba(225,189,120,.55); padding: 0 1px; transition: color .18s ease; }
.topbar-drag-handle:hover, .topbar.is-dragging .topbar-drag-handle { color: #f2d99f; cursor: grabbing; }
.topbar.is-dragging { cursor: grabbing !important; }
.topbar-fullscreen-btn { background: transparent; border: 1px solid transparent; color: #ebf2ed; font-size: 15px; line-height: 1; padding: 3px 6px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .16s ease, color .16s ease, border-color .16s ease; }
.topbar-fullscreen-btn:hover { background: rgba(225,189,120,.18); border-color: rgba(225,189,120,.45); color: #f5dfa8; }
.topbar-fullscreen-btn:active { background: rgba(225,189,120,.32); }
.topbar-finish-btn { width: 28px; height: 24px; flex: 0 0 28px; color: #ffb3b3; }
.topbar-finish-btn:hover { background: rgba(220,70,70,.18); border-color: rgba(220,70,70,.45); color: #ffd0d0; }
.topbar[data-position="left"] { left: 8px; transform: none; }
.topbar[data-position="right"] { left: auto; right: 8px; transform: none; }

.edge-tools { position: absolute; z-index: 45; inset: 0; pointer-events: none; }
.edge-button { pointer-events: auto; position: absolute; width: 58px; height: 88px; min-width: 0; min-height: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 7px; padding: 6px 3px; border-radius: 0 7px 7px 0; background: rgba(10,34,37,.88); backdrop-filter: blur(10px); box-shadow: 0 5px 18px rgba(0,0,0,.34); transition: background .16s, border-color .16s, box-shadow .16s; touch-action: none; user-select: none; font-size: 10px; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.edge-button[data-edge="right"] { border-radius: 7px 0 0 7px; }
.edge-button[data-edge="top"] { width: 88px; height: 58px; flex-direction: row; border-radius: 0 0 7px 7px; }
.edge-button[data-edge="bottom"] { width: 88px; height: 58px; flex-direction: row; border-radius: 7px 7px 0 0; }
.edge-button.record { width: 72px; height: 106px; font-size: 11px; }
.edge-button.record[data-edge="top"], .edge-button.record[data-edge="bottom"] { width: 106px; height: 72px; }
.edge-button.dragging { cursor: grabbing; border-color: #e1bd78; box-shadow: 0 0 0 4px rgba(200,165,95,.18), 0 8px 24px rgba(0,0,0,.55); }
.edge-button.holding::after { content: ""; position: absolute; left: 3px; bottom: 2px; height: 2px; border-radius: 2px; background: #e1bd78; animation: dock-hold 5s linear forwards; }
@keyframes dock-hold { from { width: 0; } to { width: calc(100% - 6px); } }
.edge-button.active { background: #843934; }
.edge-button.mode-enabled { border-color: #e1bd78; background: rgba(32,73,68,.96); box-shadow: 0 0 0 2px rgba(225,189,120,.16),0 5px 18px rgba(0,0,0,.34); }
.edge-button.delete { color: #f0aaa2; }
.edge-button { font-size: 12px; overflow-wrap: normal; word-break: normal; hyphens: auto; gap: 4px; }
.tool-catalog { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 16px; }
.tool-catalog button { text-align: left; min-height: 44px; }
.server-status-card { padding: 12px 0; border-bottom: 1px solid var(--line); }
.server-status-card p { margin: 6px 0; font-size: 14px; overflow-wrap: anywhere; }
.server-occupancy { margin: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.server-occupancy > summary { padding: 16px 8px; font-size: 16px; font-weight: 700; cursor: pointer; color: var(--gold); min-height: 48px; overflow-wrap: anywhere; }
.server-occupancy > summary::marker { color: var(--gold); }
.server-occupancy > summary:hover { background: rgba(255,255,255,.06); }
.server-occupancy > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.server-status-card small { display: block; margin-top: 6px; color: var(--muted); }
.drawer:has(.tool-catalog) { z-index: 50; }
.rdp-recovery { position: absolute; z-index: 41; top: 110px; left: 50%; transform: translateX(-50%); width: min(520px, calc(100% - 200px)); padding: 20px; background: #13262b; color: #eff4ef; border: 1px solid #b99d60; border-radius: 12px; box-shadow: 0 8px 32px #0008; }
.rdp-recovery p { line-height: 1.5; }
.rdp-recovery button { margin: 4px; }
.tab-icon, .tab-language { width: 30px; flex: 0 0 30px; text-align: center; font-weight: 800; font-size: 25px; line-height: 1; }
.tab-language { color: #e5c77f; font-size: 17px; }
.edge-button[data-dock="reports"] { flex-direction: column; }
.edge-button[data-dock="reports"] .tab-language { width: 100%; max-width: 100%; flex: 0 0 auto; font-size: 22px; letter-spacing: -.04em; white-space: nowrap; }
.record-quick-controls { pointer-events: auto; position: absolute; z-index: 47; width: auto !important; max-width: max-content; min-height: 28px; display: flex; align-items: center; justify-content: flex-start; gap: 6px; padding: 2px 7px; border: 1px solid var(--line); border-radius: 0 7px 7px 0; background: rgba(7,25,28,.97); box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.record-quick-controls[data-edge="right"] { border-radius: 7px 0 0 7px; }
.record-quick-controls:is([data-edge="top"], [data-edge="bottom"]) { border-radius: 7px; }
.record-quick-controls .quick-mode { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; margin: 0; padding-right: 5px; border-right: 1px solid rgba(255,255,255,.15); }
.record-quick-controls .quick-mode input[type="checkbox"] { width: 14px; height: 14px; margin: 0; cursor: pointer; accent-color: #efd08a; }
.record-quick-controls .quick-mode .quick-mode-label { font-size: 11px; color: #ebf2ed; font-weight: 500; white-space: nowrap; line-height: 1; }
.record-quick-controls .quick-lang-group { display: inline-flex; align-items: center; gap: 2px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.1); border-radius: 4px; padding: 1px; }
.record-quick-controls .quick-lang-btn { background: transparent; border: 1px solid transparent; color: #a2c2be; font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 6px; border-radius: 3px; cursor: pointer; transition: all .15s ease; }
.record-quick-controls .quick-lang-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.record-quick-controls .quick-lang-btn.active { color: #fff; background: #204944; border-color: #d8b66c; box-shadow: 0 0 0 1px rgba(216,182,108,.5); }
.record-quick-controls[hidden] { display: none !important; }
.live-transcript { pointer-events: none; position: absolute; z-index: 47; width: min(280px, calc(100vw - 90px)); min-height: 58px; max-height: 140px; overflow-x: hidden; overflow-y: auto; padding: 10px 12px; border: 1px solid rgba(225,189,120,.7); border-radius: 8px; background: rgba(7,25,28,.96); color: #fff4d5; font-size: 13px; line-height: 1.35; box-shadow: 0 8px 24px rgba(0,0,0,.46); }
.live-transcript::before { content: "● "; color: #f08d82; }
.badge { position: absolute; top: 4px; right: 5px; min-width: 17px; height: 17px; padding: 1px 4px; border-radius: 9px; background: #b94f46; color: #fff; font-size: 10px; font-style: normal; }
.dock-guide { position: absolute; z-index: 44; pointer-events: none; background: #e1bd78; box-shadow: 0 0 18px rgba(225,189,120,.85); }
.dock-guide[data-edge="left"], .dock-guide[data-edge="right"] { top: 40px; bottom: 0; width: 3px; }
.dock-guide[data-edge="left"] { left: 0; } .dock-guide[data-edge="right"] { right: 0; }
.dock-guide[data-edge="top"], .dock-guide[data-edge="bottom"] { left: 0; right: 0; height: 3px; }
.dock-guide[data-edge="top"] { top: 40px; } .dock-guide[data-edge="bottom"] { bottom: 0; }

.drawer { position: absolute; z-index: 42; top: 46px; width: min(460px, calc(100vw - 90px)); max-height: calc(100vh - 24px); padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: rgba(7,25,28,.94); backdrop-filter: blur(15px); box-shadow: 0 16px 50px rgba(0,0,0,.46); overflow: auto; }
.drawer.expanded { width: min(780px, calc(100vw - 90px)); }
.drawer header { position: sticky; top: -18px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -18px -18px 14px; padding: 17px 18px 12px; background: rgba(7,25,28,.98); }
.heading-actions { display: flex; gap: 4px; }
.heading-actions button { border: 0; background: transparent; padding: 4px 8px; font-size: 20px; }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; }
.field-heading label { margin: 0; }
.mic-button { flex: 0 0 auto; width: 38px; height: 34px; padding: 4px; }
.mic-button.active { background: #843934; animation: pulse 1.1s infinite; }
.tall-text, .report-editor { min-height: 300px; }
.report-editor { margin: 10px 0 14px; overflow: auto; line-height: 1.55; white-space: pre-wrap; }
/* HTML paragraphs/br already supply line breaks. Do not render indentation
   and source-code newlines as additional blank lines. Plain text keeps them. */
.report-editor:has(p, div, section, h1, h2, h3, ul, ol, table, br) { white-space: normal; }
.report-editor p { margin: .35em 0; }
.button-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.button-row.wrap { flex-wrap: wrap; justify-content: flex-start; }
.text-workflow-panel { scroll-behavior: smooth; }
.text-workflow-nav { position: sticky; z-index: 2; top: 48px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 0 0 12px; padding: 7px; border: 1px solid rgba(200,165,95,.25); border-radius: 9px; background: rgba(7,25,28,.98); }
.text-workflow-nav button { min-height: 38px; padding: 7px 10px; color: #ead49e; }
.workflow-section { margin: 0 0 14px; padding: 15px; border: 1px solid rgba(200,165,95,.24); border-radius: 10px; background: rgba(8,29,32,.82); scroll-margin-top: 112px; }
.workflow-step-heading { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 10px; }
.workflow-step-heading strong, .workflow-step-heading small { display: block; }
.workflow-step-heading strong { color: #f0dfba; font-size: 15px; }
.workflow-step-heading small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.workflow-step-number { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; color: #e7c77e; font-weight: 800; }
.workflow-input { min-height: 170px; }
.text-workflow-panel .report-editor { min-height: 190px; max-height: 360px; }
.workflow-create { margin-top: 12px; min-height: 48px; font-size: 15px; }
.workflow-buttons { flex-wrap: wrap; }
.workflow-buttons button { min-height: 42px; flex: 1 1 180px; }
.workflow-status { position: sticky; z-index: 2; bottom: -18px; margin: 0 -18px -18px; padding: 11px 18px; border-top: 1px solid rgba(200,165,95,.28); background: rgba(7,25,28,.98); }
.signing-panel textarea { min-height: 125px; }
.capture-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(92px,1fr)); gap: 8px; margin: 12px 0; }
.capture-item { position: relative; min-height: 64px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #071518; }
.capture-item img, .capture-item video, .capture-item audio { width: 100%; display: block; }
.capture-item video { min-height: 150px; background: #020707; border-radius: 7px; }
.capture-item video:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.media-meta { padding: 7px 38px 2px 2px; color: var(--muted); font-size: 12px; }
.capture-item button { position: absolute; right: 3px; top: 3px; padding: 2px 6px; background: rgba(0,0,0,.75); }
.chat-stream { min-height: 160px; max-height: 310px; overflow: auto; display: grid; gap: 8px; padding: 10px; border: 1px solid rgba(200,165,95,.2); border-radius: 8px; background: #081a1d; }
.chat-message { padding: 9px 11px; border-radius: 8px; background: #173135; }
.chat-message.mine { background: #493e27; }
.chat-message strong { display: block; margin-bottom: 4px; color: #e4c780; }
.chat-message p { margin: 0; color: var(--text); white-space: pre-wrap; }
.approval-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.approval-actions button { min-height: 34px; padding: 6px 12px; }
.approval-actions small { color: #d9c38b; }
.check-row { display: flex; grid-template-columns: none; align-items: flex-start; gap: 9px; }
.check-row input { width: auto; margin-top: 3px; }
.settings-panel { padding-bottom: 74px; }
.settings-domain-title { margin: 18px 2px 6px; color: #e4c780; font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.settings-domain-title.rdp-title { margin-top: 25px; }
.settings-panel details { margin: 0; border: 0; border-bottom: 1px solid rgba(118,145,139,.3); border-radius: 0; background: transparent; }
.settings-panel details:first-of-type { border-top: 1px solid rgba(118,145,139,.3); }
.settings-panel summary { position: relative; min-height: 47px; display: flex; align-items: center; padding: 11px 26px 11px 3px; cursor: pointer; color: var(--text); font-weight: 700; list-style: none; }
.settings-panel summary::-webkit-details-marker { display: none; }
.settings-panel summary::after { content: '›'; position: absolute; right: 4px; color: #cbb16f; font-size: 22px; line-height: 1; transition: transform .15s ease; }
.settings-panel details[open] summary::after { transform: rotate(90deg); }
.settings-panel summary:hover, .settings-panel summary:focus-visible { color: #f1cf87; }
.settings-section-body { padding: 2px 3px 16px; }
.settings-section-body hr { margin: 18px 0; border: 0; border-top: 1px solid rgba(118,145,139,.25); }
.settings-facts { margin: 8px 0 14px; }
.settings-facts div { display: flex; justify-content: space-between; gap: 20px; padding: 8px 0; border-bottom: 1px solid rgba(118,145,139,.18); }
.settings-facts dt { color: var(--muted); font-size: 12px; }
.settings-facts dd { margin: 0; max-width: 62%; color: var(--text); font-size: 12px; text-align: right; overflow-wrap: anywhere; }
.settings-save { position: sticky; z-index: 3; bottom: -1px; margin-top: 20px; box-shadow: 0 -10px 24px rgba(7,25,28,.94); }

.toast { position: absolute; z-index: 70; bottom: 22px; left: 50%; transform: translateX(-50%); max-width: min(720px,calc(100% - 40px)); padding: 12px 18px; border: 1px solid var(--line); border-radius: 9px; background: #10272a; color: #f0dfba; box-shadow: 0 14px 45px #000; }
dialog { border: 0; padding: 0; border-radius: 12px; background: transparent; color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.72); }
.dialog-card { width: min(450px,calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.dialog-card > div:last-child { display: flex; justify-content: flex-end; gap: 10px; }
.danger { background: #843934; }

.capture-overlay { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; background: #0b191b; cursor: crosshair; overflow: hidden; }
.capture-overlay[hidden] { display: none !important; pointer-events: none; }
.capture-overlay canvas { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.capture-hint { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); padding: 8px 14px; border-radius: 8px; background: rgba(7,24,27,.9); color: #f0dfba; pointer-events: none; }
.capture-actions { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; cursor: default; }
.capture-selection { outline: 2px solid #f0c86c; }

.ui-hidden .edge-tools { display: none; }
.ui-hidden .record-quick-controls, .ui-hidden .live-transcript { display: none; }
.capture-clean .topbar, .capture-clean .edge-tools, .capture-clean .drawer, .capture-clean .toast { display: none !important; }
.video-control { position: fixed; z-index: 1100; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(7,24,27,.96); }
.video-control strong { color: #f0aaa2; }
.video-recording-guide { position: fixed; z-index: 1080; inset: 0; pointer-events: none; }
.video-recording-guide .video-control { pointer-events: auto; white-space: nowrap; box-shadow: 0 12px 38px rgba(0,0,0,.7); }
.video-roi-frame { position: fixed; border: 3px solid #ff665a; outline: 1px solid rgba(255,255,255,.9); outline-offset: 2px; box-shadow: 0 0 0 2px rgba(0,0,0,.75),inset 0 0 0 1px rgba(0,0,0,.8); pointer-events: none; animation: roi-recording-pulse 1.15s ease-in-out infinite; }
.video-roi-frame::before { content: 'REC · записывается только эта область'; position: absolute; left: -3px; top: -31px; padding: 5px 9px; border-radius: 6px 6px 0 0; background: #b53f38; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.video-recording-guide.paused .video-roi-frame { border-color: #f1c96e; animation: none; }
.video-recording-guide.paused .video-roi-frame::before { content: 'ПАУЗА'; background: #756136; }
@keyframes roi-recording-pulse { 50% { box-shadow: 0 0 0 4px rgba(255,102,90,.24),inset 0 0 0 1px rgba(0,0,0,.8); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(188,108,98,.22); } }
@media (max-height: 760px) { .edge-button { width: 52px; height: 68px; font-size: 9px; } .edge-button.record { width: 64px; height: 84px; font-size: 10px; } .edge-button[data-edge="top"], .edge-button[data-edge="bottom"] { width: 68px; height: 52px; } .edge-button.record[data-edge="top"], .edge-button.record[data-edge="bottom"] { width: 84px; height: 64px; } .tab-icon, .tab-language { width: 26px; flex-basis: 26px; font-size: 22px; } .tab-language { font-size: 15px; } }
@media (max-width: 780px) { .drawer, .drawer.expanded { width: calc(100% - 54px); max-width: none; } .topbar { width: calc(100% - 18px); } .session-name { display: none; } .workflow-section { padding: 12px; } .workflow-step-heading { grid-template-columns: 30px minmax(0,1fr) auto; } .workflow-buttons button { flex-basis: 100%; } }
.edge-button, .edge-button.record { font-size: 12px; }
.edge-button .tab-icon { font-size: 25px; }
.feedback-controls { border: 1px solid var(--line); padding: 12px; margin: 12px 0; }
.feedback-traits { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.feedback-traits label { display: flex; align-items: center; gap: 6px; margin: 5px 0; }
.feedback-traits input { width: auto; }
#feedbackChart { width: 100%; height: 180px; }

/* Fold by clipping, not by adding an invisible full-width hover overlay.
   Layout bounds stay stable for drawers/dragging; only the visible 12px can
   receive pointer input while folded. Top/bottom docks remain unchanged. */
.edge-button[data-edge="left"], .edge-button[data-edge="right"] {
  clip-path: inset(0 0 0 0);
  transition: clip-path .15s ease-out, background .16s, border-color .16s;
}
.edge-button[data-edge="left"]::before, .edge-button[data-edge="right"]::before {
  content: ''; position: absolute; top: 0; bottom: 0; width: 3px;
  background: #d8b66c; pointer-events: none;
}
.edge-button[data-edge="left"]::before { left: -1px; }
.edge-button[data-edge="right"]::before { right: -1px; }
.edge-button[data-edge="left"]:not(:hover):not(:focus-visible):not(.holding):not(.dragging):not(.touch-revealed):not(.pinned):not(:has(+ .dock-pin:hover)):not(:has(+ .dock-pin:focus-visible)) {
  --fold-handle-width: 12px;
  clip-path: inset(0 calc(100% - 12px) 0 0);
}
.edge-button[data-edge="right"]:not(:hover):not(:focus-visible):not(.holding):not(.dragging):not(.touch-revealed):not(.pinned):not(:has(+ .dock-pin:hover)):not(:has(+ .dock-pin:focus-visible)) {
  --fold-handle-width: 12px;
  clip-path: inset(0 0 0 calc(100% - 12px));
}
.edge-button[data-edge="left"]::before, .edge-button[data-edge="right"]::before {
  width: var(--fold-handle-width, 3px);
  background: linear-gradient(#173134, #173134) center / 2px 20px no-repeat, #efd08a;
  box-shadow: inset 0 0 0 1px #354b48;
}
.edge-button[data-edge="left"]::before { border-radius: 0 5px 5px 0; }
.edge-button[data-edge="right"]::before { border-radius: 5px 0 0 5px; }
.edge-tools:has(.record[data-edge="left"], .record[data-edge="right"]) .record-quick-controls {
  visibility: hidden;
  opacity: 0;
  transition: opacity .18s ease, visibility .18s ease;
}
.edge-tools:has(.record:is(:hover, :focus-visible, .holding, .dragging, .touch-revealed, .pinned), .dock-pin[data-pin-for="record"]:hover, .dock-pin[data-pin-for="record"]:focus-visible, .record-quick-controls:hover, .record-quick-controls:focus-within) .record-quick-controls {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transition-delay: 0s;
}
.edge-tools:has(.record-quick-controls:hover, .record-quick-controls:focus-within) .edge-button.record {
  clip-path: inset(0 0 0 0) !important;
}
@media (prefers-reduced-motion: reduce) {
  .edge-button[data-edge="left"], .edge-button[data-edge="right"] { transition: none; }
}

/* Independent sibling controls: pinning never starts recording or opens a panel. */
/* A reserved header keeps the pin out of the icon/label area on every edge. */
.edge-button[data-dock] {
  padding: 26px 3px 3px; flex-direction: column; justify-content: flex-start; gap: 2px;
}
.edge-button[data-dock] .tab-icon { width: 34px; flex: 0 0 32px; height: 32px; font-size: 32px; line-height: 32px; color: #ebf2ed; }
.tab-icon svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 3px #0004); }
.tab-icon .icon-accent { stroke: #e6c77e; }
.tab-icon .record-stop { display: none; }
.edge-button.record.active .record-mic { display: none; }
.edge-button.record.active .record-stop { display: block; fill: #ffe7e3; stroke: #ffe7e3; }
.edge-button.delete .tab-icon { color: #eda89c; }
.edge-button[data-dock] > span:last-of-type:not(.tab-icon):not(.tab-language) { font-weight: 600; }
.edge-button[data-dock="reports"] .tab-language { font-size: 22px; line-height: 25px; }
.edge-button[data-dock]:is([data-edge="top"], [data-edge="bottom"]) {
  padding-top: 26px; flex-direction: row; align-items: center; justify-content: center; gap: 4px;
}
.edge-button[data-dock]:is([data-edge="top"], [data-edge="bottom"]) .tab-icon { width: 26px; height: 26px; flex-basis: 26px; }
.edge-button[data-dock="reports"]:is([data-edge="top"], [data-edge="bottom"]) { flex-direction: column; gap: 0; }
.edge-button[data-dock="reports"]:is([data-edge="top"], [data-edge="bottom"]) .tab-language { font-size: 18px; line-height: 18px; }
.edge-button[data-dock="reports"]:is([data-edge="top"], [data-edge="bottom"]) > span:last-child { font-size: 10px; line-height: 10px; }
.dock-pin {
  position: absolute; z-index: 2; width: 20px; height: 20px; min-height: 0;
  padding: 3px; margin: 0; border: 1px solid #68817b; border-radius: 50%;
  background: #13282b; color: #afc0b9; cursor: pointer; pointer-events: auto;
  visibility: hidden; display: grid; place-items: center;
}
.dock-pin svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transform: rotate(35deg); }
.dock-pin[aria-pressed="true"] { color: #102124; background: #d8b66c; border-color: #f4d992; box-shadow: 0 0 0 2px #d8b66c26; }
.dock-pin[aria-pressed="true"] svg { transform: rotate(0); fill: #10212422; }
.edge-button:is(:hover, :focus-visible, .pinned, .touch-revealed) + .dock-pin,
.edge-button:is([data-edge="top"], [data-edge="bottom"]) + .dock-pin,
.dock-pin:hover, .dock-pin:focus-visible { visibility: visible; }
.dock-pin:focus-visible { outline: 2px solid #fff1bd; outline-offset: 2px; }
.edge-button:is(.holding, .dragging) + .dock-pin { visibility: hidden; }
.edge-button.record.active { clip-path: inset(0 0 0 0) !important; --fold-handle-width: 3px; }
.edge-tools:has(.record.active) .record-quick-controls { visibility: visible; transition-delay: 0s; }
.edge-button.record.active + .dock-pin { visibility: visible; }

body.is-dictating .live-transcript { display:block !important; visibility:visible !important; }

/* Transparent Willy overlay can still paint a blinking caret from focused
   fields inside [hidden] drawers; kill caret there so it cannot float over PACS. */
html.mar-local-tools [hidden] textarea,
html.mar-local-tools [hidden] input,
html.mar-local-tools [hidden] [contenteditable="true"],
html.mar-local-tools [hidden] [contenteditable=""] {
  caret-color: transparent !important;
}
/* MarLocal login/landing must be opaque. Transparent body otherwise lets
   Windows composite other desktop windows through Willy and looks like blink/jump. */
html.mar-local-tools #authScreen,
html.mar-local-tools #landingView,
html.mar-local-tools body:has(#authScreen:not([hidden])) {
  background: #0b191b !important;
}
html.mar-local-tools body:has(#authScreen:not([hidden])) #workspace {
  background: #0b191b !important;
}

/* mar-local: hide RDP server picker */
html.mar-local-tools #landingView .auth-card > p,
html.mar-local-tools #landingView label[for="serverSelect"],
html.mar-local-tools #landingView #serverSelect,
html.mar-local-tools #landingView label:has(#serverSelect),
html.mar-local-tools #landingView #startSession,
html.mar-local-tools #landingView #refreshServers,
html.mar-local-tools #landingView #openWillyOnly,
html.mar-local-tools #landingView #serverCards,
html.mar-local-tools #landingView #landingServerSync,
html.mar-local-tools #landingView .server-cards,
html.mar-local-tools #landingView #refreshStatusCards,
html.mar-local-tools #backToServers {
  display: none !important;
}

/* mar-local-hide-capture-confirm: ROI applies on pointerup */
html.mar-local-tools #captureConfirm { display: none !important; }

/* signing edge label: full name visible */
html.mar-local-tools .edge-button#signingTool { height: 100px; width: 64px; }
html.mar-local-tools .edge-label-signing { display: block; text-align: center; font-size: 11px; line-height: 1.2; overflow-wrap: anywhere; }

/* mar-local ABC: hide manual RU retry; live transcript auto-scroll */
html.mar-local-tools #retryRussian { display: none !important; }

/* mar-local-hide-reports-top */
html.mar-local-tools #createReport,
html.mar-local-tools .text-workflow-nav { display: none !important; }
