/* SalaryCalc — iOS-style UI */

:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --cell: #ffffff;
  --cell-pressed: #e5e5ea;
  --label: #000000;
  --secondary: rgba(60, 60, 67, 0.6);
  --tertiary: rgba(60, 60, 67, 0.3);
  --separator: rgba(60, 60, 67, 0.29);
  --bar: rgba(249, 249, 249, 0.96);
  --tint: #007aff;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --teal: #30b0c7;
  --indigo: #5856d6;
  --fill: rgba(120, 120, 128, 0.12);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --cell: #1c1c1e;
    --cell-pressed: #2c2c2e;
    --label: #ffffff;
    --secondary: rgba(235, 235, 245, 0.6);
    --tertiary: rgba(235, 235, 245, 0.3);
    --separator: rgba(84, 84, 88, 0.6);
    --bar: rgba(22, 22, 23, 0.96);
    --tint: #0a84ff;
    --green: #30d158;
    --red: #ff453a;
    --orange: #ff9f0a;
    --teal: #40c8e0;
    --indigo: #5e5ce6;
    --fill: rgba(118, 118, 128, 0.24);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  -webkit-text-size-adjust: 100%;
  /* No double-tap zoom (pinch zoom still works, for accessibility) */
  touch-action: manipulation;
}

a, button, input, select, label, .row, .widget, .cal-day { touch-action: manipulation; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.29;
  letter-spacing: -0.41px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--tint); text-decoration: none; }

/* ---------- Navigation bar ---------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: var(--safe-top);
  background: transparent;
  border-bottom: 0.5px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.navbar.scrolled {
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--separator);
}

.navbar-inner {
  max-width: 680px;
  margin: 0 auto;
  height: 44px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 8px;
}

.nav-title {
  font-size: 17px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.navbar.title-shown .nav-title { opacity: 1; }

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  padding: 8px 4px;
}

.nav-back svg {
  width: 12px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Content ---------- */

.content {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px calc(32px + var(--safe-bottom));
}

body.with-tabs .content { padding-bottom: calc(100px + var(--safe-bottom)); }

.large-title {
  font-size: 34px;
  line-height: 41px;
  font-weight: 700;
  letter-spacing: 0.37px;
  margin: 2px 4px 14px;
}

.greeting {
  margin: -8px 4px 16px;
  color: var(--secondary);
  font-size: 15px;
}

/* ---------- Grouped lists ---------- */

.group { margin: 0 0 32px; }

.group-header {
  padding: 0 16px 7px;
  font-size: 13px;
  line-height: 18px;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: -0.08px;
}

.group-footer {
  padding: 7px 16px 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--secondary);
  letter-spacing: -0.08px;
}

.list {
  background: var(--cell);
  border-radius: 10px;
  overflow: hidden;
}

.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 11px 16px;
  color: var(--label);
  background: var(--cell);
  width: 100%;
  border: 0;
  font: inherit;
  text-align: left;
}

.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 0.5px;
  background: var(--separator);
}

.list > .row:has(.row-icon) + .row::before { left: 60px; }

.row-link:active,
.row-button:active { background: var(--cell-pressed); }

.row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.row-title { font-size: 17px; }

.row-subtitle {
  font-size: 13px;
  line-height: 18px;
  color: var(--secondary);
}

.row-value {
  color: var(--secondary);
  text-align: right;
  flex-shrink: 0;
  max-width: 55%;
}

.value-strong { color: var(--label); font-weight: 600; }

.chevron {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  margin-left: -2px;
  border-top: 2px solid var(--tertiary);
  border-right: 2px solid var(--tertiary);
  transform: rotate(45deg);
}

.row-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  font-size: 16px;
}

.icon-blue { background: var(--tint); }
.icon-orange { background: var(--orange); }
.icon-teal { background: var(--teal); }
.icon-green { background: var(--green); }
.icon-red { background: var(--red); }

.row-disabled .row-title { color: var(--secondary); }
.row-disabled .row-icon { opacity: 0.55; }

.row-button {
  justify-content: center;
  cursor: pointer;
  color: var(--tint);
  text-align: center;
}

.row-destructive { color: var(--red); }

.empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--secondary);
  font-size: 15px;
  line-height: 1.45;
}

/* ---------- Inputs inside rows ---------- */

.row-input { cursor: text; }

.row-input .row-title {
  flex: 1 1 55%;
  min-width: 0;
}

