/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Page ── */
body {
  background: #EEF2F8;
  font-family: 'Roboto', sans-serif;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
}

/* ── Wrapper ── */
.manual-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Cover ── */
.cover {
  background: #111827;
  border-radius: 0;
  padding: 72px 48px 60px;
  margin: 0 -24px 60px;
  position: relative;
  overflow: hidden;
}
.cover::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(239,108,0,0.22) 0%, transparent 65%);
  border-radius: 50%;
}
.cover::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(25,118,210,0.12) 0%, transparent 70%);
  border-radius: 50%;
}
.cover-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 56px;
}
.cover-logo-icon {
  width: 44px; height: 44px;
  background: #EF6C00;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.cover-brand {
  font-size: 18px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.2px;
}
.cover-brand span { color: #EF6C00; }
.cover-tagline {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}
.cover-title {
  font-size: 44px;
  font-weight: 800;
  color: white;
  line-height: 1.15;
  letter-spacing: -1px;
}
.cover-title em {
  color: #EF6C00;
  font-style: normal;
}
.cover-meta {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cover-meta-left {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
}
.cover-version-badge {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
}

/* ── Table of Contents ── */
.toc {
  background: white;
  border-radius: 16px;
  padding: 36px 40px;
  margin-bottom: 48px;
  box-shadow: 0 1px 8px rgba(0,0,0,.07);
}
.toc-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #9E9E9E;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.toc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.toc-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid #F5F5F5;
  text-decoration: none;
  color: inherit;
}
.toc-item:nth-child(odd) { padding-right: 24px; }
.toc-item:nth-child(even) { padding-left: 24px; border-left: 1px solid #F5F5F5; }
.toc-num {
  width: 28px; height: 28px;
  background: #1565C0;
  color: white;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.toc-label { font-size: 14px; font-weight: 500; color: #333; }

/* ── Section ── */
.section { margin-bottom: 60px; }
.section-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 1px 8px rgba(0,0,0,.07);
}

.section-card {
  border-top: 4px solid #1976D2;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid #E0E0E0;
}
.section-number {
  width: 40px; height: 40px;
  background: #EF6C00;
  color: white;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  font-weight: 700;
  flex-shrink: 0;
}
.section-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.2px;
}

/* ── Layout: text + phone side by side ── */
.layout {
  display: flex;
  gap: 36px;
  align-items: flex-start;
}
.layout.reverse { flex-direction: row-reverse; }
.layout-text { flex: 1; min-width: 0; }
.layout-phone { flex-shrink: 0; }

/* ── Phone frame ── */
.phone-frame {
  width: 210px;
  border-radius: 26px;
  border: 8px solid #1a1a1a;
  box-shadow:
    0 0 0 1px #3a3a3a,
    0 16px 48px rgba(0,0,0,0.28);
  overflow: hidden;
  background: #1a1a1a;
  flex-shrink: 0;
}
.phone-frame img {
  width: 100%;
  display: block;
}

/* ── Two-phone row ── */
.phone-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin: 20px 0;
  flex-wrap: wrap;
}
.phone-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.phone-caption {
  font-size: 12px;
  font-weight: 600;
  color: #757575;
  text-align: center;
}

/* ── Small phone frame (multi-phone rows) ── */
.phone-sm { width: 160px; }

/* ── Coming-soon phone placeholder ── */
.cs-frame {
  width: 210px;
  border-radius: 26px;
  border: 8px solid #1a1a1a;
  box-shadow: 0 0 0 1px #3a3a3a, 0 16px 48px rgba(0,0,0,0.28);
  background: #1a1a1a;
  min-height: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 20px;
  text-align: center;
}
.cs-icon { font-size: 38px; }
.cs-badge {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
}
.cs-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  line-height: 1.5;
  max-width: 150px;
}

/* ── Text elements ── */
.intro-text {
  font-size: 15px;
  color: #555;
  line-height: 1.75;
  margin-bottom: 14px;
}
.intro-text:last-child { margin-bottom: 0; }

