:root { font-family: system-ui, sans-serif; color: #e5e8df; background: #101714; color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #d7efa6; outline-offset: 3px; }
[hidden] { display: none !important; }
main, .workspace, .side-panel { width: 100%; height: 100%; }
main { position: relative; }
.side-panel { display: flex; flex-direction: column; }
.tabs { position: absolute; top: 16px; left: 16px; display: flex; gap: 6px; z-index: 3; }
.tab, .icon-button { display: grid; place-items: center; width: 40px; height: 40px; background: #202b23; color: #bdcbb3; border: 1px solid #384734; border-radius: 12px; font-size: 21px; }
.tab.active, .icon-button[aria-pressed=true] { background: #405136; color: #e3efcf; }
#agent-ui-layer, #transcripts { flex: 1; min-height: 0; overflow-y: auto; padding: 80px 28px 150px; scrollbar-color: #43503c transparent; }
#tool-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 24px; align-items: start; }
.tool-card { border: 1px solid #35432f; border-radius: 12px; background: #172019; padding: 18px; }
.tool-card h3 { font-size: 13px; margin: 0 0 10px; }
.tool-card p { font-size: 12px; color: #aab99a; line-height: 1.6; overflow-wrap: anywhere; }
.tool-card a { color: #d8eab7; font-size: 12px; }
.tool-card img, .tool-card iframe { width: 100%; border: 0; border-radius: 8px; margin-bottom: 12px; }
.tool-card img { max-height: 70vh; object-fit: contain; background: #0c140e; }
.tool-card iframe { height: min(65vh, 650px); }
#transcripts { padding-left: max(24px, calc((100% - 760px) / 2)); padding-right: max(24px, calc((100% - 760px) / 2)); }
.transcript-line { margin-bottom: 20px; line-height: 1.6; font-size: 13px; overflow-wrap: anywhere; }
.transcript-line strong { display: block; color: #b6c99c; font-size: 10px; margin-bottom: 5px; }
#text-form { position: absolute; z-index: 3; bottom: 88px; left: 50%; transform: translateX(-50%); display: flex; width: min(460px, calc(100% - 32px)); padding: 7px 8px 7px 13px; border: 1px solid #35432f; border-radius: 12px; background: #172019ed; }
input { min-width: 0; flex: 1; border: 0; color: #dce5d3; background: transparent; font-size: 13px; }
#send { border: 0; border-radius: 8px; background: #c9dfa6; color: #26371c; width: 30px; height: 30px; font-size: 20px; }
.session-dock { position: absolute; z-index: 3; bottom: 16px; left: 50%; transform: translateX(-50%); border: 1px solid #384734; border-radius: 18px; padding: 9px; background: #172019ee; box-shadow: 0 12px 40px #0004; backdrop-filter: blur(18px); }
.controls { display: flex; align-items: center; gap: 9px; }
.start-button { display: grid; place-items: center; width: 48px; height: 40px; padding: 0; border: 0; border-radius: 12px; background: #daecb8; color: #223019; font-size: 18px; }
.start-button:hover { background: #e8f5ce; }
#notice { position: absolute; z-index: 6; top: 70px; left: 50%; transform: translateX(-50%); width: min(650px, calc(100% - 32px)); background: #343326; border: 1px solid #6c6744; color: #e2d9af; font-size: 12px; padding: 14px 18px; line-height: 1.6; border-radius: 9px; }
.camera-window { position: fixed; z-index: 5; top: 16px; right: 16px; width: min(300px, calc(100vw - 16px)); border: 1px solid #657650; border-radius: 13px; background: #172019; box-shadow: 0 18px 65px #0009; overflow: hidden; }
.camera-titlebar { display: flex; height: 32px; background: #243020; }
.camera-titlebar button { border: 0; color: #ceddbd; background: transparent; }
.camera-drag { display: flex; align-items: center; justify-content: center; flex: 1; min-width: 0; padding: 0 12px; touch-action: none; cursor: grab; user-select: none; }
.drag-grip { font-size: 21px; color: #92a87c; }
.dragging .camera-drag { cursor: grabbing; }
#camera-close { width: 32px; font-size: 23px; }
#camera-close:hover { background: #485638; }
#camera { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; transform: scaleX(-1); }
@media (max-width: 600px) {
  .camera-window { width: 190px; }
  #agent-ui-layer { padding: 72px 16px 150px; }
}

.tool-card video { display: block; width: 100%; max-height: 75vh; background: #000; border-radius: 8px; }
.movie-screen { grid-column: 1 / -1; grid-row: 1; padding: 0; background: #000; overflow: hidden; }
.movie-screen #movie-player { width: 100%; height: calc(100dvh - 245px); min-height: 200px; object-fit: contain; }
.movie-screen p:empty { display: none; }
.movie-screen p { padding: 0 16px; }
.movie-screen button { margin: 10px; border: 1px solid #384734; background: #202b23; color: #dce8ce; border-radius: 8px; padding: 8px 16px; }

.reference-photo img { max-height: 380px; }
.photo-actions { display: flex; gap: 8px; }
.photo-actions button { border: 1px solid #384734; border-radius: 8px; padding: 8px 12px; background: #202b23; color: #dce8ce; font-size: 12px; }
.photo-actions button:last-child { margin-left: auto; }

#video-confirmation { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 24px; border: 1px solid #657650; border-radius: 16px; background: #172019; color: #e5e8df; box-shadow: 0 20px 80px #0008; }
#video-confirmation::backdrop { background: #0009; backdrop-filter: blur(4px); }
#video-confirmation h2 { margin: 0 0 16px; font-size: 20px; }
#video-confirmation p { font-size: 13px; line-height: 1.6; }
#video-confirmation-prompt { max-height: 200px; overflow: auto; overflow-wrap: anywhere; color: #adbea0; }
.confirmation-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.confirmation-actions button { padding: 10px 16px; border: 1px solid #526347; border-radius: 9px; background: #263322; color: #dce8ce; }
#video-approve { background: #daecb8; color: #223019; }

#access-dialog { width: min(420px, calc(100vw - 32px)); border: 1px solid #657650; border-radius: 16px; background: #172019; color: #e5e8df; padding: 24px; }
#access-dialog::backdrop { background: #000a; }
#access-dialog h2 { font-size: 20px; margin-top: 0; }
#access-dialog label { display: block; font-size: 13px; margin-top: 16px; }
#access-dialog input { width: 100%; margin-top: 8px; padding: 12px; border: 1px solid #657650; border-radius: 8px; }
#access-dialog p { color: #adbea0; font-size: 12px; }
