:root {
  color-scheme: light;
  --background: #f7f7f8;
  --foreground: #09090b;

  --card: #ffffff;
  --card-foreground: #09090b;

  --popover: #ffffff;
  --popover-foreground: #09090b;

  --primary: #09090b;
  --primary-foreground: #fafafa;

  --secondary: #f4f4f5;
  --secondary-foreground: #18181b;

  --muted: #f4f4f5;
  --muted-foreground: #71717a;

  --accent: #f4f4f5;
  --accent-foreground: #18181b;

  --destructive: #dc2626;
  --destructive-foreground: #ffffff;

  --border: #e4e4e7;
  --input: #eeeeef;
  --ring: #a1a1aa;

  --radius: 18px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;

  --shadow-card:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 1px 1px rgba(0, 0, 0, 0.02);

  --surface: var(--muted);
  --accent-muted: var(--accent);
  --success: var(--primary);
  --success-muted: var(--secondary);
  --warning: #52525b;
  --warning-muted: var(--secondary);
  --danger: var(--destructive);
  --danger-muted: #fef2f2;
  --audit-good: #16a34a;
  --audit-good-muted: #f0fdf4;
  --audit-review: #f59e0b;
  --audit-review-muted: #fffbeb;
  --audit-danger: var(--destructive);
  --audit-danger-muted: #fef2f2;
  --note: var(--muted-foreground);
  --note-muted: var(--secondary);
  --control-radius: 999px;
  --control-height: 38px;
  --shadow: var(--shadow-card);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  background: var(--background);
  color: var(--foreground);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums lining-nums;
  text-rendering: optimizeLegibility;
}

html,
body,
h1,
h2,
h3,
h4,
p,
a,
button,
input,
select,
textarea,
label,
fieldset,
legend,
table,
thead,
tbody,
tr,
th,
td,
dialog,
details,
summary,
[role="button"],
.card,
.panel,
.result,
.metric,
.badge,
.chip,
.input-wrap,
.form-group,
.field,
.calculator,
.calculator-card,
.room-preview {
  min-width: 0;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--foreground);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.2;
}

h1 {
  font-size: 1.35rem;
}

h2 {
  font-size: 0.9rem;
}

h3 {
  font-size: 0.88rem;
}

h4 {
  font-size: 0.82rem;
}

p {
  color: inherit;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration-color: rgba(9, 9, 11, 0.28);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
[role="button"] {
  border: 0;
  border-radius: var(--control-radius);
  background: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
  font-weight: 650;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  background: var(--input);
  color: var(--foreground);
  outline: none;
}

input,
select {
  padding: 0 12px;
}

textarea {
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-foreground);
}

label,
.input-wrap,
.form-group,
.field {
  display: grid;
  gap: 5px;
}

fieldset {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

legend {
  color: var(--foreground);
  font-size: 0.82rem;
  font-weight: 650;
  padding: 0 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: var(--foreground);
}

thead,
tbody,
tr {
  border-color: inherit;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted-foreground);
  font-size: 0.76rem;
  font-weight: 650;
}

dialog {
  width: min(100% - 32px, 560px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-card);
  padding: 16px;
}

dialog::backdrop {
  background: rgba(9, 9, 11, 0.42);
}

details {
  color: var(--foreground);
}

summary {
  cursor: pointer;
}

.card,
.panel,
.calculator,
.calculator-card,
.room-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow);
  padding: 14px;
}

.result,
.metric {
  border-radius: 12px;
  background: var(--surface);
  padding: 10px 12px;
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 24px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--foreground);
  padding: 0 9px;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
.pictogram-option:has(input:focus-visible) .pictogram-frame {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.planner-shell {
  display: grid;
  gap: 12px;
  width: min(calc(100% - 24px), 960px);
  margin: 14px auto 28px;
}

.ad-banner {
  display: grid;
  place-items: center;
  min-height: 62px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
}

.title-card {
  padding: 4px 2px 2px;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  object-fit: contain;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.35rem;
  font-weight: 650;
  line-height: 1.2;
}

h2 {
  color: var(--foreground);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.25;
}

.app-header p,
small {
  color: var(--muted-foreground);
}

.title-card .app-header p {
  margin-top: 2px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.config-card,
.canvas-card,
.summary-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow);
  padding: 14px;
}

.planner-form,
.tool-section,
.fan-controls {
  display: grid;
  gap: 10px;
}

.planner-form {
  gap: 12px;
}

.setup-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 4px;
}

