 :root {
      --bg: #f4f7fb;
      --panel: #ffffff;
      --panel-2: #f8fafc;
      --text: #172033;
      --muted: #5f6b7a;
      --line: #d9e2ec;
      --brand: #134074;
      --brand-2: #1f6fb2;
      --accent: #e8f1fb;
      --danger: #b42318;
      --shadow: 0 18px 45px rgba(16, 24, 40, 0.10);
      --radius: 20px;
    }

    * { box-sizing: border-box; }
    html, body { margin: 0; padding: 0; font-family: 'Inter', Arial, sans-serif; background: var(--bg); color: var(--text); }

    .app {
      display: grid;
      grid-template-columns: minmax(520px, 40%) minmax(500px, 60%);
      min-height: 100vh;
      gap: 20px;
      padding: 20px;
    }

    .panel {
      background: var(--panel);
      border: 1px solid rgba(19, 64, 116, 0.08);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .panel-header {
      padding: 22px 24px 14px;
      border-bottom: 1px solid var(--line);
      background: linear-gradient(180deg, #fff 0%, #f9fbfe 100%);
    }

    .eyebrow {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: var(--accent);
      color: var(--brand);
      padding: 6px 10px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    h1, h2, h3, h4, p { margin: 0; }
    h1 { font-size: 28px; margin-top: 12px; }
    .subtext { margin-top: 8px; color: var(--muted); line-height: 1.5; }

    .top-brand {
      display: flex;
      align-items: center;
      gap: 16px;
      margin-top: 14px;
      padding: 14px 16px;
      border: 1px solid rgba(19, 64, 116, 0.10);
      border-radius: 18px;
      background: linear-gradient(180deg, #ffffff 0%, #f4f8fd 100%);
    }

    .top-brand img {
      width: 94px;
      height: 94px;
      object-fit: contain;
      border-radius: 16px;
      background: #fff;
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
      padding: 8px;
      flex: 0 0 auto;
    }

    .top-brand-copy { min-width: 0; }

    .top-brand-title {
      font-size: 15px;
      font-weight: 800;
      color: var(--brand);
      letter-spacing: 0.03em;
      text-transform: uppercase;
      margin-bottom: 4px;
    }

    .top-brand-copy p {
      color: var(--muted);
      line-height: 1.45;
      font-size: 13px;
    }

    .form-shell { display: flex; flex-direction: column; height: calc(100vh - 40px); }
    .form-body, .preview-body { padding: 20px 24px 24px; overflow: auto; }

    .reminder-builder {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 10px;
      align-items: start;
    }

    .item-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 12px;
    }

    .item-row {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 14px;
      border-radius: 14px;
      background: #fff;
      border: 1px solid #d8e2ee;
    }

    .item-row span {
      font-size: 14px;
      line-height: 1.45;
      color: var(--text);
      white-space: pre-wrap;
    }

    .item-row button {
      padding: 8px 12px;
      border-radius: 10px;
      flex: 0 0 auto;
    }

    .empty-state {
      padding: 14px;
      border: 1px dashed #c7d3e0;
      border-radius: 14px;
      background: #fff;
      color: var(--muted);
      font-size: 13px;
    }

    .visually-hidden {
      position: absolute !important;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .section {
      border: 1px solid var(--line);
      background: var(--panel-2);
      border-radius: 18px;
      padding: 18px;
      margin-bottom: 18px;
    }

    .section-title {
      font-size: 15px;
      font-weight: 800;
      color: var(--brand);
      margin-bottom: 14px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .grid { display: grid; gap: 14px; }
    .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .field { display: flex; flex-direction: column; gap: 7px; }
    label {
      font-size: 13px;
      font-weight: 700;
      color: #314155;
    }

    input, textarea {
      width: 100%;
      border: 1px solid #cbd5e1;
      background: #fff;
      border-radius: 12px;
      padding: 12px 13px;
      font: inherit;
      color: var(--text);
      transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    }

    textarea { min-height: 88px; resize: vertical; }
    input:focus, textarea:focus {
      outline: none;
      border-color: var(--brand-2);
      box-shadow: 0 0 0 4px rgba(31, 111, 178, 0.12);
    }

    .toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 16px;
    }

    button {
      border: none;
      border-radius: 14px;
      padding: 12px 16px;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    }

    button:hover { transform: translateY(-1px); }
    button:active { transform: translateY(1px) scale(0.99); }

    .btn-primary {
      background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
      color: white;
      box-shadow: 0 12px 30px rgba(19, 64, 116, 0.2);
    }
    .btn-secondary { background: #e8eef5; color: var(--brand); }
    .btn-danger { background: #fde8e8; color: var(--danger); }

    .helper {
      font-size: 12px;
      color: var(--muted);
      line-height: 1.45;
      margin-top: 4px;
    }

    .preview-wrap {
      background: #dbe7f3;
      min-height: calc(100vh - 40px);
      padding: 22px;
    }

    .mobile-switcher {
      display: none;
      gap: 10px;
      margin-top: 16px;
    }

    .mobile-switcher button {
      flex: 1 1 0;
      padding: 12px 14px;
    }

    .mobile-switcher button.is-active {
      background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
      color: #fff;
      box-shadow: 0 12px 30px rgba(19, 64, 116, 0.2);
    }

    .report-page {
      width: 8.5in;
      min-height: 11in;
      margin: 0 auto;
      background: #fff;
      color: #1a1a1a;
      box-shadow: 0 20px 60px rgba(15, 23, 42, 0.16);
      padding: 0.65in;
    }

    .report-header {
      display: grid;
      grid-template-columns: minmax(0, 120px) 1.15fr 1fr;
      gap: 18px;
      border-bottom: 2px solid #1f4f82;
      padding-bottom: 16px;
      margin-bottom: 18px;
      align-items: center;
    }

    .report-logo-wrap {
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .report-logo {
      width: 100px;
      height: 100px;
      object-fit: contain;
    }

    .report-title {
      font-size: 22px;
      font-weight: 800;
      color: #163b63;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      margin-bottom: 8px;
    }

    .company-name { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
    .meta p, .company-block p, .overview-text, .disclaimer-text, .reminder-list li, .emergency-list li {
      font-size: 11.3px;
      line-height: 1.5;
    }

    .meta-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
      margin: 16px 0 18px;
    }

    .meta-card {
      border: 1px solid #d6dee8;
      border-radius: 12px;
      padding: 12px;
      background: #f9fbfd;
    }

    .meta-card strong {
      display: block;
      font-size: 10px;
      color: #506173;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      margin-bottom: 4px;
    }

    .report-section { margin-top: 18px; }
    .report-section h3 {
      font-size: 12px;
      color: #163b63;
      margin-bottom: 8px;
      border-bottom: 1px solid #d6dee8;
      padding-bottom: 6px;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .finding-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
    }

    .finding-item {
      border: 1px solid #d6dee8;
      border-radius: 10px;
      padding: 10px 12px;
      background: #fff;
    }

    .finding-item strong {
      display: inline-block;
      min-width: 155px;
      color: #163b63;
    }

    .video-link {
      color: #135ca1;
      text-decoration: underline;
      word-break: break-word;
    }

    .review-box {
      border: 1px dashed #c3d2e1;
      background: #f8fafc;
      border-radius: 12px;
      padding: 12px;
      margin-top: 8px;
    }

    .review-columns {
      display: flex;
      gap: 14px;
      align-items: flex-start;
      margin-top: 8px;
    }

    .review-text-col {
      flex: 1 1 0;
      min-width: 0;
    }

    .review-qr-col {
      flex: 0 0 auto;
      width: 116px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      border: 1px dashed #c3d2e1;
      background: #f8fafc;
      border-radius: 12px;
      padding: 10px 8px 8px;
    }

    .review-qr {
      width: 96px;
      height: 96px;
      object-fit: contain;
      display: block;
    }

    .review-qr-placeholder {
      width: 96px;
      height: 96px;
      border: 2px dashed #c3d2e1;
      border-radius: 8px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      font-size: 9px;
      color: #a0aec0;
      line-height: 1.4;
    }

    .review-qr-caption {
      font-size: 9px;
      color: #607086;
      text-align: center;
      line-height: 1.35;
      margin: 0;
    }

    .small-note { font-size: 10px; color: #607086; }

    ul { margin: 8px 0 0 18px; padding: 0; }
    .footer-bar {
      margin-top: 18px;
      padding-top: 10px;
      border-top: 1px solid #d6dee8;
      font-size: 10px;
      color: #607086;
      display: flex;
      justify-content: space-between;
      gap: 10px;
    }
    .form-shell {
        height: auto;
        min-height: calc(100vh - 40px);
    }

    .form-body {
        flex: 1 1 auto;
        overflow: visible;
    }
    @media (max-width: 1200px) {
      .app { grid-template-columns: 1fr; }
      .form-shell, .preview-wrap { height: auto; min-height: auto; }
    }

    @media (max-width: 900px) {
      .app { padding: 12px; gap: 12px; }
      .mobile-switcher { display: flex; }
      .app.mobile-form .preview-wrap { display: none; }
      .app.mobile-preview .form-shell { display: none; }
      .app.mobile-form .form-shell,
      .app.mobile-preview .preview-wrap { display: block; }
      .panel-header, .form-body, .preview-body, .preview-wrap { padding: 16px; }
      .form-shell { height: auto; }
    }

    @media (max-width: 720px) {
      .grid.two, .report-header, .meta-grid, .reminder-builder { grid-template-columns: 1fr; }
      .top-brand { flex-direction: column; align-items: flex-start; }
      .top-brand img { width: 82px; height: 82px; }
      .report-logo-wrap { justify-content: flex-start; }
      .report-page { width: 100%; min-height: auto; padding: 22px; }
      .item-row { flex-direction: column; align-items: stretch; }
      .item-row button { width: 100%; }
    }