:root {
    color-scheme: light;
    --bg: #f1f8f1;
    --ink: #17271d;
    --muted: #65776a;
    --line: #c9ddcd;
    --panel: #fbfefb;
    --header-bg: #e8f4ea;
    --field-bg: #ffffff;
    --field-border: #aecab6;
    --table-line: #dcebdd;
    --soft-panel: #f4faf4;
    --accent: #2f7a4e;
    --accent-strong: #1f5a39;
    --button-bg: var(--accent);
    --button-hover: var(--accent-strong);
    --button-ink: #ffffff;
    --amber: #8f7118;
    --danger: #b42318;
    --danger-bg: #fff1ef;
    --danger-line: #f3b7b0;
    --success-bg: #edf8ef;
    --success-line: #acd8b9;
    --positive: #1f7a45;
    --shadow: 0 18px 40px rgba(31, 88, 54, 0.09);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #111418;
    --ink: #f0f3f6;
    --muted: #a8b0bb;
    --line: #313943;
    --panel: #1a2027;
    --header-bg: #151a20;
    --field-bg: #12171d;
    --field-border: #3b4653;
    --table-line: #2c3540;
    --soft-panel: #202832;
    --accent: #7dd3c7;
    --accent-strong: #a7efe6;
    --button-bg: #2f6f7a;
    --button-hover: #3a8390;
    --button-ink: #ffffff;
    --amber: #f0b35a;
    --danger: #ff9c92;
    --danger-bg: #341d1f;
    --danger-line: #7e3834;
    --success-bg: #132a27;
    --success-line: #2d6c64;
    --positive: #78d69d;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

:root[data-theme="blue"] {
    color-scheme: light;
    --bg: #eef7fd;
    --ink: #172536;
    --muted: #66788c;
    --line: #c9deee;
    --panel: #fbfdff;
    --header-bg: #e2f1fb;
    --field-bg: #ffffff;
    --field-border: #abc8dc;
    --table-line: #dbeaf4;
    --soft-panel: #f1f8fd;
    --accent: #1b6fa8;
    --accent-strong: #124d77;
    --button-bg: var(--accent);
    --button-hover: var(--accent-strong);
    --button-ink: #ffffff;
    --amber: #9b6714;
    --danger: #b42318;
    --danger-bg: #fff0ef;
    --danger-line: #f1b2ad;
    --success-bg: #edf8f5;
    --success-line: #a9d7ce;
    --positive: #137a4d;
    --shadow: 0 18px 40px rgba(30, 79, 115, 0.10);
}

:root[data-theme="green"] {
    color-scheme: dark;
    --bg: #0d1712;
    --ink: #eef7f0;
    --muted: #a4b9ad;
    --line: #294136;
    --panel: #14231b;
    --header-bg: #101d16;
    --field-bg: #0e1913;
    --field-border: #345444;
    --table-line: #263f33;
    --soft-panel: #193025;
    --accent: #8bd9a7;
    --accent-strong: #b9f0ca;
    --button-bg: #326f4b;
    --button-hover: #3d8259;
    --button-ink: #ffffff;
    --amber: #e1bd69;
    --danger: #ff9c92;
    --danger-bg: #321e1c;
    --danger-line: #804039;
    --success-bg: #143123;
    --success-line: #38734f;
    --positive: #9be0af;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.30);
}

:root[data-theme="contrast-light"] {
    color-scheme: light;
    --bg: #ffffff;
    --ink: #000000;
    --muted: #222222;
    --line: #000000;
    --panel: #ffffff;
    --header-bg: #ffffff;
    --field-bg: #ffffff;
    --field-border: #000000;
    --table-line: #000000;
    --soft-panel: #ffffff;
    --accent: #000000;
    --accent-strong: #000000;
    --button-bg: #000000;
    --button-hover: #333333;
    --button-ink: #ffffff;
    --amber: #000000;
    --danger: #b00020;
    --danger-bg: #ffffff;
    --danger-line: #b00020;
    --success-bg: #ffffff;
    --success-line: #006b2e;
    --positive: #006b2e;
    --shadow: none;
}

:root[data-theme="contrast-dark"] {
    color-scheme: dark;
    --bg: #000000;
    --ink: #ffffff;
    --muted: #ffffff;
    --line: #ffffff;
    --panel: #000000;
    --header-bg: #000000;
    --field-bg: #000000;
    --field-border: #ffffff;
    --table-line: #ffffff;
    --soft-panel: #000000;
    --accent: #ffffff;
    --accent-strong: #ffffff;
    --button-bg: #ffffff;
    --button-hover: #dddddd;
    --button-ink: #000000;
    --amber: #ffffff;
    --danger: #ff5c5c;
    --danger-bg: #000000;
    --danger-line: #ff5c5c;
    --success-bg: #000000;
    --success-line: #5cff8d;
    --positive: #5cff8d;
    --shadow: none;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

.app-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding: 32px clamp(18px, 4vw, 48px) 20px;
    border-bottom: 1px solid var(--line);
    background: var(--header-bg);
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.edit-link {
    display: inline-flex;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 900;
    text-decoration: none;
    text-transform: uppercase;
}

.top-links {
    display: flex;
    gap: 14px;
    margin-bottom: 8px;
}

.header-actions {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.theme-switcher {
    position: relative;
}

.theme-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--ink);
    box-shadow: var(--shadow);
}

.theme-button:hover,
.theme-switcher:focus-within .theme-button {
    background: var(--soft-panel);
}

.theme-icon {
    position: relative;
    display: block;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-radius: 999px;
    overflow: hidden;
}

.theme-icon::after {
    content: "";
    position: absolute;
    inset: -2px -2px -2px 50%;
    background: currentColor;
}

.theme-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 10;
    display: none;
    min-width: 170px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.theme-switcher.is-open .theme-menu,
.theme-switcher:focus-within .theme-menu {
    display: grid;
    gap: 4px;
}

.theme-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 34px;
    width: 100%;
    padding: 7px 9px;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    text-align: left;
}