.setup-tab {
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  outline: none;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.setup-tab:hover {
  color: var(--foreground);
}

.setup-tab:focus-visible {
  box-shadow: 0 0 0 3px rgba(161, 161, 170, 0.3);
}

.setup-tab.is-active {
  background: #fff;
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
}

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

.setup-panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.setup-panel-heading small {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding-bottom: 4px;
}

.setup-title {
  min-width: 0;
}

.setup-title h2 {
  margin-bottom: 3px;
}

.setup-actions,
.plan-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.setup-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.units-control {
  min-width: 150px;
}

.heatmap-toggle {
  position: relative;
  display: inline-flex;
  min-width: 0;
  cursor: pointer;
}

.heatmap-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.heatmap-toggle span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--foreground);
  padding: 0 14px;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
  white-space: nowrap;
}

.heatmap-toggle:hover span {
  background: var(--input);
}

.heatmap-toggle input:checked + span {
  background: var(--foreground);
  color: #fff;
}

.heatmap-toggle input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(161, 161, 170, 0.3);
}

.spec-sheet-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--foreground);
  padding: 0 13px;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease;
}

.spec-sheet-button:hover {
  background: var(--primary);
  color: var(--primary-foreground);
}

.spec-sheet-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(161, 161, 170, 0.3);
}

.spec-sheet-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-section {
  padding: 0;
  border-bottom: 0;
}

.room-section > h2 {
  display: none;
}

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

.compact-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.lighting-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lights-panel .layout-section {
  order: 0;
}

.lights-panel .light-customize-section {
  order: 1;
}

.lights-panel .light-advanced-section {
  order: 2;
}

.lights-panel > .tool-section,
.fan-controls > .tool-section {
  padding-block: 2px 6px;
}

.fan-controls {
  gap: 16px;
}

.room-name-field {
  grid-column: span 3;
}

.room-use-field {
  grid-column: span 3;
}

.room-dimension-field {
  grid-column: span 2;
}

label {
  min-width: 0;
}

.input-grid label {
  display: grid;
  gap: 5px;
}

.input-grid span,
.units-control span,
.pictogram-option > span:last-child {
  color: var(--foreground);
  font-size: 0.76rem;
  font-weight: 560;
}

.input-grid small,
.unit-copy {
  color: var(--muted-foreground);
  font-size: 0.72rem;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  background: var(--input);
  color: var(--foreground);
  padding: 0 12px;
  outline: none;
  box-shadow: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

select {
  appearance: none;
  padding-right: 30px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted-foreground) 50%),
    linear-gradient(135deg, var(--muted-foreground) 50%, transparent 50%),
    var(--input);
  background-position:
    calc(100% - 16px) 15px,
    calc(100% - 11px) 15px,
    0 0;
  background-size: 5px 5px, 5px 5px, 100% 100%;
  background-repeat: no-repeat;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  border-color: rgba(9, 9, 11, 0.16);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(161, 161, 170, 0.22);
}

select option {
  background: #fff;
  color: var(--foreground);
}

select.native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px;
  height: 1px !important;
  min-height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.custom-select__button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  background: var(--input);
  color: var(--foreground);
  padding: 0 12px;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  box-shadow: none;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.custom-select__button:hover {
  background: #e9e9eb;
}

.custom-select__button:focus-visible,
.custom-select.is-open .custom-select__button {
  border-color: rgba(9, 9, 11, 0.16);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(161, 161, 170, 0.22);
  outline: none;
}

.custom-select__value {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select__chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 1.5px solid var(--muted-foreground);
  border-bottom: 1.5px solid var(--muted-foreground);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 140ms ease;
}

.custom-select.is-open .custom-select__chevron {
  transform: translateY(2px) rotate(225deg);
}

.custom-select__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 3px;
  max-height: 238px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--popover);
  color: var(--popover-foreground);
  padding: 5px;
  box-shadow:
    0 14px 32px rgba(9, 9, 11, 0.12),
    0 4px 10px rgba(9, 9, 11, 0.07);
  scrollbar-width: thin;
}

.custom-select__menu[hidden] {
  display: none;
}

.custom-select__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 32px;
  border-radius: 10px;
  background: transparent;
  color: var(--foreground);
  padding: 0 9px;
  font-size: 0.84rem;
  font-weight: 520;
  text-align: left;
  box-shadow: none;
}

.custom-select__option:hover,
.custom-select__option:focus-visible {
  background: var(--muted);
  color: var(--foreground);
  outline: none;
}

.custom-select__option.is-selected {
  background: var(--primary);
  color: var(--primary-foreground);
}

