.room-scans-dialog { width: min(680px, 90vw); max-height: 85vh; border: 0; border-radius: 18px; padding: 24px; color: #172033; }
.room-scans-dialog::backdrop { background: rgb(8 25 42 / 55%); }
.room-scans-dialog header { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.room-scans-dialog h2 { margin: 0; }
.room-scans-dialog p { line-height: 1.5; }
.room-scans-note { color: #52647a; font-size: 14px; }
.room-scan-card { padding: 18px 0; border-top: 1px solid #dce5ee; }
.room-scans-dialog button { padding: 10px 14px; border: 1px solid #c7d2e1; border-radius: 8px; background: #eaf6ff; color: #123f66; cursor: pointer; }
.room-scans-dialog button:disabled { opacity: .5; cursor: wait; }

:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --panel: #ffffff;
  --line: #d7dde5;
  --text: #18202a;
  --muted: #657385;
  --accent: #0b6bcb;
  --accent-strong: #064f9a;
  --brand-blue: #123f66;
  --brand-blue-soft: #eaf6ff;
  --brand-orange: #e49a4f;
  --brand-orange-strong: #c57924;
  --good: #11845b;
  --warn: #9b6400;
  --bad: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  border-color: #aeb8c5;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) var(--designer-panel-width, 430px);
  height: 100vh;
  min-height: 620px;
  transition: grid-template-columns 0.18s ease;
}

.app-shell.designer-collapsed {
  grid-template-columns: minmax(620px, 1fr) 52px;
}

body.panraspil-native-panel-shell .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body.panraspil-native-panel-shell .designer-pane,
body.panraspil-native-panel-shell .designer-resize-handle {
  display: none !important;
}

/* The PlanPlace-native shell owns the scene and the outer AI toggle. */
body.embedded-planplace {
  min-height: 100%;
  background: #fff;
}

body.embedded-planplace .app-shell {
  display: block;
  width: 100%;
  height: 100dvh;
  min-height: 0;
}

body.embedded-planplace .planner-pane,
body.embedded-planplace .designer-resize-handle,
body.embedded-planplace .panel-toggle {
  display: none;
}

body.embedded-planplace .designer-pane {
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: 8px;
  padding: 10px;
  border: 0;
}

/* The iframe is deliberately compact: its parent already provides the scene. */
body.embedded-planplace .designer-profile {
  min-height: 72px;
  padding: 10px 12px;
}

body.embedded-planplace .designer-profile h1 {
  font-size: 18px;
}

body.embedded-planplace .designer-profile p {
  margin-top: 4px;
  font-size: 13px;
}

body.embedded-planplace .designer-avatar {
  width: 58px;
  height: 58px;
}

body.embedded-planplace .dialogue-stage {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  gap: 8px;
}

body.embedded-planplace .chat-log {
  flex: 1 1 auto;
  max-height: none;
  padding-bottom: 0;
}

body.embedded-planplace .assistant-question {
  max-height: none;
  padding: 10px;
  overflow: visible;
  font-size: 14px;
}

body.embedded-planplace .panel-bottom-stack {
  margin-top: auto;
}

body.embedded-planplace .account-panel {
  padding-top: 8px;
}

@media (max-width: 980px) {
  body.embedded-planplace .designer-pane {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

.planner-pane,
.designer-pane {
  min-width: 0;
  min-height: 0;
}

.planner-pane {
  display: grid;
  grid-template-rows: 1fr;
  border-right: 1px solid var(--line);
  background: #eef2f6;
}

.inline-row,
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill,
#ordersMeta,
#currentProjectBadge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.status-pill.good {
  color: var(--good);
  border-color: #9bd7c2;
  background: #eefaf5;
}

.status-pill.warn {
  color: var(--warn);
  border-color: #e6c789;
  background: #fff8e8;
}

#plannerFrame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.designer-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
  background: var(--panel);
  position: relative;
  container-type: inline-size;
  transition: padding 0.18s ease;
}

.designer-resize-handle {
  position: absolute;
  top: 116px;
  bottom: auto;
  left: 0;
  z-index: 4;
  width: 28px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.designer-resize-handle::after {
  position: absolute;
  top: 50%;
  left: 2px;
  display: grid;
  width: 24px;
  height: 42px;
  place-items: center;
  border: 1px solid #b9c7d6;
  border-radius: 7px;
  background: #f7fbff;
  box-shadow: 0 2px 8px rgba(24, 32, 42, 0.12);
  color: #6687a4;
  content: "↔";
  font-size: 16px;
  font-weight: 800;
  transform: translateY(-50%);
}

.designer-resize-handle:hover::after,
.designer-resize-handle:focus-visible::after,
body.designer-panel-resizing .designer-resize-handle::after {
  border-color: var(--accent);
  background: #eaf6ff;
  color: var(--accent);
  box-shadow: 0 2px 10px rgba(11, 107, 203, 0.2);
}

.designer-resize-handle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body.designer-panel-resizing {
  cursor: col-resize;
  user-select: none;
}

.panel-toggle {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 5;
  width: 30px;
  height: 82px;
  padding: 0;
  border-color: #b9c7d6;
  border-radius: 0 8px 8px 0;
  background: #fff;
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 2px 10px rgba(24, 32, 42, 0.12);
  transform: translateY(-50%);
}

.panel-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.app-shell.designer-collapsed .designer-pane {
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.app-shell.designer-collapsed .designer-pane > :not(.panel-toggle) {
  display: none !important;
}

.app-shell.designer-collapsed .designer-resize-handle {
  display: none;
}

.app-shell.designer-collapsed .panel-toggle {
  position: static;
  width: 38px;
  height: 96px;
  border-radius: 8px;
  box-shadow: none;
  transform: none;
  font-size: 12px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  color: var(--bad);
  animation: collapsedPanelPulse 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.designer-profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  min-height: 92px;
  padding: 13px 13px 13px 15px;
  border: 1px solid #c8e0f6;
  border-bottom-color: #b7d6f0;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(234, 246, 255, 0.92) 58%, rgba(255, 246, 235, 0.92)),
    #f7fbff;
  box-shadow: 0 1px 0 rgba(18, 63, 102, 0.04);
}

.designer-profile h1,
.section-title h2 {
  margin: 0;
}

.designer-profile h1 {
  font-size: 20px;
  line-height: 1.2;
  color: var(--brand-blue);
  font-weight: 800;
}

.designer-profile p {
  margin: 6px 0 0;
  color: #356f9f;
  font-weight: 500;
}

.assistant-voice-toggle {
  position: relative;
  flex: 0 0 auto;
  min-width: 52px;
  height: 30px;
  padding: 0 9px;
  border-color: #b6d6ef;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 700;
}

.assistant-voice-toggle.active {
  border-color: var(--accent);
  background: #eaf6ff;
  color: var(--accent-strong);
}

.assistant-voice-toggle.muted:not(.is-loading) {
  border-color: #ffb8b8;
  background: rgba(255, 234, 234, 0.9);
  color: #9a1a1a;
  animation: voiceToggleMutedPulse 1.2s ease-in-out infinite;
}

.assistant-voice-toggle.is-loading {
  color: transparent;
}

.assistant-voice-toggle.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 13px;
  border: 2px solid #bdd7f7;
  border-top-color: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spin 0.8s linear infinite;
}

.designer-avatar {
  position: relative;
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  border: 2px solid #ffffff;
  border-radius: 50%;
  overflow: hidden;
  background: var(--brand-blue-soft);
  box-shadow:
    0 0 0 1px #9dccf3,
    0 8px 18px rgba(18, 63, 102, 0.16);
}

.designer-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.designer-avatar::after {
  content: "AI";
  position: absolute;
  right: -1px;
  bottom: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 18px;
  padding: 0 6px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--brand-orange);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.panel-section {
  display: grid;
  gap: 8px;
}

.panel-section label {
  font-weight: 600;
}

.inline-row input,
.inline-row select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.section-title {
  justify-content: space-between;
}

.section-title h2 {
  font-size: 15px;
}

.orders-list {
  display: grid;
  gap: 8px;
}

.dialogue-stage {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 10px;
}

.assistant-question {
  padding: 12px;
  border: 1px solid #bdd7f7;
  border-radius: 8px;
  background: #edf5ff;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

.assistant-question.is-typing {
  min-height: 142px;
}

.assistant-question.is-typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  background: var(--accent);
  vertical-align: -0.15em;
  animation: caretBlink 0.8s steps(1, end) infinite;
}

.dictation-highlight {
  color: #dc2626;
  font-weight: 700;
}

.inline-quick-replies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.inline-quick-replies button {
  min-height: 38px;
  border-color: #93c5fd;
  background: #ffffff;
  color: var(--accent);
  font-weight: 600;
}

.inline-quick-replies button:hover {
  background: #eff6ff;
}

.bazis-export-action {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.bazis-export-action button {
  width: 100%;
  min-height: 42px;
  border-color: #0f766e;
  background: #0f766e;
  color: #fff;
  font-weight: 700;
}

.bazis-export-action button:hover:not(:disabled) {
  background: #115e59;
}

.bazis-export-action .panorama-render-button {
  border-color: #4338ca;
  background: #4338ca;
}

.bazis-export-action .panorama-render-button:hover:not(:disabled) {
  background: #3730a3;
}

.panorama-quality-overlay {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(5px);
}

.panorama-quality-dialog {
  width: min(520px, 100%);
  padding: 18px;
  border: 1px solid #dbe4ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.panorama-quality-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panorama-quality-heading strong,
.panorama-quality-heading span {
  display: block;
}

.panorama-quality-heading strong {
  color: #172033;
  font-size: 20px;
}

.panorama-quality-heading span {
  margin-top: 3px;
  color: #64748b;
  font-size: 13px;
}

.panorama-quality-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eef2f7;
  color: #475569;
  font-size: 23px;
  line-height: 1;
}

.panorama-quality-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.panorama-quality-option {
  display: grid;
  gap: 4px;
  min-height: 112px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 13px;
  background: #fff;
  color: #334155;
  text-align: left;
}

.panorama-quality-option:hover,
.panorama-quality-option:focus-visible {
  border-color: #6366f1;
  background: #eef2ff;
}

.panorama-quality-option.recommended {
  border-color: #4f46e5;
  box-shadow: inset 0 0 0 1px #4f46e5;
}

.panorama-quality-title {
  color: #172033;
  font-weight: 750;
}

.panorama-quality-option small {
  color: #64748b;
}

.panorama-quality-note {
  margin: 13px 2px 0;
  color: #64748b;
  font-size: 12px;
}

.bazis-export-action .production-menu-button {
  border-color: #0f766e;
  background: #0f766e;
}

.bazis-export-action .production-menu-button:hover:not(:disabled) {
  background: #115e59;
}

.production-overlay {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(5px);
}

.production-dialog {
  width: min(760px, 100%);
  padding: 22px;
  border: 1px solid #dbe4ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.production-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.production-heading strong,
.production-heading span {
  display: block;
}

.production-heading strong {
  color: #172033;
  font-size: 22px;
}

.production-heading span {
  margin-top: 4px;
  color: #64748b;
  font-size: 14px;
}

.production-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.production-project-status {
  margin: 18px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.production-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.production-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 12px;
  padding: 18px;
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff, #f8fafc);
}

.production-option-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: #ccfbf1;
  color: #0f766e;
  font-weight: 800;
}

.production-option h3,
.production-option p {
  margin: 0;
}

.production-option h3 {
  color: #172033;
  font-size: 17px;
}

.production-option p {
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.production-option > p,
.production-action-button,
.production-postprocessor-label,
.production-postprocessor,
.production-postprocessor-description {
  grid-column: 1 / -1;
}

.production-postprocessor-label {
  margin-top: 4px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.production-postprocessor {
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #172033;
  font: inherit;
}

.production-postprocessor-description {
  min-height: 38px;
}

.production-action-button {
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid #0f766e;
  border-radius: 9px;
  background: #0f766e;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

.production-action-button:hover,
.production-action-button:focus-visible {
  background: #115e59;
}

.production-note {
  margin: 16px 2px 0;
  color: #64748b;
  font-size: 12px;
}

.woodwop-production-result {
  margin-top: 10px;
}

.woodwop-production-result button {
  width: 100%;
  min-height: 42px;
  border-color: #0f766e;
  background: #0f766e;
  color: #fff;
  font-weight: 750;
}

.woodwop-production-result button:hover:not(:disabled) {
  background: #115e59;
}

.panorama-render-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.panorama-render-result a,
.panorama-render-result button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid #4338ca;
  border-radius: 9px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.panorama-render-result a {
  background: #4338ca;
  color: #fff;
}

.panorama-render-result button {
  background: #fff;
  color: #4338ca;
}

@media (max-width: 620px) {
  .bazis-export-action,
  .panorama-quality-options,
  .panorama-render-result,
  .production-options {
    grid-template-columns: 1fr;
  }
}

.product-choice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.product-choice-actions button {
  display: grid;
  align-content: center;
  gap: 3px;
  height: auto;
  min-height: 64px;
  padding: 9px 10px;
  text-align: left;
  border-color: #c8d7e6;
  background: #ffffff;
}

.product-choice-actions button strong,
.product-choice-actions button span {
  display: block;
  min-width: 0;
}

.product-choice-actions button strong {
  color: var(--brand-blue);
  font-size: 14px;
  line-height: 1.2;
}

.product-choice-actions button span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.product-choice-actions button.active {
  border-color: var(--accent);
  background: #edf5ff;
  box-shadow: inset 0 0 0 1px rgba(11, 107, 203, 0.2);
}

.voice-button {
  padding: 0 8px;
  font-size: 12px;
}

.voice-button {
  border-color: #fecaca;
  background: #fff1f2;
  color: #dc2626;
  font-weight: 700;
}

.voice-button:hover:not(:disabled) {
  border-color: #fca5a5;
  background: #ffe4e6;
}

.room-validation-actions {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.room-validation-actions button {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.room-validation-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.quick-actions button.is-processing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 1;
}

.quick-actions button.is-processing::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid #bdd7f7;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.voice-button.recording {
  border-color: var(--bad);
  background: #dc2626;
  color: #fff;
}

.project-summary {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.account-panel {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.panel-bottom-stack {
  display: grid;
  flex: 0 0 auto;
  gap: 8px;
  margin-top: auto;
}

.bottom-account-panel {
  display: grid;
  gap: 8px;
}

.account-billing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.account-plan-badge,
.account-balance-button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  white-space: nowrap;
}

.account-plan-badge {
  padding: 0 10px;
  border: 1px solid #b7dfc9;
  border-radius: 999px;
  background: #f0fbf5;
  color: var(--good);
  font-weight: 700;
  font-size: 12px;
}

.account-balance-button {
  height: 30px;
  border-color: #b8c7d9;
  background: #f8fafc;
  color: var(--text);
  font-weight: 700;
}

.account-panel .section-title {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
}

.account-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.account-card p {
  margin: 0;
  color: var(--muted);
}

.account-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
}

.account-user-line {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 8px;
}

.account-user-line strong {
  min-width: 0;
  color: var(--good);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-prefix {
  color: var(--muted);
  font-weight: 700;
}

#accountLogoutBtn {
  height: 30px;
  padding: 0 12px;
}

.account-mode-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
}

.account-mode-actions button {
  min-height: 30px;
  height: auto;
  padding: 0 9px;
  font-size: 12px;
  white-space: normal;
}

.account-mode-actions button.active {
  border-color: #9ec5f2;
  background: #edf5ff;
  color: var(--accent-strong);
}

.account-form,
.account-verify,
.account-actions,
.account-flow {
  display: grid;
  gap: 8px;
}

.account-form input,
.account-verify input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.account-password-field {
  position: relative;
  min-width: 0;
}

.account-form .account-password-field input {
  padding-right: 44px;
}

.account-form .account-password-toggle {
  position: absolute;
  top: 50%;
  right: 3px;
  display: grid;
  width: 36px;
  height: 30px;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  border-color: transparent;
  background: transparent;
  color: #66758a;
}

.account-form .account-password-toggle:hover,
.account-form .account-password-toggle:focus-visible,
.account-form .account-password-toggle.is-visible {
  border-color: #c8d8ea;
  background: #f2f7fd;
  color: var(--accent-strong);
}

.account-password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.account-password-toggle.is-visible .account-password-slash {
  display: none;
}

.account-form .account-forgot-password {
  justify-self: end;
  width: auto;
  height: auto;
  margin-top: -3px;
  padding: 1px 2px;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 12px;
}

.account-form .account-forgot-password:hover,
.account-form .account-forgot-password:focus-visible {
  text-decoration: underline;
}

.account-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.account-status:empty {
  display: none;
}

#accountBadge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.admin-panel {
  border-color: #e2c56f;
  background: #fffaf0;
}

.admin-panel summary {
  color: #6d5210;
}

#adminPanelBadge {
  color: #8a6a12;
  font-size: 12px;
  font-weight: 700;
}

.admin-panel button {
  width: 100%;
  min-height: 34px;
  border-color: #d8b94e;
  background: #fff4cf;
  color: #5f4606;
  font-weight: 700;
  white-space: normal;
}

.admin-status {
  color: #6f5a1b;
  font-size: 12px;
  line-height: 1.4;
}

.admin-status:empty {
  display: none;
}

.admin-request-queue {
  color: #6f5a1b;
  font-size: 12px;
  line-height: 1.4;
}

.admin-request-queue p {
  margin: 0;
}

.collision-report-title {
  margin: 8px 0 6px !important;
  font-weight: 700;
}

.collision-report-table {
  min-width: 0;
  max-height: 520px;
  overflow: auto;
  border: 1px solid #e5d3a1;
  border-radius: 8px;
  background: #fffdf8;
}

.collision-report-head,
.collision-report-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.05fr) minmax(220px, 1.35fr) minmax(135px, .7fr);
  gap: 14px;
  padding: 10px 12px;
}

.collision-report-head {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid #e5d3a1;
  background: #fff4cf;
  color: #5f4606;
  font-weight: 700;
}

.collision-report-row + .collision-report-row {
  border-top: 1px solid #eee3c9;
}

.collision-request,
.collision-result,
.collision-date {
  min-width: 0;
  overflow-wrap: anywhere;
}

.collision-request {
  color: #3b3219;
  font-weight: 650;
}

.collision-request p {
  margin: 3px 0 9px;
}

.collision-request p:last-child {
  margin-bottom: 0;
}

.collision-field-label {
  display: block;
  color: #7c6424;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.collision-result p {
  margin-top: 5px;
  color: #5f4a17;
}

.collision-date {
  color: #7c6424;
  font-variant-numeric: tabular-nums;
}

.collision-status,
.collision-repeats,
.collision-project {
  display: inline-flex;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.collision-status {
  margin-top: 0;
  color: #825c04;
  background: #fff0bf;
}

.collision-status-resolved,
.collision-status-dismissed {
  color: #426242;
  background: #dff0df;
}

.collision-status-in_progress {
  color: #1e5f83;
  background: #dceffb;
}

.collision-repeats {
  margin-right: 4px;
  color: #704620;
  background: #f5e3d4;
}

.collision-project {
  color: #66562b;
  background: #f1ead7;
  overflow-wrap: anywhere;
}

@container (max-width: 560px) {
  .collision-report-head {
    display: none;
  }

  .collision-report-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .collision-date::before {
    content: "Коллизия: ";
    font-weight: 700;
  }
}

.hidden {
  display: none !important;
}

.technical-hidden {
  display: none !important;
}

.project-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.utility-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.utility-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px;
  cursor: pointer;
  font-weight: 600;
}

.utility-panel[open] {
  padding-bottom: 10px;
}

.utility-panel[open] summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.utility-panel > button,
.utility-panel > .panel-section,
.utility-panel > .orders-list {
  margin-left: 10px;
  margin-right: 10px;
}

.orders-list.compact {
  max-height: 260px;
  overflow: auto;
  margin-top: 8px;
}

.restore-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.restore-log {
  min-height: 96px;
  max-height: 180px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.order-card,
.current-project,
.message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.order-card {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.order-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.order-card strong {
  display: block;
}

.order-card small,
.order-card .meta {
  color: var(--muted);
}

.order-card .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.order-card .primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.order-card .primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.message.processing {
  border-color: #bdd7f7;
  background: #f6fbff;
  color: var(--muted);
}

.message.processing .message-text::after {
  content: "";
  display: inline-block;
  width: 1.6em;
  animation: loadingDots 1.2s steps(1, end) infinite;
}

.message-media {
  display: grid;
  gap: 6px;
  margin: 0 0 8px;
}

.message-thumb {
  display: block;
  width: min(150px, 100%);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.message-text {
  white-space: pre-wrap;
}

.current-project {
  padding: 10px;
  color: var(--muted);
  word-break: break-word;
}

.current-project:not(.empty) {
  color: var(--text);
}

.current-project a {
  color: var(--accent);
}

.chat-log {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 8px;
  overflow: auto;
  padding-bottom: 10px;
}

.chat-log:empty {
  display: none;
}

.message {
  padding: 9px 10px;
}

.message.user {
  align-self: flex-end;
  max-width: 88%;
  background: #edf5ff;
  border-color: #bdd7f7;
}

.message.assistant {
  align-self: flex-start;
  max-width: 92%;
}

.chat-form {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
}

.chat-form .voice-button {
  height: 40px;
  min-width: 86px;
  justify-content: center;
  white-space: nowrap;
  padding: 0 10px;
}

.chat-input-wrap {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-input-wrap input {
  min-width: 0;
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
}

.chat-input-wrap input:focus {
  outline: none;
}

.chat-send-button {
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: #eaf6ff;
  color: var(--accent-strong);
  font-weight: 700;
  height: 40px;
  min-width: 46px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 14px;
}

.chat-form:focus-within .chat-input-wrap {
  border-color: var(--accent);
  animation: voiceInputPulse 1.4s ease-in-out infinite;
}

@keyframes voiceInputPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(11, 107, 203, 0.2);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(11, 107, 203, 0.12);
  }
}

@keyframes collapsedPanelPulse {
  0%,
  100% {
    background: #ffffff;
    border-color: #fca5a5;
    color: #7f1d1d;
    box-shadow: 0 2px 10px rgba(24, 32, 42, 0.12), 0 0 0 0 rgba(239, 68, 68, 0.35);
    transform: scale(1);
  }
  50% {
    background: #ffe2e2;
    border-color: #dc2626;
    color: #7f1d1d;
    box-shadow: 0 2px 14px rgba(24, 32, 42, 0.2), 0 0 0 8px rgba(239, 68, 68, 0);
    transform: scale(1.025);
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 58vh 42vh;
  }

  .app-shell.designer-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 52px;
  }

  .planner-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .designer-pane {
    min-height: 0;
  }

  .designer-resize-handle {
    display: none;
  }

  .panel-toggle {
    top: -16px;
    left: 50%;
    right: auto;
    width: 74px;
    height: 32px;
    border-radius: 8px 8px 0 0;
    transform: translateX(-50%);
    writing-mode: horizontal-tb;
    font-size: 20px;
  }

  .app-shell.designer-collapsed .panel-toggle {
    width: 96px;
    height: 38px;
  }

  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-choice-actions {
    grid-template-columns: 1fr;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes caretBlink {
  50% {
    opacity: 0;
  }
}

@keyframes loadingDots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75%,
  100% {
    content: "...";
  }
}

@keyframes voiceToggleMutedPulse {
  0% {
    background: rgba(255, 234, 234, 0.9);
    box-shadow: 0 0 0 0 rgba(255, 70, 70, 0.35);
  }
  50% {
    background: rgba(255, 220, 220, 0.9);
    box-shadow: 0 0 0 5px rgba(255, 70, 70, 0);
  }
  100% {
    background: rgba(255, 234, 234, 0.9);
    box-shadow: 0 0 0 0 rgba(255, 70, 70, 0.35);
  }
}
