:root {
  color-scheme: light;
  font-family: "Space Grotesk", system-ui, sans-serif;
  --bg: #f4f4f6;
  --panel: #ffffff;
  --panel-2: #f7f7f9;
  --ink: #1b1b1f;
  --muted: #5f5f6b;
  --accent: #e11d2e;
  --accent-2: #ff5c6c;
  --teal: #0f766e;
  --navy: #111827;
  --ring: rgba(225, 29, 46, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at 15% 10%, #ffffff 0%, var(--bg) 55%);
  color: var(--ink);
}

.page {
  max-width: 1180px;
  margin: 32px auto;
  padding: 0 24px 60px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  background: linear-gradient(135deg, #f4f4f6 0%, #ffffff 52%, #eef6f4 100%);
}

.login-screen.hidden {
  display: none;
}

.login-panel {
  width: min(100%, 390px);
  background: #fff;
  border: 1px solid #e3e3e7;
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.1);
}

.login-panel h1 {
  margin-top: 18px;
  font-size: 26px;
}

.login-info-button {
  position: absolute;
  left: 24px;
  bottom: 22px;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  border: 1px solid rgba(216, 221, 232, 0.8);
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
}

.login-info-button:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: #fff;
}

.login-powered-by {
  position: absolute;
  right: 24px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(95, 95, 107, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.login-powered-by img {
  width: 76px;
  height: auto;
  display: block;
  opacity: 0.72;
}

.login-form {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.app-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.app-logo-mark {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 42%, transparent 42%),
    linear-gradient(135deg, var(--navy) 0%, #253b3a 48%, var(--accent) 100%);
  color: #fff;
  font-size: 16px;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.18);
}

.app-logo-mark::before,
.app-logo-mark::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 999px;
}

.app-logo-mark::before {
  width: 26px;
  height: 5px;
  right: 8px;
  bottom: 10px;
}

.app-logo-mark::after {
  width: 5px;
  height: 26px;
  right: 18px;
  bottom: 0;
}

.app-logo-mark span {
  position: relative;
  z-index: 1;
  transform: translate(-5px, -3px);
  font-size: 15px;
  line-height: 1;
}

.app-logo-text {
  font-size: 20px;
  color: var(--navy);
}

.app-logo-large {
  justify-content: center;
}

.app-logo-large .app-logo-mark {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  font-size: 20px;
}

.app-logo-large .app-logo-mark::before {
  width: 35px;
  height: 7px;
  right: 10px;
  bottom: 14px;
}

.app-logo-large .app-logo-mark::after {
  width: 7px;
  height: 35px;
  right: 24px;
}

.app-logo-large .app-logo-mark span {
  font-size: 20px;
  transform: translate(-7px, -5px);
}

.app-logo-large .app-logo-text {
  font-size: 30px;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-name {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--panel);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

#app-view.is-dossier-open .hero {
  min-height: 54px;
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

#app-view.is-dossier-open .hero .brand-copy p {
  display: none;
}

#app-view.is-dossier-open .hero h1 {
  margin: 0;
  font-size: 20px;
}

#app-view.is-dossier-open .hero .app-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

#app-view.is-dossier-open .app-main-tabs {
  display: none;
}

h1 { margin: 0 0 6px; font-size: 36px; letter-spacing: 0.5px; }

.badge {
  background: var(--accent);
  color: white;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
}

.card {
  margin-top: 24px;
  background: var(--panel);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.06);
}

.home-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.home-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid #e3e3e7;
  border-radius: 12px;
  background: #f7f7f9;
}

.app-main-tabs {
  margin-top: 14px;
  margin-bottom: 0;
}

.owner-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid #d7ece9;
  border-radius: 12px;
  background: #eef8f6;
}