.input-grid .field-with-help {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.field-label-row > span:first-child {
  min-width: 0;
  color: var(--foreground);
  font-size: 0.76rem;
  font-weight: 560;
}

.tooltip-wrapper {
  position: static;
  display: inline-flex;
  flex: 0 0 auto;
  margin-left: auto;
}

.field-info-button {
  display: inline-flex;
  align-items: center;
  width: auto;
  height: auto;
  min-height: 18px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-foreground);
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 560;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
  outline: 0;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.field-info-button:hover,
.field-info-button[aria-expanded="true"] {
  background: transparent;
  color: var(--foreground);
}

.field-info-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(161, 161, 170, 0.3);
}

.field-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 45;
  width: min(280px, calc(100vw - 36px));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--foreground);
  color: #fff;
  padding: 10px 12px;
  box-shadow:
    0 14px 32px rgba(9, 9, 11, 0.16),
    0 4px 10px rgba(9, 9, 11, 0.1);
  font-size: 0.78rem;
  font-weight: 520;
  line-height: 1.42;
  text-align: left;
}

.input-grid .field-tooltip {
  color: #fff;
  font-size: 0.78rem;
  font-weight: 520;
  line-height: 1.42;
}

.field-tooltip[hidden] {
  display: none;
}

.layout-strip-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.layout-section .layout-strip-heading {
  display: flex;
}

.layout-strip-heading small {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout-section .layout-groups {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  margin-inline: -2px;
  padding: 2px 2px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  scrollbar-width: thin;
  scroll-padding-inline: 2px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.pictogram-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 7px;
}

.fan-pictograms {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.pictogram-option {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 0;
  cursor: pointer;
  color: var(--muted-foreground);
  text-align: center;
}

.layout-section .pictogram-option {
  flex: 0 0 78px;
  scroll-snap-align: start;
}

.pictogram-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pictogram-frame {
  display: grid;
  place-items: center;
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.layout-section .pictogram-frame {
  min-height: 40px;
}

.pictogram-frame svg {
  width: 100%;
  max-width: 88px;
  height: 38px;
  fill: none;
  stroke: var(--foreground);
  stroke-width: 1.25;
}

.layout-section .pictogram-frame svg {
  height: 30px;
}

.pictogram-frame circle {
  fill: var(--primary);
  stroke: var(--primary);
  stroke-width: 1.1;
}

.pictogram-frame polygon {
  fill: none;
}

.fan-pictograms .pictogram-frame circle,
.fan-pictograms .pictogram-frame path {
  fill: rgba(9, 9, 11, 0.08);
  stroke: var(--foreground);
}

.pictogram-option input:checked + .pictogram-frame {
  border-color: var(--foreground);
  background: var(--primary);
  box-shadow: none;
}

.pictogram-option input:checked + .pictogram-frame svg {
  stroke: #fff;
}

.pictogram-option input:checked + .pictogram-frame rect,
.pictogram-option input:checked + .pictogram-frame polygon,
.pictogram-option input:checked + .pictogram-frame path {
  stroke: #fff;
}

.pictogram-option input:checked + .pictogram-frame circle {
  fill: #fff;
  stroke: #fff;
}

.pictogram-option input:checked ~ span:last-child {
  color: var(--foreground);
}

.section-heading,
.plan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.plan-header {
  margin-bottom: 8px;
}

.plan-subtitle {
  max-width: min(100%, 760px);
  margin: 10px auto 0;
  color: var(--muted-foreground);
  font-size: 0.86rem;
  line-height: 1.35;
  text-align: center;
}

.plan-subtitle strong {
  color: var(--foreground);
  font-weight: 700;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--foreground);
  box-shadow: none;
  transition: border-color 140ms ease, background 140ms ease;
}

.icon-button:hover {
  background: var(--primary);
  color: var(--primary-foreground);
}

.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.canvas-wrap {
  position: relative;
  overflow: hidden;
  height: clamp(320px, 46vh, 480px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.audit-panel {
  display: grid;
  gap: 12px;
}

.audit-summary {
  min-width: 0;
}

.audit-summary h2 {
  margin: 0;
  color: var(--foreground);
  font-size: 0.96rem;
  font-weight: 650;
}

.audit-items {
  display: grid;
  gap: 8px;
}

.audit-item {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--border);
  border-left-width: 5px;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
}

.audit-item--pass {
  border-left-color: var(--audit-good);
}

.audit-item--warning {
  border-left-color: var(--audit-review);
}

.audit-item--fail {
  border-left-color: var(--audit-danger);
}

.audit-item--advisory,
.audit-item--unknown {
  border-left-color: var(--note);
  background: #fff;
}

.audit-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.audit-item__label {
  margin: 0;
  color: var(--foreground);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.2;
}

.audit-item__status {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 24px;
  border-radius: 999px;
  background: #eee;
  color: var(--foreground);
  padding: 0 9px;
  font-size: 0.74rem;
  font-weight: 650;
}

.audit-item--pass .audit-item__status {
  background: var(--audit-good);
  color: #fff;
}

.audit-item--warning .audit-item__status {
  background: var(--audit-review);
  color: #fff;
}

.audit-item--fail .audit-item__status {
  background: var(--audit-danger);
  color: var(--destructive-foreground);
}

.audit-item--advisory .audit-item__status,
.audit-item--unknown .audit-item__status {
  background: var(--primary);
  color: var(--primary-foreground);
}

.audit-item__message,
.audit-item__metric,
.audit-item__recommendation,
.audit-item__details p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.84rem;
  line-height: 1.42;
}

.audit-item__metric {
  color: var(--foreground);
  font-weight: 600;
}

.audit-item__recommendation {
  color: #374151;
}

.audit-item__details {
  margin-top: 2px;
}

.audit-item__details summary {
  width: max-content;
  cursor: pointer;
  color: var(--foreground);
  font-size: 0.78rem;
  font-weight: 650;
}

.audit-item__details p {
  margin-top: 6px;
}

.print-spec {
  display: none;
}

table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 8px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted-foreground);
  font-size: 0.76rem;
  font-weight: 500;
  background: var(--muted);
}

