/* pt-sans-cyrillic-ext-400-normal */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(./fonts/pt-sans-cyrillic-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}

/* pt-sans-cyrillic-400-normal */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(./fonts/pt-sans-cyrillic-400-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

/* pt-sans-latin-ext-400-normal */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(./fonts/pt-sans-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* pt-sans-latin-400-normal */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(./fonts/pt-sans-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* pt-sans-cyrillic-ext-700-normal */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(./fonts/pt-sans-cyrillic-ext-700-normal.woff2) format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}

/* pt-sans-cyrillic-700-normal */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(./fonts/pt-sans-cyrillic-700-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

/* pt-sans-latin-ext-700-normal */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(./fonts/pt-sans-latin-ext-700-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* pt-sans-latin-700-normal */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(./fonts/pt-sans-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/** Shared colors for the workspace and native form controls. */
:root {
  color-scheme: dark;
  font-family: "PT Sans", system-ui, Arial, sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--background);
  --control-height: 37px;
  --icon-target: 38px;
  --form-font-size: 15px;
  --background: #101326;
  --surface: #181c33;
  --surface-subtle: #20243e;
  --ink: #f0eeff;
  --muted: #babfdb;
  --border: #343a56;
  --control-hover: #272b48;
  --field: #13172d;
  --field-border: #697097;
  --accent: #b8a6ff;
  --accent-hover: #c8baff;
  --on-accent: #1b1437;
  --focus: #c7b5ff;
  --outline-ink: #e6dfff;
  --active: #2e294d;
  --active-border: #8a77ce;
  --category-background: #252c53;
  --category-ink: #dbe2ff;
  --personal-background: #332749;
  --personal-ink: #efd9ff;
  --danger: #ffc6d6;
  --error-background: #412338;
  --error-border: #7b4863;
  --header: #14172d;
  --header-ink: #f6f3ff;
  --header-muted: #c0c3e0;
  --header-control: #222641;
  --header-border: #6d739a;
  --header-hover: #333752;
  --strong-surface: #2a2550;
  --strong-border: #615887;
  --on-strong: #f7f4ff;
  --strong-muted: #ddd4fd;
  --rail: #151b35;
  --received: #9ce0cd;
  --received-bg: #244145;
  --owed: #f6b7c6;
  --owed-bg: #482e46;
  --journal-row: var(--surface);
  --excluded-row: #2b3355;
}

:root[data-theme="light"] {
  color-scheme: light;
  --background: #f2f2fa;
  --surface: #fefeff;
  --surface-subtle: #eeeefa;
  --ink: #1b1d36;
  --muted: #515675;
  --border: #dcdded;
  --control-hover: #efedf9;
  --field: #fafaff;
  --field-border: #8288aa;
  --accent: #4e3a9c;
  --accent-hover: #3e2b86;
  --on-accent: #fff;
  --focus: #6743b7;
  --outline-ink: #3d2d79;
  --active: #ebe6fa;
  --active-border: #8468b8;
  --category-background: #e7ebfd;
  --category-ink: #323970;
  --personal-background: #f0e5fa;
  --personal-ink: #593775;
  --danger: #84294b;
  --error-background: #fce9f1;
  --error-border: #d797ae;
  --rail: #e9e9f8;
  --received: #145a49;
  --received-bg: #dcefe9;
  --owed: #822d4a;
  --owed-bg: #f9e3eb;
  --journal-row: #f1f1fa;
  --excluded-row: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-inline-size: 280px; line-height: 1.34; letter-spacing: .016em; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.topbar { background: var(--header); color: var(--header-ink); border-bottom: 1px solid var(--border); }
.topbar :focus-visible { outline-color: var(--header-muted); }
.topbar .outline { background: var(--header-control); border-color: var(--header-border); color: var(--header-ink); }
.topbar .outline:hover:not(:disabled) { background: var(--header-hover); }
.top-inner { width: min(100% - 64px, 1400px); margin-inline: auto; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand, .account { display: flex; gap: 14px; align-items: center; }
.brand { text-decoration: none; color: inherit; font-weight: 700; font-size: 20px; line-height: 1.06; flex: none; letter-spacing: .006em; }
.brand img { border-radius: 4px; }
.brand small { display: block; color: var(--header-muted); font-size: 11px; letter-spacing: .025em; margin-top: 5px; font-weight: 400; }
.account { min-width: 0; color: var(--header-muted); font-size: 14px; }
.account > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.button { border: 1px solid transparent; border-radius: 4px; min-height: var(--control-height); padding: 6px 13px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 650; font-size: 14px; line-height: 1.2; }
.button span { font-size: 19px; line-height: .8; }
.primary { color: var(--on-accent); background: var(--accent); }
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.outline { color: var(--outline-ink); background: var(--surface); border-color: var(--field-border); }
.outline:hover:not(:disabled) { background: var(--control-hover); }
.link { border: 0; padding: 6px 0; min-height: var(--control-height); background: none; color: var(--outline-ink); text-decoration: underline; text-underline-offset: 4px; font-weight: 650; }
.workspace { width: min(100% - 64px, 1400px); margin: 15px auto 56px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .115em; text-transform: uppercase; color: var(--muted); }
h1 { font-size: clamp(29px, 4.5vw, 45px); line-height: 1.05; letter-spacing: .002em; font-weight: 700; margin-top: 8px; }
h2 { font-size: 19px; letter-spacing: .008em; line-height: 1.2; }
.overview-summaries {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 10px 16px;
  margin-bottom: 12px;
}
.summary-title { margin-bottom: 6px; font-size: 15px; }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 12px; }
.overview-expenses { margin-bottom: 10px; }
.summary.overview-expense-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { display: grid; align-content: center; min-height: 43px; gap: 1px; padding: 4px 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; }
.stat span { color: var(--muted); font-size: 11px; font-weight: 650; line-height: 1.2; }
.stat strong { font-size: 17px; line-height: 1.15; overflow-wrap: anywhere; }
.stat-balance { background: var(--strong-surface); color: var(--on-strong); border-color: var(--strong-border); }
.stat-balance span { color: var(--strong-muted); }
.detail { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; min-width: 0; }
#add-party { min-width: var(--icon-target); padding: 0; flex: none; }
input, select, textarea { width: 100%; min-width: 0; min-height: var(--control-height); color: var(--ink); background: var(--field); border: 1px solid var(--field-border); border-radius: 4px; padding: 5px 10px; font-size: var(--form-font-size); line-height: 1.24; }
input[type="date"] { display: block; appearance: none; }
textarea { resize: vertical; min-height: 56px; }
.list-empty { padding: 5px 16px 17px; font-size: 14px; color: var(--muted); }
.detail { min-height: 314px; }
.detail-head { display: flex; justify-content: space-between; gap: 9px 11px; flex-wrap: wrap; padding: 14px 17px 12px; }
.detail-head h2 { overflow-wrap: anywhere; font-size: clamp(20px, 2.75vw, 28px); }
.detail-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 9px; }
.kind { display: inline-block; background: var(--category-background); color: var(--category-ink); border-radius: 4px; padding: 4px 7px; font-size: 12px; font-weight: 650; margin-top: 7px; }
.kind.personal { background: var(--personal-background); color: var(--personal-ink); }
.detail-totals { margin-inline: 19px; background: var(--surface-subtle); border: 1px solid var(--border); padding: 8px 13px; border-radius: 4px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 12px; }
.detail-totals span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.detail-totals strong { font-size: 15px; overflow-wrap: anywhere; }
.journal-heading { padding: 14px 17px 8px; }
.table-wrap { overflow-x: auto; }
.journal-table { border-collapse: collapse; table-layout: fixed; width: 100%; font-size: 13px; line-height: 1.3; text-align: left; }
.date-article-column { width: 39%; }
.amount-column { width: clamp(69px, 11cqi, 108px); }
.actions-column { width: calc(var(--icon-target) + 2px); }
th { font-weight: 650; color: var(--muted); background: var(--surface-subtle); }
th, td { padding: 8px 10px; border-top: 1px solid var(--border); vertical-align: top; }
th:first-child, td:first-child { padding-left: 19px; }
th:last-child, td:last-child { padding-right: 12px; }
td { overflow-wrap: anywhere; }
.date-article { display: grid; grid-template-columns: 9ch minmax(0, 1fr); align-items: baseline; column-gap: 9px; }
.date-article time { white-space: nowrap; font-variant-numeric: tabular-nums; }
td.comment-cell { white-space: pre-wrap; }
.journal-table td:last-child, .journal-table th:last-child { padding-inline: 0; text-align: center; }
.stat strong, .detail-totals strong, .row-money, .operation-amount strong, .party-balance, .recent-amount strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: .025em;
}
.empty-detail { padding: 34px 22px; display: grid; place-content: center; justify-items: center; text-align: center; min-height: 313px; }
.empty-detail p, .journal-empty { color: var(--muted); margin-top: 8px; font-size: 14px; line-height: 1.5; }
.journal-empty { padding: 8px 19px 26px; }
.icon-button { padding: 0 9px; min-width: var(--icon-target); min-height: var(--icon-target); background: transparent; color: var(--outline-ink); border: 1px solid transparent; border-radius: 4px; font-size: 20px; line-height: 1; }
.icon-button:hover { background: var(--control-hover); }
.row-edit { font-size: 18px; margin: -5px 0; }
.auth { width: min(100% - 64px, 920px); margin: clamp(30px, 10vh, 114px) auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.auth-context { display: flex; flex-direction: column; padding: clamp(23px, 5vw, 50px); justify-content: center; color: var(--on-strong); background: var(--strong-surface); }
.auth-context .eyebrow { color: var(--strong-muted); }
.auth-heading { font-size: clamp(38px, 6vw, 66px); letter-spacing: .002em; line-height: 1; font-weight: 700; margin: 17px 0; }
.auth-context p:last-child { color: var(--strong-muted); font-size: 15px; line-height: 1.34; max-width: 24ch; }
.auth-panel { display: grid; align-content: center; padding: clamp(22px, 4vw, 47px); }
.auth-panel h1 { font-size: clamp(26px, 4vw, 36px); margin: 0 0 16px; }
.auth-panel label, .editor-fields label { display: grid; gap: 5px; color: var(--ink); font-size: 14px; font-weight: 600; }
#auth-form, .editor-fields { display: grid; gap: 11px; }
.auth-submit { margin-top: 4px; width: 100%; }
.auth-panel .link { justify-self: start; margin-top: 9px; }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.error { color: var(--danger); background: var(--error-background); border: 1px solid var(--error-border); padding: 9px 11px; border-radius: 4px; font-size: 14px; }
.page-error { margin-bottom: 14px; }
.startup { text-align: center; padding: 60px 20px 12px; color: var(--muted); }
.startup-retry { display: flex; margin: 0 auto; }
dialog { width: min(100% - 30px, 520px); max-height: calc(100% - 28px); overflow: auto; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--ink); padding: 18px 20px 20px; }
dialog::backdrop { background: #0b0d1cb5; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 9px; }
.dialog-head h2 { font-size: 24px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px 11px; margin-top: 16px; }
.two-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
#editor-error { margin-top: 12px; }
.delete-action { color: var(--danger); justify-self: start; }
.notice { position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); max-width: calc(100% - 32px); background: var(--strong-surface); color: var(--on-strong); border: 1px solid var(--strong-border); border-radius: 4px; padding: 12px 16px; font-size: 14px; }
@media (max-width: 850px) {
  .top-inner, .workspace { width: calc(100% - 32px); }
}
@media (max-width: 665px) {
  .top-inner { min-height: 57px; }
  .workspace { margin-top: 12px; }
  .auth { width: calc(100% - 32px); grid-template-columns: 1fr; }
  .auth-heading { font-size: 35px; margin-block: 10px; }
  .auth-heading br { display: none; }
  .auth-context p:last-child { max-width: none; }
  .summary { column-gap: 6px; }
  .stat { padding-inline: 6px; }
  .stat strong { font-size: 15px; }
  .detail { min-height: 200px; }
  .empty-detail { min-height: 200px; }
}
@media (max-width: 390px) {
  .top-inner { gap: 9px; }
  .brand { font-size: 17px; }
  .account > span, .brand small { display: none; }
  .two-fields { grid-template-columns: 1fr; }
}

.workspace, .top-inner { max-width: 1400px; }
.account { gap: 10px; }
.account .button { flex: none; }
.detail { container-type: inline-size; }
.journal-cards { display: none; }
.settings-email { color: var(--muted); overflow-wrap: anywhere; margin-bottom: 14px; }
.settings-theme, .settings-password label { display: grid; gap: 5px; font-size: 14px; font-weight: 600; }
.settings-theme { grid-template-columns: 1fr minmax(110px, 46%); align-items: center; }
#theme-status, #theme-error { margin-top: 8px; }
.settings-password { display: grid; gap: 11px; border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; }
.settings-password .button { justify-self: end; }
#export-party { overflow-wrap: anywhere; }
.checkbox { min-height: 44px; display: flex; align-items: center; gap: 10px; font-size: 14px; margin-top: 8px; }
.checkbox input { width: 17px; min-height: auto; height: 17px; flex: none; accent-color: var(--accent); }
@container (max-width: 500px) {
  .table-wrap { display: none; }
  .journal-cards { display: grid; list-style: none; margin: 0; padding: 0 14px 8px; }
  .journal-card { border-top: 1px solid var(--border); padding: 7px 0; overflow-wrap: anywhere; }
  .journal-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
  .journal-card-summary { display: grid; gap: 4px; min-width: 0; }
  .journal-card-summary .date-article { font-size: 13px; }
  .operation-amount { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 10px; }
  .journal-card-head time { color: var(--muted); font-size: 12px; }
  .journal-card-head strong { font-size: 15px; }
  .operation-side { border-radius: 4px; padding: 3px 6px; color: var(--category-ink); background: var(--category-background); font-size: 11px; }
  .operation-fields { margin: 7px 0 0; display: grid; gap: 4px; font-size: 13px; }
  .operation-fields div { display: grid; grid-template-columns: minmax(78px, 25%) minmax(0, 1fr); column-gap: 8px; }
  .operation-fields dt { color: var(--muted); }
  .operation-fields dd { margin: 0; white-space: pre-wrap; }
}
@media (max-width: 540px) {
  .account > span { display: none; }
  .top-inner, .workspace { width: calc(100% - 24px); }
  .account { gap: 6px; }
  .account .button { padding-inline: 8px; font-size: 13px; }
  .brand { gap: 8px; }
  .brand img { width: 30px; height: 30px; }
  .brand small { font-size: 10px; }
  .detail-head { padding-inline: 13px; }
  .detail-totals { margin-inline: 13px; }
  .detail-tools .button { padding-inline: 9px; }
}
@media (min-width: 700px) and (max-width: 1370px) and (any-pointer: coarse) {
  .top-inner { min-height: 62px; width: calc(100% - 42px); }
  .workspace { width: calc(100% - 42px); margin-top: 12px; }
  .summary { column-gap: 10px; }
  .detail-head { padding: 12px 15px 9px; }
  .detail-head h2 { font-size: clamp(18px, 2.4vw, 24px); }
  .detail-totals { margin-inline: 15px; padding: 7px 10px; }
  .journal-heading { padding: 11px 15px 7px; }
  th, td { padding: 7px 7px; }
  th:first-child, td:first-child { padding-left: 15px; }
}

.avatar {
  display: grid;
  place-items: center;
  border: 1px solid var(--header-border);
  border-radius: 50%;
  color: var(--on-strong);
  background: var(--strong-surface);
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
}
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-button { flex: none; width: 40px; height: 40px; padding: 0; font-size: 15px; }
.avatar-button:hover { background: var(--header-hover); }
.profile-form { display: grid; gap: 10px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.profile-form > .button { justify-self: end; }
.profile-form label, #register-name label { display: grid; gap: 5px; font-size: 14px; }
.profile-photo-row { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: center; }
.profile-avatar { width: 62px; height: 62px; font-size: 23px; }
.photo-options input { padding: 7px; }
.photo-options input::file-selector-button { font: inherit; color: var(--outline-ink); background: var(--surface-subtle); border: 0; padding: 4px 8px; margin-inline-end: 6px; }
@media (max-width: 1370px) and (pointer: coarse) {
  :root { --control-height: 44px; --icon-target: 44px; --form-font-size: 16px; }
  body { zoom: .9; }
  .avatar-button { width: 44px; height: 44px; }
}
@media (hover: hover) and (pointer: fine) {
  .stat { padding-block: 4px; }
  .stat span { font-size: 12px; }
  .stat strong { font-size: 19px; }
}

.app-shell { display: grid; grid-template-columns: clamp(186px, 21%, 258px) minmax(0, 1fr); gap: 16px 20px; align-items: start; }
.workspace-content { min-width: 0; }
.workspace-sidebar {
  position: sticky;
  top: 12px;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  background: var(--rail);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.mobile-menu { display: none; font-size: calc(14px + 1pt); }
.sidebar-views { display: grid; gap: 3px; padding: 9px; border-bottom: 1px solid var(--border); }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: var(--control-height);
  padding: 5px 9px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
}
.sidebar-link[aria-current="page"] .sidebar-label,
.sidebar-link:hover .sidebar-label,
.party-button[aria-current="true"] .party-name,
.party-button:hover .party-name,
.recent-item:hover .recent-info strong,
.recent-selection :is(time, .operation-article) {
  text-decoration-line: underline;
  text-decoration-color: var(--active-border);
  text-decoration-thickness: 1px;
  text-underline-offset: .28em;
}
.sidebar-symbol { width: 17px; color: var(--outline-ink); font-size: 16px; line-height: 1; text-align: center; }
.sidebar-count { margin-inline-start: auto; color: var(--muted); font-size: 12px; font-weight: 400; }
.sidebar-label { min-width: 0; overflow-wrap: anywhere; }
.workspace-sidebar .sidebar-link, .workspace-sidebar .party-group-title { font-size: calc(15px + 1pt); }
.workspace-sidebar .party-name { font-size: calc(14px + 1pt); }
.workspace-sidebar .party-balance, .workspace-sidebar .sidebar-count { font-size: calc(12px + 1pt); }
.sidebar-directory { padding: 9px; }
.sidebar-tools { display: flex; justify-content: flex-end; margin-bottom: 5px; }
.party-group + .party-group { border-top: 1px solid var(--border); }
.party-group-title { display: flex; align-items: baseline; gap: 8px; padding: 7px 5px; font-size: 15px; }
.party-list { margin: 0; padding: 1px 0 6px; list-style: none; }
.party-button {
  width: 100%;
  min-height: var(--control-height);
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: center;
  gap: 1px 10px;
  padding: 5px 9px;
  text-align: left;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
}
.party-dot { grid-row: span 2; width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--active-border); }
.party-name { font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.party-balance { grid-column: 2; color: var(--muted); font-size: 12px; }
.sidebar-directory .list-empty { padding: 8px; }
.overview-heading, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.overview-heading { margin: 0 0 9px; }
.overview-heading h1 { font-size: clamp(22px, 3.5vw, 30px); margin: 0; }
.overview-recent { border: 1px solid var(--border); border-radius: 4px; background: var(--surface); }
.panel-heading { padding: 8px 12px; }
.panel-heading h2 { font-size: 17px; line-height: 1.15; }
.recent-operations { padding: 0; margin: 0; list-style: none; }
.recent-operations li { border-top: 1px solid var(--border); }
.recent-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(79px, auto);
  align-items: center;
  column-gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 5px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.recent-info, .recent-amount { min-width: 0; overflow-wrap: anywhere; }
.recent-item strong { display: block; font-weight: 700; font-size: 14px; line-height: 1.2; }
.recent-info span, .recent-amount span { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; margin-top: 3px; }
.recent-amount { text-align: right; }
.recent-symbol { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 15px; line-height: 1; }
.recent-symbol.debit { color: var(--received); background: var(--received-bg); }
.recent-symbol.credit { color: var(--owed); background: var(--owed-bg); }
.recent-amount.debit strong { color: var(--received); }
.recent-amount.credit strong { color: var(--owed); }
.dashboard-back { color: var(--outline-ink); font-size: 14px; background: none; border: 0; min-height: var(--control-height); padding: 0 5px; margin-bottom: 4px; }
.dashboard-back:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 666px) and (max-width: 850px) {
  .app-shell { grid-template-columns: 173px minmax(0, 1fr); gap: 10px 12px; }
  .sidebar-link { gap: 8px; }
}
@media (max-width: 665px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mobile-menu { display: inline-flex; margin-bottom: 9px; }
  .workspace-sidebar { display: none; position: static; max-height: 53dvh; }
  .navigation-open .workspace-sidebar { display: block; }
  .panel-heading { padding: 7px 10px; }
  .recent-item { padding-inline: 9px; }
}

.journal-table tbody tr, .journal-card, .recent-item { background: var(--journal-row); }
.journal-table .excluded-entry, .journal-card.excluded-entry, .recent-item.excluded-entry { background: var(--excluded-row); }
.exclusion-label { display: block; margin-top: 3px; font-size: 11px; line-height: 1.2; color: var(--muted); }
.operation-amount .exclusion-label { margin-top: 0; }
.editor-fields .exclude-option { display: flex; margin-top: 0; }

.directory-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; }
.directory-panel .sidebar-directory { padding: 13px; }
.directory-panel .party-group-title { padding-inline: 10px; }
.directory-panel .party-group + .party-group { margin-top: 6px; }
.directory-panel .party-button {
  grid-template-columns: 8px minmax(0, 1fr) minmax(76px, auto);
  padding: 6px 11px;
  border-bottom-color: var(--border);
  border-radius: 0;
}
.directory-panel .party-dot { grid-row: auto; }
.directory-panel .party-balance { grid-column: auto; text-align: right; overflow-wrap: anywhere; }

.expenses-heading { gap: 8px 16px; }
.expense-month-picker {
  display: grid;
  grid-template-columns: var(--icon-target) minmax(0, 1fr) var(--icon-target);
  column-gap: 6px;
  inline-size: min(100%, calc(12rem + var(--icon-target) + var(--icon-target) + 12px));
}
.expense-month-picker :is(.month-arrow, select) { block-size: var(--control-height); }
.expense-month-picker .month-arrow { padding-inline: 6px; font-size: 20px; line-height: 1; }
.expense-summary { margin-bottom: 12px; }
.expense-panel { container-type: inline-size; margin-top: 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); }
.expenses-table {
  width: 100%;
  min-width: 320px;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
  line-height: 1.3;
}
.expense-date-column { width: 84px; }
.expense-amount-column { width: clamp(112px, 18cqi, 168px); }
.expenses-table td:first-child, .expenses-table th:first-child { padding-left: 10px; }
.expenses-table time { white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.expenses-table th:last-child, .expense-amount { text-align: right; }
.expense-amount { white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: .025em; }
.expense-article {
  display: block;
  width: 100%;
  min-height: 27px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  overflow-wrap: anywhere;
}
.expense-article:hover { text-decoration: underline; text-underline-offset: .22em; }
.expense-editor-actions #delete-expense { margin-inline-end: auto; }
.expense-article-field { position: relative; }
.expense-suggestions {
  position: absolute;
  z-index: 1;
  inset: 100% 0 auto;
  max-height: 175px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 3px 0 0;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--field-border);
  border-radius: 4px;
}
.expense-suggestions li { padding: 7px 9px; cursor: pointer; overflow-wrap: anywhere; }
.expense-suggestions li + li { border-top: 1px solid var(--border); }
.expense-suggestions li:hover, .expense-suggestions li[aria-selected="true"] { background: var(--active); }

@media (max-width: 665px) {
  .expenses-table { font-size: 13px; }
  .expenses-table th, .expenses-table td { padding-inline: 7px; }
}
