/* ============================================================
   Värderingsplattform — design system
   Warm editorial / paper aesthetic. Themeable via [data-theme].
   ============================================================ */

/* ---- Default theme: Varm arkiv (warm editorial) ---- */
:root {
  --bg:          #f3efe7;
  --surface:     #fbf9f4;
  --surface-2:   #efe9dd;
  --surface-3:   #e7e0d0;
  --ink:         #28251f;
  --ink-2:       #5b554a;
  --ink-3:       #8d8675;
  --ink-4:       #b3ab98;
  --line:        #e4ddcd;
  --line-2:      #d6cdb8;
  --line-strong: #c7bca2;
  --accent:      #6f5a37;
  --accent-2:    #8a7142;
  --accent-soft: #ece3d0;
  --accent-ink:  #fbf9f4;

  --ok:      #5d7a4f;
  --ok-soft: #e4ecdd;
  --warn:      #ad7a37;
  --warn-soft: #f3e7d2;
  --danger:      #a64f3c;
  --danger-soft: #f1ddd5;
  --info:      #4f6680;
  --info-soft: #dfe6ee;

  --radius:    7px;
  --radius-sm: 5px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(40,37,31,.05), 0 1px 1px rgba(40,37,31,.04);
  --shadow:    0 2px 4px rgba(40,37,31,.05), 0 6px 16px -8px rgba(40,37,31,.12);
  --shadow-lg: 0 12px 40px -12px rgba(40,37,31,.28), 0 2px 8px rgba(40,37,31,.08);

  --font-ui:   "Hanken Grotesk", system-ui, sans-serif;
  --font-serif:"Source Serif 4", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --pad:   1px;   /* density multiplier base via calc not used; see [data-density] */
  --gap-unit: 1;

  color-scheme: light;
}

/* ---- Theme: Kall kontor (cool neutral) ---- */
[data-theme="cool"] {
  --bg:          #eceef1;
  --surface:     #fbfcfd;
  --surface-2:   #e8ebef;
  --surface-3:   #dde2e8;
  --ink:         #1c2228;
  --ink-2:       #4d565f;
  --ink-3:       #818a94;
  --ink-4:       #aab2bb;
  --line:        #e0e4e9;
  --line-2:      #d0d6dd;
  --line-strong: #bcc4cd;
  --accent:      #3d586f;
  --accent-2:    #4a6b86;
  --accent-soft: #dee6ed;
  --accent-ink:  #fbfcfd;

  --ok:      #41785f;   --ok-soft:   #ddeae3;
  --warn:    #9a7430;   --warn-soft: #f0e6d2;
  --danger:  #9c4a40;   --danger-soft:#f0dcd9;
  --info:    #3f607f;   --info-soft: #dde7f0;
}

/* ---- Theme: Hög kontrast (paper + sharp accent) ---- */
[data-theme="contrast"] {
  --bg:          #ffffff;
  --surface:     #ffffff;
  --surface-2:   #f4f3f0;
  --surface-3:   #eceae5;
  --ink:         #131312;
  --ink-2:       #45443f;
  --ink-3:       #7c7a72;
  --ink-4:       #a8a69d;
  --line:        #e7e5df;
  --line-2:      #d6d3ca;
  --line-strong: #c3bfb3;
  --accent:      #a83a22;
  --accent-2:    #c14b30;
  --accent-soft: #f6e1da;
  --accent-ink:  #ffffff;

  --ok:      #2f7d4f;   --ok-soft:   #dcefe2;
  --warn:    #b06d1a;   --warn-soft: #f6e7cf;
  --danger:  #b3392a;   --danger-soft:#f6dbd5;
  --info:    #2f5b86;   --info-soft: #dbe6f1;
  --shadow:    0 1px 2px rgba(0,0,0,.06), 0 6px 16px -8px rgba(0,0,0,.14);
  --shadow-lg: 0 16px 44px -14px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.08);
}

/* ---- density ---- */
[data-density="compact"] { --row-pad: 9px; --card-pad: 16px; --section-gap: 18px; }
:root              { --row-pad: 13px; --card-pad: 22px; --section-gap: 28px; }

