/* ==========================================================================
   Self Managed — Academy Design System (lightweight, consistent, no card spam)
   Purpose: Provides a consistent look for Academy articles, procedures, and
   interactive how‑to guides. Colours convey meaning only.
   --------------------------------------------------------------------------
   Semantic colour meaning
   - Example  (blue)   : --sms-primary (teal/blue palette), softened
   - Warning  (yellow) : --sms-warning (amber), softened
   - Note     (grey)   : --sms-light  (grey), with border
   ========================================================================== */


/* Overall page rhythm */
.academy-article {
  max-width: 1080px;
  margin-inline: auto;
  padding-block: 1.25rem 3rem;
  background: transparent !important;
}

/* Ensure the main content area has transparent background */
.col-md-10 {
  background: transparent !important;
}

.academy-article header.article-header {
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--sms-border);
  padding-bottom: .75rem;
}

.article-meta {
  color: #6b7280; /* neutral text */
  font-size: .875rem;
}

/* Section spacing (cards avoided — use content rhythm instead) */
.academy-article .section {
  margin-top: 0.5rem;
  padding: 0.5rem 0; /* Override style.css padding with smaller amount */
}
.academy-article .section + .section {
  margin-top: 0.75rem;
}

.section h2,
.section h3 {
  scroll-margin-top: 6rem; /* avoid navbar overlap on anchor jump */
}

/* Link styling - use teal color instead of default blue */
/* Exclude buttons from link styling */
.academy-article a:not(.btn),
.col-md-10 > .card a:not(.btn) {
  color: var(--sms-primary) !important;
  text-decoration: none;
}

.academy-article a:not(.btn):hover,
.col-md-10 > .card a:not(.btn):hover {
  color: var(--sms-primary) !important;
  text-decoration: underline;
}

/* Academy menu active state - teal highlight */
.academy-menu-active {
  color: var(--sms-primary) !important;
  font-weight: 600 !important;
}

/* Override Bootstrap default link color for academy menu links */
/* Only apply inherit to non-active links */
.col-md-2 .card a:not(.academy-menu-active),
.col-md-2 .card a:not(.academy-menu-active):link,
.col-md-2 .card a:not(.academy-menu-active):visited,
.col-md-2 .card a:not(.academy-menu-active):hover,
.col-md-2 .card a:not(.academy-menu-active):active {
  color: inherit !important;
}

/* Academy menu active links - comprehensive coverage for all link states and positions */
.col-md-2 .card a.academy-menu-active,
.col-md-2 .card a.academy-menu-active:link,
.col-md-2 .card a.academy-menu-active:visited,
.col-md-2 .card a.academy-menu-active:hover,
.col-md-2 .card a.academy-menu-active:active,
.col-md-2 .card a.academy-menu-active:focus,
.col-md-2 .card .list-group-item.academy-menu-active,
.col-md-2 .card .list-group-item.academy-menu-active.text-dark,
.col-md-2 .card a.list-group-item.academy-menu-active,
.col-md-2 .card a.list-group-item.academy-menu-active.text-dark,
.col-md-2 .card a.list-group-item.list-group-item-action.academy-menu-active,
.col-md-2 .card a.list-group-item.list-group-item-action.academy-menu-active.text-dark,
.col-md-2 .card .list-group-item > a.academy-menu-active,
.col-md-2 .card .list-group-item > a.academy-menu-active.text-dark,
.col-md-2 .card .list-group-item > a.academy-menu-active.text-decoration-none,
.col-md-2 .card .list-group-item > a.academy-menu-active:link,
.col-md-2 .card .list-group-item > a.academy-menu-active:visited,
.col-md-2 .card .list-group-item > a.academy-menu-active:hover,
.col-md-2 .card .list-group-item > a.academy-menu-active:focus,
.col-md-2 .card .list-group-item > a.academy-menu-active:active {
  color: var(--sms-primary) !important;
  font-weight: 600 !important;
}

