/* ==========================================================
   SailAway v2 — Scoped CSS for Astra/Elementor
   - Boxes: Your Information, Income & Funds, Variables
   - Three charts (A, B, C) with consistent layout
   - Accessible, mobile-first, no theme collisions
   ========================================================== */

.sailaway-app {
  /* Theme tokens */
  --sa-brand: #00bcd4;
  --sa-brand-ink: #0f172a;
  --sa-ink: #111827;
  --sa-sub: #6b7280;
  --sa-card: #ffffff;
  --sa-br: #e5e7eb;
  --sa-bg: linear-gradient(180deg,#9be7ff 0%,#48cae4 35%,#00b4d8 70%,#0077b6 100%);
  --sa-radius: 16px;
  --sa-shadow: 0 6px 16px rgba(2, 6, 23, 0.12);
  --sa-pad: 16px;
  --sa-gap: 14px;
  --sa-chart-h: 320px; /* adjust if you want taller charts */
  --sa-focus: 2px solid #00bcd4;
  display: block;
  background: var(--sa-bg);
  background-attachment: fixed;
  color: var(--sa-ink);
  padding: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
}

/* Container & header */
.sailaway-app .sa-container {
  max-width: 1200px;
  margin: 0 auto;
}

.sailaway-app .sa-header {
  text-align: center;
  color: #fff;
  margin: 8px 0 18px 0;
}
.sailaway-app .sa-header h1 {
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 4px 0;
}
.sailaway-app .sa-header p {
  opacity: 0.9;
  font-size: 14px;
}

/* Cards / boxes */
.sailaway-app .sa-card {
  background: var(--sa-card);
  border: 1px solid var(--sa-br);
  border-radius: var(--sa-radius);
  box-shadow: var(--sa-shadow);
  padding: clamp(14px, 1.8vw, 22px);
}

.sailaway-app .sa-card + .sa-card { margin-top: 14px; }

.sailaway-app .sa-card .sa-card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.sailaway-app .sa-card .sa-card-title h2 {
  font-size: clamp(18px, 2vw, 22px);
  margin: 0;
}
.sailaway-app .sa-muted { color: var(--sa-sub); font-size: 12px; }

/* Layout grids */
.sailaway-app .sa-grid {
  display: grid;
  gap: var(--sa-gap);
}
.sailaway-app .sa-grid-2 {
  display: grid;
  gap: var(--sa-gap);
  grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .sailaway-app .sa-grid-2 { grid-template-columns: 1fr 1fr; }
}

/* Form fields */
.sailaway-app .sa-field {
  display: grid;
  gap: 6px;
}
.sailaway-app .sa-field.inline {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.sailaway-app label.sa-label {
  font-size: 13px;
  color: var(--sa-ink);
  font-weight: 600;
}
.sailaway-app .sa-help {
  font-size: 12px;
  color: var(--sa-sub);
}

/* Full-width by default EXCEPT the compact fields */
.sailaway-app input[type="text"]:not(.sa-ch9),
.sailaway-app input[type="number"]:not(.sa-ch9),
.sailaway-app input[type="email"]:not(.sa-ch9),
.sailaway-app input[type="tel"]:not(.sa-ch9),
.sailaway-app input[type="url"]:not(.sa-ch9),
.sailaway-app select:not(.sa-ch9) {
  width: 8%;
  height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--sa-br);
  border-radius: 10px;
  background: #fff;
  color: var(--sa-ink);
  outline: none;
}
/* Compact inputs ~9 characters wide */
.sailaway-app .sa-ch9 {
  width: auto;
  inline-size: 9ch;          /* ≈ 9 characters */
  max-inline-size: 9ch;
  box-sizing: content-box;   /* keep padding from inflating width */
  padding-inline: 6px;
  display: inline-block;     /* don't stretch in grid */
  justify-self: start;       /* prevent grid from stretching it */
}

.sailaway-app input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--sa-brand);
}
.sailaway-app input:focus,
.sailaway-app select:focus { box-shadow: 0 0 0 2px rgba(0,188,212,0.25); border-color: var(--sa-brand); }