.row-input input,
.row-input select {
  flex: 0 0 36%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--label);
  font: inherit;
  font-size: 17px;
  text-align: right;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.row-input select {
  color: var(--tint);
  cursor: pointer;
  text-align-last: right;
  direction: rtl;
}

.row-input select option { direction: ltr; color: initial; }

.row-input input::placeholder { color: var(--tertiary); }

.form-actions { margin: -16px 0 32px; }

.btn {
  display: block;
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 12px;
  background: var(--tint);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn:active { opacity: 0.7; }

.btn-small {
  border: 0;
  border-radius: 14px;
  padding: 6px 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--fill);
  color: var(--tint);
}

.btn-small-destructive { color: var(--red); }

.row-action { margin: 0; flex-shrink: 0; }

/* ---------- Banners and pills ---------- */

.banner {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
  line-height: 20px;
  background: var(--cell);
}

.banner-good { color: var(--green); }
.banner-bad { color: var(--red); }

.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
  vertical-align: middle;
}

.pill-green { color: var(--green); background: color-mix(in srgb, var(--green) 15%, transparent); }
.pill-red { color: var(--red); background: color-mix(in srgb, var(--red) 15%, transparent); }
.pill-blue { color: var(--tint); background: color-mix(in srgb, var(--tint) 15%, transparent); }
.pill-gray { color: var(--secondary); background: var(--fill); }

/* ---------- Widgets ---------- */

.widgets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
}

.widget {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 16px;
  border-radius: 20px;
  background: var(--cell);
  color: var(--label);
}

a.widget:active { background: var(--cell-pressed); }

.widget-wide { grid-column: 1 / -1; }

.widget-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
}

.widget-value {
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  letter-spacing: 0.36px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.widget:not(.widget-wide) .widget-value { font-size: 22px; line-height: 28px; }
.widget .widget-value-sm { font-size: 20px; }

.widget-meta {
  font-size: 13px;
  line-height: 18px;
  color: var(--secondary);
}

.widget-foot { margin-top: 8px; }

.payout-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.payout-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.payout-next { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; text-align: right;
  opacity: 0.55; min-width: 0; flex: 0 1 38%; }
.payout-next-sum { font-size: 22px; line-height: 34px; font-weight: 700; font-variant-numeric: tabular-nums;
  white-space: nowrap; color: var(--secondary); }
.payout-line-next { opacity: 0.55; padding-top: 8px; border-top: 0.5px solid var(--separator); }
.payout-line-next .payout-sum { color: var(--secondary); font-size: 18px; }
.payout-lines { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.payout-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.payout-when { display: flex; flex-direction: column; font-size: 15px; font-weight: 600; min-width: 0; }
.payout-what { font-size: 13px; font-weight: 400; color: var(--secondary); }
.payout-sum { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.accent-green { color: var(--green); }
.accent-indigo { color: var(--indigo); }

/* ---------- Payslip comparison ---------- */

.compare-row { align-items: flex-start; }

.compare-values {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  text-align: right;
}

.compare-calc {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.compare-actual {
  font-size: 13px;
  line-height: 18px;
  color: var(--secondary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.diff { font-weight: 600; margin-left: 4px; }
.diff-ok { color: var(--green); }
.diff-bad { color: var(--red); }
.diff-minor { color: var(--secondary); }

.row-total .row-title,
.row-total .compare-calc { font-weight: 600; }

/* ---------- Tab bar ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--separator);
  padding-bottom: var(--safe-bottom);
}

.tabbar-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 0 5px;
  color: #999999;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1px;
}

.tab svg { width: 26px; height: 26px; fill: currentColor; }
.tab.active { color: var(--tint); }

/* ---------- Auth ---------- */

.auth {
  max-width: 420px;
  margin: 0 auto;
  padding-top: 24px;
  text-align: center;
}

.auth .group, .auth .form-actions, .auth .banner { text-align: left; }

.auth-icon {
  display: block;
  margin: 0 auto 16px;
  border-radius: 19px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.auth-title {
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  margin: 0 0 6px;
}

.auth-subtitle {
  margin: 0 0 28px;
  color: var(--secondary);
  font-size: 15px;
}

.auth-footer { font-size: 15px; color: var(--secondary); }

/* ---------- Larger screens ---------- */

@media (hover: hover) {
  .row-link:hover, a.widget:hover { background: var(--cell-pressed); }
  .btn:hover { opacity: 0.88; }
}

.row-input input[type=date] { min-height: 22px; color: var(--tint); }
.row-input input::-webkit-date-and-time-value { text-align: right; }

/* Pull to refresh (home-screen app) */
.ptr {
  position: fixed;
  top: calc(var(--safe-top) + 44px);
  left: 50%;
  z-index: 25;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cell);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translate(-50%, -24px);
  pointer-events: none;
}
.ptr-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--tertiary);
  border-top-color: transparent;
}
.ptr.ready .ptr-spinner { border-color: var(--tint); border-top-color: transparent; }
.ptr.loading { transition: transform 0.2s ease; }
.ptr.loading .ptr-spinner { border-color: var(--tint); border-top-color: transparent; animation: ptr-spin 0.7s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* Segmented control */
.segmented {
  display: flex;
  margin: 0 0 12px;
  padding: 2px;
  border-radius: 9px;
  background: var(--fill);
}
.segmented label { flex: 1; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block;
  padding: 9px 6px;
  border-radius: 7px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--label);
  transition: background 0.15s ease;
}
.segmented input:checked + span {
  background: var(--tint);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--tint) 35%, transparent);
}
.segmented input:checked + span::before { content: "✓ "; }
.segmented input:focus-visible + span { outline: 2px solid var(--tint); outline-offset: 2px; }

/* Range calendar */
.calendar { padding: 12px 12px 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 10px; }
.cal-title { font-size: 17px; font-weight: 600; }
.cal-nav {
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; color: var(--tint); font-size: 28px; line-height: 1; cursor: pointer;
}
.cal-nav:active { background: var(--fill); }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-weekdays span { text-align: center; font-size: 13px; font-weight: 600; color: var(--tertiary); padding-bottom: 6px; }
.cal-day {
  position: relative;
  z-index: 0;
  height: 42px;
  border: 0;
  background: transparent;
  color: var(--label);
  font: inherit;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
}
.cal-day.holiday { color: var(--red); }
.cal-day.today { color: var(--tint); font-weight: 700; }
.cal-day.in-range,
.cal-day.range-start,
.cal-day.range-end { background: color-mix(in srgb, var(--tint) 16%, transparent); }
.cal-day.range-start { border-radius: 21px 0 0 21px; }
.cal-day.range-end { border-radius: 0 21px 21px 0; }
.cal-day.start, .cal-day.end { color: #fff; font-weight: 600; }
.cal-day.start::before, .cal-day.end::before {
  content: "";
  position: absolute;
  inset: 1px;
  margin: auto;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--tint);
  z-index: -1;
}
.cal-grid { isolation: isolate; }
.cal-day.busy::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 4px;
  width: 5px; height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--orange);
}
.cal-summary { margin-top: 10px; text-align: center; font-size: 15px; min-height: 20px; }
.btn:disabled { opacity: 0.4; cursor: default; }

