:root {
  color-scheme: light;
  font-family: "Space Grotesk", system-ui, sans-serif;
  --bg: #eef7fb;
  --panel: #ffffff;
  --panel-2: #f4f9fb;
  --ink: #10202f;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-2: #14b8a6;
  --teal: #0e7490;
  --navy: #172554;
  --ring: rgba(37, 99, 235, 0.26);
  --aurora-mint: #dffaf1;
  --aurora-sky: #e0f2fe;
  --aurora-lavender: #eef2ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, var(--aurora-mint) 0%, rgba(223, 250, 241, 0) 34%),
    radial-gradient(circle at 82% 12%, var(--aurora-lavender) 0%, rgba(238, 242, 255, 0) 32%),
    linear-gradient(135deg, var(--aurora-sky) 0%, #ffffff 48%, var(--bg) 100%);
  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:
    radial-gradient(circle at 20% 12%, var(--aurora-mint) 0%, rgba(223, 250, 241, 0) 36%),
    radial-gradient(circle at 86% 16%, var(--aurora-lavender) 0%, rgba(238, 242, 255, 0) 34%),
    linear-gradient(135deg, var(--aurora-sky) 0%, #ffffff 54%, var(--bg) 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;
  justify-content: flex-start;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

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

.login-panel .app-logo {
  display: flex;
  width: 100%;
}

.app-logo img {
  display: block;
  width: auto;
  height: 92px;
  max-width: min(560px, 46vw);
  object-fit: contain;
}

.login-panel .app-logo img {
  height: auto;
  width: min(100%, 230px);
  max-width: 230px;
  margin: 0 auto;
}

.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%, #0e7490 48%, var(--accent-2) 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 img {
  height: auto;
  width: min(100%, 230px);
  max-width: 230px;
}

.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 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.ai-cost-badge {
  min-height: 42px;
  min-width: 190px;
  display: inline-grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 8px;
  row-gap: 4px;
  padding: 6px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.08);
  cursor: default;
}

.ai-cost-badge span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.ai-cost-badge strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.ai-cost-badge i {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}

.ai-cost-badge i em {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
  transition: width 180ms ease;
}

.ai-cost-badge.warning {
  border-color: #fbbf24;
  background: #fffbeb;
  color: #92400e;
}

.ai-cost-badge.warning i {
  background: #fde68a;
}

.ai-cost-badge.warning i em {
  background: #d97706;
}

.ai-cost-badge.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.ai-cost-badge.danger i {
  background: #fee2e2;
}

.ai-cost-badge.danger i em {
  background: #dc2626;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 5px 10px 5px 5px;
  border: 1px solid #d9e5e2;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.profile-button:hover,
.profile-button[aria-expanded="true"] {
  border-color: #9fd6cc;
  background: #f6fbfa;
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  place-items: center;
  box-sizing: border-box;
  flex: 0 0 auto;
  background: #e7f5f2;
  color: var(--teal);
  border: 1px solid #b7ded6;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  font-family: inherit;
}

.profile-avatar-large {
  width: 52px;
  height: 52px;
  font-size: 18px;
  line-height: 1;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 98px;
  z-index: 80;
  width: 240px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
}

.profile-menu button {
  width: 100%;
  justify-content: flex-start;
  padding: 10px 12px;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 800;
}

.profile-menu button:hover {
  background: #f4f7f7;
}

.account-modal-panel {
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100vh - 36px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 0;
}

.account-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
}

.account-tab {
  flex: 1 1 180px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.account-tab.active {
  background: #fff;
  color: var(--teal);
  border-color: #b7ded6;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.account-profile-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
  margin-bottom: 12px;
}

.account-profile-summary strong,
.account-profile-summary span {
  display: block;
}

.account-profile-summary strong {
  font-size: 16px;
}

.account-profile-summary span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

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

.account-user-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fbfcfd;
}

.account-modal-panel [data-account-content] {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.account-ai-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fbfcfd;
}

.account-modal-panel > .status {
  margin-top: 12px;
}

.account-modal-panel .modal-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

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

.account-ai-section {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.account-ai-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.ai-rule-card {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  background: #f8fbff;
}

.ai-rule-card strong {
  color: var(--navy);
}

.ai-rule-card span {
  color: var(--muted);
  font-size: 13px;
}

.ai-rules-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.ai-rules-table {
  min-width: 960px;
  margin: 0;
}

.work-price-db-content {
  display: grid;
  gap: 10px;
}

.work-price-note {
  padding: 9px 11px;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.work-price-table {
  min-width: 1180px;
}

.work-price-table th,
.work-price-table td {
  font-size: 12px;
  vertical-align: top;
}

.work-price-table td span {
  color: var(--muted);
  font-size: 11px;
}

.disorder-price-reference {
  align-self: end;
  min-height: 48px;
  padding: 9px 11px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  display: grid;
  gap: 3px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
}

.disorder-price-reference strong {
  color: var(--navy);
  font-size: 13px;
}

.disorder-price-reference small {
  color: var(--muted);
  line-height: 1.35;
}

.ai-rules-table th,
.ai-rules-table td {
  vertical-align: top;
  font-size: 12px;
  line-height: 1.35;
}

.ai-rules-table th {
  white-space: nowrap;
}

.ai-rules-table td:nth-child(1) {
  width: 130px;
  font-weight: 800;
  color: var(--navy);
}

.ai-rules-table td:nth-child(2) {
  width: 260px;
  font-weight: 700;
}

.ai-rules-table td:nth-child(3),
.ai-rules-table td:nth-child(4) {
  color: var(--muted);
}

.account-company-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fbfcfd;
  display: grid;
  gap: 12px;
}

.account-company-panel-compact {
  margin: 12px 0;
}

.account-company-details {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.account-company-logo-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.account-company-logo-preview {
  width: 118px;
  height: 70px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  position: relative;
}

.account-company-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.account-company-logo-preview.is-default img {
  padding: 8px 8px 22px;
}

.account-company-logo-note {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.account-company-logo-actions {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.account-company-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-compliance-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
}

.account-compliance-heading,
.operator-competency-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.account-compliance-heading .panel-title {
  margin-bottom: 4px;
}

.compliance-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
}

.compliance-badge.ok {
  color: #166534;
  background: #dcfce7;
}

.compliance-badge.warning {
  color: #92400e;
  background: #fef3c7;
}

.compliance-badge.missing {
  color: #991b1b;
  background: #fee2e2;
}

.compliance-upload-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) max-content minmax(130px, max-content);
  gap: 10px;
  align-items: center;
}

.compliance-upload-row a,
.operator-competency-row a {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.account-company-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.42fr) 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid #eef1f4;
}

