:root {
  color-scheme: light;
  --canvas: #f3f5ef;
  --paper: #fcfdf9;
  --white: #fff;
  --ink: #17221a;
  --muted: #536158;
  --line: #dce3d8;
  --forest: #142e23;
  --forest-light: #244337;
  --lime: #baf150;
  --green: #1c633e;
  --negative: #a02c39;
  --radius: 1.2rem;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 1rem/1.5 var(--font); }
a { color: inherit; }
button, input, select, textarea { color: inherit; font: inherit; }
button, summary { cursor: pointer; }
button { border: 0; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible { outline: 3px solid #519146; outline-offset: 3px; }
h1, h2, p, dl, ul { margin: 0; }
h1 { font-size: clamp(2.05rem, 6vw, 3.15rem); font-weight: 650; letter-spacing: -.055em; line-height: 1.06; }
h2 { font-size: 1.17rem; font-weight: 675; letter-spacing: -.026em; line-height: 1.25; }
small { font-size: .82rem; }
dd { margin: 0; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 2rem, 78rem); margin-inline: auto; }
.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip { position: fixed; z-index: 5; top: 1rem; left: 1rem; background: white; padding: .8rem; }
.app-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.masthead {
  display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: .6rem;
  min-height: 4rem;
}
.brand, .login-brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 720; letter-spacing: -.045em; font-size: 1.26rem; }
.brand { text-decoration: none; justify-self: start; min-height: 3.35rem; }
.mark { position: relative; display: inline-block; width: 2rem; height: 2rem; background: var(--forest); border-radius: .64rem; flex: none; }
.mark::before, .mark::after {
  content: ""; position: absolute; width: .30rem; height: .70rem; background: var(--lime);
  bottom: .5rem; left: .60rem; border-radius: .18rem; transform: skew(-17deg);
}
.mark::after { height: 1rem; left: 1.04rem; }
.masthead nav { grid-column: 1/-1; grid-row: 2; display: flex; align-self: stretch; justify-content: space-between; gap: .35rem; }
.masthead nav a {
  color: var(--muted); display: inline-flex; align-items: center; border-bottom: 3px solid transparent;
  text-decoration: none; min-height: 2.8rem; font-size: .9rem; font-weight: 575;
  transition: color .15s, border-color .15s;
}
.masthead nav a:hover, .masthead nav a[aria-current] { color: var(--ink); }
.masthead nav a[aria-current] { border-color: #437b4d; }
.masthead form { grid-column: 2; grid-row: 1; }
.signout { padding: .55rem .1rem .55rem .5rem; min-height: 2.75rem; background: transparent; color: var(--muted); font-size: .9rem; }
.signout:hover, .text-link:hover { text-decoration: underline; }
.workspace { padding-block: 1.65rem 3.5rem; animation: enter .25s ease-out both; }
@keyframes enter { from { opacity: .7; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { margin-bottom: 1.35rem; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .95rem 1.5rem; }
.page-heading p { color: var(--muted); margin-top: .42rem; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.actions:empty { display: none; }
.button {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; min-height: 2.8rem;
  padding: .62rem 1.04rem; border-radius: .64rem; font-size: .91rem; font-weight: 680;
  border: 1px solid transparent; transition: background .16s, color .16s, border .16s, transform .16s;
}
.button:active { transform: translateY(1px); }
.primary { background: var(--forest); color: #f7fff4; }
.primary:hover { background: var(--forest-light); }
.secondary { background: var(--paper); border-color: #cfd9cb; }
.secondary:hover { background: #e8eee3; border-color: #acbdab; }
.text-link { color: #23573b; font-size: .9rem; font-weight: 680; text-underline-offset: .22rem; text-decoration: none; display: inline-flex; align-items: center; min-height: 2.75rem; }
.positive { color: var(--green); }
.negative { color: var(--negative); }
.muted { color: var(--muted); }
.overview-grid { display: grid; gap: 1rem; }
.valuation {
  background: var(--forest); color: #f0faec; border-radius: var(--radius);
  padding: clamp(1.15rem, 4vw, 2rem); display: grid; align-content: start; min-width: 0;
}
.valuation-top { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; justify-content: space-between; }
.valuation h2 { font-size: 1rem; letter-spacing: -.005em; color: #d8e7d9; font-weight: 560; }
.coverage { font-size: .81rem; color: #e4f4de; background: #284637; border-radius: 2rem; padding: .34rem .7rem; }
.display-value { margin-top: .38rem; font-size: clamp(2.35rem, 8.2vw, 4.75rem); line-height: 1.05; font-weight: 610; letter-spacing: -.075em; overflow-wrap: anywhere; }
.quote-note { margin-top: .55rem; font-size: .88rem; color: #bfd6c5; }
.valuation-metrics {
  display: grid; gap: 1rem .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 1.5rem;
  padding-top: 1.12rem; border-top: 1px solid #4b6758; font-variant-numeric: tabular-nums;
}
.valuation-metrics dt { color: #c4d9c9; font-size: .87rem; }
.valuation-metrics dd { font-size: clamp(1.08rem, 2.45vw, 1.55rem); font-weight: 655; letter-spacing: -.035em; overflow-wrap: anywhere; }
.valuation-metrics small { display: block; color: #bfd6c5; line-height: 1.25; }
.valuation .positive { color: #cbf68c; }
.valuation .negative { color: #ffb8c0; }
.allocation-panel { padding: 1.3rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); min-width: 0; }
.allocation-panel p, .holdings-allocation p { color: var(--muted); font-size: .91rem; margin-top: .22rem; }
.allocation-bar { height: .83rem; margin: .95rem 0 .78rem; display: flex; gap: .2rem; border-radius: .3rem; overflow: hidden; }
.allocation-bar > span { min-width: 0; flex: var(--share) 1 0; background: var(--swatch); border-radius: .24rem; }
.legend { list-style: none; padding: 0; }
.legend li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .62rem; align-items: center; padding: .47rem 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.legend li:last-child { border-bottom: 0; }
.legend small { display: block; color: var(--muted); }
.legend strong { font-size: 1rem; font-weight: 665; }
.swatch { width: .6rem; height: .6rem; background: var(--swatch); border-radius: .17rem; }
.allocation-panel .text-link { margin-top: .35rem; }
.basis-notice { margin: .9rem 0 0; color: var(--muted); padding-left: .78rem; border-left: 2px solid #829b72; font-size: .9rem; }
.activity { margin-top: 1.5rem; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: .75rem; min-height: 2.65rem; margin-bottom: .38rem; }
.transactions-list { border-top: 1px solid var(--line); }
.transaction { border-bottom: 1px solid var(--line); transition: background .16s; scroll-margin-top: 2rem; }
.transaction:hover, .transaction[open] { background: var(--paper); }
.transaction:target { background: #eaf2e1; }
.transaction summary {
  display: grid; align-items: center; grid-template-areas: "kind name name cash down" ". date qty cash down";
  grid-template-columns: minmax(3.75rem, 4.15rem) minmax(0, 1fr) minmax(0, .75fr) auto .55rem;
  gap: .2rem .55rem; min-height: 4.25rem; padding: .68rem .15rem; list-style: none;
}
.transaction summary::-webkit-details-marker { display: none; }
.kind { grid-area: kind; justify-self: start; border-radius: .3rem; padding: .22rem .34rem; font-size: .73rem; font-weight: 680; background: #e5ebe1; color: #435344; line-height: 1.2; }
.kind-buy { background: #e0efdb; color: #265635; }
.kind-sell { background: #eae7dc; color: #574c32; }
.transaction-name { grid-area: name; overflow-wrap: anywhere; }
.transaction-date { grid-area: date; color: var(--muted); font-size: .82rem; }
.transaction-qty { grid-area: qty; overflow-wrap: anywhere; font-size: .83rem; }
.transaction-qty small { display: none; }
.transaction-cash { grid-area: cash; text-align: right; overflow-wrap: anywhere; }
.transaction-cash strong { font-size: .94rem; }
.transaction-name small, .transaction-cash small { display: block; color: var(--muted); line-height: 1.25; }
.transaction-cash small { font-size: .76rem; }
.chevron {
  grid-area: down; width: .46rem; height: .46rem; border-right: 1.5px solid #607364;
  border-bottom: 1.5px solid #607364; transform: rotate(45deg); transition: transform .18s;
}
.transaction[open] .chevron { transform: rotate(225deg); }
.transaction-body { padding: .1rem .8rem 1rem; color: var(--muted); }
.transaction-body p { margin-top: .45rem; overflow-wrap: anywhere; }
.transaction-details { display: flex; flex-wrap: wrap; gap: .7rem 1.4rem; }
.transaction-details dt { font-size: .84rem; }
.transaction-details dd { font-size: .95rem; font-weight: 640; color: var(--ink); overflow-wrap: anywhere; }
.transaction-details dd.positive { color: var(--green); }
.transaction-details dd.negative { color: var(--negative); }
.empty { padding: 1rem .15rem; color: var(--muted); }
.holdings-allocation {
  display: grid; gap: .7rem 2rem; padding: 1rem; background: #e9efe4;
  border-radius: .95rem; margin-bottom: 1rem;
}
.holdings-allocation .allocation-bar { margin-top: .3rem; }
.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: .95rem; overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
thead { display: none; }
tbody, tbody tr, td, tbody th { display: block; }
tbody tr { padding: .82rem .95rem; }
tbody tr + tr { border-top: 1px solid var(--line); }
tbody th { padding: 0 0 .42rem; text-align: left; }
td { display: flex; align-items: baseline; flex-wrap: wrap; padding: .18rem 0; gap: .15rem .4rem; overflow-wrap: anywhere; }
td::before { content: attr(data-label); color: var(--muted); font-weight: 540; min-width: 6.55rem; }
td small, tbody th small { color: var(--muted); font-weight: 450; display: block; }
table small { line-height: 1.35; }
.row-actions { display: flex; gap: .45rem; }
.row-actions::before { content: none; }
.row-actions a { color: var(--green); font-size: .875rem; font-weight: 660; text-decoration: none; padding: .55rem .48rem; min-height: 2.75rem; }
.row-actions a:hover { text-decoration: underline; }
.method { margin-top: .85rem; border-top: 1px solid var(--line); padding: .45rem 0 0; color: var(--muted); }
.method summary { color: var(--ink); font-weight: 640; min-height: 2.75rem; padding-block: .6rem; }
.method p, .method ul { margin-bottom: .6rem; }
.method ul { padding-left: 1.15rem; }
.method li + li { margin-top: .34rem; }
.source-quotes { display: grid; list-style: none; padding-left: 0 !important; gap: 0 1.4rem; }
.source-quotes li { display: flex; gap: .55rem; align-items: baseline; border-bottom: 1px solid var(--line); padding: .3rem 0; }
.source-quotes li strong { margin-right: auto; color: var(--ink); }
label { display: grid; gap: .28rem; align-content: start; font-size: .9rem; font-weight: 620; min-width: 0; }
label small { color: var(--muted); font-weight: 480; }
input:not([type="hidden"]), select, textarea {
  width: 100%; min-width: 0; min-height: 2.8rem; padding: .57rem .65rem; background: #fff;
  border: 1px solid #bdcbbb; border-radius: .54rem; font-size: 1rem; font-weight: 460;
}
textarea { resize: vertical; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; align-items: end; }
.filters label:first-child { grid-column: 1/-1; }
.filters .clear { justify-self: start; padding: 0 .3rem; }
.results-heading { margin-top: 1rem; }
.form-layout { display: grid; align-items: start; gap: 1.05rem 2rem; }
.form-surface, .settings-section { background: var(--paper); padding: clamp(.95rem, 3vw, 1.6rem); border: 1px solid var(--line); border-radius: var(--radius); }
.form-stack { display: grid; gap: 1rem; }
.form-grid { display: grid; gap: .82rem .9rem; }
.form-divider { border-top: 1px solid var(--line); padding-top: 1rem; }
.mode-switch { display: inline-flex; padding: .19rem; background: #e9efe4; border-radius: .64rem; margin-bottom: 1.05rem; gap: .2rem; }
.mode-switch a { min-width: 5rem; min-height: 2.55rem; display: grid; place-items: center; text-decoration: none; border-radius: .49rem; font-weight: 630; }
.mode-switch a[aria-current] { background: var(--paper); box-shadow: 0 1px 2px #1e392b26; }
.form-aside { padding: .7rem .15rem; }
.form-aside > p { margin-top: .43rem; color: var(--muted); }
.inventory { list-style: none; padding: 0; margin-top: .56rem; }
.inventory li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.inventory li strong { color: var(--green); display: block; font-size: .88rem; }
.inventory li[data-selected] { background: #e4eedc; }
.alert, .confirmation { border-radius: .63rem; padding: .65rem .82rem; margin: 0 0 .85rem; font-size: .92rem; }
.alert { background: #fae9e8; color: #791b2b; }
.confirmation { background: #e3efda; color: #234e30; }
.settings-grid { display: grid; gap: 1rem; }
.settings-section p { margin-block: .52rem .84rem; color: var(--muted); }
.settings-facts div { display: flex; justify-content: space-between; gap: 1rem; padding-block: .53rem; border-bottom: 1px solid var(--line); }
.settings-facts div:last-child { border-bottom: 0; }
.settings-facts dt { color: var(--muted); }
.settings-facts dd { font-weight: 580; text-align: right; }
.login-wrap { width: min(100% - 2rem, 26rem); min-height: 100svh; margin-inline: auto; display: grid; place-items: center; }
.login-panel { width: 100%; padding: 1.55rem; background: var(--paper); border-radius: var(--radius); border: 1px solid var(--line); }
.login-brand { margin-bottom: 1.7rem; }
.login-body h1 { font-size: 2rem; }
.login-body p { margin: .4rem 0 1.2rem; color: var(--muted); }
.login-body button { width: 100%; }
@media (min-width: 32em) {
  .valuation-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .transaction summary {
    grid-template-areas: "kind name date qty cash down";
    grid-template-columns: 6.05rem minmax(0, 1fr) minmax(5.05rem, auto) minmax(3.4rem, auto) minmax(5rem, auto) .6rem;
    padding-inline: .64rem; gap: .65rem;
  }
  .transaction-qty small { display: block; color: var(--muted); line-height: 1.25; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-quotes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 46em) {
  .wrap { width: min(100% - 3.5rem, 78rem); }
  .masthead { grid-template-columns: auto 1fr auto; gap: clamp(1.45rem, 4vw, 3.3rem); min-height: 4.25rem; }
  .masthead nav { grid-column: 2; grid-row: 1; justify-content: start; gap: clamp(1rem, 3vw, 2.25rem); }
  .masthead form { grid-column: 3; }
  .workspace { padding-top: 2.45rem; }
  .page-heading { margin-bottom: 1.75rem; }
  .overview-grid { grid-template-columns: minmax(0, 1.8fr) minmax(14rem, 1fr); }
  .valuation { align-content: center; }
  .allocation-panel { align-self: stretch; }
  .activity { margin-top: 2rem; }
  .transaction summary {
    grid-template-columns: 7rem minmax(0, 1.45fr) minmax(6rem, .8fr) minmax(4.5rem, .7fr) minmax(7rem, .75fr) .8rem;
    gap: 1.3rem; min-height: 4.15rem;
  }
  .holdings-allocation { grid-template-columns: minmax(11rem, .6fr) minmax(0, 1fr); align-items: center; padding: 1.15rem 1.5rem; }
  .holdings-allocation .legend { display: flex; align-items: center; flex-wrap: wrap; column-gap: 1.8rem; }
  .holdings-allocation .legend li { border-bottom: 0; }
  .filters { grid-template-columns: minmax(12rem, 1.55fr) minmax(7rem, .85fr) minmax(7rem, 1fr) auto auto; }
  .filters label:first-child { grid-column: auto; }
  .form-layout { grid-template-columns: minmax(0, 1.75fr) minmax(13rem, 1fr); }
  .form-aside { padding: 1.2rem .2rem; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 64em) {
  .overview-grid { gap: 1.25rem; }
  .allocation-panel { padding: 1.55rem 1.65rem; }
  thead { display: table-header-group; color: var(--muted); }
  tbody { display: table-row-group; }
  tbody tr { display: table-row; }
  thead th, td, tbody th { display: table-cell; text-align: left; padding: .68rem .6rem; overflow-wrap: anywhere; }
  thead th:first-child, tbody th { padding-left: .95rem; }
  thead th { font-size: .85rem; font-weight: 615; background: #e9efe4; }
  td { font-size: .92rem; }
  td::before { display: none; }
  .row-actions { display: table-cell; white-space: nowrap; }
  .row-actions a { display: inline-flex; align-items: center; }
}
@media (max-width: 24em) {
  .transaction summary { grid-template-areas: "kind name cash down" ". date cash down" ". qty cash down"; grid-template-columns: 3.75rem minmax(0, 1fr) auto .55rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
