:root {
  --ink: #1e2433;
  --muted: #647089;
  --line: #d7deea;
  --paper: #fffdf8;
  --panel: #ffffff;
  --bg: #f3efe7;
  --accent-a: #c75c35;
  --accent-b: #0f766e;
  --accent-c: #c29a2f;
  --deep: #1b2330;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(199, 92, 53, 0.12), transparent 26%),
    radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.1), transparent 24%),
    linear-gradient(180deg, #f8f4ec 0%, var(--bg) 100%);
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 12px 18px;
  background: rgba(248, 244, 236, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(30, 36, 51, 0.08);
}

.toolbar button,
.toolbar a {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font: 600 14px/1.2 "Segoe UI", Tahoma, sans-serif;
  cursor: pointer;
  color: white;
  text-decoration: none;
  background: var(--deep);
}

.toolbar .secondary {
  background: #7d877f;
}

.page {
  width: 960px;
  margin: 28px auto;
  padding: 0;
}

.sheet {
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.98)),
    var(--paper);
  border: 1px solid rgba(30, 36, 51, 0.06);
  border-radius: 30px;
  box-shadow: 0 28px 70px rgba(39, 27, 15, 0.14);
}

.sheet + .sheet {
  margin-top: 22px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 20px;
  align-items: stretch;
}

.hero-copy {
  padding: 0 4px 0 2px;
}

.hero-logo-wrap {
  min-height: 24px;
  margin-bottom: 8px;
}

.hero-logo {
  display: none;
  max-width: 33%;
  max-height: 42mm;
  width: auto;
  height: auto;
  object-fit: contain;
}

.eyebrow,
.section-kicker,
.stat-label,
.meta-label {
  font: 700 11px/1.2 "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.eyebrow {
  color: var(--accent-a);
  margin-bottom: 12px;
}

.title {
  margin: 0;
  font: 700 42px/1.02 "Aptos Display", "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.02em;
  color: #18202e;
}

.project-card,
.report-panel,
.notes-panel,
.stat-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 14px 28px rgba(23, 20, 13, 0.05);
}

.project-card {
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(30, 36, 51, 0.98), rgba(52, 62, 83, 0.96));
  color: white;
}

.project-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.project-tag,
.project-date {
  font: 700 12px/1.2 "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-tag {
  color: #ffd5b5;
}

.project-date {
  color: rgba(255,255,255,0.82);
}

.project-details {
  margin-top: 4px;
  font: 400 15px/1.5 "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: rgba(255,255,255,0.92);
}

.project-divider {
  height: 1px;
  margin: 6px 0;
  background: linear-gradient(90deg, rgba(255,213,181,0.8), rgba(255,255,255,0.08));
}

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

.meta-box {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
}

.meta-label {
  display: block;
  color: rgba(255,255,255,0.66);
}

.meta-value {
  display: block;
  margin-top: 6px;
  font: 700 20px/1.1 "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.stat-panel {
  padding: 18px 18px 20px;
  position: relative;
  overflow: hidden;
}

.stat-panel::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 6px;
  opacity: 0.9;
}

