/* Advisor report: shared chrome for every advisor-prepared client report (screen + print).
   Sibling of client-consent.css. Report pages add their own section styles under .ar-document. */

.advisor-report-page .header,
.advisor-report-page .mobile-nav-toggle,
.advisor-report-page .cookie-banner {
  display: none !important;
}

.advisor-report-page {
  background: #f1f5f9;
}

/* ---- toolbar (screen only) ---- */
.ar-toolbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(253, 252, 251, 0.97);
  border-bottom: 1px solid #e2e8f0;
  padding: 0.65rem 0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.ar-toolbar-inner {
  max-width: 9.5in;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.ar-toolbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1 1 auto;
  font-size: 0.9rem;
}

.ar-back { font-weight: 600; }
.ar-lang a { font-weight: 600; }

.ar-toolbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ar-toolbar-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
  max-width: 48rem;
}

/* ---- the document ---- */
.ar-document {
  max-width: 8.5in;
  margin: 1.5rem auto 3rem;
  padding: 0.9in 0.8in 1in;
  background: #fff;
  box-shadow: 0 2px 18px rgba(15, 23, 42, 0.08);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.6;
  color: #334155;
  font-size: 0.95rem;
}

.ar-document h1,
.ar-document h2,
.ar-document h3 {
  font-family: "Lora", Georgia, serif;
  color: #1a2744;
  line-height: 1.25;
}

.ar-document h2 {
  font-size: 1.35rem;
  margin: 2.2rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #e2e8f0;
}

.ar-document h3 {
  font-size: 1.08rem;
  margin: 1.4rem 0 0.4rem;
}

.ar-document p { margin: 0.65rem 0; }
.ar-document ul, .ar-document ol { margin: 0.5rem 0 1rem 1.25rem; padding: 0; }
.ar-document li { margin: 0.3rem 0; }
.ar-document strong { color: #1e293b; }

.ar-muted { color: #64748b; font-size: 0.85rem; }
.ar-small { font-size: 0.85rem; }

/* ---- cover ---- */
.ar-cover {
  padding-bottom: 1.5rem;
  margin-bottom: 1rem;
  border-bottom: 3px solid #1a2744;
}

.ar-cover-brand {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 2.2rem;
}

.ar-cover-logo {
  font-family: "Montserrat", "Lora", Georgia, serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: #1a2744;
  letter-spacing: 0.01em;
}

.ar-cover-tag {
  font-size: 0.8rem;
  color: #64748b;
}

.ar-cover-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #b8923f;
  margin: 0 0 0.35rem;
}

.ar-cover-title {
  font-size: clamp(1.7rem, 2vw + 1.1rem, 2.3rem);
  margin: 0 0 1.4rem;
}

.ar-cover-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 2rem;
  margin: 0;
}