/* Override Bootstrap list-group-item-action default link colors for academy menu */
.col-md-2 .card .list-group-item-action.academy-menu-active,
.col-md-2 .card .list-group-item-action.academy-menu-active:hover,
.col-md-2 .card .list-group-item-action.academy-menu-active:focus,
.col-md-2 .card .list-group-item-action.academy-menu-active:active {
  color: var(--sms-primary) !important;
  background-color: transparent !important;
}

/* Inline utilities */
.mono   { font-variant-numeric: tabular-nums; font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; }
.tight  { margin-top: .75rem; }
.small  { font-size: .875rem; }
.mb-0   { margin-bottom: 0; }
.mb-1   { margin-bottom: 0.25rem; }
.p-2    { padding: 0.5rem; }

/* Callouts: meaning is colour; keep them subtle and consistent */
.callout {
  border-radius: .5rem;
  padding: .875rem 1rem;
  border: 1px solid var(--sms-border);
  margin: 1rem 0;
}
.callout > *:first-child { margin-top: 0; }
.callout > *:last-child  { margin-bottom: 0; }
.callout-title {
  font-weight: 600;
  margin-bottom: .375rem;
}

.callout.example {
  background: color-mix(in srgb, var(--sms-primary) 10%, white);
  border-color: color-mix(in srgb, var(--sms-primary) 35%, var(--sms-border));
}
.callout.warning {
  background: color-mix(in srgb, var(--sms-warning) 12%, white);
  border-color: color-mix(in srgb, var(--sms-warning) 45%, var(--sms-border));
}
.callout.note {
  background: var(--sms-light);
  border-color: var(--sms-border);
}
.callout.success {
  background: color-mix(in srgb, var(--sms-success) 10%, white);
  border-color: color-mix(in srgb, var(--sms-success) 35%, var(--sms-border));
}
.callout.info {
  background: color-mix(in srgb, var(--sms-primary) 8%, white);
  border-color: color-mix(in srgb, var(--sms-primary) 30%, var(--sms-border));
}

/* Layout modules
   --------------------------------------- */

/* 1) Text‑only */
.layout-text {}

/* 2) Text + media (image | html | chart) */
.layout-side {
  display: grid;
  gap: 1rem;
  align-items: start;
}
/* 12-column style breakpoints without Bootstrap dependency */
@media (min-width: 820px) {
  .layout-side {
    grid-template-columns: 1fr 1fr; /* text 1, media 1 - equal split */
  }
}

/* 3) Step-by-step procedures with media */
.layout-procedure {
  display: grid;
  gap: 1rem;
  align-items: start;
}
@media (min-width: 820px) {
  .layout-procedure {
    grid-template-columns: 1fr 1fr;
  }
}

/* 4) Procedure with checklist layout */
.layout-procedure-checklist {
  display: grid;
  gap: 1rem;
  align-items: start;
}
@media (min-width: 820px) {
  .layout-procedure-checklist {
    grid-template-columns: 2fr 1fr;
  }
}

/* 5) Data table layout */
.layout-data-table {
  background: #f8fafc;
  border: 1px solid var(--sms-border);
  border-radius: .5rem;
  padding: 1rem;
}

/* 6) Comparison table layout */
.layout-comparison-table {
  background: #f8fafc;
  border: 1px solid var(--sms-border);
  border-radius: .5rem;
  padding: 1rem;
}

/* 7) Chart layout */
.layout-chart {
  background: white;
  border: 1px solid var(--sms-border);
  border-radius: .5rem;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Checklist styling for procedures */
.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: white;
  border: 1px solid var(--sms-border);
  border-radius: 0.375rem;
}

.checklist .task {
  flex: 1;
}

.checklist .task small {
  display: block;
  color: #64748b;
  margin-top: 0.25rem;
}

.checklist .box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--sms-border);
  border-radius: 0.25rem;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s;
}

.checklist .box:hover {
  border-color: var(--sms-primary);
}

.checklist .box.checked {
  background: var(--sms-primary);
  border-color: var(--sms-primary);
  position: relative;
}