.theme-option:hover,
.theme-option.is-active {
    background: var(--soft-panel);
    color: var(--accent-strong);
}

.edit-link:hover {
    color: var(--accent-strong);
}

.auth-shell {
    min-height: 100vh;
    align-content: center;
    padding: 24px;
}

.auth-panel {
    width: min(420px, 100%);
    margin: 0 auto;
}

.auth-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.auth-note {
    margin-top: 16px;
}

.auth-note a {
    color: var(--accent);
    font-weight: 800;
}

.auth-choice-group {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.auth-choice-group legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.auth-choice-group small {
    color: var(--muted);
}

.choice-buttons,
.auth-theme-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.choice-buttons button {
    width: auto;
}

.auth-theme-row {
    justify-content: space-between;
}

.auth-theme-row > span {
    color: var(--muted);
    font-weight: 800;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

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

h1 {
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1;
    letter-spacing: 0;
}

h2 {
    font-size: 1.15rem;
}

h3 {
    font-size: 1rem;
}

main {
    display: grid;
    gap: 22px;
    padding: 24px clamp(18px, 4vw, 48px) 48px;
}

.header-total,
.summary-grid article,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.header-total {
    min-width: 220px;
    padding: 16px 18px;
    text-align: right;
}

.display-header-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    width: min(760px, 100%);
}

.display-header-totals .header-total {
    min-width: 0;
}

.header-total span,
.summary-grid span,
.currency-strip span,
label,
small,
.section-heading p,
.allocation small {
    color: var(--muted);
    font-size: 0.82rem;
}

.header-total strong {
    display: block;
    margin-top: 2px;
    font-size: 1.3rem;
}

.header-total small {
    display: block;
    margin-top: 2px;
}

.alert,
.notice {
    padding: 14px 16px;
    border-radius: 8px;
    font-weight: 700;
}

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

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

.inline-notice,
.inline-error {
    display: inline-flex;
    margin: -6px 0 14px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 800;
}

.inline-notice {
    border: 1px solid var(--success-line);
    background: var(--success-bg);
    color: var(--accent-strong);
}

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

.compact-feedback {
    align-self: end;
    margin: 0;
    min-height: 40px;
    align-items: center;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    gap: 14px;
}

.display-summary {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.summary-break {
    grid-column: 1 / -1;
    height: 0;
}

.summary-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    border-style: dashed !important;
    background: var(--soft-panel) !important;
}

.summary-separator span {
    font-weight: 800;
    color: var(--muted);
}

.display-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.display-controls form {
    margin: 0;
}

.display-controls button {
    width: auto;
}

.summary-grid article {
    padding: 16px;
}

.summary-grid strong {
    display: block;
    margin-top: 6px;
    font-size: 1.15rem;
}

.subvalue {
    display: block;
    margin-top: 4px;
}

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

.negative {
    color: var(--danger);
}

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

.panel {
    padding: 18px;
}

.display-category table {
    min-width: 760px;
}

.budget-detail-table {
    table-layout: fixed;
}

.budget-detail-table th:nth-child(1),
.budget-detail-table td:nth-child(1) {
    width: 32%;
}

.budget-detail-table th:nth-child(2),
.budget-detail-table td:nth-child(2) {
    width: 18%;
}

.budget-detail-table th:nth-child(3),
.budget-detail-table td:nth-child(3) {
    width: 16%;
}

.budget-detail-table th:nth-child(4),
.budget-detail-table td:nth-child(4),
.budget-detail-table th:nth-child(5),
.budget-detail-table td:nth-child(5) {
    width: 17%;
}

.display-detail-table {
    table-layout: fixed;
}

.display-detail-table th:nth-child(1),
.display-detail-table td:nth-child(1) {
    width: 26%;
}

.display-detail-table th:nth-child(2),
.display-detail-table td:nth-child(2) {
    width: 17%;
}

.display-detail-table th:nth-child(3),
.display-detail-table td:nth-child(3) {
    width: 12%;
}

.display-detail-table th:nth-child(4),
.display-detail-table td:nth-child(4),
.display-detail-table th:nth-child(5),
.display-detail-table td:nth-child(5),
.display-detail-table th:nth-child(6),
.display-detail-table td:nth-child(6) {
    width: 13%;
}

.display-detail-table th:nth-child(7),
.display-detail-table td:nth-child(7) {
    width: 6%;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.section-heading:has(.section-actions) {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.holdings-heading {
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.section-feedback {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.section-feedback .compact-feedback {
    margin-top: 0;
}

.rates-heading {
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

.rates-left,
.add-currency-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rates-left h2 {
    align-self: flex-start;
    padding-top: 8px;
}

.add-currency-inline {
    margin: 0;
}

.add-currency-inline span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.add-currency-inline input {
    width: 160px;
}

.add-currency-inline button {
    width: auto;
}

.section-actions,
.table-actions {
    display: flex;
    align-items: end;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.table-actions {
    justify-content: flex-start;
    margin-bottom: 12px;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 22px;
}

.entry-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.holding-form {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.rate-form {
    grid-template-columns: 100px minmax(160px, 1fr) minmax(160px, 1fr) auto;
}

.add-currency-form {
    grid-template-columns: minmax(140px, 180px) auto;
    justify-content: start;
}

.add-currency-form button {
    width: auto;
}

.sort-form {
    margin: 0;
}

.sort-form label {
    width: 180px;
}

.sort-form select {
    min-height: 40px;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.wide {
    grid-column: span 2;
}

input,
select,
button {
    width: 100%;
    min-height: 40px;
    border-radius: 6px;
    font: inherit;
}

input,
select {
    border: 1px solid var(--field-border);
    background: var(--field-bg);
    color: var(--ink);
    padding: 8px 10px;
}

input.field-invalid,
select.field-invalid {
    border-color: var(--danger);
    background: var(--danger-bg);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent);
}

button {
    align-self: end;
    border: 0;
    background: var(--button-bg);
    color: var(--button-ink);
    cursor: pointer;
    font-weight: 800;
    padding: 9px 14px;
}

button:hover {
    background: var(--button-hover);
}

.delete-form,
.mini-form,
.cell-form,
.inline-action {
    margin: 0;
}

.mini-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(78px, 1fr)) auto;
    gap: 6px;
    min-width: 320px;
}

.mini-form input,
.mini-form button {
    min-height: 32px;
}

.mini-form button {
    padding: 6px 10px;
}

.account-mini-form {
    grid-template-columns: minmax(96px, 130px) auto;
    min-width: 190px;
}

.delete-form button {
    min-height: 32px;
    background: transparent;
    border: 1px solid var(--danger-line);
    color: var(--danger);
}

.delete-form button:hover {
    background: var(--danger-bg);
}

.inline-action button {
    min-width: 130px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

th,
td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--table-line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

tfoot th {
    border-top: 2px solid var(--line);
    color: var(--ink);
    font-size: 0.9rem;
}

.subtotal-row th {
    background: var(--header-bg);
    color: var(--ink);
}

.budget-disclosures {
    display: grid;
    gap: 10px;
}

.nested-disclosures {
    padding: 12px;
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.budget-group,
.display-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft-panel);
    overflow: hidden;
}

.budget-group summary,
.display-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    padding: 12px 14px;
    font-weight: 800;
}

.budget-group summary span:first-child,
.display-group summary span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.budget-group summary span:first-child::before,
.display-group summary span:first-child::before {
    content: "";
    display: inline-flex;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.budget-group[open] summary span:first-child::before,
.display-group[open] summary span:first-child::before {
    transform: rotate(225deg);
}

.budget-group summary::marker,
.display-group summary::marker {
    content: "";
}

.budget-group .table-wrap,
.display-group .table-wrap {
    background: var(--panel);
    border-top: 1px solid var(--line);
}

.budget-disposable {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    font-weight: 900;
}

.graph-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 14px;
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.graph-card {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft-panel);
}

.graph-card h3 small {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.profit-loss-grid {
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
    gap: 16px;
    padding: 14px;
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.profit-loss-total {
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft-panel);
}

.profit-loss-total span,
.profit-loss-total small {
    color: var(--muted);
    font-size: 0.82rem;
}

.profit-loss-total strong {
    font-size: 1.25rem;
}

.profit-loss-category-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.profit-loss-category-list div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: baseline;
}

.profit-loss-category-list strong {
    font-size: 0.92rem;
    text-align: right;
}

.profit-loss-list {
    display: grid;
    gap: 10px;
}

.profit-loss-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
}

.profit-loss-row span {
    min-width: 0;
}

.profit-loss-row strong,
.profit-loss-row small {
    display: block;
}

.profit-loss-row span > strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-chart {
    display: grid;
    gap: 12px;
}

.pie-chart-wrap {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 20px;
    align-items: center;
}

.pie-chart {
    width: min(320px, 100%);
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 50%;
    box-shadow: inset 0 0 0 14px var(--panel);
}

.pie-legend {
    display: grid;
    gap: 10px;
}

.pie-legend-row {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
}

.pie-legend-row strong,
.pie-legend-row small {
    display: block;
}

.pie-legend-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.legend-swatch {
    width: 12px;
    height: 12px;
    margin-top: 5px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.bar-row {
    display: grid;
    gap: 7px;
}

.bar-row-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
}

.bar-row-heading span {
    min-width: 0;
}

.bar-row-heading span:last-child {
    text-align: right;
}

.bar-row-heading strong,
.bar-row-heading small {
    display: block;
}

.bar-row-heading strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--field-bg);
    border: 1px solid var(--line);
}

.bar-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.empty-state {
    color: var(--muted);
    font-weight: 700;
}

td strong,
td small {
    display: block;
}

.currency-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.currency-strip div,
.rate-list > span,
.allocation-row {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft-panel);
}

.currency-strip div {
    padding: 12px;
}

.currency-chip {
    position: relative;
    padding-right: 72px;
}

.currency-chip.is-base {
    border-width: 2px;
    border-color: var(--field-border);
}

:root[data-theme="contrast-light"] .currency-chip.is-base,
:root[data-theme="contrast-dark"] .currency-chip.is-base {
    border-width: 3px;
    border-color: var(--ink);
}

:root[data-theme="dark"] .currency-chip.is-base,
:root[data-theme="green"] .currency-chip.is-base {
    border-color: #8fa3b8;
}

:root[data-theme="green"] .currency-chip.is-base {
    border-color: var(--button-bg);
}

.currency-chip:hover .chip-delete-form,
.currency-chip:focus-within .chip-delete-form {
    opacity: 1;
    pointer-events: auto;
}

.currency-strip strong {
    display: block;
}

.holdings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 18px;
}