.subsection { margin-bottom: 32px; }
.subsection:last-child { margin-bottom: 0; }
.subsection-title {
  font-size: 11px;
  font-weight: 700;
  color: #1976D2;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

/* Steps */
.steps { list-style: none; }
.steps li {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  align-items: flex-start;
}
.step-num {
  width: 26px; height: 26px;
  background: #E3F2FD;
  color: #1565C0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-text {
  font-size: 15px;
  line-height: 1.6;
  color: #333;
  padding-top: 3px;
}
.step-text strong { color: #1a1a1a; }

/* Note / Warning */
.note {
  background: #E3F2FD;
  border-left: 3px solid #1976D2;
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14px;
  color: #1565C0;
  line-height: 1.55;
}
.warn {
  background: #FFF8E1;
  border-left: 3px solid #F9A825;
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14px;
  color: #E65100;
  line-height: 1.55;
}
.warn strong, .note strong { font-weight: 700; }

/* Status badge grid */
.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}
.status-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: #F8F9FA;
  border-radius: 10px;
}
.status-badge {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}
.badge-off { background: #616161; }
.badge-on  { background: #2E7D32; }
.badge-d   { background: #1565C0; }
.badge-sb  { background: #616161; }
.badge-ym  { background: #2E7D32; }
.badge-pu  { background: #616161; }
.inline-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 20px;
  border-radius: 5px;
  font-size: 9px; font-weight: 800; color: white;
  vertical-align: middle; margin-right: 2px;
}
.status-item-text {}
.status-item-name { font-size: 13px; font-weight: 700; color: #1a1a1a; }
.status-item-desc { font-size: 12px; color: #757575; margin-top: 2px; line-height: 1.4; }

/* Callout row */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 7px 10px;
  border: 1px solid #d9dee7;
  text-align: left;
}

.data-table th {
  background: #f1f4f8;
  font-weight: 700;
}

.callout-row {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.callout {
  flex: 1;
  min-width: 140px;
  background: #F8F9FA;
  border-radius: 10px;
  padding: 14px 16px;
  border-top: 3px solid #1976D2;
}
.callout-label { font-size: 11px; font-weight: 700; color: #1976D2; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.callout-value { font-size: 14px; color: #333; line-height: 1.4; }

/* Definition list */
dl.defs { margin: 12px 0; }
dl.defs dt { font-size: 14px; font-weight: 700; color: #1a1a1a; margin-top: 10px; }
dl.defs dd { font-size: 14px; color: #555; line-height: 1.5; margin-left: 0; margin-top: 2px; }

/* Inline tag */
.tag {
  display: inline-block;
  background: #FFF3E0;
  color: #EF6C00;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  vertical-align: middle;
}

/* Horizontal rule */
.rule { border: none; border-top: 1px solid #EEE; margin: 28px 0; }

/* ── Mobile ── */
@media (max-width: 640px) {
  .manual-wrap { padding: 0 16px 56px; }

  .cover { padding: 40px 24px 32px; margin: 0 -16px 32px; }
  .cover-logo-row { margin-bottom: 36px; }
  .cover-title { font-size: 30px; letter-spacing: -0.5px; }
  .cover-meta { flex-direction: column; align-items: flex-start; gap: 12px; }

  .toc { padding: 24px 20px; margin-bottom: 32px; }
  .toc-grid { grid-template-columns: 1fr; }
  .toc-item:nth-child(odd) { padding-right: 0; }
  .toc-item:nth-child(even) { padding-left: 0; border-left: none; }

  .section { margin-bottom: 40px; }
  .section-card { padding: 24px 20px; overflow-x: auto; }

  .layout, .layout.reverse { flex-direction: column; }
  .layout-phone { align-self: center; }

  .phone-row { justify-content: center; }
  .phone-sm { width: 210px; }

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

/* ── Print styles ── */
@page {
  size: A4;
  margin: 14mm 16mm;
}

@media print {
  body { background: white !important; }

  /* Wrapper fills the page — @page margins handle outer whitespace */
  .manual-wrap {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Cover: full-bleed dark page — bleeds into @page margin on all sides */
  .cover {
    break-after: page;
    page-break-after: always;
    border-radius: 0 !important;
    margin: -14mm -16mm 0 !important;
    padding: 22mm 20mm 18mm !important;
    min-height: 100vh;
  }

  /* TOC: flat, no card chrome */
  .toc {
    break-after: page;
    page-break-after: always;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    margin-top: 8mm !important;
  }

  /* Each section starts on a new page */
  .section {
    break-before: page;
    page-break-before: always;
    margin-bottom: 0 !important;
  }

  /* Section cards: flat — keep only the top accent bar, drop all other chrome */
  .section-card {
    box-shadow: none !important;
    border: none !important;
    border-top: 4px solid #1976D2 !important;
    border-radius: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
  }

  .section-header { break-after: avoid; }
  .subsection-title { break-after: avoid; }
  .note, .warn { page-break-inside: avoid; break-inside: avoid; }
  .phone-row, .phone-frame { break-inside: avoid; }

  /* Layouts stack vertically in print */
  .layout, .layout.reverse { flex-direction: column !important; }
  .layout-phone { align-self: center; margin-top: 24px; }
  .layout-text { width: 100% !important; flex: none !important; }

  /* Preserve colors */
  *, *::before, *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
