/* Identidade de cada cliente. A geometria dos modais e os formulários ficam no componente compartilhado. */
:root {
  color-scheme: light;
  --qg-input-background: #fffaf5;
  --qg-input-border: #c1a18a;
  --qg-select-background: #fffaf5;
  --qg-select-border: #c1a18a;
  --qg-text: #5B2E1F;
  --qg-mint: #8e3e50;
  --canvas: #F9E8D6;
  --surface: #fffaf5;
  --panel: #fff6ec;
  --line: #c1a18a;
  --body-text: #5B2E1F;
  --secondary: #704a3c;
  --mint: #8e3e50;
  --action-text: #fffaf5;
  --backdrop: #5b2e1f80;
  --scene-light: #F9E8D6;
  --scene-dark: #E8D2BA;
}

/* Keep the shared form controls readable on the Lekos light palette. */
:where(form button, .qg-forms button) {
  background: var(--surface);
  border-color: var(--line);
}
:where(form button, .qg-forms button):where(:hover:not(:disabled)),
:where(select):where(:hover:not(:disabled)) {
  background: #f1dfd0;
  border-color: var(--mint);
}
:where(input, textarea)::placeholder { color: var(--secondary); }
:where(input, textarea, button, .qg-forms a, .qg-forms summary):where(:focus-visible) {
  outline-color: var(--mint);
}
@supports (appearance: base-select) {
  :where(select:not([multiple], [size])):where(:open),
  :where(select:not([multiple], [size]))::picker(select) {
    background: var(--surface);
    border-color: var(--line);
    color: var(--body-text);
  }
  :where(select:not([multiple], [size]) option) { color: var(--body-text); }
  :where(select:not([multiple], [size]) option:checked),
  :where(select:not([multiple], [size]) option:hover:not(:disabled)),
  :where(select:not([multiple], [size]) option:checked:hover) {
    background: #f1dfd0;
    color: var(--body-text);
  }
}