.owner-tab {
  min-height: 34px;
  padding: 8px 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.owner-tab.active {
  background: #fff;
  color: var(--teal);
  border-color: #c3e2dc;
}

.home-owner-caption {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.home-tab {
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.home-tab.active {
  background: #fff;
  color: var(--ink);
  border-color: #e3e3e7;
}

.home-tab-panel {
  min-width: 0;
}

.home-toolbar h2 {
  margin: 0;
}

.home-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fab-add {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 30px;
  line-height: 1;
  background: var(--teal);
  box-shadow: 0 10px 18px rgba(15, 118, 110, 0.22);
}

.fab-add:hover {
  filter: brightness(1.05);
}

.mission-choice {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.mission-choice label {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #dce4e3;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.mission-choice input {
  width: auto;
  margin: 0;
}

.visit-dates-block {
  display: grid;
  gap: 8px;
}

.field-row-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.visit-date-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
}

.icon-add,
.icon-remove {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  line-height: 1;
}

.icon-add {
  background: var(--teal);
}

.icon-remove {
  background: #fff;
  color: var(--muted);
  border: 1px solid #e3e3e7;
  box-shadow: none;
}

.icon-remove:disabled {
  opacity: 0.45;
}

.form {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

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

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

textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: var(--panel-2);
  color: var(--ink);
  font-size: 14px;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: var(--panel-2);
  color: var(--ink);
  font-size: 14px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.suggestions {
  display: grid;
  gap: 8px;
}

.suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e3e3e7;
  background: #ffffff;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
}

.suggestion em {
  font-style: normal;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--accent);
}

.suggestion.empty {
  justify-content: center;
  color: var(--muted);
  background: transparent;
  border-style: dashed;
}

.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.switch input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.hidden {
  display: none;
}

.error {
  color: var(--accent);
  font-size: 13px;
  background: #fff0f2;
  border: 1px solid #ffd1d6;
  padding: 8px 10px;
  border-radius: 8px;
}

.status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.export-progress {
  margin-top: 8px;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #ececf2;
  overflow: hidden;
}

.export-progress-bar {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #15803d 0%, #22c55e 100%);
  transition: width 0.2s ease;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.divider {
  height: 1px;
  background: #e9e9ef;
  margin: 16px 0;
}

.panel {
  border: 1px dashed #e3e3e7;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.panel-title {
  font-size: 13px;
  font-weight: 700;
}

.status:empty {
  display: none;
}

.panel button {
  width: 100%;
}

.missing-list {
  margin: 8px 0 12px;
  padding-left: 0;
  color: var(--muted);
  font-size: 12px;
  display: grid;
  gap: 6px;
  list-style: none;
}

.missing-action {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  box-shadow: none;
  text-align: left;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.28;
  white-space: normal;
  overflow-wrap: anywhere;
}

.missing-action:hover {
  border-color: #f59e0b;
  background: #fef3c7;
}

.upload-row {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.file-choice {
  min-width: 240px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #fbfbfd;
}

.file-choice-title {
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.file-choice-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.file-choice input[type="file"] {
  width: 100%;
  font-size: 12px;
}

.ai-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid #b9c2cf;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-weight: 900;
  max-width: 100%;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.ai-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 2.35;
}

.ai-compact {
  width: 40px;
  height: 40px;
  padding: 0;
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #6d28d9;
}

.ai-compact:hover {
  background: #ede9fe;
  border-color: #c4b5fd;
}

.ai-compact:disabled {
  cursor: wait;
  opacity: 0.72;
}

.ai-compact-inline {
  width: 34px;
  height: 34px;
}

.ai-compact-inline svg {
  width: 16px;
  height: 16px;
}

.dtg-control-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.document-list {
  margin-top: 14px;
  display: grid;
  gap: 8px;
  align-content: start;
  max-height: 560px;
  overflow: auto;
}

.document-list-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e3e3e7;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}

.document-list-item:hover,
.document-list-item.active {
  border-color: var(--accent);
  color: var(--accent);
}

.document-manager {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.document-preview-panel {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.document-preview-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.document-preview {
  width: 100%;
  height: min(64vh, 620px);
  border: 1px solid #e3e3e7;
  border-radius: 8px;
  background: #f6f6f9;
}

.section-subcard {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed #e3e3e7;
  border-radius: 10px;
  background: #fff;
}

.dtg-ai-suggestions {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.dtg-ai-empty {
  color: var(--muted);
  font-size: 13px;
}

.dtg-ai-card {
  border: 1px solid #d9e8de;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.dtg-ai-title {
  font-weight: 800;
  color: var(--navy);
}

.dtg-ai-proposed-value {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f3f4f6;
  color: var(--ink);
  border: 1px solid #d8dce8;
  font-size: 13px;
  font-weight: 800;
}

.dtg-state-ok,
.dtg-ai-proposed-value.dtg-state-ok {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.dtg-state-incomplete,
.dtg-ai-proposed-value.dtg-state-incomplete {
  border-color: #fbbf24;
  background: #fffbeb;
  color: #92400e;
}

.dtg-state-missing,
.dtg-ai-proposed-value.dtg-state-missing {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.dtg-state-bad,
.dtg-ai-proposed-value.dtg-state-bad {
  border-color: #dc2626;
  background: #fee2e2;
  color: #7f1d1d;
}

.dtg-state-na,
.dtg-ai-proposed-value.dtg-state-na {
  border-color: #d1d5db;
  background: #f3f4f6;
  color: #4b5563;
}

.dtg-ai-meta,
.dtg-ai-source,
.dtg-ai-details,
.dtg-ai-evidence {
  margin-top: 6px;
  font-size: 13px;
}

.dtg-ai-meta {
  color: #15803d;
  font-weight: 700;
}

.dtg-ai-meta-warning {
  color: #b45309;
}

.dtg-ai-source a {
  color: var(--accent);
  font-weight: 700;
}

.dtg-ai-details {
  color: var(--text);
}

.dtg-ai-evidence {
  color: var(--muted);
  line-height: 1.45;
}

.fire-obligations-summary {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
  padding: 12px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
  color: #3f2d05;
}

.fire-regulation-variables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 8px 0 10px;
  padding: 12px;
  border: 1px solid #e3e3e7;
  border-radius: 10px;
  background: #fff;
}

.fire-regulation-variables label {
  min-width: 0;
}

.field-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.field-label-row span {
  min-width: 0;
}

.field-info-button {
  position: relative;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid #bfdbfe;
  border-radius: 50%;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.field-info-button::before {
  content: "i";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.field-info-button:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

.fire-stepper-field {
  align-self: start;
}

.fire-stepper {
  display: grid;
  grid-template-columns: 38px minmax(48px, 1fr) 38px;
  align-items: center;
  overflow: hidden;
  min-height: 42px;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #fff;
}

.fire-stepper button {
  height: 42px;
  border: 0;
  background: #f8fafc;
  color: #334155;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.fire-stepper button:hover {
  background: #eef2f7;
}

.fire-stepper output {
  min-height: 42px;
  display: grid;
  place-items: center;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
}

.field-rule-button {
  width: auto;
  min-height: 26px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.field-help {
  margin-top: 6px;
  padding: 8px 10px;
  border-left: 3px solid #64748b;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  line-height: 1.4;
}

.fire-checklist-field {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid #e3e3e7;
  border-radius: 12px;
  background: #fff;
}

.fire-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.fire-check-item {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e8ecef;
  border-radius: 10px;
  background: #f8fafb;
  color: var(--ink);
}

.fire-check-item input {
  width: auto;
  margin: 0;
}

.fire-check-details {
  margin-top: 8px;
  min-height: 62px;
}

.regulatory-analysis-summary {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid #e3e3e7;
  border-radius: 12px;
  background: #fbfbfd;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.fire-obligations-title {
  font-weight: 800;
  color: #92400e;
}

.fire-obligations-basis,
.fire-obligations-reference {
  color: #7c5b12;
  font-size: 13px;
}

.fire-obligations-summary ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
}

.fire-obligations-summary li {
  line-height: 1.4;
}

.dtg-ai-review-card {
  display: grid;
  gap: 8px;
}

.ppt-ai-review-summary {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 800;
}

.ppt-ai-review-content {
  display: grid;
  gap: 12px;
  max-height: min(58vh, 620px);
  overflow: auto;
  padding-right: 4px;
}

.ppt-ai-review-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.ppt-ai-review-card h3 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 15px;
}

.ppt-ai-analyzed-photo {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #dbe3ef;
  background: #f8fafc;
  border-radius: 8px;
}

.ppt-ai-analyzed-photo img {
  width: 128px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  cursor: zoom-in;
  background: #eef2f7;
}

.ppt-ai-analyzed-photo-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ppt-ai-analyzed-photo-meta span {
  overflow-wrap: anywhere;
  color: #475569;
}

.ppt-ai-review-line {
  display: grid;
  grid-template-columns: minmax(120px, 0.32fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 13px;
}

.ppt-ai-review-line span {
  color: var(--muted);
  font-weight: 700;
}

.ppt-ai-review-line strong {
  color: var(--ink);
  font-weight: 700;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ppt-ai-review-compare-line {
  display: grid;
  grid-template-columns: minmax(130px, 0.26fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  font-size: 13px;
}

.ppt-ai-review-compare-label {
  color: var(--navy);
  font-weight: 800;
  line-height: 1.35;
}

.ppt-ai-review-compare-value {
  display: grid;
  gap: 5px;
  align-content: start;
  min-height: 48px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.ppt-ai-review-compare-value span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ppt-ai-review-compare-value strong {
  color: var(--ink);
  font-weight: 700;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ppt-ai-review-compare-value.is-proposed {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.ppt-ai-review-chip {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.ppt-ai-review-empty {
  padding: 14px;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  color: var(--muted);
  background: #f9fafb;
}

.ppt-ai-adjustment-panel {
  display: grid;
  gap: 9px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.ppt-ai-adjustment-title {
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.ppt-ai-adjustment-list {
  display: grid;
  gap: 7px;
}

.ppt-ai-adjustment-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.ppt-ai-adjustment-item span {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ppt-ai-adjustment-empty {
  color: var(--muted);
  font-size: 13px;
}

.ppt-ai-adjustment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.ppt-ai-adjustment-form textarea {
  min-height: 72px;
  resize: vertical;
}

@media (max-width: 760px) {
  .ppt-ai-review-compare-line {
    grid-template-columns: 1fr;
  }
  .ppt-ai-adjustment-form,
  .ppt-ai-adjustment-item {
    grid-template-columns: 1fr;
  }
}

.dtg-ai-accepted {
  border-color: #86efac;
  background: #f0fdf4;
}

.dtg-ai-refused {
  border-color: #fecaca;
  background: #fef2f2;
  opacity: 0.82;
}

.dtg-ai-comment-label {
  margin-top: 4px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dtg-ai-review-comment {
  min-height: 86px;
  resize: vertical;
  font-weight: 500;
  color: var(--text);
}

.dtg-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dtg-comment-toggle {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #d8dce8;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  line-height: 1;
}

.dtg-ai-control-button {
  min-width: 32px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #d8dce8;
  background: #fff;
  color: var(--muted);
  box-shadow: none;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.dtg-ai-control-button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #edf6ff;
}

.dtg-ai-control-button.is-loading {
  border-color: #fbbf24;
  background: #fffbeb;
  color: #92400e;
  cursor: wait;
}

.dtg-comment-toggle:hover,
.dtg-comment-toggle.has-comment {
  border-color: var(--accent);
  color: var(--accent);
  background: #edf6ff;
}

.dtg-item-comment {
  min-height: 76px;
  resize: vertical;
  font-weight: 500;
  color: var(--text);
}

.apparent-control-table {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.target-highlight {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
  transition: outline-color 0.2s ease;
}

.apparent-control-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.15fr) minmax(130px, 0.55fr) minmax(220px, 1.2fr) minmax(170px, 0.8fr);
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid #ececf2;
  border-radius: 10px;
  background: #fff;
}

.apparent-control-row-head {
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.apparent-control-row textarea {
  min-height: 42px;
  resize: vertical;
}

.apparent-photo-cell {
  display: grid;
  gap: 8px;
}

.apparent-photo-cell img {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border: 1px solid #ececf2;
  border-radius: 8px;
  background: #f6f6f9;
  cursor: zoom-in;
}

.dpe-pdf-list {
  display: grid;
  gap: 10px;
}

.dpe-pdf-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1fr) minmax(220px, 1fr) minmax(170px, 0.8fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #ececf2;
  border-radius: 10px;
  background: #fff;
}

.dpe-pdf-row-individual {
  grid-template-columns: minmax(130px, 0.75fr) minmax(190px, 1fr) minmax(220px, 1fr) minmax(280px, 1.25fr);
}

.dpe-mode-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

#dpe-building-sync {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.dpe-mode-panel textarea,
.dpe-pdf-actions textarea {
  width: 100%;
  min-height: 58px;
  resize: vertical;
}

.dpe-pdf-actions {
  display: grid;
  gap: 8px;
}

.dpe-not-done-line {
  justify-content: flex-start;
}

.dpe-pdf-title {
  font-weight: 800;
  color: var(--navy);
}

.dpe-pdf-title label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.dpe-pdf-title input {
  width: 100%;
  min-width: 0;
}

.dpe-pdf-file {
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dpe-pdf-file a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.dpe-pdf-file a:hover {
  text-decoration: underline;
}

.admin-main-photo-preview {
  margin-top: 10px;
  width: 100%;
  max-width: 460px;
  max-height: 280px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #ececf2;
  background: #f6f6f9;
  display: block;
}

.key-action-card {
  border-style: solid;
  border-color: #ffd1d6;
  background: #fff6f7;
}

.liciel-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-key-action {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-transfer {
  font-weight: 700;
}

.btn-push {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.btn-push:hover {
  filter: brightness(1.05);
}

.btn-pull {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.btn-pull:hover {
  filter: brightness(1.05);
}

.status-ok {
  color: #15803d;
  font-weight: 600;
}

.status-bad {
  color: #b91c1c;
  font-weight: 600;
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid #ffd1d6;
}

.btn-light {
  background: #fff;
  color: var(--accent);
  border: 1px solid #ffd1d6;
}

.step-btn-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.table {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
}

.table-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.table-row input, .table-row select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
}

.disorder-workspace-layout {
  margin-top: 8px;
  display: block;
  position: relative;
}

.disorder-workspace-main {
  min-width: 0;
}

.disorder-step-floating {
  margin-top: 10px;
  position: fixed;
  top: 132px;
  right: max(18px, calc((100vw - 1180px) / 2 - 238px));
  border: 1px solid #ececf2;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
  width: 210px;
  margin-top: 0;
  z-index: 900;
}

.disorder-step-floating-actions {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.disorder-step-floating-actions button {
  width: 100%;
}

.disorder-photo-grid {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.disorder-photo-card {
  border: 1px solid #ececf2;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
}

.disorder-photo-card.is-rejected {
  opacity: 0.8;
  border-style: dashed;
  background: #fff6f7;
}

.disorder-photo-preview {
  width: 130px;
  height: 98px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #ececf2;
  background: #f6f6f9;
  cursor: zoom-in;
}

.disorder-photo-preview.empty {
  display: grid;
  place-items: center;
  color: #8f8fa1;
  font-size: 11px;
}

.disorder-photo-main {
  min-width: 0;
}

.disorder-photo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.disorder-photo-name {
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #e3e3e7;
  background: #f7f7fa;
  color: #444;
}

.pill.ok {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.pill.warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.pill.bad {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.disorder-photo-fields {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.disorder-photo-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row .disorder-photo-actions {
  margin-top: 0;
}

.btn-bad {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.btn-good {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}

.disorder-category-board {
  margin-top: 10px;
  display: grid;
  gap: 12px;
}

.disorder-priority-board {
  margin-top: 10px;
  display: grid;
  gap: 12px;
}

.disorder-priority-section {
  border: 1px solid #ececf2;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.disorder-priority-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.disorder-priority-title {
  font-weight: 700;
  font-size: 14px;
}

.disorder-priority-meta {
  color: var(--muted);
  font-size: 12px;
}

.disorder-priority-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #12263a;
}

.disorder-priority-total strong {
  font-size: 15px;
}

.disorder-priority-total span {
  font-weight: 900;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 38px;
  font-weight: 800;
}

.checkbox-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.disorder-category-section {
  border: 1px solid #ececf2;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.disorder-category-header {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.disorder-category-title {
  font-weight: 700;
  font-size: 14px;
}

.disorder-category-desc {
  color: var(--muted);
  font-size: 12px;
}

.category-terrain-state {
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}

.category-terrain-state.has-photos {
  border-color: #d9e8de;
  background: #fbfefc;
}

.category-terrain-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.category-terrain-title {
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.category-terrain-fields {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) minmax(240px, 1fr);
  gap: 10px;
  align-items: start;
}

.category-terrain-fields textarea {
  min-height: 46px;
  resize: vertical;
}

.disorder-groups {
  display: grid;
  gap: 10px;
}

.disorder-group-card {
  border: 1px solid #ececf2;
  border-radius: 10px;
  padding: 10px;
  background: #fdfdff;
}

.disorder-group-card-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.disorder-group-card-clickable:hover,
.disorder-group-card-clickable:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
  outline: none;
}

.disorder-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.disorder-group-title {
  font-weight: 700;
  font-size: 13px;
}

.disorder-group-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.disorder-group-photos {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  align-items: start;
  max-width: 100%;
  overflow: hidden;
}

.disorder-group-photo {
  border: 1px solid #ececf2;
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.disorder-group-photo img {
  width: 100%;
  height: 92px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #ececf2;
  background: #f6f6f9;
  cursor: zoom-in;
}

.disorder-edit-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.disorder-edit-grid label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: #334155;
}

.disorder-edit-grid input,
.disorder-edit-grid select,
.disorder-edit-grid textarea {
  width: 100%;
}

.disorder-edit-grid textarea {
  min-height: 120px;
  resize: vertical;
}

.disorder-edit-wide {
  grid-column: 1 / -1;
}

.disorder-group-photo .meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.disorder-empty {
  border: 1px dashed #e3e3e7;
  border-radius: 10px;
  padding: 10px;
  color: #8f8fa1;
  font-size: 12px;
  background: #fff;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(10, 10, 12, 0.92);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 16px;
}

.photo-lightbox.hidden {
  display: none;
}

.photo-lightbox-close {
  justify-self: end;
  background: #fff;
  color: #111;
  border: 1px solid #ddd;
}

.photo-lightbox-image {
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 140px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  background: #111;
  justify-self: center;
  align-self: center;
}

.photo-lightbox-caption {
  color: #fff;
  font-size: 13px;
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.54);
}

.modal.hidden {
  display: none;
}

.modal-panel {
  width: min(100%, 520px);
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.22);
}

.modal-panel-wide {
  width: min(100%, 860px);
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
}

.modal-close {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.info-text {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.info-version {
  margin-top: 14px;
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #99f6e4;
  color: #115e59;
  font-size: 12px;
  font-weight: 800;
}

.contact-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.contact-list a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 700;
}

.contact-list a:hover {
  text-decoration: underline;
}

.modal-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

body.lightbox-open {
  overflow: hidden;
}

select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
}

label {
  font-size: 13px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

@media (max-width: 900px) {
  .login-screen {
    padding-bottom: 72px;
  }
  .login-info-button {
    left: 18px;
    bottom: 18px;
  }
  .login-powered-by {
    right: 18px;
    bottom: 18px;
    font-size: 11px;
  }
  .login-powered-by img {
    width: 68px;
  }
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .user-bar {
    width: 100%;
    justify-content: space-between;
  }
  .home-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .home-tabs {
    width: 100%;
  }
  .home-tab {
    flex: 1;
  }
  .home-actions {
    width: 100%;
    justify-content: space-between;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .document-manager,
  .document-preview-toolbar {
    grid-template-columns: 1fr;
  }
  .table-row {
    grid-template-columns: 1fr;
  }
  .apparent-control-row,
  .apparent-control-row-head {
    grid-template-columns: 1fr;
  }
  .apparent-control-row-head {
    display: none;
  }
  .dpe-pdf-row {
    grid-template-columns: 1fr;
  }
  .disorder-photo-card {
    grid-template-columns: 1fr;
  }
  .disorder-photo-preview {
    width: 100%;
    height: 160px;
  }
  .disorder-step-floating {
    position: static;
  }
}
.dossier-layout {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding-left: 336px;
}

.dossier-topline {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid #e3e3e7;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 16px rgba(0,0,0,0.05);
}

.dossier-topline-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.dossier-topline-app {
  font-size: 13px;
  font-weight: 800;
  color: var(--teal);
  white-space: nowrap;
}

#dossier-topline-name {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dossier-topline-mode {
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef8f6;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.sidebar-toggle {
  position: fixed;
  top: 122px;
  left: max(14px, calc((100vw - 1180px) / 2 - 22px));
  width: 30px;
  height: 30px;
  border-radius: 999px;
  padding: 0;
  line-height: 1;
  font-size: 19px;
  font-weight: 700;
  display: grid;
  place-items: center;
  z-index: 20;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.12);
}

#dossier-view.sidebar-collapsed .dossier-layout {
  padding-left: 0;
}

#dossier-view.sidebar-collapsed .sidebar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-24px);
  overflow: hidden;
}

#dossier-view.sidebar-collapsed .sidebar-toggle {
  left: max(12px, calc((100vw - 1180px) / 2 + 8px));
}

.sidebar {
  position: fixed;
  top: 108px;
  left: max(24px, calc((100vw - 1180px) / 2));
  width: 310px;
  max-height: calc(100vh - 132px);
  background: var(--panel-2);
  border: 1px solid #e3e3e7;
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 12px;
  overflow: auto;
  z-index: 850;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.sidebar-title {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.sidebar-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  font-weight: 400;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #fff;
}

.nav-button {
  width: 100%;
  text-align: left;
  color: var(--ink);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #fff;
  box-shadow: none;
  font-weight: 700;
}

.nav-button-documents {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  background: #eef8f6;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.nav a:hover,
.nav-button:hover {
  border-color: #ffd1d6;
  color: var(--accent);
}

.livrable-preview-floating {
  position: fixed;
  right: max(20px, calc((100vw - 1180px) / 2 + 20px));
  bottom: 26px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  z-index: 860;
  background: var(--navy);
  box-shadow: 0 14px 28px rgba(17, 24, 39, 0.24);
}

.floating-save-dossier {
  position: fixed;
  right: max(20px, calc((100vw - 1180px) / 2 + 20px));
  bottom: 86px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  z-index: 862;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}

.floating-save-dossier svg {
  width: 19px;
  height: 19px;
  stroke-width: 2.4;
}

.floating-save-dossier:hover {
  background: #1d4ed8;
}

.floating-save-dossier:disabled {
  cursor: wait;
  opacity: 0.72;
}

.floating-save-dossier.is-saving svg {
  animation: savePulse 0.8s ease-in-out infinite alternate;
}

.floating-save-toast {
  position: fixed;
  right: max(20px, calc((100vw - 1180px) / 2 + 20px));
  bottom: 140px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #15803d;
  font-size: 13px;
  font-weight: 800;
  z-index: 863;
  box-shadow: 0 10px 20px rgba(21, 128, 61, 0.16);
}

.floating-save-toast.hidden {
  display: none;
}

@keyframes savePulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(0.88);
  }
}

.magnifier-icon {
  width: 19px;
  height: 19px;
  border: 3px solid #fff;
  border-radius: 999px;
  position: relative;
  display: block;
}

.magnifier-icon::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 3px;
  background: #fff;
  right: -8px;
  bottom: -5px;
  transform: rotate(45deg);
  border-radius: 999px;
}

.content {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.section {
  border: 1px solid #e3e3e7;
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}

.modal-panel-document {
  width: min(1220px, calc(100vw - 32px));
  height: min(88vh, 920px);
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.livrable-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0 14px;
  border-bottom: 1px solid #ececf2;
  flex-wrap: wrap;
}

.livrable-preview-settings {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.livrable-setting-field {
  display: grid;
  gap: 4px;
  min-width: 170px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.livrable-setting-field input {
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
}

.livrable-preview-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.livrable-preview-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  padding-top: 16px;
}

.livrable-preview-toc {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: calc(88vh - 170px);
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.livrable-preview-toc button {
  width: 100%;
  text-align: left;
  background: #fff;
  color: var(--ink);
  border: 1px solid #e3e3e7;
  box-shadow: none;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13px;
}

.livrable-preview-toc button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.livrable-preview-document {
  min-height: 0;
  overflow: auto;
  padding: 0 8px 24px 0;
  scroll-behavior: smooth;
}

.livrable-preview-section {
  border-bottom: 1px solid #ececf2;
  padding: 22px 0;
  scroll-margin-top: 18px;
}

.livrable-preview-section:first-child {
  padding-top: 0;
}

.livrable-preview-section h1,
.livrable-preview-section h2,
.livrable-preview-section h3 {
  letter-spacing: 0;
}

.livrable-preview-section h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.livrable-preview-section h2 {
  margin: 0 0 14px;
  font-size: 21px;
}

.livrable-preview-section h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.livrable-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.livrable-field {
  border: 1px solid #ececf2;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  display: grid;
  gap: 4px;
}

.livrable-field span {
  color: var(--muted);
  font-size: 12px;
}

.livrable-field strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.livrable-long-text {
  margin-top: 12px;
  white-space: pre-wrap;
}

.livrable-preview-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
}

.livrable-preview-table th,
.livrable-preview-table td {
  border: 1px solid #e3e3e7;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.livrable-preview-table th {
  background: #f7f7f9;
  font-weight: 800;
}

.preview-missing {
  color: #9f1239;
  font-weight: 700;
}

.preview-warning {
  color: #92400e;
  font-weight: 700;
}

.preview-ok {
  color: #166534;
  font-weight: 700;
}

.livrable-disorder-detail {
  margin-top: 14px;
  border: 1px solid #ececf2;
  border-radius: 8px;
  padding: 12px;
}

.livrable-preview-photos {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.livrable-preview-photos figure {
  margin: 0;
  border: 1px solid #ececf2;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.livrable-preview-photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  background: #f7f7f9;
}

.livrable-preview-photos figcaption,
.livrable-preview-empty {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
}

.energy-scenarios-board {
  display: grid;
  gap: 14px;
}

.energy-scenario-card {
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 14px;
  background: #f8fbff;
}

.energy-scenario-card h4 {
  margin-top: 0;
}

.energy-scenario-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.energy-guidance-label {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-weight: 800;
  color: #334155;
}

.energy-ai-guidance {
  min-height: 68px;
  resize: vertical;
  font-weight: 500;
}

.energy-edit-table {
  display: grid;
  gap: 8px;
}

.energy-edit-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(220px, 2fr) minmax(100px, 0.7fr) minmax(240px, 2fr);
  gap: 8px;
  align-items: stretch;
}

.energy-edit-head {
  font-size: 12px;
  font-weight: 900;
  color: #475569;
}

.energy-edit-row input,
.energy-edit-row textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  background: #fff;
}

.energy-edit-row textarea {
  min-height: 82px;
  resize: vertical;
}

@media (max-width: 900px) {
  .energy-edit-row {
    grid-template-columns: 1fr;
  }

  .energy-edit-head {
    display: none;
  }

  .dossier-layout {
    padding-left: 0;
  }
  .sidebar {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    max-height: none;
  }
  .sidebar-toggle {
    display: none;
  }
  .livrable-preview-floating {
    right: 18px;
    bottom: 18px;
  }
  .livrable-preview-layout {
    grid-template-columns: 1fr;
  }
  .livrable-preview-toc {
    position: static;
    max-height: none;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  .disorder-step-floating {
    position: static;
    width: auto;
    right: auto;
  }
}

.admin-settings-panel {
  margin-top: 22px;
}

.account-settings-panel {
  margin-bottom: 18px;
}

.account-overview {
  display: grid;
  gap: 12px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.account-card {
  border: 1px solid #d7dee8;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 4px;
}

.account-card span,
.account-meta,
.account-solution span {
  color: var(--muted);
  font-size: 0.86rem;
}

.account-card strong {
  color: #0f172a;
  font-size: 1.05rem;
}

.account-progress {
  height: 8px;
  background: #e5eaf1;
  border-radius: 999px;
  overflow: hidden;
}

.account-progress-bar {
  height: 100%;
  background: var(--accent);
}

.account-meta,
.account-solutions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-meta span,
.account-solution {
  border: 1px solid #d7dee8;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
}

.account-solution {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.account-solution.enabled strong {
  color: #166534;
}

.account-solution.disabled strong {
  color: #991b1b;
}

.account-usage-table {
  margin-top: 2px;
}

@media (max-width: 900px) {
  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
}

.admin-settings-stack {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.admin-settings-row {
  border: 1px solid #ececf2;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.admin-settings-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-settings-code {
  color: var(--muted);
  font-size: 12px;
}

.admin-settings-template-grid {
  margin-top: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger {
  background: #b91c1c;
  color: #fff;
}

.btn-danger:hover {
  background: #991b1b;
}

.btn-small {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 13px;
}

.grid {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.item {
  border: 1px solid #e3e3e7;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.item-btn {
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.2s ease;
}

.item-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.item-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: stretch;
  padding: 10px;
}

.item-content {
  min-width: 0;
}

.item-photo {
  width: 120px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #ececf2;
  background: #f6f6f9;
}

.item-photo-empty {
  display: grid;
  place-items: center;
  color: #8f8fa1;
  font-size: 11px;
  text-align: center;
  padding: 8px;
}

.item-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { color: var(--muted); font-size: 13px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { font-size: 12px; margin-top: 8px; font-weight: 600; }
.item-meta-ok { color: #15803d; }
.item-meta-progress { color: #b45309; }
.item-meta-neutral { color: #8f8fa1; }

@media (max-width: 640px) {
  .item-card {
    grid-template-columns: 1fr;
  }
  .item-photo {
    width: 100%;
    height: 120px;
  }
}
