: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); }
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 { min-height: 100%; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 50% 30%, #153236 0, var(--bg) 62%); }
.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; }

#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: 40; top: 0; left: 50%; transform: translateX(-50%); height: 36px; width: min(650px, calc(100% - 150px)); display: flex; align-items: center; gap: 14px; padding: 3px 6px 3px 14px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; background: rgba(7,24,27,.94); backdrop-filter: blur(10px); transition: opacity .16s, transform .16s; }
.brand { font-weight: 800; letter-spacing: .15em; font-size: 13px; }
.brand span { color: var(--gold); }
.session-name { min-width: 100px; max-width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; gap: 5px; margin-left: auto; }
.top-actions button { padding: 5px 9px; font-size: 12px; }
.top-actions #settingsButton { font-size: 17px; padding-inline: 10px; }
.finish { color: #f3c1bb; }

.edge-tools { position: absolute; z-index: 45; inset: 0; pointer-events: none; }
.edge-button { pointer-events: auto; position: absolute; width: 44px; height: 76px; min-width: 0; min-height: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; padding: 4px 2px; 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: 8px; line-height: 1.12; text-align: center; overflow-wrap: anywhere; }
.edge-button[data-edge="right"] { border-radius: 7px 0 0 7px; }
.edge-button[data-edge="top"] { width: 76px; height: 44px; flex-direction: row; border-radius: 0 0 7px 7px; }
.edge-button[data-edge="bottom"] { width: 76px; height: 44px; flex-direction: row; border-radius: 7px 7px 0 0; }
.edge-button.record { width: 64px; height: 96px; font-size: 9px; }
.edge-button.record[data-edge="top"], .edge-button.record[data-edge="bottom"] { width: 96px; height: 64px; }
.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.delete { color: #f0aaa2; }
.tab-icon, .tab-language { width: 24px; flex: 0 0 24px; text-align: center; font-weight: 800; }
.tab-language { color: #e5c77f; font-size: 12px; }
.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 - 70px)); 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 - 70px)); }
.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; }
.button-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.button-row.wrap { flex-wrap: wrap; justify-content: flex-start; }
.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 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; }
.check-row { display: flex; grid-template-columns: none; align-items: flex-start; gap: 9px; }
.check-row input { width: auto; margin-top: 3px; }
.settings-panel details { margin: 10px 0; border: 1px solid rgba(200,165,95,.22); border-radius: 9px; background: rgba(8,26,29,.72); }
.settings-panel summary { padding: 13px; cursor: pointer; color: #e7d3a7; font-weight: 700; }
.settings-panel details > :not(summary) { margin-left: 13px; margin-right: 13px; }
.settings-panel details > :last-child { margin-bottom: 13px; }

.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: rgba(4,12,14,.35); cursor: crosshair; overflow: hidden; }
.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; }
.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; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(188,108,98,.22); } }
@media (max-height: 760px) { .edge-button { height: 62px; } .edge-button.record { height: 76px; } .edge-button[data-edge="top"], .edge-button[data-edge="bottom"] { width: 62px; height: 44px; } .edge-button.record[data-edge="top"], .edge-button.record[data-edge="bottom"] { width: 76px; height: 54px; } }
@media (max-width: 780px) { .drawer, .drawer.expanded { width: calc(100% - 54px); max-width: none; } .topbar { width: calc(100% - 18px); } .session-name { display: none; } }