.allocation {
    display: grid;
    align-content: start;
    gap: 12px;
}

.allocation-row {
    padding: 10px;
}

.allocation-row div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

meter {
    width: 100%;
    height: 10px;
}

.rate-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rate-list span {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    color: var(--muted);
    font-size: 0.86rem;
}

.rate-chip {
    position: relative;
    padding-right: 72px;
}

.chip-delete-form {
    margin: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.15s ease;
}

.rate-chip:hover .chip-delete-form,
.rate-chip:focus-within .chip-delete-form {
    opacity: 1;
    pointer-events: auto;
}

.chip-delete-form button {
    min-height: 28px;
    width: auto;
    border: 1px solid var(--danger-line);
    background: var(--danger-bg);
    color: var(--danger);
    padding: 4px 8px;
}

.rate-list small {
    font-size: 0.72rem;
}

.rate-chip strong {
    color: var(--ink);
    font-size: 0.9rem;
}

@media (max-width: 1100px) {
    .summary-grid,
    .two-column,
    .holdings-layout,
    .graph-grid,
    .profit-loss-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .app-header {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .theme-switcher {
        align-self: flex-start;
    }

    .header-total {
        text-align: left;
    }

    .summary-grid,
    .entry-form,
    .holding-form,
    .rate-form {
        grid-template-columns: 1fr;
    }

    .pie-chart-wrap {
        grid-template-columns: 1fr;
    }

    .wide {
        grid-column: auto;
    }
}
