* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { width: 100%; max-width: 100%; overflow-x: clip; }

body { margin: 0; min-width: 320px; background: var(--paper); }

a { color: inherit; text-decoration: none; }

button, input, textarea, select { font: inherit; }

nav { display: flex; gap: 8px; }

nav a { padding: 9px 13px; color: var(--muted); border-radius: 8px; font-size: 14px; font-weight: 600; }

nav a:hover { background: var(--paper); color: var(--ink); }

.shell { width: min(1380px, calc(100% - 48px)); max-width: calc(100% - 48px); margin: 0 auto; padding: 34px 0 64px; min-height: calc(100vh - 130px); }

.shell > * { max-width: 100%; }

h1, h2, h3, p { margin-top: 0; }

h1 { margin-bottom: 10px; font-size: clamp(30px, 4vw, 48px); line-height: 1.04; letter-spacing: -.045em; }

h2 { margin-bottom: 0; font-size: 21px; letter-spacing: -.025em; }

h3 { font-size: 20px; letter-spacing: -.02em; }

.muted { color: var(--muted); }

.nowrap { white-space: nowrap; }

.section-heading, .page-heading { display: flex; justify-content: space-between; align-items: flex-end; }

.section-heading { margin: 42px 0 17px; }

.page-heading { margin: 10px 0 28px; }

.page-heading h1 { font-size: 36px; }

.page-heading p:last-child { margin: 0; color: var(--muted); }

.breadcrumbs { display: flex; gap: 9px; margin-bottom: 25px; color: var(--muted); font-size: 13px; }

.breadcrumbs a { color: var(--forest); font-weight: 650; }

.status { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 99px; font-size: 11px; font-weight: 750; white-space: nowrap; }

.status.working { color: var(--forest); background: var(--mint); }

.status.ready { color: var(--green-strong); background: var(--green-bg); }

.status.review { color: var(--red); background: var(--red-bg); }

.status.neutral { color: var(--muted); background: var(--line); }

.panel { padding: var(--space-5); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-l); }

.panel.flush { padding: 0; overflow: hidden; margin-bottom: 18px; }

.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 19px; }

.panel-heading.padded { padding: var(--space-5) var(--space-5) 5px; }

.panel > p { color: var(--muted); line-height: 1.5; }

.file-drop { position: relative; padding: 16px; display: flex; align-items: center; gap: 13px; overflow: hidden; border: 1px dashed var(--line-strong); border-radius: 11px; cursor: pointer; background: var(--surface); transition: background-color var(--motion-base) ease, border-color var(--motion-base) ease; }

.file-drop:hover { border-color: var(--forest); }

.file-drop:focus-within { border-color: var(--forest); outline: 3px solid var(--green-line); outline-offset: 2px; }

.file-drop.has-file { border-color: var(--green-strong); background: var(--green-bg-soft); }

.file-drop.has-file .file-icon { color: white; background: var(--forest); }

.file-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }

.file-drop strong, .file-drop small { display: block; }

.file-drop small { margin-top: 4px; color: var(--muted); }

.file-icon { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; color: var(--forest); background: var(--mint); border-radius: 9px; font-size: 11px; font-weight: 850; }

.file-icon.small { width: 35px; height: 35px; }

.button { min-height: var(--control-height); padding: 0 var(--space-4); display: inline-flex; justify-content: center; align-items: center; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 750; font-size: 13px; transition: color var(--motion-fast) ease, background-color var(--motion-fast) ease, border-color var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out); }

.button.primary { color: white; background: var(--forest); }

.button.primary:hover { background: var(--forest-2); }

.button.secondary { color: var(--ink); background: white; border-color: var(--line); }

.button.secondary:hover { background: var(--surface); border-color: var(--line-strong); }

.button.warning { color: var(--amber); background: var(--amber-bg); }

.button.small { min-height: var(--control-height-compact); padding: 0 var(--space-3); }

.button.full { width: 100%; }

.button.ghost { color: var(--muted); background: transparent; border-color: var(--line); font-weight: 600; }

.button.ghost:hover { color: var(--forest); background: var(--green-bg-soft); border-color: var(--green-line); }

.button.ghost.danger-ghost:hover { color: var(--red); background: var(--red-bg-soft); border-color: var(--red-line); }

.button:not(:disabled):active { transform: translateY(1px); }

.heading-actions { display: flex; gap: 8px; }

.edit-form { display: grid; gap: 16px; }

.edit-form label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 720; }

.edit-form label > small { color: var(--muted); font-weight: 400; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 13px; }

input, select { min-height: var(--control-height); }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
select { height: var(--control-height); }

input, textarea, select { width: 100%; padding: 10px 11px; color: var(--ink); background-color: white; border: 1px solid var(--line-strong); border-radius: var(--control-radius); outline: 0; transition: background-color var(--motion-fast) ease, border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease; }

input[type="checkbox"], input[type="radio"] { min-height: 0; padding: 0; accent-color: var(--forest); }

