/* SPDX-License-Identifier: 0BSD — AIX web prototype (2026-09-29). */
:root { --bg: #f6f7f9; --panel: #fff; --ink: #1d2330; --muted: #667085; --line: #d0d5dd;
        --accent: #1f5fbf; --bad: #b42318; --ok: #067647; }
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 system-ui, sans-serif; background: var(--bg); color: var(--ink); }
header { display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: var(--panel);
         border-bottom: 1px solid var(--line); }
header h1 { font-size: 18px; margin: 0; }
header h1 span { font-weight: 400; color: var(--muted); }
#case { color: var(--muted); }
.lang { margin-left: auto; display: flex; gap: 6px; align-items: center; }
main { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 12px; padding: 12px;
       height: calc(100vh - 50px); }
section { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px;
          overflow: auto; }
h2 { font-size: 14px; margin: 8px 0; }
.hint, .note { color: var(--muted); font-size: 12px; margin: 4px 0 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 3px 4px; border-bottom: 1px solid var(--line); }
td input { width: 100%; font: inherit; padding: 2px 4px; }
td input.changed { background: #fff6d6; }
.actions { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
button { font: inherit; padding: 6px 12px; border: 1px solid var(--line); border-radius: 4px;
         background: #fff; cursor: pointer; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 0; }
dt { color: var(--muted); }
#issues { padding-left: 18px; color: var(--bad); }
#message { margin-top: 8px; white-space: pre-wrap; }
#message.error { color: var(--bad); }
#message.ok { color: var(--ok); }
#view { display: flex; flex-direction: column; }
.layers { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
#canvas-wrap { position: relative; flex: 1; min-height: 300px; }
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
#placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
               color: var(--muted); }
#colorbar { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
#cb { width: 256px; height: 12px; border: 1px solid var(--line); }
body.busy { cursor: progress; }
#who { color: var(--muted); }
#signin { position: fixed; inset: 0; background: rgba(246,247,249,.97); display: flex;
          align-items: center; justify-content: center; z-index: 10; }
#signin[hidden], #signin [hidden] { display: none; } /* "hidden" must beat display: flex */
#signin form { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
               padding: 24px; width: min(360px, 92vw); display: flex; flex-direction: column; gap: 12px; }
#signin label { display: flex; flex-direction: column; gap: 4px; }
#signin input { font: inherit; padding: 6px 8px; }
#signin-error { color: var(--bad); min-height: 1.4em; margin: 0; }

/* 2026-09-29 (feature/pai-parity): tabs, model tree, properties, commands, 3D view. */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.tab { border: 1px solid var(--line); border-bottom: none; border-radius: 4px 4px 0 0; background: var(--bg); }
.tab.active { background: var(--panel); font-weight: 600; }
.tab-body[hidden], .view-body[hidden] { display: none; }
.view-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
#tree { max-height: 32vh; overflow: auto; border: 1px solid var(--line); border-radius: 4px; padding: 4px; }
#tree ul { list-style: none; margin: 0; padding-left: 14px; }
#tree > ul { padding-left: 0; }
#tree li > span { cursor: pointer; padding: 1px 4px; border-radius: 3px; display: inline-block; }
#tree li > span:hover { background: #eef2f7; }
#tree li > span.selected { background: #cfe0fb; }
#tree li > span.selected.second { background: #fde2c4; }
#tree .toggle { width: 14px; display: inline-block; color: var(--muted); cursor: pointer; user-select: none; }
#properties table td:first-child { color: var(--muted); width: 45%; }
#properties .errors { color: var(--bad); }
#commands .group { color: var(--muted); font-size: 12px; margin: 6px 0 2px; }
#commands button { margin: 2px 4px 2px 0; }
#commands button[disabled] { cursor: help; }
#gl-wrap { position: relative; flex: 1; min-height: 300px; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
#gl-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
                  color: var(--muted); pointer-events: none; }
#geo-label { color: var(--muted); }
/* 2026-09-29 (feature/pai-parity step 2): the sketch view */
/* The actions row keeps its height when empty, so the canvas never moves under the cursor. */
#sketch-actions { min-height: 32px; align-items: center; }
#sketch-wrap { position: relative; flex: 1; min-height: 300px; }
#sketch-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; background: #fff; }
#sketch-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
                      color: var(--muted); pointer-events: none; }
#sketch-tools button.active { background: #1971c2; color: #fff; border-color: #1971c2; }
.muted { color: var(--muted); }
.tab[hidden] { display: none; }