.checklist .box.checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* Reference pill styling */
.ref-pill {
  display: inline-block;
  background: var(--sms-primary);
  color: white;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  margin: 0 0.125rem;
}

.ref-pill:hover {
  background: #1e6b8a;
  transform: translateY(-1px);
}

/* Assistant panel styling */
.assistant-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  border-bottom: 2px solid var(--sms-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 1000;
  display: none;
  padding: 1rem;
}

.assistant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.assistant-header h3 {
  margin: 0;
  color: var(--sms-primary);
  font-size: 1.1rem;
}

.assistant-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.assistant-close:hover {
  color: var(--sms-primary);
}

.assistant-content {
  max-width: 1080px;
  margin: 0 auto;
}

.assistant-content p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

/* Media frame (for screenshots, rendered HTML, charts) */
.media-frame {
  position: relative;
  border: 1px solid var(--sms-border);
  border-radius: .5rem;
  background: white;
  overflow: hidden;
}
.media-frame .media-inner {
  max-height: 520px;
  overflow: auto;
}

/* 3) Full‑bleed chart/table */
.layout-bleed {
  margin-inline: -1rem;
}
@media (min-width: 820px) {
  .layout-bleed {
    margin-inline: 0;
  }
}

/* Tables (simple, non‑ornate) */
.academy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  table-layout: fixed;
}

.academy-table th:first-child,
.academy-table td:first-child {
  width: 23.08%;
  padding-right: 0.5rem;
}