select {
  padding-inline-end: 36px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none' stroke='%2346504c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

input:not(:disabled):not([readonly]):hover, textarea:not(:disabled):hover, select:not(:disabled):hover { border-color: var(--muted); }

input:focus, textarea:focus, select:focus { border-color: var(--forest); box-shadow: var(--focus-ring); }

input[readonly] { color: var(--muted); background: var(--surface-2); cursor: not-allowed; }

textarea { resize: vertical; }

.alert { margin-bottom: 18px; padding: 13px 16px; border-radius: 10px; font-size: 13px; font-weight: 650; }

.alert.success { color: var(--green-strong); background: var(--green-bg); border: 1px solid var(--green-line); }

.alert.error { color: var(--red); background: var(--red-bg); border: 1px solid var(--red-line); }

.form-hint { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

@media (max-width: 680px) {
  .shell { width: min(100% - 28px, 1380px); padding-top: 22px; }
  .panel { padding: 19px; }
  .panel-heading.padded { padding: 19px 19px 5px; }
  .page-heading { align-items: flex-start; gap: 14px; }
  .page-heading h1 { font-size: 29px; }
  .heading-actions { align-items: stretch; flex-direction: column; }
}

.status.info { color: var(--muted-2); background: var(--surface-2); }

.status.working { color: var(--muted-2); background: var(--surface-2); }

.panel-heading h3 { margin: 0; font-size: 18px; }

.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.disclosure-panel { padding: 0; overflow: hidden; }

.disclosure-summary { min-height: 82px; padding: 20px 24px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; list-style: none; cursor: pointer; }

.disclosure-summary::-webkit-details-marker { display: none; }

.disclosure-summary strong, .disclosure-summary small { display: block; }

.disclosure-summary strong { color: var(--forest); font-size: 15px; }

.disclosure-summary small { margin-top: 4px; color: var(--muted-2); font-size: var(--text-xs); font-weight: 500; }

.disclosure-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--forest); background: var(--mint); border-radius: var(--radius-m); font-size: 20px; line-height: 1; transition: transform var(--motion-base) var(--ease-out); }

.disclosure-label { color: var(--muted-2); font-size: var(--text-xs); font-weight: 700; }

details[open] > .disclosure-summary .disclosure-icon { transform: rotate(45deg); }

.disclosure-body { margin: 0 24px 24px; padding-top: 20px; border-top: 1px solid var(--line); }

.file-drop.compact { min-height: 42px; padding: 7px 9px; }

.column-filter { position: relative; }

.column-filter > summary { width: 20px; height: 20px; display: grid; place-items: center; color: var(--muted); background: var(--surface-2); border-radius: 5px; list-style: none; cursor: pointer; font-size: 12px; }

.column-filter > summary::-webkit-details-marker { display: none; }

.column-filter[open] > summary { color: white; background: var(--forest); }

.column-filter-menu { width: 225px; padding: 10px; position: absolute; top: 26px; left: 0; z-index: 30; display: grid; gap: 9px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); text-align: left; text-transform: none; letter-spacing: 0; }

.column-filter-menu.wide { width: 280px; }

.column-filter-menu label { display: grid; gap: 5px; color: var(--muted-2); font-size: 9px; font-weight: 700; }

.column-filter-menu input, .column-filter-menu select { min-height: var(--control-height-compact); height: var(--control-height-compact); padding: 7px 8px; font-size: 10px; }

.column-filter-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.column-filter-actions > a { color: var(--muted); font-size: 9px; }

.board-search-form { height: 36px; display: flex; align-items: center; overflow: hidden; background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius-s); }

.board-search-form:focus-within { border-color: var(--forest); box-shadow: 0 0 0 2px var(--mint); }

.board-search-form label { display: block; }

.board-search-form input { width: 148px; min-height: 34px; height: 34px; padding: 7px 4px 7px 10px; border: 0; outline: 0; font-size: 11px; }

.board-search-form button { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; color: var(--muted-2); background: transparent; border: 0; cursor: pointer; }

.board-search-form button:hover { color: var(--forest); }

.board-search-form svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.column-filter { width: 24px; height: 24px; position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 6px; }

.column-filter:hover, .column-filter.active { color: var(--forest); background: var(--mint); }

.column-filter select { min-width: 0; width: 24px; height: 24px; min-height: 0; position: absolute; inset: 0; z-index: 2; cursor: pointer; opacity: .001; }

.column-filter svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; pointer-events: none; }

.empty-note { margin: 0; padding: 22px 25px; color: var(--muted); font-size: 12px; }

* { scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }

:focus-visible { outline: 3px solid var(--green-line); outline-offset: 2px; }

.skip-link { padding: 9px 13px; position: fixed; left: 12px; top: 10px; z-index: 100; color: var(--white); background: var(--forest-2); border-radius: var(--radius-s); transform: translateY(-160%); transition: transform .16s ease-out; }

.skip-link:focus { transform: translateY(0); }