.account-company-row:last-child {
  border-bottom: 0;
}

.account-company-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.account-company-row strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.account-company-users {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.account-company-users-list {
  display: grid;
  gap: 8px;
}

.account-company-user-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.45fr) repeat(4, minmax(58px, 0.46fr)) minmax(130px, 0.9fr) 36px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  min-width: 0;
}

.account-company-user-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.account-company-user-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.account-company-user-row input[type="text"],
.account-company-user-row input[type="password"] {
  width: 100%;
  min-width: 0;
}

.account-company-user-row label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  font-size: 11px;
  font-weight: 800;
  color: #334155;
}

.account-company-user-row label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operator-competency-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) max-content minmax(120px, max-content);
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 7px;
}

.operator-competency-heading {
  grid-column: 1 / -1;
  align-items: center;
}

.operator-competency-heading strong {
  color: #334155;
  font-size: 12px;
}

.icon-action {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 17px;
  line-height: 1;
  font-weight: 900;
}

.account-company-user-create {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr)) repeat(3, max-content) 36px;
  gap: 8px;
  align-items: center;
}

.account-company-user-create label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .account-company-user-row,
  .account-company-user-create {
    grid-template-columns: 1fr 1fr;
  }

  .account-company-user-main,
  .account-company-user-row input[type="password"],
  .operator-competency-row {
    grid-column: 1 / -1;
  }

  .account-compliance-heading,
  .operator-competency-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .compliance-upload-row,
  .operator-competency-row {
    grid-template-columns: 1fr;
  }
}