.academy-table th:not(:first-child),
.academy-table td:not(:first-child) {
  width: 15.38%;
}
.academy-table th,
.academy-table td {
  padding: .3rem .75rem;
  border-bottom: 1px solid var(--sms-border);
}
.academy-table thead th {
  text-align: left;
  font-weight: 600;
  color: #475569;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Override default left alignment for specific header types */
.academy-table thead th.num {
  text-align: right !important;
}
/* Table alignment rules */
.academy-table td.num { 
  text-align: right; 
  font-variant-numeric: tabular-nums; 
}

/* Values (numbers, percentages, currency) -> right align */
.academy-table td[data-type="value"],
.academy-table td[data-type="number"],
.academy-table td[data-type="currency"],
.academy-table td[data-type="percentage"],
.academy-table .value,
.academy-table .number,
.academy-table .currency,
.academy-table .percentage {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

/* Headers align with content - right align for value columns */
.academy-table th[data-type="value"],
.academy-table th[data-type="number"],
.academy-table th[data-type="currency"],
.academy-table th[data-type="percentage"],
.academy-table th.value,
.academy-table th.number,
.academy-table th.currency,
.academy-table th.percentage {
  text-align: right !important;
}

/* Words and icons -> center align */
.academy-table td[data-type="icon"],
.academy-table td[data-type="word"],
.academy-table td[data-type="status"],
.academy-table td[data-type="action"],
.academy-table .icon,
.academy-table .word,
.academy-table .status,
.academy-table .action {
  text-align: center !important;
}

/* Headers align with content - center align for icon/word columns */
.academy-table th[data-type="icon"],
.academy-table th[data-type="word"],
.academy-table th[data-type="status"],
.academy-table th[data-type="action"],
.academy-table th.icon,
.academy-table th.word,
.academy-table th.status,
.academy-table th.action {
  text-align: center !important;
}

/* Sentences and text -> left align (default) */
.academy-table td[data-type="text"],
.academy-table td[data-type="sentence"],
.academy-table td[data-type="description"],
.academy-table .text,
.academy-table .sentence,
.academy-table .description {
  text-align: left !important;
}

/* Table cell coloring for loan purpose tracking */
.academy-table .paydown-amount {
  background-color: color-mix(in srgb, var(--sms-primary) 15%, white);
  color: var(--sms-primary);
  font-weight: 600;
}

.academy-table .paydown-balance {
  background-color: color-mix(in srgb, var(--sms-primary) 15%, white);
  color: var(--sms-primary);
  font-weight: 600;
}

.academy-table .draw-investment {
  background-color: color-mix(in srgb, var(--sms-success) 15%, white);
  color: var(--sms-success);
  font-weight: 600;
}

.academy-table .draw-investment-balance {
  background-color: color-mix(in srgb, var(--sms-success) 15%, white);
  color: var(--sms-success);
  font-weight: 600;
}

.academy-table .draw-investment-deductible {
  background-color: color-mix(in srgb, var(--sms-success) 15%, white);
  color: var(--sms-success);
  font-weight: 600;
}

.academy-table .draw-non-investment {
  background-color: color-mix(in srgb, var(--sms-warning) 15%, white);
  color: var(--sms-warning);
  font-weight: 600;
}

.academy-table .draw-non-investment-balance {
  background-color: color-mix(in srgb, var(--sms-warning) 15%, white);
  color: var(--sms-warning);
  font-weight: 600;
}

/* Headers align with content - left align for text columns */
.academy-table th[data-type="text"],
.academy-table th[data-type="sentence"],
.academy-table th[data-type="description"],
.academy-table th.text,
.academy-table th.sentence,
.academy-table th.description {
  text-align: left !important;
}

/* Procedure pattern with on‑page annotations
   ----------------------------------------- */
.procedure {
  counter-reset: step;
}
.step-block {
  display: grid;
  gap: .5rem .75rem;
  grid-template-columns: minmax(28px, 32px) 1fr;
  align-items: start;
  margin-bottom: .75rem;
}
.step-index::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sms-primary);
  color: white;
  font-weight: 700;
  font-size: .9rem;
}
.step-title { font-weight: 600; }
.step-body { color: #374151; }

/* Screenshot pins over rendered HTML or images */
.media-annotations {
  position: relative;
}
.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--sms-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .9rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  cursor: pointer;
}
.pin[data-kind="warn"]  { background: #b45309; } /* optional variant */
.pin[data-kind="note"]  { background: #64748b; }

/* Pin callout popovers (CSS-only, simple) */
.pin[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  inset: auto auto calc(100% + 8px) 50%;
  transform: translate(-50%, 0);
  white-space: nowrap;
  background: #111827;
  color: white;
  padding: .35rem .5rem;
  border-radius: .35rem;
  font-size: .75rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.pin:hover::after, .pin:focus::after { opacity: 1; }

/* Toggle for annotation visibility */
.annotation-toolbar {
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: flex-end;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--sms-border);
  background: #fff;
}

.annotation-toolbar button {
  border: 1px solid var(--sms-border);
  background: white;
  padding: .25rem .5rem;
  border-radius: .375rem;
  font-size: .875rem;
  cursor: pointer;
}
.annotation-toolbar button:active { transform: translateY(1px); }

.annotations-hidden .pin { display: none; }

/* Minor helpers */
.hr {
  height: 1px;
  background: var(--sms-border);
  margin: 1rem 0;
}

/* Link style for in-article navigation */
.toc {
  border-left: 3px solid var(--sms-border);
  padding-left: .75rem;
  margin: .75rem 0 1.25rem;
}
.toc a {
  display: block;
  padding: .25rem 0;
  text-decoration: none;
  color: #374151;
}
.toc a:hover { color: var(--sms-primary); }

/* Section background colors */
.section-examples {
  background: #f8fafc;
  border: 1px solid var(--sms-border);
  border-radius: .5rem;
  padding: 1.5rem;
  margin: 1rem 0;
}

.section-simulator {
  background: color-mix(in srgb, var(--sms-success) 8%, white);
  border: 1px solid color-mix(in srgb, var(--sms-success) 25%, var(--sms-border));
  border-radius: .5rem;
  padding: 1.5rem;
  margin: 1rem 0;
}

.section-simulator h2 {
  color: var(--sms-success);
  margin-top: 0;
  margin-bottom: 1rem;
}

.section-selfmanaged {
  background: color-mix(in srgb, var(--sms-primary) 8%, white);
  border: 1px solid color-mix(in srgb, var(--sms-primary) 25%, var(--sms-border));
  border-radius: .5rem;
  padding: 1.5rem;
  margin: 1rem 0;
}

.section-selfmanaged h2,
.section-selfmanaged h5 {
  color: var(--sms-primary);
  margin-top: 0;
  margin-bottom: 1rem;
}

.section-selfmanaged p {
  color: var(--sms-dark);
}

.section-selfmanaged .col-4 {
  text-align: left !important;
}

.section-selfmanaged .btn {
  text-align: center;
}

/* Right-align numbers in input fields */
#dr-sim input[type="number"] {
  text-align: right;
}

/* Simulator form styling - more compact */
#dr-sim .form-control {
  height: 2rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
}