/* ---- heading font tweak ---- */
[data-headings="sans"] .serif,
[data-headings="sans"] h1,
[data-headings="sans"] h2,
[data-headings="sans"] h3 { font-family: var(--font-ui); letter-spacing: -.015em; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#root { height: 100%; }

h1,h2,h3,h4 { margin: 0; font-weight: 600; }
.serif { font-family: var(--font-serif); }
.mono  { font-family: var(--font-mono); }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }
::selection { background: var(--accent-soft); }

/* scrollbars */
html { scrollbar-gutter: stable; }
.dashboard-results {
  min-height: 281px;
  position: relative;
  z-index: 1;
}
.dashboard-active-filter {
  height: 31px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
  font: 600 12px var(--font-ui);
  transition: background .14s, border-color .14s, color .14s;
}
.dashboard-active-filter:hover {
  border-color: var(--accent);
}
.dashboard-toolbar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto 280px auto;
  align-items: center;
  position: relative;
  z-index: 10;
}
.dashboard-toolbar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 0 !important;
}
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--line-strong); background-clip: padding-box; border: 3px solid transparent; }

/* responsive layout */
.responsive-table {
  max-width: 100%;
}
.settings-select {
  width: 170px;
}
.topbar-search {
  min-width: 0;
}

@media (max-width: 1100px) {
  .dashboard-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .dashboard-toolbar {
    grid-template-columns: minmax(0, 1fr) auto 240px auto;
  }
  .responsive-content-grid {
    grid-template-columns: 1fr !important;
  }
  .ai-review-layout {
    grid-template-columns: minmax(0, 1fr) 320px !important;
  }
}

@media (max-width: 900px) {
  .sidebar-shell {
    width: 72px !important;
    padding: 18px 10px !important;
  }
  .sidebar-shell nav button,
  .sidebar-shell > div:last-child > button {
    justify-content: center !important;
    gap: 0 !important;
  }
  .sidebar-shell nav button > span,
  .sidebar-shell > div:last-child > button > span,
  .sidebar-shell .card,
  .sidebar-shell .eyebrow,
  .sidebar-shell .sidebar-toggle {
    display: none !important;
  }
  .sidebar-shell > button:first-of-type > div > div:last-child {
    display: none !important;
  }
  .topbar-user-details {
    display: none !important;
  }
  .dashboard-page {
    padding: 28px 24px 64px !important;
  }
  .account-page {
    padding: 28px 24px 64px !important;
  }
  .account-layout {
    grid-template-columns: 1fr !important;
  }
  .dashboard-toolbar {
    grid-template-columns: minmax(0, 1fr) auto 240px auto !important;
  }
  .dashboard-toolbar-title {
    grid-column: 1 / -1;
  }
  .responsive-table {
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }
  .dashboard-table-row {
    min-width: 780px;
  }
  .documents-table-row {
    min-width: 900px;
  }
  .archive-table-row {
    min-width: 820px;
  }
  .valuation-table-row {
    min-width: 610px;
  }
  .ai-review-layout {
    display: block !important;
    height: auto !important;
  }
  .ai-review-layout > div {
    overflow: visible !important;
  }
  .ai-review-layout > div:last-child {
    border-top: 1px solid var(--line);
  }
  .appendix-row {
    flex-wrap: wrap;
  }
  .appendix-row > div:nth-last-child(2) {
    margin-left: 104px;
  }
  .report-builder-layout {
    display: block !important;
    height: auto !important;
  }
  .report-section-nav {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line);
    overflow: visible !important;
  }
  .report-section-nav > div:nth-child(2) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .report-editor {
    overflow: visible !important;
  }
}

