[hidden] { display: none !important; }
:root {
  --bg: #0b1522;
  --bg-2: #102033;
  --line: rgba(148, 163, 184, 0.18);
  --text: #e8eef6;
  --muted: #93a4bb;
  --blue: #3b82f6;
  --teal: #5eead4;
  --danger: #ef4444;
  --rail: 52px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bar); color: var(--text); font: 15px/1.45 ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif; overscroll-behavior: none; }
/* gocmd-settings-v1: the outer page never scrolls (iOS would slide it under the Dynamic Island);
   only the workspace inside scrolls. Solid safe-area spacers top and bottom. */
body { position: fixed; inset: 0; }
:root { --bar: #0f1720; --bar-fg: #b7c3cf; --bar-hi: #ffffff; --bar-line: rgba(255,255,255,.08); --sab-bg: var(--bar); --accent: var(--blue); }
.shell { position: absolute; inset: 0; height: 100%; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.sat { flex: 0 0 auto; height: env(safe-area-inset-top, 0px); min-height: env(safe-area-inset-top, 0px); background: var(--bar); }
.sab { flex: 0 0 auto; height: env(safe-area-inset-bottom, 0px); min-height: env(safe-area-inset-bottom, 0px); background: var(--sab-bg); }
.shell-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: row; overflow: hidden; }
.shell.empty-mode .sat, .shell.empty-mode .sab { background: var(--bg); }
.rail {
  position: relative; box-sizing: border-box; padding-left: env(safe-area-inset-left, 0px) !important; flex: 0 0 calc(56px + env(safe-area-inset-left, 0px)); width: 56px; display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 10px 0 10px; background: var(--bar); box-shadow: inset -1px 0 0 var(--bar-line);
  overflow: hidden; transition: margin-left .18s ease;
}
.rail.collapsed { margin-left: calc(-56px - env(safe-area-inset-left, 0px)); }
.rail-ws { align-self: stretch; width: 100%; padding: 4px 0 !important; display: flex; flex-direction: column; align-items: center; gap: 8px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; min-height: 0; padding: 2px 0; }
.rail-ws::-webkit-scrollbar { display: none; }
.rtab { position: relative; appearance: none; border: 0; padding: 0; width: 40px; height: 40px; border-radius: 12px; cursor: pointer; background: rgba(255,255,255,.08); color: var(--bar-hi); font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; transition: border-radius .15s, background .15s; }
.rtab img { width: 26px; height: 26px; object-fit: contain; pointer-events: none; }
.rtab .ini { pointer-events: none; }
.rtab:hover { background: rgba(255,255,255,.14); }
.rtab.on { background: rgba(255,255,255,.16); box-shadow: 0 0 0 2px var(--accent); }
.rtab::before { content: ""; position: absolute; left: -8px; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--bar-hi); transform: translateY(-50%); transition: height .15s; }
.rtab.on::before { height: 24px; }
.rtab .bdg { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; border: 2px solid var(--bar); box-sizing: content-box; }
.rtab .bdg[hidden] { display: none; }
.rail-add, .rail-gear { appearance: none; border: 0; width: 40px; height: 40px; border-radius: 12px; background: transparent; color: var(--bar-fg); cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.rail-add { font-size: 22px; font-weight: 400; border: 1.5px dashed var(--bar-line); }
.rail-add:hover, .rail-gear:hover { background: rgba(255,255,255,.1); color: var(--bar-hi); }
.rail-fill { flex: 1 1 auto; }
.shell.light-bar .rtab { background: rgba(15,23,42,.06); color: #0f172a; }
.shell.light-bar .rtab:hover, .shell.light-bar .rail-add:hover, .shell.light-bar .rail-gear:hover { background: rgba(15,23,42,.1); }
.shell.light-bar .rtab::before { background: #0f172a; }
.primary {
  appearance: none; border: 0; background: var(--blue); color: #fff;
  font-weight: 700; font-size: 13px; padding: 7px 12px; border-radius: 10px; cursor: pointer;
}
.primary:hover { filter: brightness(1.08); }
.stage { flex: 1 1 auto; position: relative; min-height: 0; min-width: 0; background: var(--bg); }
/* gocmd-embed-v1: one persistent frame per workspace; switching only flips visibility */
.wsframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg); color-scheme: normal; visibility: hidden; opacity: 0; pointer-events: none; z-index: 1; }
.wsframe.on { visibility: visible; opacity: 1; pointer-events: auto; z-index: 2; }
.wsframe.on.loading { visibility: hidden; opacity: 0; pointer-events: none; }
.loader { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 14px; background: var(--bg); }
.loader b { color: var(--text); font-weight: 600; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(147,164,187,.25); border-top-color: var(--blue); animation: gcspin .8s linear infinite; }
@keyframes gcspin { to { transform: rotate(360deg); } }
.notify-banner { position: absolute; z-index: 10; left: 50%; top: 10px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: calc(100% - 20px); padding: 8px 8px 8px 14px; border-radius: 12px; background: #152234; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0,0,0,.4); font-size: 14px; }
.notify-banner span { color: var(--text); }
.notify-banner .primary { white-space: nowrap; }
.notify-banner .ghost { white-space: nowrap; font-size: 13px; }
.empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 32px 20px; gap: 8px;
}
.empty img { border-radius: 16px; margin-bottom: 8px; }
.empty h1 { margin: 8px 0 0; font-size: 28px; letter-spacing: -0.03em; }
.empty p { max-width: 420px; color: var(--muted); margin: 8px 0; }
.empty .hint { font-size: 13px; }
.modal-bg {
  position: fixed; inset: 0; background: rgba(2, 8, 16, 0.72);
  display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 20;
}
.modal {
  width: min(420px, 100%); background: #152234; border: 1px solid var(--line);
  border-radius: 16px; padding: 22px 20px 18px; box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.modal h2 { margin: 0 0 6px; font-size: 18px; }
.modal p { margin: 0 0 12px; color: var(--muted); }
.modal input {
  width: 100%; background: #0b1522; color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-size: 16px;
}
.modal input:focus { outline: 2px solid var(--blue); border-color: transparent; }
.preview { min-height: 1.2em; font-size: 13px; }
.err { color: #fca5a5; font-size: 13px; min-height: 1.2em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.ghost { appearance: none; border: 0; background: transparent; color: var(--muted); font-weight: 600; padding: 7px 12px; border-radius: 10px; cursor: pointer; }
.ghost:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
@media (max-width: 640px) {
  .empty h1 { font-size: 24px; }
}

/* gocmd-rail-v2: when the workspace shows its bottom tab bar (phone), the rail's bottom
   continues that bar so there is no dark notch beside it; the gear sits above it. */
.rail { --tabs-h: 0px; }
.rail.has-tabs { padding-bottom: calc(var(--tabs-h) + 10px); }
.rail.has-tabs::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--tabs-h); background: var(--tabs-bg, #fff); border-top: 1px solid var(--tabs-line, transparent); box-sizing: border-box; }

/* gocmd-deck-v1: Direction C "Editorial Floating Deck" shell. Companies switch from the deck in each workspace menu. */
@font-face { font-family: "GC Jakarta"; src: url("/app/gocmd-jakarta.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
.rail { display: none !important; }
html[data-gc-deck] { --bg: #eef1f5; --bg-2: #ffffff; --line: #e2e8f0; --text: #0f172a; --muted: #64748b; --blue: var(--gc-g1, #4f46e5); --bar: #eef1f5; --gc-g: linear-gradient(135deg, var(--gc-g1, #4f46e5), var(--gc-g2, #0d9488)); }
html[data-gc-deck="dark"] { --bg: #0b0f19; --bg-2: #131a2a; --line: #253049; --text: #f1f5f9; --muted: #94a3b8; --bar: #0b0f19; }
html[data-gc-deck], html[data-gc-deck] body { font-family: "GC Jakarta", "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, sans-serif; }
html[data-gc-deck] .sat, html[data-gc-deck] .sab { background: var(--bar); }
html[data-gc-deck] .shell.empty-mode .sat, html[data-gc-deck] .shell.empty-mode .sab { background: var(--bg); }
html[data-gc-deck] .primary { background: var(--gc-g); border-radius: 14px; padding: 10px 18px; font-size: 14px; font-weight: 800; box-shadow: 0 10px 22px -10px var(--gc-g1, #4f46e5); }
html[data-gc-deck] .empty img { border-radius: 20px; box-shadow: 0 14px 30px -14px rgba(15,23,42,.35); }
html[data-gc-deck] .empty h1 { font-size: 36px; font-weight: 800; letter-spacing: -0.04em; }
html[data-gc-deck] .empty::before { content: "GoCommand"; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; background: var(--gc-g); -webkit-background-clip: text; background-clip: text; color: transparent; order: 1; }
html[data-gc-deck] .empty > * { order: 2; }
html[data-gc-deck] .empty > img { order: 0; }
html[data-gc-deck] .modal-bg { background: rgba(15, 23, 42, 0.45); }
html[data-gc-deck] .modal { background: var(--bg-2); border: 0; border-radius: 26px; padding: 26px 24px 20px; box-shadow: 0 30px 70px -20px rgba(15,23,42,.45); }
html[data-gc-deck] .modal h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
html[data-gc-deck] .modal input { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 14px; }
html[data-gc-deck] .modal input:focus { outline: 2px solid var(--gc-g1, #4f46e5); }
html[data-gc-deck] .ghost:hover { background: rgba(15,23,42,.06); }
html[data-gc-deck="light"] .err { color: #dc2626; }
html[data-gc-deck] .notify-banner { background: var(--bg-2); border: 0; border-radius: 999px; box-shadow: 0 14px 34px -12px rgba(15,23,42,.35); }
html[data-gc-deck] .loader { background: var(--bg); }
html[data-gc-deck] .spin { border-color: rgba(100,116,139,.25); border-top-color: var(--gc-g1, #4f46e5); }

/* ui-polish-v1 (NC-25): keyboard open, the shell is exactly the visual viewport; no bottom spacer under the keyboard */
html.gc-kb .shell { top: var(--gc-vvt, 0px); bottom: auto; height: var(--gc-vvh, 100%) !important; }
html.gc-kb .sab { height: 0 !important; min-height: 0 !important; }
/* t408u / t409u: edge to edge. No black spacer bars above or below a workspace: the frame runs to the screen
   edges and the shell passes the real safe-area insets into it (gocmd-insets), where Command pads its own chrome. */
.shell:not(.empty-mode) .sat, .shell:not(.empty-mode) .sab { height: 0 !important; min-height: 0 !important; }
.sat, .sab { touch-action: none; }
html { position: fixed; inset: 0; width: 100%; overflow: hidden; overscroll-behavior: none; }
/* edge to edge: the notification prompt sits below the status bar, not on top of the workspace header's clock area */
.notify-banner { top: calc(max(env(safe-area-inset-top, 0px), var(--gc-test-sat, 0px)) + 8px); }

/* duo-island-fix-v5 (t439u): the "Turn on notifications" prompt. Centred with left:50% + translateX(-50%), an absolute box
   only gets half the screen as its shrink-to-fit width, so the text wrapped into a narrow 6-line column that overflowed the
   999px pill. Now it is centred between left/right 10px insets (full width available, capped at 460px) and is a rounded card. */
.notify-banner { left: 10px; right: 10px; transform: none; margin: 0 auto; width: fit-content; max-width: min(460px, calc(100% - 20px)); box-sizing: border-box; }
.notify-banner span { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
html[data-gc-deck] .notify-banner { border-radius: 16px; padding: 10px 10px 10px 14px; }
@media (max-width: 480px) { .notify-banner { flex-wrap: wrap; row-gap: 8px; } .notify-banner span { flex-basis: 100%; } .notify-banner .primary { margin-left: auto; } }