.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-row {
  gap: 10px;
}

#app-view.is-dossier-open .hero .app-logo {
  display: none;
}

#app-view.is-dossier-open .header-home-button {
  display: grid;
}

#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);
}

#dossier-view {
  overflow: hidden;
}

.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 {
  position: relative;
  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;
}

.export-progress-with-label {
  height: 18px;
}

.export-progress-with-label .export-progress-bar {
  min-width: 0;
}

.export-progress-with-label span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #111827;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.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;
}

.documents-upload-row {
  max-width: 100%;
  min-width: 0;
  align-items: stretch;
}

.documents-upload-row input[type="file"] {
  flex: 1 1 280px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.documents-upload-row .btn-light {
  flex: 0 1 190px;
  max-width: 100%;
  white-space: normal;
}

.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;
}

.photo-drop-zone {
  min-height: 128px;
  margin: 12px 0;
  border: 2px dashed #94a3b8;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.photo-drop-zone:hover,
.photo-drop-zone:focus,
.photo-drop-zone.is-dragging {
  border-color: var(--green);
  background: #effaf3;
  box-shadow: 0 0 0 3px rgba(44, 122, 75, 0.12);
  outline: none;
}

.photo-drop-zone-title {
  font-size: 16px;
  font-weight: 800;
}

.photo-drop-zone-help {
  max-width: 620px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.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 auto auto;
  gap: 8px;
  align-items: center;
}

.document-preview-frame {
  width: 100%;
  height: min(64vh, 620px);
  border: 1px solid #e3e3e7;
  border-radius: 8px;
  background: #f6f6f9;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.document-preview-frame[data-rotation="90"],
.document-preview-frame[data-rotation="270"] {
  height: min(76vh, 760px);
}

.document-preview {
  width: 100%;
  height: 100%;
  border: 0;
  background: #f6f6f9;
  transform: rotate(var(--document-rotation, 0deg));
  transform-origin: center center;
}

.document-preview-frame[data-rotation="90"] .document-preview,
.document-preview-frame[data-rotation="270"] .document-preview {
  width: min(76vh, 760px);
  height: min(100vw, 980px);
  max-height: none;
}

.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-modal {
  z-index: 1800;
}

.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-loading-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px 18px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f8fbff;
  text-align: center;
  color: var(--navy);
}

.ppt-ai-loader {
  width: 42px;
  height: 42px;
  border: 4px solid #dbeafe;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ppt-ai-spin 0.9s linear infinite;
}

.ppt-ai-loading-card strong {
  font-size: 15px;
}

.ppt-ai-loading-card span {
  color: var(--muted);
  line-height: 1.4;
}

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

.ppt-ai-review-error {
  padding: 14px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 800;
}

.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;
}

.btn-light.is-loading,
.btn-good.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: wait;
}

.btn-light.is-loading::before,
.btn-good.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: ppt-ai-spin 0.8s linear infinite;
}

.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-preview-wrap {
  position: relative;
}

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

.apparent-photo-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #c62828;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  line-height: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.apparent-photo-delete:hover,
.apparent-photo-delete:focus-visible {
  background: #a91515;
  transform: scale(1.06);
}

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

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

.dpe-pdf-row-individual {
  grid-template-columns: minmax(120px, 0.7fr) minmax(170px, 1fr) minmax(180px, 1fr) minmax(210px, 1.1fr);
}

.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-upload-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
}

.dpe-pdf-upload-field input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: 12px;
}
.dpe-pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.dpe-pdf-actions > * {
  min-width: 0;
}

.dpe-pdf-actions button {
  flex: 1 1 112px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
  min-height: 38px;
}

.dpe-pdf-row button,
.document-preview-toolbar button,
.documents-upload-row button {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

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

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

.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: var(--teal);
  border-color: var(--teal);
  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;
}

.section-header.compact {
  align-items: flex-start;
  flex-wrap: wrap;
}

.section-header.compact h4 {
  margin: 4px 0 0;
  font-size: 16px;
}

.cadastre-panel {
  display: grid;
  gap: 10px;
}

