/* Phos Editor v0.30 · Live Light button, Share menu and dialog, light on/off row, toolbar groups, symbol dev pill.
   Built from Phos UI system v1 (phos-ui.css): pills for controls, 24 for surfaces, 12 for rows, grey selection, Key only for the key moment. */

/* ── toolbar (v0.30): Select · Pan | Lights · Shaping · Grip | Camera · Cast · Set | Notes | Snap · Live Light | ⋯
   Line, arrow, pen, eraser and text live under ⋯ at every size; on phones Snap and Live Light join them. */
.toolbar .tb-group > .tb-cat:nth-child(4), .toolbar .tb-group > .tb-cat:nth-child(7) { position: relative; margin-left: 13px; }
.toolbar .tb-group > .tb-cat:nth-child(4)::before, .toolbar .tb-group > .tb-cat:nth-child(7)::before {
  content: ""; position: absolute; left: -7px; top: 50%; width: 1px; height: 20px; transform: translateY(-50%); background: rgba(255,255,255,0.09);
}
.toolbar { flex-wrap: nowrap; }
.toolbar > * { flex: none; }
.tb-btn svg { flex: none; }
@media (width > 640px) and (min-height: 521px) { .toolbar .tb-cat:not(.tb-more) .tb-pop { width: 330px; max-width: calc(100vw - 24px); } }
.tb-item svg { width: 24px !important; height: 24px !important; }
.tb-btn.labelled > svg { width: 22px; height: 22px; }
.tb-more > .tb-btn.active svg { width: 20px; height: 20px; }
.tb-more .tb-pop { width: 300px; }
.tb-more .tb-pop-grid { grid-template-columns: 1fr 1fr; }
.tb-more .tb-item { position: relative; }
.tb-key { margin-left: auto; padding: 2px 6px; border-radius: 6px; font: 500 10px/1 "Geist Mono", ui-monospace, monospace; color: rgba(255,255,255,0.45); background: rgba(255,255,255,0.06); }
.tb-item .ll-beta { margin-left: auto; height: 16px; padding: 0 6px; font-size: 9px; }
.tb-item .tb-ic { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; }
.tb-item .tb-ic svg { width: 20px !important; height: 20px !important; }
.tb-item.tb-live.on .tb-ic { color: #FF5A1F; }
@media (hover: none) { .tb-key { display: none; } }
.tb-item span { white-space: nowrap; }
/* the bar is shorter now, so labels stay on down to 1000 px (tablets held sideways included) */
@media (width >= 1000px) { .tb-btn.labelled:not(.ll-btn) span { display: inline; } }

/* phones: one row that fits a 390 px screen; anything wider than the screen scrolls sideways */
@media (width <= 640px) {
  .toolbar { justify-content: safe center; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar .tb-btn, .toolbar .tb-btn.labelled { min-width: 33px; height: 40px; padding: 0 5px; }
  .toolbar .tb-group > .tb-cat:nth-child(4), .toolbar .tb-group > .tb-cat:nth-child(7) { margin-left: 7px; }
  .toolbar .tb-group > .tb-cat:nth-child(4)::before, .toolbar .tb-group > .tb-cat:nth-child(7)::before { left: -4px; }
  .toolbar .tb-sep { margin: 0 2px; }
  .tb-more .tb-pop { width: auto; }
}
/* phones held sideways: the bar runs down the left edge and scrolls when it is taller than the screen */
@media (max-height: 520px) and (orientation: landscape) {
  .toolbar .tb-group > .tb-cat:nth-child(4), .toolbar .tb-group > .tb-cat:nth-child(7) { margin-left: 0; margin-top: 9px; }
  .toolbar .tb-group > .tb-cat:nth-child(4)::before, .toolbar .tb-group > .tb-cat:nth-child(7)::before { left: 50%; top: -5px; width: 20px; height: 1px; transform: translateX(-50%); }
  .toolbar { max-height: calc(100dvh - 136px); overscroll-behavior-y: contain; }
}

/* ── Live Light · Beta */
.ll-btn { gap: 7px; }
.ll-btn svg { width: 18px; height: 18px; flex: none; }
.ll-btn.on svg, .tb-item.tb-live.on .tb-ic { color: #FF5A1F; }
/* Live Light mark "Pool": the pool brightens from the centre out when it turns on */
.ll-btn svg circle, .tb-live svg circle { transition: fill-opacity .3s cubic-bezier(0.23, 1, 0.32, 1); }
.ll-btn.on svg .lp1, .tb-live.on svg .lp1 { fill-opacity: .16; }
.ll-btn.on svg .lp2, .tb-live.on svg .lp2 { fill-opacity: .3; }
.ll-btn.on svg .lp3, .tb-live.on svg .lp3 { fill-opacity: .6; }
@media (prefers-reduced-motion: reduce) { .ll-btn svg circle, .tb-live svg circle { transition: none; } }
.ll-beta { display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 7px; border-radius: 999px; font: 500 9.5px/1 "Geist Mono", ui-monospace, monospace;
  letter-spacing: 0.1em; text-transform: uppercase; font-style: normal; color: #FF5A1F; background: rgba(255,90,31,0.12); box-shadow: inset 0 0 0 1px rgba(255,90,31,0.28); }
.ll-beta.ll-pro svg { width: 10px; height: 10px; }
@media (width <= 1100px) { .ll-btn span { display: none; } }

/* ── Share button + menu */
.topbar.pab .actions .primary.ll-share { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='24' r='5'/%3E%3Ccircle cx='36' cy='12' r='5'/%3E%3Ccircle cx='36' cy='36' r='5'/%3E%3Cpath d='M16.5 21.5l15-7M16.5 26.5l15 7'/%3E%3C/svg%3E"); }
.ll-btn { white-space: nowrap; }
.ll-menu { position: fixed; z-index: 80; min-width: 250px; animation: llIn .18s cubic-bezier(0.23, 1, 0.32, 1); }
.ll-menu .pu-row { min-height: 48px; align-items: center; color: #E4E4E7; }
.ll-menu .pu-row svg { width: 16px; height: 16px; flex: none; color: rgba(255,255,255,0.7); }
.ll-mt { display: flex; flex-direction: column; gap: 3px; }
.ll-mt b { font: 500 14px/1.2 Geist, system-ui, sans-serif; color: #fff; }
.ll-mt small { font: 400 10.5px/1.2 "Geist Mono", ui-monospace, monospace; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.ll-menu-sep { height: 1px; margin: 6px 4px; background: rgba(255,255,255,0.09); }
@keyframes llIn { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ── Share scene dialog */
.ll-modal-wrap { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(5,5,6,0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: llFade .2s ease; }
.ll-modal { width: min(460px, 100%); display: flex; flex-direction: column; gap: 14px; color: #fff; animation: llIn .22s cubic-bezier(0.23, 1, 0.32, 1); }
.ll-modal-head { display: flex; align-items: center; justify-content: space-between; }
.ll-kick { font: 500 10.5px/1 "Geist Mono", ui-monospace, monospace; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.56); }
.ll-x { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 999px; background: transparent; color: rgba(255,255,255,0.7); cursor: pointer; }
.ll-x:hover { background: rgba(255,255,255,0.08); color: #fff; }
.ll-modal h2 { margin: 0; font: 600 22px/1.2 Geist, system-ui, sans-serif; letter-spacing: -0.02em; text-wrap: balance; }
.ll-modal p { margin: 0; font: 400 14px/21px Geist, system-ui, sans-serif; color: rgba(255,255,255,0.72); }
.ll-field svg { width: 16px; height: 16px; color: rgba(255,255,255,0.6); flex: none; }
.ll-field input { font: 400 13px "Geist Mono", ui-monospace, monospace !important; }
.ll-acts { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
@keyframes llFade { from { opacity: 0; } to { opacity: 1; } }

/* ── Light: on / off + output 0–100 %, built like White balance; the track is neutral and fills to the value */
.lt-range::-webkit-slider-runnable-track { background: linear-gradient(90deg, rgba(255,255,255,0.85) var(--lt, 100%), rgba(255,255,255,0.12) var(--lt, 100%)) !important; }
.lt-range::-moz-range-track { background: linear-gradient(90deg, rgba(255,255,255,0.85) var(--lt, 100%), rgba(255,255,255,0.12) var(--lt, 100%)) !important; }
.lt-swatch { width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); flex: none; }

/* ── zoom, undo / redo and the pen bar: the same flat Frost glass, pills and grey selection as the toolbar (UI system v1) */
.canvas .excalidraw .zoom-actions, .canvas .excalidraw .undo-redo-buttons, .pen-bar {
  --gf: 0; --gx: 50%; --mx: 50%; --my: 0px; --pu-rim-r: 120px;
  background: radial-gradient(90% 130% at var(--gx) 100%, rgba(255,150,80,calc(0.32 * var(--gf))) 0%, rgba(255,90,31,calc(0.1 * var(--gf))) 45%, rgba(255,90,31,0) 80%), var(--pu-frost) !important;
  -webkit-backdrop-filter: var(--pu-blur) !important; backdrop-filter: var(--pu-blur) !important;
  box-shadow: var(--pu-edge), var(--pu-drop) !important; border: 0 !important; border-radius: 999px !important;
  isolation: isolate; overflow: visible !important;
}
.canvas .excalidraw .zoom-actions, .canvas .excalidraw .undo-redo-buttons { position: relative; }
.canvas .excalidraw .zoom-actions, .canvas .excalidraw .undo-redo-buttons { display: flex !important; align-items: center; gap: 2px; height: 44px; padding: 4px !important; }
.canvas .excalidraw .zoom-actions::after, .canvas .excalidraw .undo-redo-buttons::after, .pen-bar::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px;
  background: radial-gradient(var(--pu-rim-r) circle at var(--mx) var(--my), rgba(255,242,228,0.95), rgba(255,150,90,0.5) 38%, rgba(255,255,255,0) 72%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: var(--eg, 0.55);
}
.canvas .excalidraw .zoom-actions .ToolIcon, .canvas .excalidraw .undo-redo-buttons .ToolIcon, .canvas .excalidraw .zoom-actions button, .canvas .excalidraw .undo-redo-buttons button {
  width: 36px !important; height: 36px !important; min-width: 36px; border-radius: 999px !important; background: transparent !important; color: rgba(255,255,255,0.78) !important;
  transition: background-color .15s cubic-bezier(0.23, 1, 0.32, 1), color .15s;
}
.canvas .excalidraw .zoom-actions .reset-zoom-button { width: auto !important; min-width: 56px; padding: 0 10px !important; font: 500 12px/1 "Geist Mono", ui-monospace, monospace !important; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.canvas .excalidraw .zoom-actions button:hover, .canvas .excalidraw .undo-redo-buttons button:hover { background: rgba(255,255,255,0.08) !important; color: #fff !important; }
.canvas .excalidraw .zoom-actions button:active, .canvas .excalidraw .undo-redo-buttons button:active { transform: scale(0.97); }
.canvas .excalidraw .zoom-actions .ToolIcon__icon, .canvas .excalidraw .undo-redo-buttons .ToolIcon__icon { background: transparent !important; width: 36px; height: 36px; }
.canvas .excalidraw .zoom-actions svg, .canvas .excalidraw .undo-redo-buttons svg { width: 16px; height: 16px; }
.pen-bar { padding: 4px 4px 4px 16px !important; gap: 8px; }
.pen-bar .pen-size { border-radius: 999px; background: transparent; box-shadow: none; width: 36px; height: 36px; }
.inspector .pen-size { background: rgba(255,255,255,0.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); border-radius: 999px; }
.pen-bar .pen-size.on, .inspector .pen-size.on { background: rgba(255,255,255,0.12) !important; box-shadow: none !important; }
.pen-bar .pen-size:not(.on):hover, .inspector .pen-size:not(.on):hover { background: rgba(255,255,255,0.08); }
.pen-label { font: 500 10.5px/1 "Geist Mono", ui-monospace, monospace; letter-spacing: 0.1em; }

/* ── symbol style dev pill (retired in v0.30: the Diffused symbols are the only style) */
.sym-dev { position: absolute; right: 16px; bottom: 16px; z-index: 3; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; }
.sym-dev-k { padding: 0 10px 0 8px; font: 500 10px/1 "Geist Mono", ui-monospace, monospace; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.sym-dev button { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: rgba(255,255,255,0.7); font: 500 12.5px/1 Geist, system-ui, sans-serif; cursor: pointer; }
.sym-dev button:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sym-dev button[aria-pressed="true"] { background: rgba(255,255,255,0.12); color: #fff; }
.canvas:has(.inspector) .sym-dev { opacity: 0; pointer-events: none; }
@media (width <= 640px) { .sym-dev { bottom: 120px; right: 12px; } .sym-dev-k { display: none; } }
@media (prefers-reduced-motion: reduce) { .ll-menu, .ll-modal, .ll-modal-wrap { animation: none; } }

/* ── right-click menu (v0.31): the same Frost glass, 12-radius rows and quiet separators as the other menus */
.canvas .excalidraw .context-menu {
  min-width: 232px; padding: 6px !important; margin: 0; border: 0 !important; border-radius: var(--pu-r-panel, 24px) !important;
  background: var(--pu-frost, rgba(28,28,32,0.72)) !important; -webkit-backdrop-filter: var(--pu-blur, blur(24px) saturate(160%)); backdrop-filter: var(--pu-blur, blur(24px) saturate(160%));
  box-shadow: var(--pu-edge, inset 0 0 0 1px rgba(255,255,255,0.08)), var(--pu-drop, 0 18px 48px -12px rgba(0,0,0,0.6)) !important;
  color: #fff; animation: llIn .16s cubic-bezier(0.23, 1, 0.32, 1);
}
.canvas .excalidraw .context-menu-item {
  display: flex !important; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px; padding: 0 12px !important;
  border-radius: var(--pu-r-row, 12px) !important; background: transparent; color: #E4E4E7 !important;
  font: 400 13.5px/1 Geist, system-ui, sans-serif !important; letter-spacing: 0; transition: background-color .12s ease;
}
.canvas .excalidraw .context-menu-item .context-menu-item__label { margin: 0 !important; color: inherit !important; }
.canvas .excalidraw .context-menu-item .context-menu-item__shortcut {
  display: inline !important; opacity: 1; font: 500 10.5px/1 "Geist Mono", ui-monospace, monospace !important; letter-spacing: 0.04em; color: rgba(255,255,255,0.42);
}
.canvas .excalidraw .context-menu-item:hover { background: rgba(255,255,255,0.08) !important; color: #fff !important; }
.canvas .excalidraw .context-menu-item.dangerous .context-menu-item__label { color: #FF7A5C !important; }
.canvas .excalidraw .context-menu-item.dangerous:hover { background: rgba(255,90,31,0.14) !important; }
.canvas .excalidraw .context-menu-item.dangerous:hover .context-menu-item__label { color: #FF8F73 !important; }
.canvas .excalidraw .context-menu-item.checkmark::before { left: auto; right: 12px; color: #FF5A1F; }
.canvas .excalidraw .context-menu-item-separator { height: 1px; margin: 5px 6px !important; border: 0 !important; background: rgba(255,255,255,0.08); }
.canvas .excalidraw .context-menu > .context-menu-item-separator:first-child,
.canvas .excalidraw .context-menu > .context-menu-item-separator:last-child,
.canvas .excalidraw .context-menu > .context-menu-item-separator + .context-menu-item-separator { display: none; }
@media (hover: none) { .canvas .excalidraw .context-menu-item { min-height: 44px; } .canvas .excalidraw .context-menu-item .context-menu-item__shortcut { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .canvas .excalidraw .context-menu { animation: none; } }

/* ── tool icons (v0.32): one family with the element icons; Clear the plan carries its icon */
.tb-btn > svg { width: 20px; height: 20px; }
.tb-pop .tb-row { display: flex; align-items: center; justify-content: flex-start; gap: 10px; text-align: left; }
.tb-pop .tb-row svg { width: 20px; height: 20px; flex: none; }
/* Lightfall™: the trademark sign sits small and quiet next to the name */
sup.tm { font-size: 0.55em; font-weight: 500; vertical-align: super; line-height: 0; margin-left: 1px; opacity: 0.7; letter-spacing: 0; }