.sr-only { width: 1px; height: 1px; padding: 0; position: absolute; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.shell > .panel + .panel { margin-top: var(--space-5); }

.button:disabled { opacity: .48; cursor: not-allowed; }

.button.danger { color: var(--white); background: var(--red); }

.button.danger:hover { background: var(--red-strong); }

.identity { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }

.identity > span { min-width: 0; }

.identity strong, .identity small { display: block; }

.identity strong { font-size: 13px; }

.identity small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.identity-mark { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; color: var(--forest); background: var(--mint); border-radius: 10px; font-size: 10px; font-style: normal; font-weight: 800; }

@media (max-width: 760px) {
  .disclosure-summary { min-height: 74px; padding: 18px; }
  .disclosure-body { margin-inline: 18px; }
}

.acquired-source { margin: 13px 20px 0; min-height: 50px; padding: 8px 9px 8px 11px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; background: var(--green-bg-soft); border: 1px solid var(--green-line); border-radius: var(--radius-m); }

.acquired-source-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--forest); background: var(--white); border-radius: var(--radius-s); }

.acquired-source-icon svg, .source-icon-action svg, .source-remove > summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.acquired-source-copy { min-width: 0; }

.acquired-source-copy strong, .acquired-source-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.acquired-source-copy strong { font-size: var(--text-s); }

.acquired-source-copy small { margin-top: 3px; color: var(--muted-2); font-size: var(--text-xs); }

.source-icon-action, .source-remove > summary { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius-s); cursor: pointer; }

.source-icon-action { color: var(--forest); }

.source-icon-action:hover, .source-icon-action:focus-visible { background: var(--mint); outline: 0; }

.source-remove { position: relative; }

.source-remove > summary { color: var(--red); list-style: none; }

.source-remove > summary::-webkit-details-marker { display: none; }

.source-remove > summary:hover, .source-remove > summary:focus-visible { background: var(--red-bg); outline: 0; }

.source-remove .popout-panel { width: 300px; padding: 14px; position: absolute; right: 0; top: 38px; z-index: 30; display: grid; gap: 10px; background: var(--white); border: 1px solid var(--red-line); border-radius: var(--radius-m); box-shadow: var(--shadow); }

.source-remove .popout-panel > p { margin: 0; color: var(--muted); font-size: var(--text-xs); line-height: 1.5; }

.source-remove .popout-panel form { display: flex; justify-content: flex-end; }

.interest-ledger-row strong,
.interest-ledger-row small { display: block; }

.interest-ledger-row strong { font-size: var(--text-s); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.interest-ledger-row small { margin-top: 4px; color: var(--muted); font-size: var(--text-xs); line-height: 1.4; overflow-wrap: anywhere; }

.popout-panel[data-portal-open] { max-height: min(560px, calc(100vh - 40px)); padding: 15px; position: fixed; z-index: 100; display: grid; gap: 12px; overflow-y: auto; overscroll-behavior: contain; color: var(--ink); text-align: left; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow-lift); transform-origin: top right; animation: popout-in var(--motion-base) var(--ease-out) both; }

@keyframes popout-in { from { opacity: .72; transform: translateY(-4px) scale(.985); box-shadow: var(--shadow); } }

@media (max-width: 760px) {
  .board-search-form { width: 100%; }
  .board-search-form label, .board-search-form input { width: 100%; }
  .acquired-source { margin-inline: 17px; }
}

html { color-scheme: light; scrollbar-color: var(--line-strong) var(--paper); }

::selection { color: var(--ink); background: var(--mint); }

*::-webkit-scrollbar { width: 10px; height: 10px; }

*::-webkit-scrollbar-thumb { background: var(--line-strong); border: 3px solid transparent; border-radius: 99px; background-clip: padding-box; }

*::-webkit-scrollbar-track { background: transparent; }

button, input, textarea, select { caret-color: var(--forest); }

select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: var(--white);
  color-scheme: light;
}

select::-ms-expand { display: none; }

.inline-selector { min-width: 286px; margin: 0; padding: 3px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }

.inline-selector.two-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.inline-selector label { position: relative; cursor: pointer; }

.inline-selector input { width: 1px; height: 1px; min-height: 0; position: absolute; opacity: 0; }

.inline-selector span, .inline-selector > a { min-height: 32px; padding: 0 var(--space-2); display: grid; place-items: center; color: var(--muted-2); border: 1px solid transparent; border-radius: 7px; font-size: var(--text-xs); font-weight: 700; }

.inline-selector input:checked + span, .inline-selector > a[aria-current="page"] { color: var(--forest); background: var(--white); border-color: var(--line); box-shadow: 0 2px 6px rgba(23,32,29,.06); }

.inline-selector input:focus-visible + span, .inline-selector > a:focus-visible { outline: 3px solid var(--green-line); outline-offset: 1px; }

@media (max-width: 680px) {
  .inline-selector { width: 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .shell, .popout-panel[data-portal-open] { animation-duration: 1ms; }
  .disclosure-icon { transition-duration: 1ms; }
}

@media (prefers-reduced-motion: reduce) {
  .ui-action-button .ui-action-icon, details summary i, .disclosure-summary .disclosure-icon {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

.inline-selector > a:not([aria-current="page"]):hover { background: transparent; color: var(--muted-2); }