.cadastre-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cadastre-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.cadastre-frame-wrap {
  width: 100%;
  height: 380px;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  overflow: hidden;
  background: #f6f6f9;
}

.cadastre-map {
  width: 100%;
  height: 100%;
  display: block;
  background: #fff;
}

.cadastre-map .leaflet-control-attribution {
  font-size: 10px;
}

.cadastre-map .leaflet-control-zoom a {
  width: 38px;
  height: 38px;
  line-height: 36px;
  font-size: 22px;
  font-weight: 900;
}

.cadastre-help {
  padding: 9px 10px;
  border-left: 3px solid var(--teal);
  background: var(--aurora-sky);
  color: #155e75;
  font-size: 13px;
  font-weight: 700;
}

.cadastre-spot-marker {
  width: 28px;
  height: 28px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--ring), 0 8px 18px rgba(17, 24, 39, 0.24);
}

.cadastre-spot-marker::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #fff;
}

.cadastre-spots-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #fbfbfd;
}

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

.cadastre-spot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #e3e3e7;
  border-radius: 8px;
  background: #fff;
}

.cadastre-spot-title {
  font-weight: 850;
  color: var(--navy);
  overflow-wrap: anywhere;
}

.cadastre-spot-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.cadastre-capture-preview {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}

.cadastre-capture-image-wrap {
  position: relative;
  width: min(100%, 508px);
  margin: 0 auto;
}

.cadastre-capture-preview img {
  width: 100%;
  height: auto;
  border: 1px solid #ececf2;
  border-radius: 8px;
  background: #f6f6f9;
  display: block;
}

.cadastre-capture-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cadastre-capture-marker {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.38), 0 8px 18px rgba(17, 24, 39, 0.24);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.cadastre-capture-marker.location {
  background: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.25), 0 8px 18px rgba(17, 24, 39, 0.24);
}

.cadastre-capture-preview.is-broken img {
  min-height: 120px;
  opacity: 0.18;
}

.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: 24px;
  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-wrap {
  width: 130px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.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-status-pill {
  justify-self: start;
  max-width: 100%;
  text-align: center;
  white-space: normal;
}

.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;
}

.disorder-sheet-btn {
  border-color: var(--teal);
  color: var(--teal);
  font-weight: 900;
}

.disorder-sheet-btn:hover {
  background: var(--aurora-mint);
}

.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-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 16px;
  align-items: start;
}

.disorder-edit-photo-panel {
  position: sticky;
  top: 0;
  align-self: start;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
  min-width: 0;
}

.disorder-edit-photos {
  margin-top: 10px;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
}

.disorder-edit-photos .disorder-group-photo img {
  height: 86px;
}

.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;
}

@media (max-width: 820px) {
  .disorder-edit-layout {
    grid-template-columns: 1fr;
  }

  .disorder-edit-photo-panel {
    position: static;
    order: -1;
  }
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1600;
  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;
}

.photo-duplicate-panel {
  width: min(100%, 980px);
}

.photo-duplicate-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.photo-duplicate-row {
  display: grid;
  grid-template-columns: 24px 96px minmax(0, 1fr) 96px;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid #ececf2;
  border-radius: 10px;
  background: #fff;
}

.photo-duplicate-row input {
  width: 18px;
  height: 18px;
}

.photo-duplicate-thumb {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f6f6f9;
  cursor: zoom-in;
}

.photo-duplicate-details {
  min-width: 0;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.photo-duplicate-details strong,
.photo-duplicate-details span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-duplicate-details strong {
  color: var(--ink);
  font-size: 13px;
}

.photo-duplicate-details small {
  color: #92400e;
  font-weight: 800;
}

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

.modal-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

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

.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;
}

.app-version-button {
  position: fixed;
  right: 24px;
  bottom: 12px;
  min-width: 54px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  z-index: 870;
  background: #eef2ff;
  color: #3152d4;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.app-version-button:hover {
  border-color: #9fb2ff;
  background: #e0e7ff;
}