/* Swipe-to-delete rows */
.swipe { position: relative; overflow: hidden; }
.swipe + .swipe::before {
  content: "";
  position: absolute;
  top: 0; left: 16px; right: 0;
  height: 0.5px;
  background: var(--separator);
  z-index: 2;
}
.swipe-action { position: absolute; top: 0; right: 0; bottom: 0; width: 88px; margin: 0; }
.swipe-action button {
  width: 100%; height: 100%;
  border: 0;
  background: var(--red);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.swipe-content { position: relative; z-index: 1; will-change: transform; touch-action: pan-y; }

/* Busy day marks: vacation vs sick leave */
.cal-day.busy-sick::after { background: var(--red); }
.cal-day.busy-trip::after { background: var(--teal); }
.cal-day.busy-vac.busy-sick::after { background: linear-gradient(90deg, var(--orange) 50%, var(--red) 50%); }
.cal-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--secondary);
}
.cal-legend .dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; display: inline-block; margin-left: 8px; }
.cal-legend .dot:first-child { margin-left: 0; }
.dot-vac { background: var(--orange); }
.dot-sick { background: var(--red); }
.dot-trip { background: var(--teal); }
.legend-holiday { color: var(--red); font-weight: 600; margin-left: 8px; }

/* Read-only mode for users waiting for approval */
.banner-info { color: var(--orange); }
.pill-orange { color: var(--orange); background: color-mix(in srgb, var(--orange) 15%, transparent); }
body.readonly form[method=post] button:disabled { opacity: 0.4; cursor: not-allowed; }
.row-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.btn-small-approve { background: var(--green); color: #fff; }

/* Red counter on a tab icon */
.tab-icon { position: relative; display: inline-flex; }
.tab-badge {
  position: absolute;
  top: -4px;
  left: 17px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  letter-spacing: 0;
  box-shadow: 0 0 0 2px var(--bar);
}

/* Annual bonus page */
.page-intro { margin: -6px 4px 22px; font-size: 14px; line-height: 1.45; }
.annual-actual-form { margin: 0; }
.annual-actual-form input { flex: 0 1 34%; }
.annual-actual-form .btn-small { flex-shrink: 0; }

/* Collapsible years on the annual bonus page */
.year-details { position: relative; }
.year-details + .year-details::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px;
  background: var(--separator); z-index: 1;
}
.year-details > summary { list-style: none; cursor: pointer; }
.year-details > summary::-webkit-details-marker { display: none; }
.year-details > summary .chevron { transform: rotate(45deg); transition: transform 0.2s ease; }
.year-details[open] > summary .chevron { transform: rotate(135deg); margin-top: -4px; }
.year-body { background: var(--bg); padding: 0 0 0 16px; }
.year-body .row { background: var(--bg); }
.year-body .row-title { font-size: 15px; }
.year-section {
  padding: 18px 16px 6px 0; font-size: 13px; line-height: 18px; color: var(--secondary);
  text-transform: uppercase; letter-spacing: -0.08px;
}
.year-note { padding: 6px 16px 4px 0; font-size: 13px; line-height: 18px; color: var(--secondary); }