@media (max-width: 700px) {
  html {
    scrollbar-gutter: auto;
  }
  .login-shell {
    display: block !important;
  }
  .login-brand-panel {
    min-height: 220px;
    padding: 30px 24px !important;
  }
  .login-brand-panel h1 {
    font-size: 29px !important;
  }
  .login-brand-panel > div:last-child {
    display: none !important;
  }
  .login-form-panel {
    padding: 30px 20px !important;
  }
  .sidebar-shell {
    width: 60px !important;
    padding: 14px 6px !important;
  }
  .sidebar-shell > button:first-of-type {
    padding-left: 9px !important;
    padding-right: 9px !important;
  }
  .topbar-shell {
    height: 54px !important;
    gap: 7px !important;
    padding: 0 10px !important;
  }
  .topbar-search input {
    height: 36px !important;
  }
  .topbar-spacer,
  .topbar-divider {
    display: none !important;
  }
  .notifications-popover {
    position: fixed !important;
    top: 58px !important;
    right: 10px !important;
    left: 70px !important;
    width: auto !important;
    max-height: calc(100vh - 70px);
    overflow-y: auto !important;
  }
  .dashboard-page {
    padding: 22px 14px 54px !important;
  }
  .account-page {
    padding: 22px 14px 54px !important;
  }
  .form-grid {
    grid-template-columns: 1fr !important;
    padding: 16px !important;
  }
  .setting-row {
    align-items: flex-start !important;
    flex-wrap: wrap;
    padding: 14px 16px !important;
  }
  .setting-row > div:last-child {
    margin-left: 45px;
  }
  .settings-select {
    width: 190px;
  }
  .dashboard-page h1 {
    font-size: 25px !important;
  }
  .dashboard-card-grid {
    grid-template-columns: 1fr !important;
  }
  .dashboard-toolbar {
    display: flex !important;
    flex-wrap: wrap;
  }
  .dashboard-toolbar-title {
    width: 100%;
  }
  .dashboard-search {
    flex: 1 1 100%;
    width: auto !important;
  }
  .dashboard-filter-controls {
    max-width: 100%;
  }
  .dashboard-active-filter {
    max-width: calc(100vw - 185px);
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .assignment-header {
    padding: 10px 14px 0 !important;
  }
  .assignment-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .assignment-actions > div:first-child {
    width: 100%;
  }
  .page-wrap {
    padding: 20px 14px 50px !important;
  }
  .page-wrap > div[style*="justify-content: space-between"],
  .page-wrap > div[style*="justifyContent: space-between"] {
    flex-wrap: wrap;
    gap: 10px;
  }
  .page-wrap [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  .page-wrap .valuation-table-row {
    grid-template-columns: 40px 1fr 56px 96px 78px 30px !important;
  }
  .page-wrap .card > div[style*="justify-content: space-between"] {
    flex-wrap: wrap;
    gap: 10px;
  }
  .ai-review-layout > div:first-child > div,
  .ai-review-layout > div:first-child > div:last-child,
  .ai-review-layout > div:last-child {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  .ai-review-layout [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  .ai-review-layout .card[style*="display: flex"] {
    flex-wrap: wrap;
  }
  .appendix-row > div:nth-last-child(2) {
    margin-left: 0;
    width: 100%;
  }
  .report-section-nav > div:nth-child(2) {
    grid-template-columns: 1fr !important;
  }
  .report-editor-inner {
    padding: 22px 14px 60px !important;
  }
  .report-editor-inner > .card {
    flex-wrap: wrap;
  }
  .report-pdf > div:first-child {
    overflow-x: auto;
  }
  .modal-overlay {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .modal-overlay .card [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  .address-picker-layout {
    display: block !important;
  }
  .address-picker-layout > div:first-child {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line);
  }
  .address-picker-layout > div:last-child {
    min-height: 280px;
  }
}

/* ---------- utility ---------- */
.muted   { color: var(--ink-2); }
.faint   { color: var(--ink-3); }
.eyebrow {
  font: 600 11px/1 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px; font-weight: 500;
  transition: background .14s, border-color .14s, transform .06s, box-shadow .14s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn svg { flex: none; }
.btn-primary {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-sm { height: 31px; padding: 0 11px; font-size: 13px; gap: 6px; }
.btn-icon { width: 38px; padding: 0; justify-content: center; }
.btn-icon.btn-sm { width: 31px; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ---------- pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px;
  border-radius: 100px;
  font: 600 12px/1 var(--font-ui);
  letter-spacing: .005em;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px; border-radius: 5px;
  font: 500 12px/1 var(--font-mono); letter-spacing: .02em;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line);
}
.ai-tag {
  display: inline-flex; align-items: center; height: 17px; padding: 0 5px;
  border-radius: 4px; font: 600 9.5px/1 var(--font-mono); letter-spacing: .08em;
  background: var(--surface-3); color: var(--ink-3); border: 1px solid var(--line-2);
}

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ---------- inputs ---------- */
.input, .select, .textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit; font-size: 14px;
  padding: 9px 12px;
  transition: border-color .14s, box-shadow .14s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.field-label { font: 500 12px/1 var(--font-ui); color: var(--ink-2); margin-bottom: 6px; display:block; letter-spacing:.01em; }

/* image placeholder */
.img-ph {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(135deg, var(--surface-2) 0 9px, var(--surface-3) 9px 18px);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
}
.img-ph span {
  font: 500 10.5px/1.3 var(--font-mono); letter-spacing: .04em;
  background: var(--surface); padding: 4px 8px; border-radius: 5px;
  border: 1px solid var(--line); text-align: center;
}

/* animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes analysisProgress { from { width: 8%; } to { width: 92%; } }
.fade-up { animation: fadeUp .4s cubic-bezier(.2,.7,.3,1) both; }
.fade-in { animation: fadeIn .3s ease both; }
.analysis-progress { animation: analysisProgress 2.4s ease-out both; }

/* focus ring for keyboard */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
@media print {
  @page { size: A4; margin: 0; }
  body * { visibility: hidden; }
  .report-pdf, .report-pdf * { visibility: visible; }
  .report-pdf { position: absolute !important; inset: 0 !important; overflow: visible !important; background: #fff !important; display: block !important; }
  .report-pdf > div:first-child, button { display: none !important; }
  .report-pdf > div:last-child { overflow: visible !important; padding: 0 !important; }
  .report-sheet { width: 210mm !important; min-height: 297mm !important; height: 297mm !important; box-shadow: none !important; break-after: page; margin: 0 !important; overflow: hidden !important; }
}

.report-sheet {
  width: 760px;
  min-height: 1075px;
}

/* ---------- mobile inspection ---------- */
.inspection-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
}
.inspection-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 62px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: minmax(74px, 1fr) minmax(0, 2fr) minmax(74px, 1fr);
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.inspection-header-title {
  min-width: 0;
  text-align: center;
}
.inspection-header-title strong,
.inspection-header-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inspection-header-title strong { font-size: 19px; }
.inspection-header-title span { margin-top: 2px; color: var(--ink-3); font-size: 13px; }
.inspection-nav-action {
  min-height: 40px;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}
.inspection-nav-action:last-child { justify-self: end; text-align: right; }
.inspection-nav-action.primary { font-weight: 700; }
.inspection-nav-action:disabled { opacity: .35; }
.inspection-nav-action:first-child { justify-self: start; }
.inspection-nav-action:only-child { justify-self: start; }
.inspection-nav-action svg { flex: 0 0 auto; }
.inspection-nav-action.icon-only {
  width: 40px;
  padding: 0;
}
.inspection-nav-action + .inspection-header-title {
  grid-column: 2;
}
.inspection-main {
  flex: 1;
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 20px 14px 32px;
}
.inspection-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}
.inspection-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .2s ease;
}
.inspection-shell .eyebrow { font-size: 13px; }
.inspection-shell .btn { font-size: 14px; }
.inspection-room-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.inspection-room-heading > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.inspection-room-heading .mono { color: var(--accent); font-size: 13px; }
.inspection-room-heading h1 { font-size: 26px; }
.inspection-done {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: var(--accent);
}
.inspection-autosave {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
}
.inspection-step-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.inspection-step-intro {
  margin: -2px 0 18px;
  padding-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-bottom: 1px solid var(--line);
}
.inspection-step-intro strong { font-size: 16px; }
.inspection-step-intro span { color: var(--ink-3); font-size: 14px; line-height: 1.45; }
.inspection-step-card > .inspection-material:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.inspection-step-card > .inspection-section:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.inspection-field {
  display: block;
  margin-bottom: 14px;
}
.inspection-field > span,
.inspection-section h2 {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.inspection-field .select { min-height: 48px; font-size: 16px; }
.inspection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.inspection-section {
  margin-top: 10px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
}
.inspection-section h2 {
  display: flex;
  justify-content: space-between;
}
.inspection-section h2 span { color: var(--accent); }
.inspection-section .textarea { font-size: 16px; min-height: 120px; }
.inspection-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.inspection-checks label {
  min-height: 44px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
}
.inspection-checks label.checked {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.inspection-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  margin-bottom: 12px;
}
.inspection-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.inspection-photos > div,
.inspection-photo-add {
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.inspection-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inspection-photos > div button {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 24, 22, .72);
  color: #fff;
}
.inspection-photo-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  border-style: dashed;
}
.inspection-material {
  margin-bottom: 16px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}
.inspection-material .inspection-field { margin-bottom: 8px; }
.inspection-material-damage {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}
.inspection-material > .input { margin-top: 7px; font-size: 15px; }
.inspection-damage-notes { margin-top: 10px; min-height: 88px !important; }
.inspection-room-plan {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.inspection-room-plan > div {
  min-height: 56px;
  padding: 8px 10px 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-weight: 600;
}
.inspection-stepper {
  display: grid;
  grid-template-columns: 38px 34px 38px;
  align-items: center;
  text-align: center;
}
.inspection-stepper button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--accent);
}
.inspection-stepper button:disabled { opacity: .35; }
.inspection-stepper strong { font-family: var(--font-mono); }
.inspection-mobile-create {
  margin-top: 18px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.inspection-mobile-create > div:nth-child(3),
.inspection-mobile-create > button { grid-column: 1 / -1; }
.inspection-object-assessment {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.inspection-object-assessment .textarea { min-height: 130px; font-size: 15px; }
.inspection-hub-heading {
  margin-bottom: 16px;
  padding: 4px 2px;
}
.inspection-hub-heading h1 { margin: 7px 0 5px; font-size: 24px; }
.inspection-hub-heading p { margin-bottom: 14px; color: var(--ink-3); font-size: 14px; line-height: 1.5; }
.inspection-hub-heading > strong { display: block; margin-top: 7px; color: var(--ink-3); font-size: 13px; text-align: right; }
.inspection-room-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.inspection-room-list > button {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 38px 1fr 18px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}
.inspection-room-list > button > span:first-child {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 13px;
}
.inspection-room-list > button > span:first-child.complete { background: var(--accent-soft); color: var(--accent); }
.inspection-room-list strong,
.inspection-room-list small { display: block; }
.inspection-room-list strong { margin-bottom: 3px; font-size: 15px; }
.inspection-room-list small { color: var(--ink-3); font-size: 13px; }
.inspection-assessment-callout {
  width: 100%;
  margin-top: 20px;
  padding: 13px;
  display: grid;
  grid-template-columns: 34px 1fr 18px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--accent);
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  text-align: left;
}
.inspection-assessment-callout > span:first-child {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inspection-assessment-callout strong,
.inspection-assessment-callout small { display: block; }
.inspection-assessment-callout strong { margin-bottom: 2px; font-size: 13.5px; }
.inspection-assessment-callout small { font-size: 13px; opacity: .8; }
.inspection-review-hero {
  padding: 18px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
}
.inspection-review-hero .eyebrow { color: rgba(255,255,255,.72); }
.inspection-review-hero h1 { margin: 7px 0 5px; font-size: 23px; }
.inspection-review-hero p { margin-bottom: 15px; color: rgba(255,255,255,.78); font-size: 14px; line-height: 1.5; }
.inspection-review-hero .inspection-progress-track { background: rgba(255,255,255,.18); }
.inspection-review-hero .inspection-progress-track span { background: #fff; }
.inspection-review-hero > strong { display: block; margin-top: 7px; font-size: 13px; text-align: right; }
.inspection-review-object {
  margin: 12px 0;
  padding: 13px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.inspection-review-object div { display: flex; flex-direction: column; gap: 3px; }
.inspection-review-object span { color: var(--ink-3); font-size: 13px; }
.inspection-review-object strong { font-size: 14px; }
.inspection-review-list { display: flex; flex-direction: column; gap: 8px; }
.inspection-review-list button {
  width: 100%;
  padding: 12px;
  display: grid;
  grid-template-columns: 32px 1fr 18px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}
.inspection-review-list button > span:first-child {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-3);
}
.inspection-review-list button > span:first-child.complete { background: var(--accent-soft); color: var(--accent); }
.inspection-review-list button > span:nth-child(2) { min-width: 0; }
.inspection-review-list strong,
.inspection-review-list small { display: block; }
.inspection-review-list strong { margin-bottom: 3px; font-size: 15px; }
.inspection-review-list small {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inspection-footer {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px max(11px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.inspection-footer .btn { height: 46px; }
.inspection-footer .btn-primary { flex: 1; }
.inspection-room-drawer {
  position: fixed;
  z-index: 19;
  top: 66px;
  left: 0;
  right: 0;
  max-height: calc(100vh - 148px);
  overflow: auto;
  padding: 10px 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.inspection-room-drawer > button {
  width: 100%;
  padding: 11px 8px;
  display: grid;
  grid-template-columns: 22px 1fr 18px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  text-align: left;
}
.inspection-room-drawer > button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.inspection-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.inspection-add-grid button {
  padding: 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink-2);
  text-align: left;
}

@media (max-width: 480px) {
  .inspection-grid { grid-template-columns: 1fr; gap: 0; }
  .inspection-checks { grid-template-columns: 1fr 1fr; }
}

/* ---------- mobile demo frame ---------- */
.mobile-demo-stage {
  min-height: 100vh;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #eef3f1, #cbd5d1);
}
.mobile-demo-phone {
  width: 430px;
  height: min(900px, calc(100vh - 56px));
  position: relative;
  padding: 22px 11px 24px;
  border-radius: 48px;
  background: #171b1a;
  border: 2px solid #49514e;
  box-shadow: 0 30px 80px rgba(21, 30, 27, .3), inset 0 0 0 2px #090b0a;
}
.mobile-demo-screen {
  height: 100%;
  overflow: auto;
  border-radius: 32px;
  background: var(--bg);
  scrollbar-width: none;
}
.mobile-demo-screen::-webkit-scrollbar { display: none; }
.mobile-demo-screen .inspection-shell { min-height: 100%; }
.mobile-demo-screen .inspection-header { top: 0; }
.mobile-demo-screen .inspection-footer {
  position: sticky;
  bottom: 0;
  margin-top: -70px;
}
.mobile-demo-screen .inspection-room-drawer {
  position: absolute;
  top: 88px;
  left: 11px;
  right: 11px;
  max-height: calc(100% - 150px);
}
.mobile-demo-screen .dashboard-page {
  padding: 24px 15px 55px !important;
}
.mobile-demo-screen .dashboard-page h1 { font-size: 25px !important; }
.mobile-demo-screen .dashboard-page > div:first-child { display: block !important; }
.mobile-demo-screen .dashboard-page > div:first-child > div:not(:first-child) { width: 100% !important; margin-top: 12px; }
.mobile-demo-screen .dashboard-page button.card { padding: 13px !important; }
.mobile-demo-screen .dashboard-page button.card > span:nth-last-child(2) { display: none; }
.mobile-demo-screen .inspection-mobile-create { grid-template-columns: 1fr; }
.mobile-demo-screen .inspection-mobile-create > * { grid-column: auto; }
.mobile-demo-speaker {
  position: absolute;
  z-index: 30;
  top: 9px;
  left: 50%;
  width: 76px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 5px;
  background: #3b413f;
}
.mobile-demo-home {
  position: absolute;
  z-index: 30;
  bottom: 8px;
  left: 50%;
  width: 110px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 4px;
  background: #68716e;
}
@media (max-width: 600px) {
  .mobile-demo-stage { padding: 0; background: var(--bg); }
  .mobile-demo-phone { width: 100%; height: 100vh; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--bg); }
  .mobile-demo-screen { border-radius: 0; }
  .mobile-demo-speaker, .mobile-demo-home { display: none; }
  .mobile-demo-screen .inspection-room-drawer { position: fixed; top: 66px; left: 0; right: 0; }
  .inspection-mobile-create { grid-template-columns: 1fr; }
  .inspection-mobile-create > * { grid-column: auto; }
}
