/* Empresa Viva is a compact, warm-cream overlay. The Godot world remains the
   largest surface and the parent can hide its normal controls in company mode. */
.company-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  color: #2b3038;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.4;
}
.company-root[aria-hidden="false"] { pointer-events: none; }
.company-shell { position: absolute; inset: 0; pointer-events: none; }
.company-head,
.company-main,
.company-error,
.company-tray { pointer-events: auto; }
.company-head {
  position: fixed;
  top: 16px;
  right: 16px;
  width: min(460px, calc(100vw - 32px));
  min-width: 380px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px 9px 16px;
  background: #fffbf3;
  border: 2px solid #e8863a;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 4px 16px rgba(43,48,56,.12);
}
.company-eyebrow { margin: 0; color: #5f6672; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.company-head h1 { margin: 0; font: 700 22px/1.2 Nunito, system-ui, sans-serif; }
.company-head-status { display: block; min-height: 1.1em; color: #7b5b17; font-size: 12px; font-weight: 700; }
.company-head-actions { display: flex; align-items: center; gap: 6px; }
.company-close { width: 36px; height: 36px; border: 1px solid #e3d9c6; border-radius: 10px; background: #f3ebdc; color: #2b3038; font-size: 25px; line-height: 1; cursor: pointer; }
.company-main {
  position: fixed;
  top: 72px;
  right: 16px;
  bottom: 82px;
  width: min(460px, calc(100vw - 32px));
  min-width: 380px;
  overflow-y: auto;
  padding: 0 12px 16px;
  background: #fffbf3;
  border: 1px solid #e3d9c6;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 16px rgba(43,48,56,.12);
  scrollbar-gutter: stable;
}
.company-error { position: fixed; right: 28px; bottom: 72px; width: min(436px, calc(100vw - 56px)); z-index: 2; margin: 0; padding: 8px 10px; color: #b9463f; background: #fff0ee; border: 1px solid #b9463f; border-radius: 8px; }
.company-loading { margin: 18px 4px; color: #5f6672; }
.company-main section { margin: 0; padding: 14px 4px; border-bottom: 1px solid #e3d9c6; }
.company-main h2 { margin: 0 0 9px; font: 700 18px/1.25 Nunito, system-ui, sans-serif; }
.company-main h3 { margin: 13px 0 6px; font-size: 14px; }
.company-case, .company-muted { margin: 0 0 8px; color: #5f6672; font-size: 14px; }
.company-unguided { margin: 12px 0 0; padding: 8px 10px; background: #f3ebdc; border-radius: 8px; }
.company-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.company-fact { min-width: 0; padding: 8px; background: #f3ebdc; border-radius: 8px; }
.company-fact-label { display: block; color: #5f6672; font-size: 12px; }
.company-fact strong { display: block; margin-top: 2px; font-size: 16px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.company-role-list { display: grid; gap: 6px; }
.company-role { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 4px; gap: 3px 8px; width: 100%; padding: 8px 10px; border: 1px solid #e3d9c6; border-radius: 9px; background: #fffbf3; color: #2b3038; text-align: left; cursor: pointer; }
.company-role[aria-pressed="true"] { border-color: #e8863a; background: #fff4e9; }
.company-role-name { font-weight: 700; }
.company-status { color: #5f6672; font-size: 13px; }
.company-meter { grid-column: 1 / -1; display: block; height: 4px; overflow: hidden; background: #eae0cd; border-radius: 99px; }
.company-meter span { display: block; height: 100%; background: #e8863a; }
.status-blocked { color: #b9463f; }.status-complete { color: #4f9a5c; }.status-in_progress { color: #c98a1e; }.status-paired, .status-pending { color: #c98a1e; }.status-connected { color: #4f9a5c; }.status-expired, .status-revoked, .status-timed-out { color: #b9463f; }
.company-assignment-state { margin: 0 0 8px; color: #5f6672; font-weight: 700; }
.company-warning { margin: 8px 0; padding: 8px; color: #7b5b17; background: #fff4d8; border: 1px solid #c98a1e; border-radius: 8px; }
.company-form { display: flex; flex-direction: column; gap: 9px; }
.company-field { display: flex; flex-direction: column; gap: 4px; color: #5f6672; font-size: 13px; font-weight: 600; }
.company-field textarea, .company-field input { width: 100%; min-height: 36px; padding: 8px 9px; border: 1px solid #d7ccb7; border-radius: 8px; background: #fffdf8; color: #2b3038; font: inherit; font-weight: 400; resize: vertical; }
.company-field textarea:focus, .company-field input:focus { border-color: #2f6fb3; }
.company-checks { display: grid; gap: 5px; margin: 0; padding: 8px; border: 1px solid #e3d9c6; border-radius: 8px; }
.company-checks legend { padding: 0 4px; color: #5f6672; font-size: 12px; font-weight: 700; }
.company-check { display: flex; align-items: flex-start; gap: 7px; color: #2b3038; font-size: 14px; font-weight: 400; }
.company-check input { width: 18px; height: 18px; flex: none; margin: 1px 0 0; accent-color: #e8863a; }
.company-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.company-wide { width: 100%; margin-top: 5px; }
.company-artifact { margin-top: 10px; border: 1px solid #e3d9c6; border-radius: 8px; }
.company-artifact summary { padding: 8px; cursor: pointer; font-weight: 700; }
.company-artifact pre { max-height: 180px; overflow: auto; margin: 0; padding: 8px; background: #f3ebdc; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; }
.company-source-inspector { margin-top: 8px; border: 1px solid #e3d9c6; border-radius: 8px; }
.company-source-inspector > summary { padding: 8px; cursor: pointer; font-weight: 700; }
.company-source { margin: 0 8px; padding: 8px 0; border-top: 1px solid #e3d9c6; scroll-margin-top: 12px; }
.company-source h4, .company-artifact h4 { margin: 0 0 5px; font-size: 13px; }
.company-source-revision { color: #5f6672; font-weight: 400; }
.company-source-fields, .company-artifact-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 2px 8px; margin: 0; font-size: 13px; }
.company-source-fields dt, .company-artifact-fields dt { color: #5f6672; }
.company-source-fields dd, .company-artifact-fields dd { margin: 0; overflow-wrap: anywhere; }
.company-evidence { margin: 0 0 5px; padding-left: 18px; font-size: 13px; }
.company-seal { color: #35673e; border-color: #bfdcc0 !important; background: #eef8ee; }
.company-review { padding: 14px 4px; border-bottom: 1px solid #e3d9c6; }
.company-review h3 { margin-top: 0; font: 700 18px/1.25 Nunito, system-ui, sans-serif; }
.company-code { letter-spacing: .12em; font: 700 18px ui-monospace, monospace !important; }
.company-connection { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 7px 0; border-top: 1px solid #e3d9c6; }
.company-badge { padding: 2px 6px; border: 1px solid #4f9a5c; border-radius: 99px; color: #35673e; font-size: 12px; font-weight: 700; }
.company-code-box { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0; padding: 10px; background: #fff4e9; border: 1px solid #e8863a; border-radius: 8px; }
.company-code-box p { flex: 1 0 100%; margin: 0; }
.company-tray { position: fixed; right: 16px; bottom: 16px; width: min(460px, calc(100vw - 32px)); display: flex; justify-content: flex-end; padding: 8px 12px; background: #fffbf3; border: 2px solid #e8863a; border-radius: 12px; box-shadow: 0 4px 16px rgba(43,48,56,.12); }
.company-tray { min-width: 380px; }
.company-tray .company-clear { min-width: 120px; }
.company-root button, .company-root input, .company-root textarea { font-size: 1rem; }
.company-root button:focus-visible, .company-root input:focus-visible, .company-root textarea:focus-visible, .company-root summary:focus-visible { outline: 3px solid #2f6fb3; outline-offset: 2px; }
body.company-mode #side, body.company-mode #buildbar, body.company-mode #buildbar-hint, body.company-mode #keyboard-help { visibility: hidden; pointer-events: none; }
@media (min-width: 1440px) { .company-main, .company-head, .company-tray { width: 480px; } }
@media (max-width: 1024px) {
  .company-head, .company-main, .company-tray { right: 10px; width: min(440px, calc(100vw - 20px)); }
  .company-head { top: 10px; }.company-main { top: 66px; bottom: 72px; }.company-tray { bottom: 10px; }
}
@media (max-width: 600px) {
  .company-head, .company-main, .company-tray { right: 8px; width: calc(100vw - 16px); }
  .company-main { padding-inline: 9px; }.company-facts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .company-head, .company-main, .company-tray { min-width: 0; }
}
/* On a small touch viewport the colony remains visible behind a folded
   bottom sheet. The header toggle is the explicit, keyboard-reachable way to
   inspect the full company surface. */
@media (max-width: 700px), (orientation: landscape) and (max-height: 520px) {
  .company-head, .company-main, .company-tray { right: 8px; left: 8px; width: auto; min-width: 0; }
  .company-head { top: auto; bottom: 58px; border-radius: 12px 12px 0 0; }
  .company-main { top: auto; bottom: 58px; height: 45dvh; max-height: 45dvh; border-radius: 12px 12px 0 0; }
  .company-root.company-folded .company-main { display: none; }
  .company-root.company-expanded .company-head { bottom: calc(45dvh + 58px); }
  .company-root.company-expanded .company-main { display: block; }
  .company-tray { bottom: 8px; }
  .company-tray .company-clear { min-width: 96px; }
}
@media (prefers-reduced-motion: reduce) { .company-root *, .company-root *::before, .company-root *::after { animation: none !important; transition: none !important; } }