/* Back button: iOS-size tap target (44 pt) with an invisible margin and press feedback */
.nav-back {
  position: relative;
  z-index: 21;
  min-height: 44px;
  min-width: 88px;
  padding: 0 16px 0 4px;
  margin-left: -4px;
  -webkit-user-select: none;
  user-select: none;
}
.nav-back::after { content: ""; position: absolute; inset: -6px -10px -6px -8px; }
.nav-back:active { opacity: 0.4; }
.nav-side { display: flex; align-items: center; min-height: 44px; }

/* Recovery code (shown once when encryption is turned on) */
.recovery-code .row-title {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 20px; letter-spacing: 0.04em; text-align: center; width: 100%;
  user-select: all; -webkit-user-select: all; overflow-wrap: anywhere;
}
.recovery-confirm { display: flex; gap: 10px; align-items: center; padding: 14px 16px; margin: 0 0 8px;
  font-size: 16px; cursor: pointer; }
.recovery-confirm input { width: 22px; height: 22px; accent-color: var(--blue, #0a84ff); }

/* Short footers: the details open with an (i) */
.info-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  margin-left: 2px; padding: 0; vertical-align: -3px; border: 1.2px solid currentColor; border-radius: 50%;
  background: none; color: var(--blue, #0a84ff); font: italic 600 11px/1 Georgia, serif; cursor: pointer;
}
.info-btn.open { background: var(--blue, #0a84ff); color: #fff; border-color: var(--blue, #0a84ff); }
.info-more { display: block; margin-top: 4px; }
.info-more[hidden] { display: none; }

/* Month page: Расчёт / Параметры / Расчётка */
.month-tabs { margin: 0 0 20px; }
.tab-pane[hidden] { display: none; }
.more-fields > summary { list-style: none; }
.more-fields > summary::-webkit-details-marker { display: none; }
.more-fields > summary .chevron { transform: rotate(45deg); transition: transform 0.2s ease; }
.more-fields[open] > summary .chevron { transform: rotate(135deg); margin-top: -4px; }
.more-fields > .list { border-radius: 0; }

.month-tabs input:checked + span::before { content: none; }

/* Navbar action on the right ("+" on the months list) */
.nav-side-right { justify-content: flex-end; }
.nav-action { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  margin-right: -6px; color: var(--tint); position: relative; z-index: 21; -webkit-user-select: none; user-select: none; }
.nav-action svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.nav-action:active { opacity: 0.4; }

/* Home: current month card in place of the greeting */
.current-month { display: flex; align-items: center; gap: 10px; margin: -4px 0 12px; padding: 12px 16px;
  border-radius: 20px; background: var(--cell); color: inherit; text-decoration: none; }
.current-month-main { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.current-month-label { font-size: 13px; font-weight: 600; color: var(--secondary); }
.current-month-value { font-size: 22px; line-height: 28px; font-weight: 700; color: var(--green); }
.current-month-meta { font-size: 13px; line-height: 18px; color: var(--secondary); }
.current-month:active { background: var(--cell-pressed); }

/* Months list: net on the right, quiet check mark when the payslip matches */
.month-net { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.list-ok { color: var(--green); font-weight: 600; }

/* Settings: salary history collapsed to the salary in force */
.salary-head { cursor: pointer; -webkit-user-select: none; user-select: none; }
.salary-head .chevron { transform: rotate(135deg); margin-top: -4px; transition: transform 0.2s ease; }
.salary-history.open .salary-head .chevron { transform: rotate(-45deg); margin-top: 4px; }
.salary-more { color: var(--secondary); }
.salary-history .salary-rest { display: none; }
.salary-history.open .salary-head .salary-more { display: none; }
.salary-history.open .salary-rest { display: block; }

/* Absences: filter, year chips, kind tiles */
.pill-teal { color: var(--teal); background: color-mix(in srgb, var(--teal) 15%, transparent); }
.segmented-filter span { padding: 8px 2px; font-size: 13px; }
.segmented-filter input:checked + span::before { content: none; }
.abs-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px 8px; }
.kind-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 10px; }
.kind-tile { cursor: pointer; }
.kind-tile input { position: absolute; opacity: 0; pointer-events: none; }
.kind-tile > span { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 12px; border-radius: 12px;
  background: var(--cell); border: 2px solid transparent; font-size: 16px; font-weight: 500; }
.kind-tile input:checked + span { border-color: var(--tint); }
.kind-tile input:focus-visible + span { outline: 2px solid var(--tint); outline-offset: 2px; }
.kind-tile .row-icon { margin: 0; }

/* Income charts */
.chart { padding: 14px 16px; background: var(--cell); }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chart-title { font-size: 15px; color: var(--secondary); }
.chart-value { font-size: 22px; font-weight: 700; white-space: nowrap; }
.chart-sub { margin-top: 2px; font-size: 13px; color: var(--secondary); text-align: right; }
.bars { position: relative; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); align-items: end;
  margin-top: 14px; border-bottom: 1px solid var(--separator); }
.bars-years { height: 170px; gap: 12px; }
.bars-months { height: 150px; gap: 5px; }
.bar { height: 100%; padding: 0; border: 0; background: none; display: flex; flex-direction: column; justify-content: flex-end;
  cursor: pointer; opacity: 0.55; transition: opacity 0.15s ease; -webkit-tap-highlight-color: transparent; }
.bar.selected { opacity: 1; }
.bar-empty { cursor: default; }
.bar-part { display: block; width: 100%; box-sizing: border-box; }
.bar-part:first-child { border-radius: 5px 5px 0 0; }
.bar-net { background: var(--green); }
.bar-ndfl { background: color-mix(in srgb, var(--green) 40%, var(--cell)); }
.bar-month { background: var(--tint); border-radius: 4px 4px 0 0; }
.bar-forecast { border: 1.5px dashed var(--green); border-bottom: 0; background: color-mix(in srgb, var(--green) 10%, transparent); }
.bar-forecast-blue { border-color: var(--tint); background: color-mix(in srgb, var(--tint) 12%, transparent); border-radius: 4px 4px 0 0; }
.bar-avg { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--secondary); pointer-events: none; z-index: 1; }
.bar-labels { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 5px; margin-top: 6px;
  text-align: center; font-size: 12px; color: var(--secondary); }
.bars-years + .bar-labels { gap: 12px; }
.bar-labels .selected { color: var(--label); font-weight: 600; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--secondary); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; box-sizing: border-box; }
.lg-net { background: var(--green); }
.lg-ndfl { background: color-mix(in srgb, var(--green) 40%, var(--cell)); }
.lg-forecast { border: 1.5px dashed var(--green); }
.chart-note { margin-top: 10px; font-size: 12px; line-height: 16px; color: var(--secondary); }
.segmented[hidden] { display: none; }

/* Year calendar on the absences page */
.ycal { padding: 10px 10px 12px; }
.yc-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 6px; }
.yc-year { font-size: 17px; font-weight: 600; }
.yc-months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
.yc-name { font-size: 12px; font-weight: 600; padding: 0 2px 3px; color: var(--label); }
.yc-name.yc-current { color: var(--tint); }
.yc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; }
.yc-day { display: flex; align-items: center; justify-content: center; height: 15px; font-size: 9.5px; line-height: 1;
  border-radius: 4px; color: var(--label); text-decoration: none; font-variant-numeric: tabular-nums; }
