:root {
  color-scheme: light;
  --ink: #20342e;
  --muted: #64716b;
  --line: #dfe5df;
  --accent: #266650;
  --paper: #ffffff;
  --canvas: #f5f6f2;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.6 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
.container { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #94b9a8; outline-offset: 3px; }
.skip-link { position: fixed; top: -80px; left: 16px; background: white; padding: 12px; z-index: 10; }
.skip-link:focus { top: 10px; }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-row { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 17px; letter-spacing: -.35px; white-space: nowrap; }
.brand strong { font-weight: 650; }
.brand-name { font-size: 12px; line-height: 1.5; letter-spacing: 0; }
.brand-name strong { display: block; font-size: 17px; letter-spacing: -.3px; }
.page-nav { display: flex; gap: 28px; padding-top: 4px; }
.page-nav a { padding: 10px 0 12px; color: var(--muted); text-decoration: none; font-size: 13px; border-bottom: 2px solid transparent; }
.page-nav a[aria-current=page] { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.brand-mark { width: 35px; height: 35px; background: var(--accent); border-radius: 10px; display: flex; gap: 3px; align-items: end; justify-content: center; padding: 9px; }
.brand-mark i { width: 4px; background: #eef6ef; border-radius: 1px; height: 8px; }
.brand-mark i:nth-child(2) { height: 13px; }
.brand-mark i:last-child { height: 18px; }
.header-note { color: var(--muted); font-size: 12px; }
.account-menu { display: flex; align-items: center; gap: 20px; }
.user-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.eyebrow { display: block; font-size: 10px; line-height: 1.5; letter-spacing: 1.7px; text-transform: uppercase; font-weight: 650; color: var(--accent); margin-bottom: 12px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 30px; line-height: 1.25; font-weight: 600; letter-spacing: -.8px; margin-bottom: 9px; }
h2 { font-size: 19px; line-height: 1.4; margin-bottom: 6px; font-weight: 600; letter-spacing: -.3px; }
p { margin-bottom: 14px; }
.muted, .intro p { color: var(--muted); }
.intro { margin: 37px 0 26px; }
.intro-row, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading { margin-bottom: 20px; }
.section-heading p { margin-bottom: 0; }
.button-link { display: inline-block; border: 1px solid var(--accent); padding: 10px 17px; border-radius: 7px; font-size: 12px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.button-link:hover { background: #eaf1e7; }
.market-selector { display: flex; align-items: end; gap: 10px; min-width: 280px; }
.market-selector > div { flex: 1; }
.portfolio-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
.portfolio-grid > * { min-width: 0; }
.allocation-panel { padding: 24px; }
.allocation-panel h2 { margin-bottom: 20px; }
.weight-field { display: grid; grid-template-columns: 1fr 105px; align-items: center; gap: 5px 12px; margin: 12px 0; }
.weight-field .field-errors { grid-column: 1 / -1; }
.percent-input { position: relative; }
.percent-input input { margin-top: 0; padding-right: 27px; }
.percent-input span { position: absolute; right: 11px; top: 11px; color: var(--muted); font-size: 12px; pointer-events: none; }
.result-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0; }
.result-metrics span { display: block; font-size: 11px; color: var(--muted); }
.result-metrics strong { display: block; font-size: 19px; font-weight: 600; margin-top: 4px; }
.method-copy { padding-top: 12px; color: var(--muted); line-height: 1.8; }
.empty-state { padding: 50px 30px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 25px 28px; margin-bottom: 24px; box-shadow: 0 2px 3px #23382e03; }
.form-grid { display: grid; grid-template-columns: 1.7fr 1fr .85fr auto; align-items: end; gap: 16px; margin-top: 22px; }
label { display: block; font-size: 12px; font-weight: 600; }
input:not([type=hidden]), select { width: 100%; display: block; height: 44px; margin-top: 7px; border: 1px solid #cfd9d2; border-radius: 7px; background: white; padding: 10px 12px; color: var(--ink); font-size: 13px; transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: #89938c; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #2666500c; }
input[type=file] { padding: 8px; font-size: 12px; }
input::file-selector-button { border: 0; background: #edf2ec; color: var(--ink); border-radius: 4px; padding: 5px 8px; margin-right: 8px; cursor: pointer; }
button { background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 7px; padding: 11px 17px; cursor: pointer; font-size: 12px; font-weight: 600; min-height: 44px; transition: background .15s, border-color .15s; }
button:hover { background: #1c4e3c; border-color: #1c4e3c; }
button:disabled { opacity: .65; cursor: wait; }
.secondary-button { background: white; border-color: var(--line); color: var(--ink); padding: 7px 15px; min-height: 36px; }
.secondary-button:hover { background: #eef2ec; border-color: #b8c8bc; }
.form-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 20px; margin-top: 18px; font-size: 11px; color: var(--muted); }
.form-footer > span { flex-basis: 100%; }
.text-button { background: none; color: var(--accent); border: 0; padding: 0; min-height: 24px; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; font-weight: 400; }
.text-button:hover { background: none; }
.status { font-size: 12px; margin: 12px 0 0; }
.status:empty { display: none; }
.source { font-size: 11px; color: var(--muted); margin: 3px 0 12px; }
.summary { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 16px; margin-bottom: 24px; }
.summary > div { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 19px 24px; }
.summary span { display: block; color: var(--muted); font-size: 11px; }
.summary strong { display: block; font-size: 29px; font-weight: 600; letter-spacing: -.5px; margin-top: 2px; }
.summary .period { font-size: 18px; margin-top: 13px; letter-spacing: -.3px; }
.chart { width: 100%; overflow-x: auto; margin-top: 20px; }
.asset-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.asset-chart { border: 1px solid var(--line); border-radius: 9px; padding: 17px; min-width: 0; }
.asset-chart-heading { display: flex; justify-content: space-between; gap: 16px; }
.asset-chart-heading strong, .asset-chart-heading span { display: block; }
.asset-chart-heading span { color: var(--muted); font-size: 11px; }
.asset-chart .chart { margin-top: 10px; overflow: visible; }
.asset-chart svg { min-width: 0; }
svg { display: block; width: 100%; min-width: 520px; height: auto; }
svg text { font: 12px 'Segoe UI', Arial, sans-serif; fill: var(--muted); }
.gridline { stroke: #e8ece6; stroke-width: 1; }
.legend { display: flex; gap: 17px; flex-wrap: wrap; font-size: 11px; margin: 10px 0 24px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 15px; height: 3px; border-radius: 2px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; white-space: nowrap; }
caption { text-align: left; font-weight: 600; padding: 8px 0 12px; }
th, td { border-bottom: 1px solid var(--line); padding: 13px 12px; }
thead th { background: #f4f6f1; color: #5a6b61; font-weight: 500; font-size: 11px; }
tbody th { font-weight: 400; }
tbody tr:hover { background: #fafbf8; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.company { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 3px; }
.positive { color: #24714c; }
.negative { color: #ad4941; }
.small { font-size: 11px; margin-top: 14px; }
.holdings { font-size: 12px; margin: 18px 0 0; }
.methods { font-size: 13px; }
.methods p { margin-bottom: 10px; }
summary { cursor: pointer; color: var(--accent); }
details ul { padding-left: 22px; color: var(--muted); }
details li { margin-bottom: 8px; }
.error { background: #fff3f0; border: 1px solid #efd3cb; padding: 13px 16px; border-radius: 7px; margin-bottom: 20px; color: #943e35; font-size: 13px; }
.error p:last-child { margin-bottom: 0; }
.notice { background: #eaf2e8; border: 1px solid #cddfc9; padding: 12px 16px; border-radius: 7px; margin-bottom: 22px; color: #30583b; font-size: 13px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; padding-block: 21px 26px; display: flex; justify-content: space-between; gap: 14px; }
/* Small account pages: one shared layout and ordinary Django forms. */
.auth-page { min-height: 100dvh; display: flex; flex-direction: column; }
.auth-main { flex: 1; display: grid; align-items: center; padding-block: 42px; }
.auth-layout { max-width: 480px; width: 100%; margin-inline: auto; background: white; border: 1px solid var(--line); border-radius: 17px; overflow: hidden; box-shadow: 0 14px 45px #24382906; }
.auth-card { padding: 47px 40px 35px; align-self: center; width: 100%; min-width: 0; }
.auth-card .eyebrow { color: var(--muted); font-size: 10px; }
.auth-card h2 { font-size: 25px; letter-spacing: -.7px; margin-bottom: 9px; }
.auth-description { color: var(--muted); font-size: 13px; margin-bottom: 29px; }
.field { margin-bottom: 18px; min-width: 0; }
.field input { height: 46px; }
.field-help { color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: 7px; }
.field-errors { color: #a13f35; font-size: 12px; padding-left: 17px; margin: 7px 0 0; }
.field-invalid input { border-color: #bc7266; }
.name-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.auth-submit { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 25px; padding: 12px 16px; font-size: 13px; min-height: 46px; }
.auth-submit span { font-size: 18px; font-weight: 400; line-height: 1; }
.auth-switch { border-top: 1px solid var(--line); padding-top: 22px; margin: 27px 0 0; font-size: 12px; text-align: center; color: var(--muted); }
.auth-switch a { margin-left: 4px; font-weight: 600; }
@media (max-width: 1000px) {
  .portfolio-grid { grid-template-columns: 290px minmax(0, 1fr); gap: 18px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 36px 28px; }
}
@media (max-width: 760px) {
  .asset-chart-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .intro-row { align-items: start; flex-direction: column; gap: 8px; }
  .section-heading { align-items: start; flex-wrap: wrap; gap: 12px; }
  .container { width: calc(100% - 36px); }
  .auth-main { padding-block: 30px; }
  .auth-layout { max-width: 460px; }
  .auth-card { padding: 34px 28px; }
  .header-note { display: none; }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary > div:last-child { grid-column: 1 / -1; }
  .panel { padding: 22px; }
}
@media (max-width: 480px) {
  .header-row { min-height: 69px; gap: 10px; }
  .brand { font-size: 15px; gap: 8px; }
  .brand-name { font-size: 10px; }
  .brand-name strong { font-size: 14px; }
  .header-row .user-name { max-width: 55px; }
  .brand-mark { width: 31px; height: 31px; padding: 7px; border-radius: 8px; }
  .account-menu { gap: 10px; }
  .user-name { max-width: 75px; font-size: 12px; }
  .secondary-button { padding: 6px 10px; }
  .intro { margin-top: 27px; }
  h1 { font-size: 25px; }
  .intro p { font-size: 13px; }
  .form-grid { grid-template-columns: 1fr; }
  .summary { gap: 12px; }
  .summary > div { padding: 14px 18px; }
  .summary .period { font-size: 16px; margin-top: 4px; }
  .panel { padding: 20px 17px; }
  .auth-card { padding: 30px 23px; }
  .auth-card h2 { font-size: 23px; }
  .site-footer { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