#dr-sim .btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  height: 2rem;
}

#dr-sim .btn-group .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.section-reference {
  background: #f8fafc;
  border: 1px solid var(--sms-border);
  border-radius: .5rem;
  padding: 1.5rem;
  margin: 1rem 0;
}

/* Hide Bootstrap-y card look when nested inside base templates, but preserve white background for academy content */
.col-md-2 .card {
  background: white !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1) !important;
  padding: 0 !important;
}

.col-md-2 .card-header {
  background: white !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 1rem 1.25rem !important;
}

.col-md-2 .card-body {
  background: white !important;
  padding: 0 !important;
}

/* Ensure academy content area has white background - target both card and academy-article */
.col-md-10 > .card,
.col-md-10 > .academy-article {
  background: white !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1) !important;
  padding: 1.5rem !important;
}

.col-md-10 > .card .card-body {
  background: white !important;
  padding: 0 !important;
}

.col-md-10 > .card .card-header {
  background: white !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 1rem 1.25rem !important;
}

/* Demo form styling for the example */
.demo-form {
  padding: 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: #374151;
}


/* HTML Diagram Styles */
.debt-recycling-diagram {
  padding: 2rem;
  text-align: center;
}

.diagram-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.step-box {
  background: white;
  border: 2px solid var(--sms-primary);
  border-radius: 0.5rem;
  padding: 1rem;
  min-width: 120px;
  transition: all 0.3s ease;
}

.step-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.step-shape {
  width: 40px;
  height: 40px;
  margin: 0 auto 0.5rem;
  border-radius: 0.25rem;
}

.cash-shape {
  background: linear-gradient(45deg, #10b981, #34d399);
  position: relative;
}

.cash-shape::after {
  content: '$';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
}

.home-shape {
  background: linear-gradient(45deg, #dc3545, #f87171);
  position: relative;
}

.home-shape::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 12px;
  background: white;
  border-radius: 2px 2px 0 0;
}

.home-shape::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 8px solid white;
  margin-top: -4px;
}