.yc-off { color: var(--red); }
a.yc-day { color: #fff; font-weight: 600; }
.yc-vac { background: var(--orange); }
.yc-unpaid { background: #8e8e93; }
.yc-sick { background: var(--red); }
.yc-train { background: var(--teal); }
.yc-today { box-shadow: inset 0 0 0 1.5px var(--tint); }
.yc-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; padding: 0 2px; font-size: 12px; color: var(--secondary); }
.yc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.yc-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.yc-offdot { background: none; box-shadow: inset 0 0 0 1px var(--red); }

/* iOS-style switch in a list row */
.row-switch { cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 51px; height: 31px; margin: 0; border-radius: 16px;
  background: var(--fill); position: relative; cursor: pointer; transition: background 0.2s ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: transform 0.2s ease; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }

/* App lock: PIN keypad (full screen at start, inline in settings) */
#lock-overlay { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-top)) 24px calc(24px + var(--safe-bottom)); overflow-y: auto; }
body.locked { overflow: hidden; }
body.locked .tabbar, body.locked .navbar { visibility: hidden; }
.pin-inline { display: flex; justify-content: center; padding: 8px 0 24px; }
.pin-box { width: 100%; max-width: 300px; display: flex; flex-direction: column; align-items: center; }
.pin-box.busy { opacity: 0.6; pointer-events: none; }
.pin-title { font-size: 20px; font-weight: 600; text-align: center; }
.pin-sub { margin-top: 4px; min-height: 20px; font-size: 15px; color: var(--secondary); text-align: center; }
.pin-dots { display: flex; gap: 18px; margin: 22px 0 10px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--label); transition: background 0.1s ease; }
.pin-dots span.on { background: var(--label); }
.pin-msg { min-height: 36px; font-size: 14px; line-height: 18px; color: var(--red); text-align: center; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 16px 24px; margin-top: 6px; }
.pin-key { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--fill); color: var(--label);
  font: 400 30px/1 -apple-system, system-ui, sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pin-key:active { background: var(--separator); }