.version-modal-panel {
  max-height: min(86vh, 820px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.version-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
}

.version-current span {
  font-size: 13px;
  font-weight: 700;
}

.version-current strong {
  font-size: 16px;
  font-weight: 900;
}

.version-history {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding-right: 4px;
}

.version-entry {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.ai-dashboard-panel {
  width: min(100%, 1040px);
}

.ai-dashboard-content {
  display: grid;
  gap: 14px;
}

.ai-dashboard-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.ai-dashboard-org {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f8fbff;
}

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

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.documents-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.ai-dashboard-table {
  min-width: 920px;
}

.ai-dashboard-table th,
.ai-dashboard-table td {
  font-size: 12px;
  vertical-align: top;
}

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

.version-entry-title {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.version-entry-title strong {
  color: var(--navy);
  font-size: 15px;
}

.version-entry-title span,
.version-entry-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.version-entry ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.version-entry li {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}

.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;
  }
  .ai-cost-badge {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .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;
  }
  .photo-duplicate-row {
    grid-template-columns: 24px 82px minmax(0, 1fr);
  }
  .photo-duplicate-row .photo-duplicate-thumb {
    width: 82px;
    height: 64px;
  }
  .photo-duplicate-row .photo-duplicate-thumb:last-child {
    grid-column: 2 / 4;
  }
  .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-wrap {
    width: 100%;
  }
  .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;
  min-width: 0;
}

.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);
}

.home-return-button {
  width: 38px;
  height: 38px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #eef2ff;
  color: #3152d4;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}

.header-home-button {
  display: none;
}

.home-return-button svg {
  width: 19px;
  height: 19px;
  stroke-width: 2.1;
}

.home-return-button:hover {
  border-color: #9fb2ff;
  background: #e0e7ff;
}

.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(32px, calc((100vw - 1180px) / 2 + 10px));
  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: 900;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.12);
}

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

#dossier-view.sidebar-collapsed .sidebar {
  width: 52px;
  padding: 52px 8px 10px;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  overflow-x: hidden;
}

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

.sidebar {
  position: fixed;
  top: 108px;
  left: max(24px, calc((100vw - 1180px) / 2));
  width: min(330px, calc(100vw - 48px));
  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-header {
  padding-left: 58px;
}

.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-link-symbol,
.nav-button-documents {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.nav-symbol-svg svg,
.nav-symbol-energy svg {
  width: 18px;
  height: 18px;
  display: block;
}

.nav-symbol-svg svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-symbol-energy svg {
  width: 20px;
  height: 20px;
}

.nav-symbol-text {
  font-size: 8px;
  letter-spacing: -0.3px;
}

#dossier-view.sidebar-collapsed .sidebar-header,
#dossier-view.sidebar-collapsed .sidebar .panel {
  display: none;
}

#dossier-view.sidebar-collapsed .nav-link-symbol,
#dossier-view.sidebar-collapsed .nav-button-documents {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  border-radius: 10px;
}

#dossier-view.sidebar-collapsed .nav-link-symbol > span:not(.nav-symbol),
#dossier-view.sidebar-collapsed .nav-button-documents > span:not(.nav-symbol) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#dossier-view.sidebar-collapsed .nav-symbol {
  margin: 0;
}

.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: 24px;
  bottom: 54px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  z-index: 860;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 14px 28px rgba(17, 24, 39, 0.24);
}

.floating-save-dossier {
  position: fixed;
  right: 24px;
  bottom: 114px;
  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: 24px;
  bottom: 168px;
  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);
  }
}


.printer-icon {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

span.printer-icon {
  background: center / 22px 22px no-repeat url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23fff'%20stroke-width='1.9'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M7%208V3h10v5'/%3E%3Cpath%20d='M6%2017H4a2%202%200%200%201-2-2v-5a2%202%200%200%201%202-2h16a2%202%200%200%201%202%202v5a2%202%200%200%201-2%202h-2'/%3E%3Cpath%20d='M6%2014h12v7H6z'/%3E%3Cpath%20d='M18%2011h.01'/%3E%3C/svg%3E");
}

.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;
  width: 100%;
  max-width: 100%;
}

.section {
  border: 1px solid #e3e3e7;
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  min-width: 0;
  max-width: 100%;
}