.investment-shape {
  background: linear-gradient(45deg, #217EA0, #57C5E5);
  position: relative;
}

.investment-shape::after {
  content: '↗';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
}

.income-shape {
  background: linear-gradient(45deg, #f59e0b, #fbbf24);
  position: relative;
}

.income-shape::after {
  content: '↑';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
}

.step-label {
  font-weight: 600;
  color: var(--sms-primary);
  font-size: 0.9rem;
}

.arrow-line {
  width: 30px;
  height: 2px;
  background: var(--sms-primary);
  position: relative;
}

.arrow-line::after {
  content: '';
  position: absolute;
  right: -5px;
  top: -3px;
  width: 0;
  height: 0;
  border-left: 8px solid var(--sms-primary);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.loop-indicator {
  background: var(--sms-light);
  border: 1px solid var(--sms-border);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: 600;
  color: var(--sms-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.loop-arrow {
  width: 20px;
  height: 20px;
  border: 2px solid var(--sms-primary);
  border-radius: 50%;
  position: relative;
}

.loop-arrow::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 0;
  height: 0;
  border-left: 6px solid var(--sms-primary);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
}

/* Account Structure Diagram */
.account-structure-diagram {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.account-split {
  background: white;
  border: 2px solid var(--sms-border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  min-width: 200px;
  flex: 1;
}

.home-split {
  border-color: #dc3545;
}

.investment-split {
  border-color: var(--sms-success);
}

.split-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--sms-border);
}

.split-shape {
  width: 30px;
  height: 30px;
  border-radius: 0.25rem;
}

.split-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.home-split .split-title {
  color: #dc3545;
}

.investment-split .split-title {
  color: var(--sms-success);
}

.split-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-item {
  background: var(--sms-light);
  padding: 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.9rem;
  color: var(--sms-secondary);
}

.vs-separator {
  display: flex;
  align-items: center;
  justify-content: center;
}

.vs-circle {
  background: var(--sms-primary);
  color: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.8rem;
}

/* App Steps Diagram */
.app-steps-diagram {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 2rem;
}

.app-step {
  background: white;
  border: 2px solid var(--sms-border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
}

.app-step:hover {
  border-color: var(--sms-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.step-number {
  background: var(--sms-primary);
  color: white;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin: 0 auto 1rem;
}

.step-title {
  font-weight: 600;
  color: var(--sms-primary);
  margin-bottom: 0.5rem;
}

.step-description {
  font-size: 0.9rem;
  color: var(--sms-secondary);
  line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .diagram-container {
    flex-direction: column;
  }
  
  .arrow {
    transform: rotate(90deg);
  }
  
  .account-structure-diagram {
    flex-direction: column;
  }
  
  .vs-separator {
    transform: rotate(90deg);
  }
  
  .app-steps-diagram {
    grid-template-columns: 1fr;
  }
}

/* Loan Tracking Table Warning Row */
.warning-row {
  background-color: #fff3cd;
  border-left: 4px solid #ffc107;
}

/* Checklist with checkboxes */
.checklist-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.checklist-list li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid #20c997;
}

.checklist-checkbox {
  margin-right: 0.75rem;
  margin-top: 0.125rem;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: #20c997;
  cursor: pointer;
}

.checklist-list li:hover {
  background: #e9ecef;
}

/* Strategies Section */
.strategies-text {
  padding-right: 1.5rem;
}

.strategies-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.strategies-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.strategies-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--sms-primary);
  font-weight: bold;
  font-size: 1.2rem;
}

/* Loan Split Strategy Diagram */
.loan-split-diagram {
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.diagram-title {
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.5rem;
  color: #212529;
}

.split-section {
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: #495057;
  text-align: center;
}

.loan-bar,
.loan-bar-small {
  display: flex;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid #dee2e6;
  margin-bottom: 0.5rem;
}

.deductible-portion,
.non-deductible-portion {
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 0;
}

.deductible-portion {
  background: #28a745;
}

.non-deductible-portion {
  background: #dc3545;
}


.split-loans-inline {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  position: relative;
}

.split-loans-inline::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 20%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 60px;
  background: repeating-linear-gradient(
    to bottom,
    #000 0px,
    #000 4px,
    transparent 4px,
    transparent 8px
  );
  z-index: 1;
}

.split-inline {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #dee2e6;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid #dee2e6;
}

.legend-color.deductible {
  background: #28a745;
}

.legend-color.non-deductible {
  background: #dc3545;
}

.media-frame figcaption {
  text-align: center;
  margin-top: 1rem;
}

/* Responsive adjustments for loan split diagram */
@media (max-width: 768px) {
  .strategies-text {
    padding-right: 0;
    margin-bottom: 2rem;
  }
  
  .loan-split-diagram {
    padding: 1rem;
  }
  
  .loan-bar,
  .loan-bar-small {
    height: 35px;
  }
  
  .split-loans-inline {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .deductible-portion,
  .non-deductible-portion {
    font-size: 0.7rem;
  }
  
  .legend {
    flex-direction: column;
    gap: 0.75rem;
  }
}