.pin-key-text { background: none; font-size: 26px; display: flex; align-items: center; justify-content: center; }
.pin-key-text svg { width: 34px; height: 34px; color: var(--tint); }
.pin-link { margin-top: 26px; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--tint); font-size: 16px; cursor: pointer; }
@keyframes pin-shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.pin-box.shake .pin-dots { animation: pin-shake 0.35s ease; }

/* Narrow phones (many Android phones are 360 px wide) */
.cal-legend { flex-wrap: wrap; row-gap: 4px; }
.kind-tile > span { min-width: 0; }
@media (max-width: 380px) {
  .kind-tile > span { gap: 8px; padding: 0 8px; font-size: 15px; }
  .kind-tile .row-icon { width: 26px; height: 26px; font-size: 13px; }
}
.cal-legend { column-gap: 12px; }
.cal-legend-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.cal-legend-item .dot, .cal-legend-item .legend-holiday { margin-left: 0; }

/* App icon choice */
.icon-grid { display: flex; gap: 12px; padding: 14px 16px; }
.icon-tile { cursor: pointer; }
.icon-tile input { position: absolute; opacity: 0; pointer-events: none; }
.icon-tile > span { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 16px;
  border: 2px solid transparent; font-size: 14px; color: var(--label); }
.icon-tile img { width: 60px; height: 60px; border-radius: 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.18); }
.icon-tile input:checked + span { border-color: var(--tint); }
.icon-tile input:focus-visible + span { outline: 2px solid var(--tint); outline-offset: 2px; }

/* Shown instead of a blank screen when something breaks */
.fatal { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: flex; flex-direction: column; justify-content: center;
  gap: 14px; padding: calc(24px + var(--safe-top)) 24px calc(24px + var(--safe-bottom)); text-align: center; }
.fatal-title { font-size: 20px; font-weight: 600; }
.fatal-text { font-size: 15px; color: var(--secondary); overflow-wrap: anywhere; }

/* Password strength meter */
.pw-meter { margin: -4px 16px 22px; }
.pw-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.pw-bar span { height: 4px; border-radius: 2px; background: var(--fill); }
.pw-meter[data-level="0"] .pw-bar span:nth-child(-n+1) { background: var(--red); }
.pw-meter[data-level="1"] .pw-bar span:nth-child(-n+2) { background: var(--orange); }
.pw-meter[data-level="2"] .pw-bar span:nth-child(-n+3) { background: var(--green); }
.pw-meter[data-level="3"] .pw-bar span { background: var(--green); }
.pw-text { margin-top: 6px; font-size: 13px; line-height: 18px; color: var(--secondary); }

.totp-secret { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 15px; letter-spacing: 0.04em; user-select: all; -webkit-user-select: all; }