.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-scenario-mode {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 14px;
  align-items: end;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}

.energy-scenario-mode label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: #1e3a8a;
}

.energy-scenario-mode select {
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #fff;
  color: #172554;
}

.energy-scenario-mode p {
  margin: 0;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .energy-scenario-mode {
    grid-template-columns: 1fr;
  }
}

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

.energy-scenario-card {
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f8fbff;
  overflow: hidden;
}

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

.energy-scenario-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  cursor: pointer;
  background: #eff6ff;
  list-style: none;
}

.energy-scenario-header::-webkit-details-marker { display: none; }
.energy-scenario-summary-main { grid-column: 1; grid-row: 1; min-width: 0; }
.energy-scenario-summary-main strong { display: block; font-size: 16px; }
.energy-scenario-summary-main small { display: block; margin-top: 5px; color: #475569; line-height: 1.35; }
.energy-scenario-remove { grid-column: 2; grid-row: 1; align-self: start; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid #fecaca; border-radius: 50%; background: #fff; color: #b91c1c; font-size: 20px; font-weight: 900; cursor: pointer; }
.energy-scenario-remove:hover { background: #fee2e2; }
.energy-scenario-toggle { grid-column: 3; grid-row: 1; align-self: start; color: #2563eb; font-size: 12px; font-weight: 800; }
.energy-scenario-summary-metrics { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.energy-scenario-summary-metrics > span { padding: 9px 10px; border: 1px solid #dbeafe; border-radius: 8px; background: #fff; text-align: center; }
.energy-scenario-summary-metrics small { display: block; color: #64748b; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.energy-scenario-summary-metrics b { display: block; margin-top: 3px; color: #172033; font-size: 13px; }
.energy-summary-dpe { display: flex !important; align-items: center; justify-content: center; gap: 5px; }
.energy-summary-dpe i { display: grid; place-items: center; width: 26px; height: 24px; border-radius: 5px; color: #fff; font-style: normal; }
.energy-method-note { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: #fff7ed; color: #9a3412; }
.energy-scenario-body { padding: 16px; min-width: 0; }
.energy-scenario-axis { margin: 0 0 14px; padding: 12px; border-left: 4px solid #2563eb; background: #fff; }
.energy-scenario-dpe-summary { display: grid; grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr); align-items: center; gap: 12px; margin: 12px 0; }
.energy-dpe-source-summary { grid-column: 1 / -1; display: grid; gap: 5px; padding: 13px 15px; border: 1px solid #bfdbfe; border-radius: 10px; background: #f8fbff; color: #1e3a8a; }
.energy-dpe-source-summary span { color: #334155; }
.energy-dpe-source-summary small { color: #64748b; }
.energy-dpe-result { display: grid; grid-template-columns: auto 62px; align-items: center; gap: 5px 12px; padding: 12px; border: 1px solid #dbeafe; border-radius: 12px; background: #fff; }
.energy-dpe-result > span { font-weight: 800; }
.energy-dpe-result small { grid-column: 1 / -1; color: #475569; line-height: 1.45; }
.energy-dpe-arrow { text-align: center; font-size: 28px; color: #2563eb; font-weight: 900; }
.energy-building-results { grid-column: 1 / -1; overflow-x: auto; padding: 13px 15px; border: 1px solid #dbeafe; border-radius: 10px; background: #fff; }
.energy-building-results > strong { display: block; margin-bottom: 9px; color: #1e3a5f; }
.energy-building-results table { width: 100%; border-collapse: collapse; font-size: 12px; }
.energy-building-results th,
.energy-building-results td { padding: 8px 10px; border-top: 1px solid #e2e8f0; text-align: left; }
.energy-building-results thead th { border-top: 0; background: #f1f5f9; color: #475569; font-size: 10px; text-transform: uppercase; }
.energy-building-results td:nth-last-child(-n+2),
.energy-building-results thead th:nth-last-child(-n+2) { width: 76px; text-align: center; }
.energy-building-results .dpe-inline { margin: 0 auto; font-size: 16px; }
.dpe-badge { display: grid; place-items: center; width: 58px; height: 42px; border-radius: 7px; color: #fff; font-size: 25px; box-shadow: inset -12px 0 rgba(0,0,0,.08); }
.dpe-inline { display: inline-grid; place-items: center; min-width: 28px; height: 25px; border-radius: 5px; color: #fff; }
.dpe-a { background: #319834; } .dpe-b { background: #33a357; } .dpe-c { background: #8fbd3e; }
.dpe-d { background: #f3e500; color: #172033; } .dpe-e { background: #f0ad22; } .dpe-f { background: #e87924; } .dpe-g { background: #d3291f; }
.energy-actions-list { display: grid; gap: 0; border: 1px solid #d9e3f0; border-radius: 10px; overflow: hidden; background: #fff; }
.energy-actions-head,
.energy-action-card { display: grid; grid-template-columns: 116px 94px minmax(180px, 1fr) 74px 86px 82px 82px 72px 78px; gap: 6px; align-items: center; min-width: 0; cursor: pointer; transition: background .16s ease, box-shadow .16s ease; }
.energy-actions-head { padding: 9px 10px; background: #eaf2fb; color: #334155; font-size: 11px; font-weight: 900; text-align: center; }
.energy-action-card { padding: 10px; border: 0; border-top: 1px solid #e2e8f0; background: #fff; }
.energy-action-card:nth-child(odd) { background: #fbfdff; }
.energy-action-card:hover { background: #f3f8fd; }
.energy-action-card.is-editing { background: #eff6ff; box-shadow: inset 4px 0 0 #2563eb; }
.energy-action-card:not(.is-editing) input,
.energy-action-card:not(.is-editing) textarea,
.energy-action-card:not(.is-editing) select { border-color: transparent; background: transparent; cursor: pointer; opacity: 1; color: inherit; }
.energy-action-card.is-editing input,
.energy-action-card.is-editing textarea,
.energy-action-card.is-editing select { border-color: #93c5fd; background: #fff; }
.energy-action-building { width: 100%; min-width: 0; font-weight: 800; color: #1d4ed8; }
.energy-action-category { font-weight: 800; color: #1e3a5f; background: #eff6ff !important; }
.energy-action-buttons { display: grid; gap: 5px; }
.energy-action-configure,
.energy-action-remove { width: 100%; padding: 5px 4px; border: 0; border-radius: 7px; font-size: 10px; font-weight: 800; cursor: pointer; }
.energy-action-configure { background: #dbeafe; color: #1d4ed8; }
.energy-action-remove { background: #fee2e2; color: #b91c1c; }
.energy-action-editor-hint { display: none; grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 11px; border-radius: 8px; background: #dbeafe; color: #334155; font-size: 11px; }
.energy-action-card.is-editing .energy-action-editor-hint { display: grid; }
.energy-ai-default-note { margin: 8px 0 12px; padding: 9px 11px; border-left: 4px solid #2563eb; border-radius: 7px; background: #eff6ff; color: #334155; font-size: 12px; }
.energy-action-description { width: 100%; min-height: 58px; resize: vertical; }
.energy-action-cost { width: 100%; text-align: center; font-weight: 800; }
.energy-action-quantity { width: 100%; text-align: center; }
.energy-action-impact { display: contents; }
.energy-action-impact span { min-width: 0; padding: 8px 5px; border-radius: 7px; background: #f1f5f9; text-align: center; font-size: 10px; color: #475569; }
.energy-action-impact b { display: block; margin-top: 4px; color: #172033; font-size: 11px; overflow-wrap: anywhere; }
.energy-action-impact .dpe-inline { display: grid; place-items: center; width: 38px; height: 30px; margin: 5px auto 0; color: #fff; font-size: 17px; overflow-wrap: normal; }
.energy-action-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #bfdbfe; }
.energy-action-add select { width: 100%; min-width: 0; }

.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-action-card input,
.energy-action-card textarea,
.energy-action-card select,
.energy-action-add select {
  width: 100%;
  min-width: 0;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  padding: 7px 6px;
  font: inherit;
  background: #fff;
}

@media (max-width: 900px) {
  .energy-scenario-summary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .energy-scenario-dpe-summary { grid-template-columns: 1fr; }
  .energy-dpe-arrow { transform: rotate(90deg); }
  .energy-actions-head { display: none; }
  .energy-action-card { grid-template-columns: 1fr; gap: 7px; }
  .energy-action-editor-hint { grid-column: 1; grid-template-columns: 1fr; }
  .energy-action-impact { display: grid; grid-template-columns: 1fr; }
  .energy-action-add { grid-template-columns: 1fr; }

  .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;
  }
}

.settings-accordion {
  display: grid;
  gap: 14px;
}

.settings-fold {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.settings-fold summary {
  list-style: none;
  cursor: pointer;
  min-height: 64px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #0f172a;
  border-bottom: 1px solid transparent;
}

.settings-fold summary::-webkit-details-marker {
  display: none;
}

.settings-fold summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
  flex: 0 0 auto;
}

.settings-fold[open] summary {
  border-bottom-color: #e5e7eb;
}

.settings-fold[open] summary::after {
  transform: rotate(225deg);
}

.settings-fold summary span {
  display: block;
  font-size: 1.04rem;
  font-weight: 800;
}

.settings-fold summary small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
}

.settings-fold-body {
  padding: 16px 18px 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(330px, 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: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  padding: 10px;
  min-height: 136px;
}

.item-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.item-photo {
  width: 132px;
  height: 104px;
  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 {
  color: var(--navy);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.item-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  margin-top: 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.item-meta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  margin-top: 10px;
  font-weight: 800;
  background: #f3f4f6;
}
.item-meta-ok { color: #166534; background: #ecfdf3; }
.item-meta-progress { color: #92400e; background: #fff7ed; }
.item-meta-neutral { color: #6b7280; background: #f3f4f6; }

.item-access {
  width: fit-content;
  margin-top: 7px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.item-access.readonly {
  color: #7c2d12;
  background: #ffedd5;
}

.item-access.write {
  color: #166534;
  background: #dcfce7;
}

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



/* Smartphone symbol navigation rail and bottom actions. */
@media (max-width: 900px) {
  .dossier-layout {
    padding-left: 58px;
    padding-top: 0;
  }

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

  .sidebar-toggle {
    position: fixed;
    top: 12px;
    left: 10px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    z-index: 940;
    border: 1px solid #cfe0e6;
    border-radius: 999px;
    background: #fff;
    color: var(--navy);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.18);
    font-size: 25px;
    line-height: 1;
  }

  .sidebar,
  #dossier-view.sidebar-collapsed .sidebar {
    position: fixed;
    top: 8px;
    left: 8px;
    width: min(330px, calc(100vw - 16px));
    max-height: calc(100dvh - 16px);
    padding-top: 58px;
    z-index: 930;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    overflow: auto;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
  }

  #dossier-view.sidebar-collapsed .sidebar {
    width: 48px;
    padding: 58px 6px 8px;
    border-radius: 24px;
    background: rgba(244, 249, 251, 0.96);
  }

  #dossier-view.sidebar-collapsed .sidebar-toggle {
    left: 10px;
  }

  #dossier-view.sidebar-collapsed .sidebar-header,
  #dossier-view.sidebar-collapsed .sidebar .panel {
    display: none;
  }

  #dossier-view.sidebar-collapsed .nav {
    gap: 8px;
  }

  #dossier-view.sidebar-collapsed .nav-link-symbol,
  #dossier-view.sidebar-collapsed .nav-button-documents {
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    border-radius: 999px;
  }

  #dossier-view.sidebar-collapsed .nav-link-symbol > span:not(.nav-symbol),
  #dossier-view.sidebar-collapsed .nav-button-documents > span:not(.nav-symbol) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  #dossier-view.sidebar-collapsed .nav-symbol {
    margin: 0;
  }

  .livrable-preview-floating,
  .floating-save-dossier {
    width: 48px;
    height: 48px;
    bottom: 52px;
  }

  .livrable-preview-floating {
    right: 18px;
  }

  .floating-save-dossier {
    right: 78px;
  }

  .floating-save-toast {
    right: 18px;
    bottom: 112px;
  }
}