/* The bakery is the main workspace; the directory keeps every role easy to find. */
.workspace { width: min(100% - 3rem, 1440px); margin-top: 1.6rem; }
.topbar { padding-inline: max(1.5rem, (100% - 1440px) / 2); background: #fffaf5e8; }
.brand img { width: 52px; height: 52px; }
.workspace-header { gap: 1.5rem; margin-bottom: 1.2rem; align-items: end; }
.workspace-header small { letter-spacing: .08em; font-size: .78rem; text-transform: uppercase; }
.workspace-header h1 { font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: -.04em; }
.scene-intro { text-align: right; color: var(--secondary); font-size: .95rem; }
.bakery-scroll { overflow: auto; max-height: min(78vh, 1000px); border: 1px solid var(--line); border-radius: 24px; background: var(--scene-dark); box-shadow: 0 15px 45px #5b2e1f13; }
.bakery-scroll:focus-visible { outline: 3px solid var(--mint); outline-offset: 4px; }
.map-surface { position: relative; width: 2000px; height: 1000px; }
.scene { position: absolute; inset: 0 auto auto 0; display: block; width: 2000px; height: 1000px; min-width: 0; min-height: 0; aspect-ratio: 2 / 1; transform-origin: top left; border: 0; border-radius: 0; padding: 0; }
.scene::before { display: none; }
#scene-image { z-index: -1; object-fit: fill; }
.team { position: absolute; inset: 0; display: block; }
.qg-forms .station.scene-person {
  position: absolute; display: flex; flex-direction: column; align-items: center;
  width: 9.4%; height: 29%; min-height: 0; gap: 0; padding: 0;
  transform: translate(-50%, -100%); border: 0; border-radius: 0;
  background: transparent; text-align: center; box-shadow: none;
}
.scene-person .portrait { display: block; width: 100%; height: calc(100% - 56px); flex: none; min-height: 0; border: 0; border-radius: 0; background: transparent; overflow: visible; }
.scene-person .portrait img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 3px #5b2e1f2b); transition: transform .18s ease; }
.scene-person .station-caption { flex: none; max-width: 100%; width: 100%; height: 56px; padding: 3px 6px; border: 1px solid #bd8c6c; border-radius: 12px; background: #fff9f0f5; box-shadow: 0 2px 6px #5b2e1f18; }
.scene-person strong { padding: 0; border: 0; background: transparent; font-size: 16px; line-height: 1.2; box-shadow: none; }
.scene-person small { display: block; color: var(--secondary); font-weight: 400; font-size: 14px; line-height: 1.15; margin-top: 2px; }
.scene-person::before { content: ''; position: absolute; bottom: 57px; left: 38%; width: 24%; height: 6px; border-radius: 50%; background: #5b2e1f30; filter: blur(3px); z-index: -1; }
.qg-forms .station.scene-person:hover, .qg-forms .station.scene-person:focus-visible { z-index: 4; background: transparent; }
.scene-person:hover .portrait img, .scene-person:focus-visible .portrait img { transform: translateY(-5px) scale(1.05); }
.scene-person:focus-visible { outline: 0; }
.scene-person:focus-visible strong { outline: 3px solid var(--mint); outline-offset: 3px; }
.scene-person[data-agent="assistant"] .station-caption { color: var(--surface); background: var(--mint); border-color: var(--mint); }
.scene-person[data-agent="assistant"] strong, .scene-person[data-agent="assistant"] small { color: var(--surface); }
.map-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin: 0 0 .75rem; }
.map-tools strong { font-size: 1rem; }
#map-scale { color: var(--secondary); font-size: .875rem; }
.map-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.map-actions button { font-size: .875rem; }
.scene-help { margin: .8rem .3rem 2rem; color: var(--secondary); font-size: .9rem; }
.scene-help span { display: none; }
.team-directory { padding-bottom: 1rem; }
.team-directory > header { margin-bottom: 1rem; }
.team-directory h2 { font-size: 1.4rem; }
.team-directory > header p { color: var(--secondary); margin-top: .2rem; }
.directory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .65rem; }
.qg-forms .directory-person { display: flex; align-items: center; gap: .8rem; padding: .6rem .8rem; min-height: 105px; text-align: left; background: var(--surface); border-color: var(--line); border-radius: 14px; }
.directory-portrait { display: block; width: 60px; height: 85px; flex: none; }
.directory-portrait img { width: 100%; height: 100%; object-fit: contain; }
.directory-person strong, .directory-person small { display: block; }
.directory-person small { font-size: .875rem; font-weight: 400; }
.agent-header .portrait { width: 76px; height: 100px; border: 0; background: transparent; }
@media (max-width: 1000px) { .scene-help span { display: inline; } }
@media (max-width: 720px) {
  .workspace { width: calc(100% - 1.2rem); }
  .workspace-header { display: block; }
  .scene-intro { text-align: left; margin-top: .5rem; }
  .bakery-scroll { border-radius: 16px; }
  .topbar { padding-inline: .8rem; }
  .scene-help { font-size: .875rem; }
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qg-forms .directory-person { flex-direction: column; gap: .35rem; padding: .7rem; text-align: center; }
  .directory-portrait { width: 75px; height: 105px; }
}
@media (prefers-reduced-motion: reduce) { .scene-person .portrait img { transition: none; } }

/* Quiet grouping: shared islands, open circulation, compact names on the map. */
.scene-person .portrait { height: calc(100% - 28px); }
.scene-person .station-caption { width: auto; min-width: 80px; height: 28px; padding: 4px 9px; border-radius: 15px; }
.scene-person .station-caption small { display: none; }
.scene-person:hover .station-caption, .scene-person:focus-visible .station-caption { height: auto; min-height: 28px; position: absolute; top: calc(100% - 28px); width: 210px; z-index: 10; }
.scene-person:hover .station-caption small, .scene-person:focus-visible .station-caption small { display: block; padding-block: 3px; }
.scene-person::before { bottom: 29px; }
.scene-person[data-zone="management"], .scene-person[data-zone="customers"] { height: 30%; }
.scene-person.is-muted { opacity: .35; }
.zone-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.zone-nav button { border-radius: 22px; padding: .4rem .85rem; font-size: .875rem; font-weight: 500; }
.zone-nav button[aria-pressed="true"] { color: var(--surface); background: var(--mint); border-color: var(--mint); }
.zone-labels { position: absolute; inset: 0; pointer-events: none; }
.zone-label { position: absolute; transform: translate(-50%, -50%); padding: 5px 15px; background: #fff8eeeb; border: 1px solid #c9a893; border-radius: 24px; color: var(--body-text); font-size: 18px; font-weight: 600; white-space: nowrap; }
.directory-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; align-items: start; }
.directory-group { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; overflow: hidden; }
.directory-group summary { cursor: pointer; padding: 1rem 1.2rem; }
.directory-group summary strong { font-size: 1.05rem; }
.directory-group summary small { display: block; margin: .25rem 0 0 1.1rem; font-size: .875rem; }
.directory-group .directory-grid { padding: 0 .8rem .8rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) { .directory-groups { grid-template-columns: 1fr; } .zone-nav { gap: .4rem; } .zone-nav button { font-size: .875rem; } }

.motion-tools { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; margin: 0 0 .8rem; }
.motion-tools > div { display: flex; gap: .45rem; }
.motion-tools button { font-size: .875rem; }
.walk-preview-link { display: inline-flex; align-items: center; padding: .6rem .8rem; min-height: 44px; color: var(--body-text); background: var(--surface); border: 1px solid #bd8c6c; border-radius: 10px; font-size: .875rem; font-weight: 600; text-decoration: none; }
.walk-preview-link:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
#scene-motion-status { color: var(--secondary); font-size: .875rem; }
.walking-routes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; }
.walking-routes.routes-visible { opacity: 1; }
.walking-route { stroke: #8e3e50; stroke-width: 3; stroke-dasharray: 8 10; stroke-linejoin: round; stroke-linecap: round; opacity: .22; }
.walking-route.active-route { stroke: #6b7a3f; stroke-width: 5; stroke-dasharray: 9 8; opacity: .9; }
.qg-forms .station.scene-person.is-animated { width: 220px; height: 286px; }
.scene-person.is-animated .motion-portrait { width: 220px; height: 258px; flex: none; }
.motion-portrait canvas { display: block; width: 220px; height: 258px; filter: drop-shadow(0 3px 2px #5b2e1f20); }
.scene-person.is-animated:hover .motion-portrait, .scene-person.is-animated:focus-visible .motion-portrait { transform: none; }
.scene-person.is-walking { opacity: 1; }
.scene-person.is-walking .station-caption { border-color: #6b7a3f; }
@media (max-width: 720px) { .motion-tools { display: block; } #scene-motion-status { display: block; margin-top: .5rem; } }

.chair-guides { display: none; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.is-chair-review #team, .is-chair-review #zone-labels, .is-chair-review #walking-routes { visibility: hidden; }
.is-chair-review .chair-guides { display: block; }
.chair-guides circle { fill: #11c4d4; stroke: #fff; stroke-width: 3; }
.chair-guides .chair-seat { fill: #11c4d430; stroke: #006c7a; stroke-width: 2; }
.chair-guides .chair-backrest { fill: none; stroke: #a36d00; stroke-width: 2; stroke-dasharray: 5 3; }
.chair-guides .chair-facing { stroke: #006c7a; stroke-width: 3; }
.chair-legend { color: var(--secondary); font-size: .875rem; margin: -.3rem 0 .8rem; }
.chair-guides text { fill: #533222; stroke: #fffaf5; stroke-width: 5px; paint-order: stroke; font: 600 18px system-ui, sans-serif; text-anchor: middle; }
.work-poses { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.team { z-index: 2; }
.zone-labels { z-index: 3; pointer-events: none; }
.chair-guides { z-index: 4; }
.is-chair-review .work-poses { visibility: hidden; }
.scene-person.is-fitted .portrait, .scene-person.is-fitted::before { visibility: hidden; }
.scene-person.is-fitted .station-caption { position: absolute; bottom: 0; height: 28px; width: auto; min-width: 90px; max-width: none; padding: 3px 9px; border-radius: 16px; }
.scene-person.is-fitted .station-caption small { display: none; }
.scene-person.is-fitted .station-caption strong { white-space: nowrap; }
.scene-person.is-fitted:focus-visible .station-caption { outline: 3px solid var(--mint); outline-offset: 3px; }