/* Range / sliders (Path A/B/C) */
.sailaway-app input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 4px; width: 100%;
  background: #e6fafd;
  border-radius: 999px;
  outline: none;
}
.sailaway-app input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--sa-brand);
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(0,188,212,0.25);
  cursor: pointer;
}
.sailaway-app input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--sa-brand);
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(0,188,212,0.25);
  cursor: pointer;
}

.sailaway-app .sa-path-note {
  font-size: 12px; color: var(--sa-sub);
  margin-top: -2px;
}

/* Two-column micro layout inside cards on wide screens */
@media (min-width: 980px) {
  .sailaway-app .sa-fields-2 { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: var(--sa-gap);
  }
}

/* Conditional spouse SS block */
.sailaway-app .sa-spouse { transition: grid-template-rows .25s ease, opacity .25s ease; }
.sailaway-app .sa-spouse.is-hidden { display: none; }
.sailaway-app .sa-spouse .sa-spouse-title {
  font-size: 14px; font-weight: 700; margin: 4px 0 6px 0;
}

/* Variables → Accordions (native <details>) */
.sailaway-app details.sa-acc {
  border: 1px solid var(--sa-br);
  border-radius: 12px;
  background: #fafafa;
  padding: 10px 12px;
}
.sailaway-app details.sa-acc + details.sa-acc { margin-top: 8px; }

.sailaway-app summary.sa-acc__summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 14px;
  color: var(--sa-brand-ink);
  display: flex; align-items: center; gap: 8px;
}
.sailaway-app summary.sa-acc__summary::-webkit-details-marker { display: none; }
.sailaway-app .sa-acc__summary:after {
  content: "▾";
  margin-left: auto;
  transition: transform .2s ease;
  font-size: 12px;
  color: var(--sa-sub);
}
.sailaway-app details[open] .sa-acc__summary:after { transform: rotate(180deg); }
.sailaway-app .sa-acc__body { margin-top: 10px; display: grid; gap: var(--sa-gap); }
@media (min-width: 980px) {
  .sailaway-app .sa-acc__body.grid-2 { grid-template-columns: 1fr 1fr; }
}

/* Charts area: three consistent cards */
.sailaway-app .sa-charts {
  display: grid;
  gap: var(--sa-gap);
  margin-top: 14px;
}
@media (min-width: 980px) {
  .sailaway-app .sa-charts { grid-template-columns: 1fr 1fr 1fr; }
}

.sailaway-app .sa-chart-card {
  background: var(--sa-card);
  border: 1px solid var(--sa-br);
  border-radius: var(--sa-radius);
  box-shadow: var(--sa-shadow);
  padding: 10px;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: calc(var(--sa-chart-h) + 48px);
}

.sailaway-app .sa-chart-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--sa-ink);
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 6px;
}
.sailaway-app .sa-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 999px;
  background: #e6fafd;
  color: #036b7a;
  border: 1px solid #b5eef5;
}

.sailaway-app .sa-chart-wrap {
  width: 100%;
  height: var(--sa-chart-h);
  position: relative;
}
.sailaway-app .sa-chart-wrap canvas {
  position: absolute; inset: 0;
  width: 100% !important; height: 100% !important;
}

/* Buttons (if used in panels) */
.sailaway-app .sa-btn {
  appearance: none; border: 0; cursor: pointer;
  background: var(--sa-brand);
  color: #002b36;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0,188,212,0.25);
}
.sailaway-app .sa-btn:focus-visible { outline: var(--sa-focus); }
.sailaway-app .sa-btn.ghost {
  background: transparent;
  color: var(--sa-brand-ink);
  border: 1px solid var(--sa-brand);
}

/* Validation helpers */
.sailaway-app .is-invalid { border-color: #ef4444 !important; }
.sailaway-app .sa-error { color: #b91c1c; font-size: 12px; margin-top: 4px; }

/* Utilities */
.sailaway-app .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;
}

/* Mobile niceties */
@media (max-width: 480px) {
  .sailaway-app .sa-card { padding: 12px; }
  .sailaway-app .sa-header h1 { font-size: 22px; }
  .sailaway-app .sa-chart-title { font-size: 13px; }
	
	.sailaway-app .sa-ch9 {
  width: auto !important;
  inline-size: 9ch !important;
  max-inline-size: 9ch !important;
  box-sizing: content-box;
  padding-inline: 6px;
  display: inline-block;
  justify-self: start;
}



}