.ar-cover-meta div { margin: 0; }
.ar-cover-meta dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.ar-cover-meta dd { margin: 0; font-weight: 600; color: #1e293b; }

.ar-cover-note { margin-top: 1.2rem; color: #475569; font-size: 0.9rem; }

/* ---- editable regions ----
   On screen: a dashed underline says "type here". In print they are plain text. */
.ar-edit {
  display: block;
  min-height: 1.4em;
  outline: none;
  border-bottom: 1px dashed #94a3b8;
  padding: 0.1rem 0.15rem;
  border-radius: 2px;
  white-space: pre-wrap;
}

.ar-edit:focus { background: #fffbeb; border-bottom-color: #b8923f; }

.ar-edit--inline {
  display: inline-block;
  min-width: 10rem;
}

.ar-edit--block {
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  margin: 0.5rem 0 0.9rem;
  background: #fcfcfd;
}

.ar-edit:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  font-style: italic;
  font-weight: 400;
}

/* ---- boxes ---- */
.ar-box {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin: 1rem 0 1.25rem;
  background: #f8fafc;
  page-break-inside: avoid;
}

.ar-box--navy {
  background: #1a2744;
  color: #e2e8f0;
  border-color: #1a2744;
}
.ar-box--navy h3, .ar-box--navy strong { color: #fff; }
.ar-box--navy .ar-muted { color: rgba(226, 232, 240, 0.75); }

.ar-box--gold {
  background: #fdf8ee;
  border-color: #ecd9a8;
}

.ar-box--warn {
  background: #fffbeb;
  border-color: #fcd34d;
}

.ar-box h3 { margin-top: 0; }
.ar-box p:last-child { margin-bottom: 0; }

/* Big-figure grid, four across on the summary page. */
.ar-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin: 0.9rem 0 1.1rem;
}

.ar-figure {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  background: #fff;
}

.ar-figure em {
  display: block;
  font-style: normal;
  font-family: "Lora", Georgia, serif;
  font-size: 1.35rem;
  color: #1a2744;
  line-height: 1.15;
}

.ar-figure small {
  display: block;
  color: #64748b;
  font-size: 0.76rem;
  margin-top: 0.2rem;
  line-height: 1.35;
}

.ar-figure--lead {
  background: #1a2744;
  border-color: #1a2744;
}
.ar-figure--lead em { color: #fff; }
.ar-figure--lead small { color: rgba(226, 232, 240, 0.8); }

.ar-figure--best {
  border-color: #b8923f;
  box-shadow: inset 0 0 0 1px #b8923f;
}

/* ---- tables ---- */
.ar-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.6rem 0 1.2rem;
  font-size: 0.88rem;
  page-break-inside: avoid;
}

.ar-table th,
.ar-table td {
  border: 1px solid #cbd5e1;
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

.ar-table thead th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 700;
}

.ar-table tbody th {
  font-weight: 600;
  color: #1e293b;
  background: #fafafa;
}

.ar-table td.num, .ar-table th.num { text-align: right; white-space: nowrap; }
.ar-table tr.is-total td, .ar-table tr.is-total th { font-weight: 700; background: #f8fafc; }

.ar-table-wrap { overflow-x: auto; }

/* Editable comparison tables: header cells and body cells are contenteditable. */
.ar-grid [contenteditable] { outline: none; min-width: 2rem; }
.ar-grid [contenteditable]:focus { background: #fffbeb; }
.ar-grid [contenteditable]:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  font-style: italic;
  font-weight: 400;
}
.ar-grid thead th[contenteditable] { border-bottom: 2px solid #94a3b8; }

.ar-grid-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: -0.4rem 0 1rem;
}

.ar-grid-tools button,
.ar-col-x,
.ar-row-x {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1a2744;
  background: #f5efe6;
  border: 1px solid #e3dcd1;
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
}

.ar-grid-tools button:hover { background: #ebe4da; }

.ar-col-x, .ar-row-x {
  padding: 0 0.35rem;
  line-height: 1.3;
  color: #b45309;
  background: #fffbeb;
  border-color: #fcd34d;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.ar-grid thead th { position: relative; padding-right: 1.5rem; }
.ar-grid thead th .ar-th-text { display: block; min-width: 3rem; }
.ar-grid thead th .ar-col-x { position: absolute; top: 0.3rem; right: 0.3rem; margin: 0; }

/* Manual input block (screen only): the inputs that feed the calculation. */
.ar-inputs {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fdfcfb;
  padding: 0.9rem 1rem 0.6rem;
  margin: 0 0 1.5rem;
}

.ar-inputs summary {
  cursor: pointer;
  font-weight: 700;
  color: #1a2744;
  list-style: none;
}
.ar-inputs summary::-webkit-details-marker { display: none; }
.ar-inputs summary::after { content: " \25BE"; color: #b8923f; }
.ar-inputs[open] summary::after { content: " \25B4"; }

.ar-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.6rem 0.9rem;
  margin-top: 0.8rem;
}

.ar-field { display: grid; gap: 0.2rem; }
.ar-field label { font-size: 0.75rem; font-weight: 600; color: #475569; }
.ar-field input, .ar-field select {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}
.ar-field input:focus, .ar-field select:focus { outline: 2px solid #c8a050; outline-offset: 1px; }
.ar-inputs-note { font-size: 0.78rem; color: #64748b; margin: 0.6rem 0 0; }

/* Optional row: hidden until switched on. */
[data-show-when] { display: none; }
[data-show-when].is-on { display: grid; }

/* Chart: an inline SVG that sizes itself from its viewBox */
.ar-chart { width: 100%; margin: 0.6rem 0 0.4rem; page-break-inside: avoid; }
.ar-chart svg { display: block; width: 100%; height: auto; }

/* Page breaks between major parts, for the PDF. */
.ar-page { page-break-before: always; }

/* ---- closing ---- */
.ar-closing {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 3px solid #1a2744;
  font-size: 0.82rem;
  color: #475569;
}

.ar-closing h2 { font-size: 1.05rem; border: none; margin: 0 0 0.5rem; }

.ar-stamp {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  margin-top: 1rem;
  font-size: 0.72rem;
  color: #64748b;
}

/* Sections menu in the toolbar */
.ar-sections { position: relative; }
.ar-sections summary { list-style: none; cursor: pointer; }
.ar-sections summary::-webkit-details-marker { display: none; }
.ar-sections-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 50;
  min-width: 17rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
}
.ar-sections-list { display: grid; gap: 0.3rem; margin-bottom: 0.6rem; }
.ar-sections-list label { display: flex; align-items: center; gap: 0.45rem; cursor: pointer; color: #1e293b; }
.ar-sections-add {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1a2744;
  background: #f5efe6;
  border: 1px solid #e3dcd1;
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  width: 100%;
}
.ar-extra h2 .ar-edit { min-width: 14rem; font: inherit; }
.ar-extra h2 .ar-row-x { font-family: "Inter", system-ui, sans-serif; font-size: 0.78rem; vertical-align: middle; }

/* Toast for the copy-link button */
.ar-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: #1a2744;
  color: #fff;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  font-size: 0.85rem;
  z-index: 60;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.ar-toast.is-on { opacity: 1; }

@media (max-width: 640px) {
  .ar-document { padding: 1.4rem 1rem 2rem; margin: 0.75rem; }
  .ar-cover-meta { grid-template-columns: 1fr; }
}

/* ---- print ---- */
@media print {
  .no-print, .ar-toolbar, .ar-inputs, .ar-grid-tools, .ar-col-x, .ar-row-x, .ar-toast, .ar-sections {
    display: none !important;
  }
  .ar-extra h2 .ar-edit { border: none; }

  .advisor-report-page { background: #fff; }

  .ar-document {
    max-width: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
    font-size: 10.5pt;
  }

  .ar-edit, .ar-edit--block {
    border: none;
    background: transparent;
    padding: 0;
  }

  .ar-edit:empty { display: none; }
  .ar-edit:empty::before { content: none; }

  .ar-grid [contenteditable]:empty::before { content: none; }

  .ar-document h2 { page-break-after: avoid; }
  .ar-box, .ar-table, .ar-figures { page-break-inside: avoid; }

  .ar-box--navy, .ar-figure--lead {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  @page { margin: 14mm 14mm 16mm; }
}