td:first-child {
  font-weight: 600;
}

[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .planner-shell {
    width: min(calc(100% - 16px), 980px);
    margin: 8px auto 20px;
    gap: 10px;
  }

  .config-card,
  .canvas-card,
  .summary-card {
    padding: 14px;
  }

  .setup-topbar {
    align-items: flex-start;
  }

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

  .compact-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .fan-pictograms {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .canvas-wrap {
    height: 390px;
  }
}

@media (max-width: 480px) {
  .setup-topbar {
    flex-direction: column;
  }

  .setup-actions {
    width: 100%;
  }

  .units-control {
    flex: 1;
    min-width: 0;
  }

  .input-grid,
  .lighting-grid,
  .fan-inputs {
    grid-template-columns: 1fr;
  }

  .compact-grid {
    grid-template-columns: 1fr;
  }

  .room-name-field,
  .room-use-field,
  .room-dimension-field {
    grid-column: auto;
  }

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

  .audit-item__header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@page {
  size: A4 portrait;
  margin: 10mm;
}

@media print {
  * {
    box-shadow: none !important;
  }

  html,
  body {
    width: 190mm;
    background: #fff;
    color: #222;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .planner-shell {
    display: grid;
    gap: 5mm;
    width: 100%;
    min-height: 277mm;
    margin: 0;
  }

  .ad-banner,
  .config-card,
  .plan-actions {
    display: none !important;
  }

  .title-card,
  .canvas-card,
  .summary-card {
    display: grid;
    border: 1px solid #d6d6d6;
    border-radius: 0;
    background: #fff;
    margin: 0;
    padding: 5mm;
  }

  .title-card {
    padding: 5mm 0;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  h1 {
    font-size: 16pt;
  }

  .canvas-wrap {
    height: 122mm;
    border-color: #d6d6d6;
    border-radius: 0;
    margin-bottom: 4mm;
    break-inside: avoid;
  }

  .print-spec {
    display: grid;
    gap: 3mm;
  }

  .print-spec h2 {
    font-size: 9pt;
    color: #222;
  }

  .print-spec-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid #ddd;
    border-left: 1px solid #ddd;
  }

  .print-spec-item {
    display: grid;
    gap: 1mm;
    min-height: 8.5mm;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    padding: 2mm 2.5mm;
  }

  .print-spec-item span {
    color: #717171;
    font-size: 6.8pt;
    font-weight: 700;
  }

  .print-spec-item strong {
    color: #222;
    font-size: 8pt;
    line-height: 1.25;
  }

  .summary-card {
    gap: 3mm;
    break-inside: avoid;
  }

  .audit-summary {
    padding: 0;
  }

  .audit-item {
    gap: 2mm;
    border-color: #d8d8d8 !important;
    background: #fff !important;
    break-inside: avoid;
  }

  .audit-item__label {
    font-size: 7.2pt;
  }

  .audit-item__status {
    min-height: 0;
    padding: 0.8mm 2mm;
    font-size: 6.5pt;
  }

  .audit-item__message,
  .audit-item__metric,
  .audit-item__recommendation,
  .audit-item__details p {
    font-size: 7pt;
    line-height: 1.25;
  }
}