.accent-a::after { background: linear-gradient(90deg, var(--accent-a), #f0b489); }
.accent-b::after { background: linear-gradient(90deg, var(--accent-b), #78c6bb); }
.accent-c::after { background: linear-gradient(90deg, var(--accent-c), #edd79e); }

.stat-label {
  color: var(--muted);
}

.stat-value {
  display: block;
  margin-top: 12px;
  font: 700 28px/1.05 "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.01em;
}

.stat-copy {
  margin: 12px 0 0;
  font: 400 14px/1.5 "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 22px;
}

.report-panel,
.notes-panel {
  padding: 18px;
}

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

.section-kicker {
  color: var(--accent-b);
}

.section-title {
  margin: 0;
  font: 700 26px/1.08 "Aptos Display", "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.01em;
}

.surface-table {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.projector-table-wrap table {
  min-width: 0;
  table-layout: fixed;
}

.projector-panel {
  margin-top: 16px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

thead th {
  padding: 14px 12px;
  background: #f2eadc;
  color: #584634;
  border-bottom: 1px solid #ddcfb9;
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: left;
}

thead th:first-child {
  border-top-left-radius: 18px;
}

thead th:last-child {
  border-top-right-radius: 18px;
}

tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid #ece5d8;
  font-size: 14px;
  vertical-align: top;
}

.cell-subvalue {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.25;
  color: var(--muted);
}

.projector-table-wrap tbody td,
.projector-table-wrap thead th {
  padding: 7px 2px;
  font-size: 8px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
}

.projector-table-wrap thead th:first-child,
.projector-table-wrap tbody td:first-child {
  min-width: 56px;
  width: 56px;
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: #fffaf1;
}

.notes-panel p {
  margin: 0;
  font: 400 15px/1.65 "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #495364;
  white-space: pre-line;
}

.layout-visual {
  min-height: 250px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 18px;
  background:
    radial-gradient(circle at top center, rgba(255,255,255,0.04), transparent 28%),
    #121419;
}

.top-view {
  min-height: 360px;
}

.layout-strip {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-height: 150px;
}

.floor-strip {
  margin-top: 10px;
  min-height: 130px;
  justify-content: center;
}

.layout-block {
  position: relative;
  min-width: 110px;
  border-radius: 16px;
  border: 1px solid currentColor;
  padding: 12px 11px;
  color: white;
  background: color-mix(in srgb, currentColor 12%, transparent);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(4px);
}

.floor-block {
  max-width: 42%;
}

.layout-block h3 {
  margin: 0 0 6px;
  font: 700 15px/1.2 "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: inherit;
}

.layout-block p {
  margin: 0;
  font: 400 11px/1.4 "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.layout-meta {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.layout-stat {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
}

.layout-stat strong {
  display: block;
  font: 700 18px/1 "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: white;
}

.layout-stat span {
  display: block;
  margin-top: 6px;
  font: 700 11px/1.2 "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: rgba(255,255,255,0.58);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.svg-frame {
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 1240px) {
  .page {
    width: calc(100% - 20px);
    margin: 10px auto 20px;
  }

  .sheet {
    padding: 22px;
  }
}

@media (max-width: 860px) {
  .hero,
  .overview-grid,
  .project-meta-grid,
  .layout-meta {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .title {
    font-size: 34px;
  }

  .sheet {
    padding: 18px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  html {
    font-size: 82%;
  }

  body { background: white; }
  .toolbar { display: none; }

  .page {
    width: 100% !important;
    max-width: none !important;
    margin: 0;
    padding: 0;
  }

  .sheet {
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    border: 0;
    background: white;
    margin: 0;
  }

  .project-card,
  .report-panel,
  .notes-panel,
  .stat-panel {
    box-shadow: none;
  }

  .page-break-section {
    break-before: page;
    page-break-before: always;
  }

  .sheet-primary,
  .sheet-secondary {
    display: grid;
    align-content: start;
    gap: 4mm;
  }

  .sheet-primary {
    grid-template-rows: auto auto 1fr auto;
  }

  .sheet-secondary {
    grid-template-rows: auto auto auto;
  }

  .hero,
  .overview-grid,
  .project-meta-grid,
  .layout-meta {
    grid-template-columns: 1fr 1fr !important;
  }

  .layout-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

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

  .hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr) !important;
  }

  .content-grid {
    grid-template-columns: 1fr !important;
  }

  .layout-visual {
    min-height: 58mm;
    padding: 6px;
  }

  .top-view {
    min-height: 92mm;
  }

  .surface-table {
    overflow: hidden;
  }

  .table-panel {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .panel-visual,
  .table-panel,
  .panel-topview,
  .projector-panel,
  .notes-panel {
    margin: 0;
  }

  .panel-visual,
  .table-panel,
  .panel-topview,
  .projector-panel,
  .notes-panel,
  .stat-panel,
  .project-card {
    break-inside: auto;
    page-break-inside: auto;
  }

  .projector-table-wrap table {
    min-width: 0;
    table-layout: fixed;
  }

  .projector-table-wrap thead th,
  .projector-table-wrap tbody td {
    font-size: 9px;
    padding: 4px 3px;
    white-space: normal;
    word-break: break-word;
  }

  .section-title {
    font-size: 16px;
  }

  .section-head {
    margin-bottom: 6px;
  }

  .title {
    font-size: 24px !important;
  }

  .subtitle,
  .stat-copy,
  .notes-panel p,
  .project-details {
    font-size: 10px !important;
  }

  .stat-value,
  .meta-value {
    font-size: 14px !important;
  }

  .eyebrow,
  .section-kicker,
  .stat-label,
  .meta-label,
  .project-tag,
  .project-date,
  .layout-stat span {
    font-size: 8px !important;
  }

  thead th,
  tbody td {
    font-size: 8px;
  }

  .hero-copy {
    padding-top: 0;
  }

  .hero-logo-wrap {
    margin-bottom: 4px;
  }

  .hero-logo {
    max-height: 20mm;
  }

  .project-card,
  .report-panel,
  .notes-panel,
  .stat-panel {
    border-radius: 14px;
  }

  .overview-grid {
    gap: 3mm;
    margin-top: 3mm;
  }

  .stat-panel {
    padding: 10px 10px 12px;
  }

  .report-panel,
  .notes-panel {
    padding: 10px;
  }

  .panel-visual {
    padding: 8px;
  }

  .layout-strip {
    gap: 6px;
    min-height: 92px;
  }

  .floor-strip {
    margin-top: 6px;
    min-height: 84px;
  }

  .layout-block {
    min-width: 82px;
    padding: 8px 7px;
  }

  .layout-block h3 {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .layout-block p {
    font-size: 9px;
    line-height: 1.25;
  }

  .surface-table thead th,
  .surface-table tbody td {
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .surface-table thead th,
  .surface-table tbody td {
    font-size: 9px;
  }

  .cell-subvalue {
    font-size: 8px;
    margin-top: 2px;
  }

  .sheet-secondary .panel-topview {
    margin-bottom: 3mm;
  }
}
