:root {
  color-scheme: dark;
  --bg: #0b0c10;
  --bg-alt: #101218;
  --panel: #13151c;
  --panel-soft: #171a22;
  --line: #252836;
  --line-strong: #3a3f52;
  --text: #e6e8ee;
  --text-muted: #a6adbb;
  --accent: #8aa7c5;
  --accent-soft: rgba(138, 167, 197, 0.22);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  --summary-fixkosten: #c97878;
  --summary-ueberschuss: #7bb2c9;
  --summary-einkauf: #9ec77b;
  --summary-freizeit: #d1a85f;
  --summary-rest: #6f7482;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Bahnschrift", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(42, 50, 70, 0.35), transparent 45%),
    radial-gradient(circle at 20% 70%, rgba(34, 40, 55, 0.45), transparent 55%),
    linear-gradient(145deg, #0a0b0f, #14171f);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(120deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 40%),
    linear-gradient(60deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 35%);
  mix-blend-mode: screen;
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-shell {
  width: min(1100px, 92vw);
  min-height: 70vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  padding: 46px 52px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(8, 10, 14, 0.85);
  box-shadow: var(--shadow);
  position: relative;
}

.auth-toolbar {
  position: absolute;
  top: 12px;
  right: 28px;
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(12, 14, 20, 0.7);
  color: var(--text-muted);
  padding: 8px 14px;
  font-size: 12px;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.view-toggle:hover {
  border-color: var(--line-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.view-toggle--floating {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 10;
}

.view-icon {
  width: 18px;
  height: 12px;
  border: 1px solid var(--text-muted);
  border-radius: 3px;
  position: relative;
  display: inline-block;
}

.view-icon::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: 1px solid var(--text-muted);
  border-radius: 2px;
}

.view-toggle:hover .view-icon,
.view-toggle:hover .view-icon::after {
  border-color: var(--text);
}

.mobile-menu-toggle {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(12, 14, 20, 0.82);
  color: var(--text);
  display: none;
  align-content: center;
  justify-items: center;
  gap: 5px;
  cursor: pointer;
  z-index: 40;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 999px;
}

.mobile-menu-toggle:hover {
  border-color: var(--line-strong);
  background: rgba(22, 26, 36, 0.9);
  transform: translateY(-1px);
}

body.view-mobile .mobile-menu-toggle {
  display: grid;
}

body.view-mobile.sidebar-focus .mobile-menu-toggle {
  opacity: 0;
  pointer-events: none;
}

.auth-left {
  display: flex;
  flex-direction: column;
  gap: 28px;
  color: var(--text-muted);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--text);
}

.auth-logo {
  width: 128px;
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logo__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 26px;
}

.auth-info {
  max-width: 420px;
  line-height: 1.7;
  font-size: 14px;
}

.auth-version {
  margin-top: auto;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  padding: 28px 26px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(17, 20, 29, 0.85);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-card h1 {
  margin: 0 0 4px;
  font-size: 24px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-field input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0e1118;
  color: var(--text);
  font-size: 15px;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 2px rgba(138, 167, 197, 0.18);
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-remember input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.auth-error {
  min-height: 18px;
  margin: 0;
  font-size: 12px;
  color: #c98989;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
}

.auth-link:hover {
  color: var(--text);
}

.auth-button {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #1a1e28;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.auth-button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.auth-page.view-mobile .auth-shell {
  width: min(420px, 94vw);
  grid-template-columns: 1fr;
  padding: 28px;
  min-height: 80vh;
}

.auth-page.view-mobile .auth-toolbar {
  position: static;
  margin-left: auto;
  margin-bottom: 6px;
}

.auth-page.view-mobile .auth-left {
  order: 2;
  gap: 20px;
}

.auth-page.view-mobile .auth-right {
  order: 1;
}

.auth-page.view-mobile .auth-logo {
  width: 96px;
  height: 96px;
}

.auth-page.view-mobile .auth-title {
  font-size: 18px;
}

.auth-page.view-mobile .auth-info {
  font-size: 13px;
}

.auth-page.view-mobile .auth-remember {
  font-size: 14px;
}

.auth-page.view-mobile .auth-remember input {
  width: 20px;
  height: 20px;
}

body.view-mobile {
  font-size: 15px;
  line-height: 1.5;
}

body.view-mobile .app {
  grid-template-columns: 1fr;
  grid-template-rows: auto;
}

body.view-mobile .sidebar {
  width: min(86vw, 320px);
  min-width: 0;
  padding: calc(18px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right))
    calc(20px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  border-right: 1px solid var(--line);
  border-bottom: none;
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  overflow-y: auto;
  transform: translateX(-110%);
  transition: transform 0.25s ease;
  z-index: 30;
}

body.view-mobile .nav {
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 0;
  padding-right: 0;
  gap: 8px;
}

body.view-mobile .nav-link {
  white-space: normal;
  transform: none;
  font-size: 16px;
  padding: 12px 14px;
}

body.view-mobile .content {
  padding: 20px 16px 32px;
  padding-top: calc(68px + env(safe-area-inset-top));
  padding-right: calc(16px + env(safe-area-inset-right));
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

body.view-mobile .section__header--split {
  flex-direction: column;
  align-items: flex-start;
}

body.view-mobile .section__header {
  margin-bottom: 16px;
}

body.view-mobile h1 {
  font-size: 26px;
  letter-spacing: 0.2px;
}

body.view-mobile .breadcrumb {
  display: none;
}

body.view-mobile .lead {
  font-size: 15px;
  line-height: 1.55;
}

body.view-mobile .card-grid {
  gap: 12px;
}

body.view-mobile .card {
  padding: 14px 16px;
  border-radius: 16px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
}

body.view-mobile .panel {
  padding: 18px;
  border-radius: 18px;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.32);
}

body.view-mobile .panel .eyebrow {
  display: none;
}

body.view-mobile .fixkosten-form__grid {
  grid-template-columns: 1fr;
}

body.view-mobile .fixkosten-row {
  flex-direction: column;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(17, 20, 28, 0.85);
}

body.view-mobile .fixkosten-row__cells {
  grid-template-columns: 1fr;
  border-radius: 14px;
  border: none;
  background: transparent;
}

body.view-mobile .fixkosten-cell {
  border-right: none;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

body.view-mobile .fixkosten-cell::before {
  content: attr(data-label);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 10px;
  color: var(--text-muted);
}

body.view-mobile .fixkosten-cell:last-child {
  border-bottom: none;
}

body.view-mobile .fixkosten-row__spacer {
  display: none;
}

body.view-mobile .fixkosten-delete {
  align-self: flex-end;
}

body.view-mobile .fixkosten-total {
  align-items: flex-start;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: 14px;
  gap: 6px;
}

body.view-mobile .fixkosten-table {
  gap: 8px;
}

body.view-mobile .month-summary-panel__actions {
  width: 100%;
  justify-content: flex-start;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

body.view-mobile .summary-form__grid,
body.view-mobile .summary-form__grid--triple {
  grid-template-columns: 1fr;
}

body.view-mobile .month-summary-grid {
  grid-template-columns: 1fr;
  gap: 16px;
}

body.view-mobile .month-summary-panel {
  gap: 16px;
}

body.view-mobile .month-summary-legend {
  order: 2;
  gap: 8px;
}

body.view-mobile .month-summary-chart {
  order: 1;
}

body.view-mobile .month-summary-total__value {
  font-size: 18px;
}

body.view-mobile .month-summary-pie {
  width: min(240px, 72vw);
  box-shadow: inset 0 0 0 8px rgba(10, 12, 18, 0.55);
}

body.view-mobile .month-summary-legend__item {
  padding: 10px 12px;
  border-radius: 12px;
}

body.view-mobile .month-summary-legend__label,
body.view-mobile .month-summary-legend__value {
  font-size: 13px;
}

body.view-mobile .sparkonto-form__grid {
  grid-template-columns: 1fr;
}

body.view-mobile .sparkonto-grid {
  grid-template-columns: 1fr;
  gap: 16px;
}

body.view-mobile .sparkonto-table {
  gap: 8px;
}

body.view-mobile .sparkonto-row {
  flex-direction: column;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(17, 20, 28, 0.85);
}

body.view-mobile .sparkonto-row__cells {
  grid-template-columns: 1fr;
  border-radius: 14px;
  border: none;
  background: transparent;
}

body.view-mobile .freizeit-layout {
  grid-template-columns: 1fr;
}

body.view-mobile .freizeit-calendar__grid {
  min-width: 480px;
}

body.view-mobile .freizeit-calendar__header,
body.view-mobile .freizeit-calendar__row {
  padding-right: 120px;
}

body.view-mobile .freizeit-bottom {
  grid-template-columns: 1fr;
}

body.view-mobile .sparkonto-cell {
  border-right: none;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

body.view-mobile .sparkonto-cell::before {
  content: attr(data-label);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 10px;
  color: var(--text-muted);
}

body.view-mobile .sparkonto-cell:last-child {
  border-bottom: none;
}

body.view-mobile .sparkonto-row__spacer {
  display: none;
}

body.view-mobile .sparkonto-delete {
  align-self: flex-end;
}

body.view-mobile .sparkonto-total {
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  gap: 6px;
}

body.view-mobile .sparkonto-rest {
  padding: 12px 14px;
  border-radius: 14px;
  min-height: 0;
  gap: 4px;
}

body.view-mobile .sparkonto-rest__value {
  font-size: 16px;
}

body.view-mobile .calc-layout.notes-open .calculator-panel {
  margin-right: 0;
}

body.view-mobile .notes-panel {
  position: relative;
  width: 100%;
  margin-top: 18px;
  transform: translateY(20px);
}

body.view-mobile .fixkosten-row--head,
body.view-mobile .sparkonto-row--head {
  display: none;
}

body.view-mobile .settings-button {
  padding: 11px 14px;
  font-size: 14px;
  min-height: 44px;
}

body.view-mobile .form-field {
  gap: 6px;
  font-size: 12px;
}

body.view-mobile .form-field input,
body.view-mobile .form-field select,
body.view-mobile .form-field textarea {
  padding: 10px 12px;
  font-size: 14px;
}

body.view-mobile .form-field input,
body.view-mobile .form-field select {
  min-height: 44px;
}

body.view-mobile .password-field input {
  padding-right: 44px;
}

body.view-mobile .password-toggle {
  right: 8px;
}

body.view-mobile .month-select__trigger {
  padding: 10px 12px;
  font-size: 14px;
  min-height: 44px;
}

body.view-mobile .month-select__panel {
  padding: 10px;
  transition: none;
}

body.view-mobile .month-select__grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.view-mobile .month-select__trigger {
  overflow: hidden;
}

body.view-mobile .month-chip {
  padding: 8px;
  font-size: 12px;
  transition: border-color 0.08s ease, color 0.08s ease, background 0.08s ease, box-shadow 0.08s ease;
}

body.view-mobile .year-summary-header--filter {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

body.view-mobile .year-summary-filter {
  width: 100%;
}

body.view-mobile .year-summary-header__content {
  width: 100%;
}

body.view-mobile .year-summary-actions {
  width: 100%;
  display: block;
  min-width: 0;
}

body.view-mobile .year-summary-actions > * {
  width: 100%;
}

body.view-mobile .export-button {
  width: 100%;
  text-align: center;
}

body.view-mobile [data-export-button] {
  display: none !important;
}

body.view-mobile .year-summary-filter {
  flex: 1 1 100%;
  min-width: 0;
}

body.view-mobile .form-field textarea {
  min-height: 88px;
}

body.view-mobile .settings-card__header {
  flex-direction: column;
  align-items: stretch;
}

body.view-mobile .settings-card__header .settings-button {
  width: 100%;
  text-align: center;
}

body.view-mobile .settings-backup .settings-actions {
  flex-direction: column;
  align-items: stretch;
}

body.view-mobile .settings-backup .settings-actions .settings-button {
  width: 100%;
}

body.view-mobile .settings-backup__security {
  gap: 8px;
}

body.view-mobile .summary-form {
  padding: 14px;
  border-radius: 14px;
  gap: 12px;
}

body.view-mobile .vertraege-form {
  padding: 14px;
  border-radius: 14px;
}

body.view-mobile .vertraege-panel__header {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

body.view-mobile .vertraege-toggle {
  width: 100%;
  text-align: center;
}

body.view-mobile .vertraege-form__grid {
  grid-template-columns: 1fr;
}

body.view-mobile .vertraege-year__table {
  margin: 0 -4px;
  padding-bottom: 6px;
}

body.view-mobile .vertrag-grid {
  grid-template-columns: 1fr;
}

body.view-mobile .vertrag-card__header {
  flex-direction: column;
  align-items: flex-start;
}

body.view-mobile .vertrag-delete {
  align-self: flex-end;
}

body.view-mobile .form-actions,
body.view-mobile .notes-confirm__actions,
body.view-mobile .sparkonto-confirm__actions,
body.view-mobile .fixkosten-confirm__actions {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

body.view-mobile .form-actions .settings-button,
body.view-mobile .month-summary-panel__actions .settings-button,
body.view-mobile .notes-confirm__actions .settings-button,
body.view-mobile .sparkonto-confirm__actions .settings-button,
body.view-mobile .fixkosten-confirm__actions .settings-button {
  width: 100%;
}

body.view-mobile .fixkosten-panel__header,
body.view-mobile .sparkonto-panel__header,
body.view-mobile .month-summary-panel__header {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

body.view-mobile .fixkosten-toggle,
body.view-mobile .sparkonto-toggle {
  width: 100%;
  text-align: center;
}

body.view-mobile .data-table {
  font-size: 13px;
}

body.view-mobile .data-table th,
body.view-mobile .data-table td {
  padding: 8px 6px;
}

body.view-mobile .calc-layout.notes-open .notes-panel {
  transform: translateY(0);
}

body.view-mobile.sidebar-focus .sidebar {
  transform: translateX(0);
  box-shadow: var(--shadow);
}

body.view-mobile.sidebar-focus .content {
  pointer-events: none;
  filter: blur(2px);
}

body.view-mobile.sidebar-collapsed .app {
  grid-template-columns: 1fr;
}

body.view-mobile.sidebar-collapsed .sidebar {
  width: min(86vw, 320px);
  padding: calc(18px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right))
    calc(20px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 17, 24, 0.95), rgba(10, 11, 15, 0.98));
  box-shadow: none;
  transform: translateX(-110%);
}

body.view-mobile .view-toggle--floating {
  top: calc(14px + env(safe-area-inset-top));
  right: calc(16px + env(safe-area-inset-right));
}

* {
  scrollbar-width: thin;
  scrollbar-color: #5b616b #1a1d24;
}

*::-webkit-scrollbar {
  width: 12px;
}

*::-webkit-scrollbar-track {
  background: #1a1d24;
  border-radius: 999px;
  margin: 8px 0;
}

*::-webkit-scrollbar-thumb {
  background: #5b616b;
  border-radius: 999px;
  border: 3px solid #1a1d24;
}

*::-webkit-scrollbar-thumb:hover {
  background: #7b828d;
}

.app {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 28px 22px 24px;
  background: linear-gradient(180deg, rgba(15, 17, 24, 0.95), rgba(10, 11, 15, 0.98));
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 2;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #c8ceda;
  font-weight: 700;
}

.icon-button {
  width: 44px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(18, 20, 28, 0.75);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.icon-button span {
  width: 18px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 999px;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: rgba(24, 28, 38, 0.9);
  transform: translateY(-1px);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 8px;
  flex: 0 0 auto;
}

.nav--years,
.nav--months,
.nav--sections {
  display: none;
}

.nav--years.is-active,
.nav--months.is-active,
.nav--sections.is-active {
  display: flex;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  letter-spacing: 0.2px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  text-align: left;
  width: 100%;
  appearance: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--text);
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  transform: translateX(4px);
}

.nav-link.is-active {
  color: var(--text);
  font-weight: 600;
}

.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(138, 167, 197, 0.6);
}

.is-hidden {
  display: none !important;
}

.nav-link--muted {
  margin-top: 8px;
}

.sidebar__footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.content {
  padding: 40px 56px;
  background: linear-gradient(135deg, rgba(8, 10, 14, 0.95), rgba(12, 14, 20, 0.98));
  position: relative;
  overflow: hidden;
}

.content::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 10%, rgba(138, 167, 197, 0.12), transparent 45%);
  pointer-events: none;
}

.content__inner {
  position: relative;
  z-index: 1;
  max-width: 980px;
}

.page {
  animation: fadeIn 0.35s ease;
}

.calc-layout {
  position: relative;
  padding-right: 0;
  min-height: 420px;
}

.calc-layout.notes-open .calculator-panel {
  margin-right: 300px;
  transition: margin 0.3s ease;
}

.calculator-panel {
  max-width: 420px;
}

.calculator {
  padding: 20px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
}

.calc-display {
  width: 100%;
  background: #0d0f15;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 14px;
  font-size: 28px;
  color: var(--text);
  text-align: right;
  margin-bottom: 16px;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.calc-key {
  padding: 14px 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: #151821;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.calc-key:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line);
  transform: translateY(-2px);
}

.calc-key.is-operator {
  color: var(--accent);
}

.calc-key.is-secondary {
  color: var(--text-muted);
}

.calc-key.is-equals {
  grid-row: span 2;
  background: rgba(138, 167, 197, 0.18);
}

.calc-key.is-wide {
  grid-column: span 2;
}

.notes-toggle {
  border: 1px solid var(--line);
  background: #11141d;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.notes-toggle:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.notes-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: #0f121a;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calc-layout.notes-open .notes-panel {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.notes-header h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.notes-header p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.notes-input {
  width: 100%;
  flex: 1;
  min-height: 160px;
  background: #0b0d13;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  resize: none;
  font-family: inherit;
}

.notes-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.notes-confirm {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}

.notes-confirm.is-hidden {
  display: none;
}

.notes-confirm__card {
  width: min(420px, 92vw);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notes-confirm__title {
  margin: 0;
  font-size: 18px;
}

.notes-confirm__text {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.notes-confirm__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.section__header {
  margin-bottom: 24px;
}

.section__header--split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.breadcrumb {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.6px;
}

.intro {
  max-width: 720px;
}

.feature-list {
  margin: 18px 0;
  padding-left: 18px;
  color: var(--text-muted);
  line-height: 1.6;
}

.feature-list li {
  margin-bottom: 8px;
}

.hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.scroll-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

.settings-card {
  margin-top: 24px;
  padding: 20px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  max-width: 520px;
}

.settings-text {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 14px;
}

.settings-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.settings-changelog {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.settings-changelog.is-collapsed {
  display: none;
}

.settings-credits {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.settings-credits.is-collapsed {
  display: none;
}

.settings-credits__title {
  margin: 6px 0 0;
}

.settings-credits__text {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.changelog-entry {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  overflow: hidden;
}

.changelog-entry__toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
}

.changelog-entry__date {
  font-size: 12px;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  min-width: 84px;
}

.changelog-entry__title {
  font-size: 14px;
  font-weight: 600;
}

.changelog-entry__caret {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.changelog-entry.is-open .changelog-entry__caret {
  transform: rotate(-135deg);
}

.changelog-entry__body {
  display: none;
  padding: 0 16px 16px;
  color: var(--text-muted);
}

.changelog-entry.is-open .changelog-entry__body {
  display: block;
}

.changelog-entry__summary {
  margin: 0 0 10px;
  font-size: 13px;
}

.changelog-entry__list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
}

.settings-footer {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}

body.view-mobile .changelog-entry__toggle {
  padding: 12px 14px;
}

body.view-mobile .changelog-entry__date {
  min-width: 70px;
}

.settings-card__header .settings-text {
  margin-bottom: 0;
}

.settings-backup {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.settings-backup.is-collapsed {
  display: none;
}

.settings-backup__summary {
  display: grid;
  gap: 8px;
}

.settings-backup__security {
  display: grid;
  gap: 10px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.checkbox-field input {
  width: 16px;
  height: 16px;
}

.settings-backup__status {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.settings-backup__list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.settings-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-button {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #171b24;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.settings-button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.settings-button--danger {
  border-color: #6d3b3b;
  color: #e0b2b2;
}

.settings-button--danger:hover {
  border-color: #a05454;
}

.settings-button--ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--text-muted);
}

.settings-button--ghost:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.fixkosten-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fixkosten-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.fixkosten-toggle {
  white-space: nowrap;
}

.fixkosten-form {
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  gap: 16px;
}

.fixkosten-form.is-collapsed {
  display: none;
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: -2px 0 0;
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0e1118;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

.form-field textarea {
  resize: vertical;
  min-height: 96px;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 2px rgba(138, 167, 197, 0.18);
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  width: 100%;
  padding-right: 42px;
}

.password-field input[data-password-reveal="true"] {
  -webkit-text-security: none;
}

.password-field input[data-password-reveal="false"] {
  -webkit-text-security: disc;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

.password-toggle .eye-slash {
  opacity: 0;
}

.password-toggle.is-obscured .eye-slash {
  opacity: 1;
}

.password-toggle.is-obscured .eye-outline,
.password-toggle.is-obscured .eye-core {
  opacity: 0.6;
}

.month-select {
  position: relative;
  min-width: 0;
}

.month-select__trigger {
  width: 100%;
  min-width: 0;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0e1118;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.month-select__trigger:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 2px rgba(138, 167, 197, 0.18);
}

.month-select__caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.month-select.is-open .month-select__caret {
  transform: rotate(-135deg);
}

.month-select__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow);
  display: none;
  gap: 10px;
  z-index: 6;
}

.month-select.is-open .month-select__panel {
  display: grid;
}

.month-select__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.month-chip {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text-muted);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.month-chip:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.month-chip.is-disabled,
.month-chip:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  border-color: var(--line);
  color: var(--text-muted);
  background: #0d1016;
  box-shadow: none;
}

.month-chip.is-disabled:hover,
.month-chip:disabled:hover {
  border-color: var(--line);
  color: var(--text-muted);
}

.month-chip.is-selected {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}

.month-chip--year {
  font-weight: 600;
  width: 100%;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.form-error {
  margin: 0;
  font-size: 12px;
  color: #c98989;
}

.fixkosten-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fixkosten-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.fixkosten-row__cells {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 1.4fr;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel);
  flex: 1;
}

.fixkosten-row--head .fixkosten-row__cells {
  background: var(--panel-soft);
}

.fixkosten-cell {
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  font-size: 14px;
  color: var(--text);
}

.fixkosten-row--head .fixkosten-cell {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fixkosten-cell:last-child {
  border-right: none;
}

.fixkosten-row__spacer {
  width: 40px;
}

.fixkosten-delete {
  align-self: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid #6d3b3b;
  background: rgba(109, 59, 59, 0.18);
  color: #e0b2b2;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.fixkosten-delete:hover {
  border-color: #a05454;
  background: rgba(160, 84, 84, 0.22);
  transform: translateY(-1px);
}

.fixkosten-empty {
  margin: 4px 0 0;
}

.fixkosten-total {
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.fixkosten-total__label {
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 12px;
  color: var(--text-muted);
}

.fixkosten-total__value {
  font-size: 18px;
  font-weight: 600;
}

.fixkosten-confirm {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}

.fixkosten-confirm.is-hidden {
  display: none;
}

.fixkosten-confirm__card {
  width: min(420px, 92vw);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fixkosten-confirm__title {
  margin: 0;
  font-size: 18px;
}

.fixkosten-confirm__text {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.fixkosten-confirm__options {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fixkosten-confirm__options.is-hidden {
  display: none;
}

.fixkosten-confirm__hint {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fixkosten-delete-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.fixkosten-delete-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.fixkosten-delete-choice input {
  accent-color: var(--accent);
}

.fixkosten-delete-select {
  margin-top: 4px;
}

.fixkosten-confirm__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.vertraege-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.vertraege-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.vertraege-toggle {
  white-space: nowrap;
}

.vertraege-form {
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  gap: 16px;
}

.vertraege-form.is-collapsed {
  display: none;
}

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

.vertraege-year {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vertraege-year__table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.vertraege-year__table .data-table {
  min-width: 720px;
}

.vertraege-hint {
  margin: 0;
}

.vertraege-list {
  display: grid;
  gap: 12px;
}

.vertrag-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.vertrag-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.vertrag-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.vertrag-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.vertrag-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.vertrag-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.vertrag-field span:last-child {
  font-size: 14px;
  color: var(--text);
}

.vertrag-note {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.vertrag-delete {
  align-self: flex-start;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid #6d3b3b;
  background: rgba(109, 59, 59, 0.18);
  color: #e0b2b2;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.vertrag-delete:hover {
  border-color: #a05454;
  background: rgba(160, 84, 84, 0.22);
  transform: translateY(-1px);
}

.vertraege-confirm {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}

.vertraege-confirm.is-hidden {
  display: none;
}

.vertraege-confirm__card {
  width: min(420px, 92vw);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vertraege-confirm__title {
  margin: 0;
  font-size: 18px;
}

.vertraege-confirm__text {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.vertraege-confirm__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.contract-alerts {
  display: grid;
  gap: 10px;
  margin: 8px 0 18px;
}

.contract-alerts.is-hidden {
  display: none;
}

.contract-alert {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.contract-alert__text {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}

.contract-alert__icon {
  color: #f08a8a;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.contract-alert__icon::after {
  content: ":";
  color: var(--text);
  margin-left: 1px;
  font-weight: 600;
}

.contract-alert__close {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-muted);
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.contract-alert__close:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.sparkonto-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sparkonto-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.sparkonto-form {
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  gap: 16px;
}

.sparkonto-form.is-collapsed {
  display: none;
}

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

.sparkonto-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.6fr);
  gap: 24px;
  align-items: start;
}

.sparkonto-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sparkonto-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.sparkonto-row__cells {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel);
  flex: 1;
}

.sparkonto-row--head .sparkonto-row__cells {
  background: var(--panel-soft);
}

.sparkonto-cell {
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  font-size: 14px;
  color: var(--text);
}

.sparkonto-row--head .sparkonto-cell {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sparkonto-cell:last-child {
  border-right: none;
}

.sparkonto-row__spacer {
  width: 40px;
}

.sparkonto-delete {
  align-self: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid #6d3b3b;
  background: rgba(109, 59, 59, 0.18);
  color: #e0b2b2;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.sparkonto-delete:hover {
  border-color: #a05454;
  background: rgba(160, 84, 84, 0.22);
  transform: translateY(-1px);
}

.sparkonto-total {
  margin-top: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sparkonto-total__label {
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 12px;
  color: var(--text-muted);
}

.sparkonto-total__value {
  font-size: 16px;
  font-weight: 600;
}

.sparkonto-rest {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  justify-content: center;
}

.sparkonto-rest__label {
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 12px;
  color: var(--text-muted);
}

.sparkonto-rest__value {
  font-size: 18px;
  font-weight: 600;
}

.sparkonto-confirm {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}

.sparkonto-confirm.is-hidden {
  display: none;
}

.sparkonto-confirm__card {
  width: min(420px, 92vw);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sparkonto-confirm__title {
  margin: 0;
  font-size: 18px;
}

.sparkonto-confirm__text {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.sparkonto-confirm__note {
  font-size: 12px;
  color: var(--text-muted);
}

.sparkonto-confirm__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.month-summary-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.month-summary-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.month-summary-panel__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.summary-form {
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  gap: 16px;
}

.summary-form.is-collapsed {
  display: none;
}

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

.summary-form--single .summary-form__grid {
  grid-template-columns: 1fr;
}

.summary-form__grid--triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-form__group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.month-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px;
  align-items: center;
}

.year-summary-content {
  display: grid;
  gap: 20px;
  margin-top: 24px;
  min-width: 0;
}

.year-summary-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.year-summary-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.year-summary-header--filter {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.year-summary-header__content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.year-summary-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.year-summary-filter {
  width: 320px;
  max-width: 100%;
  flex: 0 0 320px;
  min-width: 0;
}

.year-summary-filter .month-select {
  width: 100%;
}

.year-summary-filter .month-select__trigger span[data-month-label],
.year-summary-filter .month-select__trigger span[data-year-label] {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-select__trigger span[data-month-label],
.month-select__trigger span[data-year-label] {
  display: block;
  max-width: 100%;
}

.export-button {
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.year-summary-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.year-summary-chart__row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 110px;
  gap: 12px;
  align-items: center;
}

.year-summary-chart__label {
  color: var(--text-muted);
  font-size: 13px;
}

.year-summary-chart__bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--panel-soft);
  overflow: hidden;
}

.year-summary-chart__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: var(--summary-fixkosten);
  border-radius: 999px;
}

.year-summary-chart__fill.is-negative {
  background: var(--summary-freizeit);
}

.year-summary-chart__value {
  text-align: right;
  font-weight: 600;
}

.year-summary-table th,
.year-summary-table td {
  font-size: 13px;
}

.year-summary-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.year-summary-total {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.year-summary-total strong {
  color: var(--text);
  font-size: 15px;
}

.month-summary-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.month-summary-total {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.month-summary-total__label {
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 12px;
  color: var(--text-muted);
}

.month-summary-total__value {
  font-size: 22px;
  font-weight: 600;
}

.month-summary-pie {
  width: min(320px, 60vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: conic-gradient(var(--line) 0deg 360deg);
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 12px rgba(10, 12, 18, 0.55);
}

.month-summary-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: stretch;
}

.month-summary-legend__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(17, 20, 28, 0.8);
}

.month-summary-legend__label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
}

.month-summary-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--summary-rest);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.month-summary-legend__value {
  font-size: 14px;
  color: var(--text-muted);
}

.freizeit-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.freizeit-content {
  display: grid;
  gap: 18px;
}

.freizeit-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.freizeit-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 18px;
  align-items: start;
}

.freizeit-calendar-panel {
  overflow-x: auto;
}

.freizeit-week-panel__header,
.freizeit-move-panel__header,
.freizeit-expense__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.freizeit-calendar__grid {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  min-width: 0;
}

.freizeit-calendar__header,
.freizeit-calendar__row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 0 170px 0 0;
}

.freizeit-calendar__header {
  background: var(--panel-soft);
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.freizeit-calendar__row {
  border-top: 1px solid var(--line);
  position: relative;
  min-height: 68px;
}

.freizeit-calendar__cell {
  padding: 10px 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.freizeit-calendar__cell.is-empty {
  color: transparent;
}

.freizeit-calendar__week-summary {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  text-align: right;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.freizeit-calendar__week-summary span {
  display: block;
}

.freizeit-week-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.freizeit-expense-table {
  margin-top: 18px;
}

.freizeit-expense-delete {
  border: none;
  background: transparent;
  color: #d56a6a;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 6px;
}

.freizeit-expense-delete:hover {
  color: #f08a8a;
}

.freizeit-week-delete {
  border: none;
  background: transparent;
  color: #d56a6a;
  cursor: pointer;
  font-size: 12px;
  padding: 4px 6px;
}

.freizeit-week-delete:hover {
  color: #f08a8a;
}

.freizeit-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.freizeit-week-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.freizeit-week-item {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.freizeit-week-item.is-empty {
  opacity: 0.55;
}

.freizeit-week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}

.freizeit-week-meta,
.freizeit-week-rest,
.freizeit-week-moved {
  font-size: 12px;
  color: var(--text-muted);
}

.freizeit-move-form {
  display: grid;
  gap: 12px;
}

.freizeit-move-rest {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.freizeit-total {
  margin: 16px 0 0;
  font-size: 16px;
  font-weight: 600;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--text-muted);
}

h1 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 600;
}

.lead {
  margin: 0;
  max-width: 640px;
  color: var(--text-muted);
  line-height: 1.6;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.card {
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(23, 26, 34, 0.8), rgba(14, 16, 22, 0.95));
  border: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}

.card__label {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card__value {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 600;
}

.card__hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.panel {
  padding: 20px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
}

.panel--empty {
  color: var(--text-muted);
  text-align: center;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 10px;
}

.data-table thead {
  border-bottom: 1px solid var(--line-strong);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--line);
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table th {
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 12px;
}

.data-table td {
  color: var(--text);
}

.nav-link,
.icon-button {
  outline: none;
}

.nav-link:focus-visible,
.icon-button:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-soft);
}

body.sidebar-collapsed .sidebar {
  width: 70px;
  padding: 18px 12px 24px;
  border-right: none;
  box-shadow: none;
  background: #0b0c10;
}

body.sidebar-collapsed .app {
  grid-template-columns: 70px 1fr;
}

body:not(.view-mobile) {
  scrollbar-gutter: stable;
}

@media print {
  body.print-mode {
    background: #ffffff !important;
  }

  body.print-mode * {
    visibility: hidden !important;
  }

  body.print-mode [data-print-target],
  body.print-mode [data-print-target] * {
    visibility: visible !important;
  }

  body.print-mode [data-print-target] {
    box-shadow: none !important;
    background: #ffffff !important;
    color: #000000;
    margin: 0 !important;
    width: 100%;
  }

  body.print-mode .content,
  body.print-mode .content__inner {
    padding: 0 !important;
    margin: 0 !important;
  }

  body.print-mode [data-print-target] a {
    color: #000000 !important;
    text-decoration: none !important;
  }

  body.print-mode [data-print-target] .panel,
  body.print-mode [data-print-target] .month-summary-legend__item,
  body.print-mode [data-print-target] .fixkosten-row,
  body.print-mode [data-print-target] .sparkonto-row,
  body.print-mode [data-print-target] .vertrag-card,
  body.print-mode [data-print-target] .contract-alert {
    background: #ffffff !important;
    box-shadow: none !important;
    border-color: #d0d0d0 !important;
  }

  body.print-mode [data-print-target] .data-table thead {
    border-bottom: 1px solid #c0c0c0 !important;
  }

  body.print-mode [data-print-target] .data-table tbody tr {
    border-bottom: 1px solid #e0e0e0 !important;
  }

  body.print-mode [data-print-target] .data-table th {
    color: #333333 !important;
  }

  body.print-mode [data-print-target] .data-table td,
  body.print-mode [data-print-target] .month-summary-legend__label,
  body.print-mode [data-print-target] .month-summary-legend__value {
    color: #000000 !important;
  }

  body.print-mode [data-print-target] .month-summary-pie,
  body.print-mode [data-print-target] .month-summary-legend__swatch,
  body.print-mode [data-print-target] .year-summary-chart__fill {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.print-mode [data-print-target] .month-summary-pie {
    box-shadow: none !important;
    border-color: #c0c0c0 !important;
  }

  body.print-mode [data-print-target] .month-summary-legend__swatch {
    border: 1px solid #c0c0c0;
  }

  body.print-mode [data-export-button],
  body.print-mode .scroll-hint {
    display: none !important;
  }
}

body.sidebar-collapsed .brand,
body.sidebar-collapsed .nav,
body.sidebar-collapsed .sidebar__footer {
  display: none;
}

body.sidebar-collapsed .sidebar__header {
  justify-content: flex-start;
}

body.sidebar-collapsed .icon-button {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  padding: 0;
}

body.sidebar-collapsed .icon-button span {
  width: 22px;
  height: 2px;
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 20px 20px 12px;
  }

  .nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .nav-link {
    white-space: nowrap;
    transform: none;
  }

  .content {
    padding: 28px 22px 40px;
  }

  .section__header--split {
    flex-direction: column;
    align-items: flex-start;
  }

  .calc-layout.notes-open .calculator-panel {
    margin-right: 0;
  }

  .notes-panel {
    position: relative;
    width: 100%;
    margin-top: 18px;
    transform: translateY(20px);
  }

  .calc-layout.notes-open .notes-panel {
    transform: translateY(0);
  }

  .auth-shell {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 32px;
  }

  .auth-right {
    justify-content: flex-start;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
