﻿:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #667085;
  --line: #d9dee7;
  --strong: #b9c1cf;
  --blue: #00b900;
  --blue-soft: #eafbe9;
  --green: #008a35;
  --green-soft: #e6f8ec;
  --amber: #a15c00;
  --amber-soft: #fff4df;
  --red: #c13434;
  --red-soft: #ffeded;
  --violet: #6d43c3;
  --violet-soft: #f2edff;
  --shadow: 0 18px 42px rgba(18, 26, 43, 0.08);
  font-family: "Yu Gothic UI", "Meiryo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

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

button {
  cursor: pointer;
}

.kb-root {
  min-height: 100vh;
}

.kb-loading,
.kb-error {
  max-width: 640px;
  margin: 48px auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-weight: 700;
}

.kb-error {
  color: var(--red);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
}

.auth-hero {
  min-height: 100vh;
  padding: 44px;
  display: grid;
  align-content: center;
  gap: 22px;
  background:
    linear-gradient(rgba(4, 55, 25, 0.80), rgba(4, 55, 25, 0.80)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='800' viewBox='0 0 1200 800'%3E%3Crect width='1200' height='800' fill='%23dcfce7'/%3E%3Cg fill='none' stroke='%2386efac' stroke-width='2'%3E%3Cpath d='M0 120h1200M0 260h1200M0 400h1200M0 540h1200M0 680h1200M160 0v800M320 0v800M480 0v800M640 0v800M800 0v800M960 0v800M1120 0v800'/%3E%3C/g%3E%3Cg fill='%2300b900' opacity='.22'%3E%3Crect x='210' y='150' width='190' height='92' rx='12'/%3E%3Crect x='455' y='315' width='245' height='110' rx='12'/%3E%3Crect x='790' y='210' width='210' height='98' rx='12'/%3E%3Crect x='720' y='500' width='280' height='125' rx='12'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  color: #ffffff;
}

.auth-hero h1 {
  margin: 0;
  max-width: 680px;
  font-size: 42px;
  line-height: 1.12;
  letter-spacing: 0;
}

.auth-hero p {
  margin: 0;
  max-width: 640px;
  font-size: 16px;
  line-height: 1.8;
}

.auth-panel {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 24px;
  background: #ffffff;
  border-left: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.18) 28%, transparent 46%),
    linear-gradient(145deg, #b9f7cf 0%, #00b900 48%, #006b2a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -14px 24px rgba(0, 69, 28, 0.18),
    0 10px 22px rgba(0, 107, 42, 0.22);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 2px 8px rgba(0, 68, 28, 0.35);
}

.brand h2,
.brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1f6;
}

.tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.tabs button.active {
  color: var(--blue);
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.08);
}

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 5px;
}

.field label {
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--strong);
  border-radius: 6px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.btn {
  min-height: 38px;
  border: 1px solid #d2d8e4;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  color: var(--ink);
  background: #eef1f6;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.btn.primary {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.btn.danger {
  color: var(--red);
  background: var(--red-soft);
  border-color: #ffd0d0;
}

.btn.icon {
  width: 36px;
  padding: 0;
  flex: 0 0 36px;
}

.auth-message {
  min-height: 22px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.save-state {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(480px, 1fr) minmax(300px, 360px);
  gap: 14px;
  padding: 14px;
  align-items: start;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-head {
  padding: 13px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
}

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

.panel-body,
.stack {
  display: grid;
  gap: 12px;
}

.panel-body {
  padding: 14px;
}

.section {
  display: grid;
  gap: 9px;
}

.section-title {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

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

.span {
  grid-column: 1 / -1;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.switch-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.switch-line span {
  font-size: 12px;
  font-weight: 800;
}

.switch {
  width: 44px;
  height: 24px;
  border: 1px solid #ccd3df;
  border-radius: 999px;
  display: inline-flex;
  justify-content: flex-start;
  padding: 2px;
  background: #dfe4ec;
}

.switch.on {
  justify-content: flex-end;
  background: var(--blue);
  border-color: var(--blue);
}

.switch::after {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.notice {
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  padding: 9px 10px;
  color: #16314f;
  background: var(--blue-soft);
  font-size: 12px;
  line-height: 1.55;
}

.notice.warn {
  color: #6b3600;
  background: var(--amber-soft);
  border-color: #ffe0a8;
}

.list {
  display: grid;
  gap: 8px;
}

.item {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.item-title {
  min-width: 0;
}

.item-title strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.25;
}

.item-title small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.chip {
  min-width: 32px;
  height: 28px;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  color: #fff;
  background: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge {
  min-height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  color: #344054;
  background: #eef1f6;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.green {
  color: var(--green);
  background: var(--green-soft);
}

.blue {
  color: #175cd3;
  background: #eaf1ff;
}

.amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.red {
  color: var(--red);
  background: var(--red-soft);
}

.violet {
  color: var(--violet);
  background: var(--violet-soft);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-title {
  min-width: 140px;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(104px, 1fr));
  gap: 8px;
  width: min(680px, 100%);
}

.stat {
  min-height: 56px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stat small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.stat strong {
  font-size: 17px;
  line-height: 1.1;
}

.salary-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 12px 14px 0;
  padding: 14px;
  border: 1px solid #cdeed6;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f5fff7);
}

.salary-ring {
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #ffffff 0 58%, transparent 59%),
    conic-gradient(var(--blue) calc(var(--progress) * 1%), #d7f5de 0);
  box-shadow: inset 0 0 0 1px #d7f5de;
}

.salary-center {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  text-align: center;
  background: #ffffff;
}

.salary-center span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.salary-center strong {
  font-size: 20px;
  line-height: 1.1;
}

.salary-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.salary-kicker {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.salary-copy h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: 0;
}

.calendar-wrap {
  padding: 12px;
}

.weekdays,
.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekdays {
  gap: 6px;
  margin-bottom: 6px;
}

.weekday {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.calendar {
  gap: 6px;
}

.day {
  min-height: 116px;
  max-height: 164px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-rows: 28px 1fr;
  gap: 4px;
  padding: 7px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.day.outside {
  color: #98a2b3;
  background: #f2f4f7;
}

.day.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.day.today {
  border-color: var(--green);
}

.day.sunday,
.day.holiday {
  border-color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(193, 52, 52, 0.2);
}

.day.holiday .date-num,
.day.sunday .date-num {
  color: var(--red);
  background: var(--red-soft);
}

.day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.date-num {
  width: 26px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.day.today .date-num {
  color: #fff;
  background: var(--green);
}

.day-total {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.events {
  display: grid;
  align-content: start;
  gap: 5px;
  overflow: hidden;
}

.pill {
  min-width: 0;
  border: 1px solid var(--slot-color, #00b900);
  border-radius: 6px;
  display: grid;
  gap: 2px;
  padding: 5px 6px;
  color: #ffffff;
  background: var(--slot-color, #00b900);
  box-shadow: inset 0 -16px 28px rgba(0, 0, 0, 0.08);
  font-size: 11px;
  line-height: 1.25;
}

.pill.cancel {
  color: #fff;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0 5px, rgba(255, 255, 255, 0) 5px 10px),
    var(--slot-color, #a15c00);
  border-color: var(--slot-color, #a15c00);
}

.pill strong,
.pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

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

.table th {
  color: var(--muted);
  background: #f8fafc;
  font-size: 11px;
  font-weight: 900;
}

.table th:last-child,
.table td:last-child {
  text-align: right;
}

.empty {
  padding: 14px;
  border: 1px dashed var(--strong);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfe;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.mobile-tabs {
  display: none;
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .right {
    grid-column: 1 / -1;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(104px, 1fr));
  }
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    min-height: 310px;
    padding: 28px 20px;
  }

  .auth-hero h1 {
    font-size: 30px;
  }

  .auth-panel {
    min-height: auto;
    border-left: 0;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: auto repeat(3, minmax(0, 1fr));
    gap: 6px;
    align-items: center;
  }

  .top-actions .btn {
    min-height: 34px;
    padding: 7px 8px;
    font-size: 12px;
  }

  .save-state {
    font-size: 11px;
    white-space: nowrap;
  }

  .mobile-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -10px 26px rgba(20, 30, 50, 0.08);
    backdrop-filter: blur(10px);
  }

  .mobile-tabs button {
    min-height: 44px;
    border: 0;
    border-radius: 7px;
    color: var(--muted);
    background: transparent;
    font-weight: 900;
  }

  .mobile-tabs button.active {
    color: #fff;
    background: var(--blue);
    border-color: var(--blue);
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 10px 10px 78px;
  }

  .left,
  .center,
  .right {
    display: none;
  }

  .left.mobile-active,
  .center.mobile-active,
  .right.mobile-active {
    display: block;
  }

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

  .salary-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .salary-copy .badges {
    justify-content: center;
  }

  .weekdays,
  .calendar {
    min-width: 720px;
  }

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

  .span {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .top-actions .btn {
    width: 100%;
  }

  .toolbar {
    align-items: stretch;
  }

  .month-nav {
    width: 100%;
    justify-content: space-between;
  }

  .month-title {
    min-width: 0;
  }

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

/* App tab layout v2 */
.layout {
  display: block;
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 14px 86px;
}

.screen {
  display: none;
}

.screen.mobile-active {
  display: block;
}

.mobile-tabs {
  position: sticky;
  top: 68px;
  z-index: 9;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.mobile-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.mobile-tabs button.active {
  color: #fff;
  background: var(--blue);
}

.quick-add {
  display: grid;
  gap: 10px;
  margin: 12px 14px 0;
  padding: 12px;
  border: 1px solid #cdeed6;
  border-radius: 8px;
  background: #f7fff8;
}

.quick-add h2 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.2;
}

.selected-day {
  border-top: 1px solid var(--line);
}

.inline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.payroll-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 82%);
  gap: 12px;
  overflow-x: auto;
  padding: 14px;
  scroll-snap-type: x mandatory;
}

.payroll-card {
  scroll-snap-align: center;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.payroll-card.is-current {
  border-color: #b6ecc4;
  background: linear-gradient(180deg, #ffffff, #f5fff7);
}

.payroll-month {
  font-size: 18px;
  font-weight: 900;
}

.salary-ring.compact {
  width: 142px;
}

.payroll-lines {
  width: 100%;
  display: grid;
  gap: 7px;
}

.payroll-lines div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.payroll-lines span {
  color: var(--muted);
  font-weight: 800;
}

.settings-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.section-row h3 {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.35;
}

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

.segmented.setting-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1f6;
}

.segmented.setting-buttons button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.segmented.setting-buttons button.active {
  color: #fff;
  background: var(--blue);
}

.color-picker {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.color-picker small {
  min-width: 64px;
  color: var(--muted);
  font-weight: 900;
}

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

.transport-add {
  margin-top: 12px;
}

.transport-add input {
  min-height: 38px;
  min-width: 0;
  flex: 1 1 180px;
  border: 1px solid var(--strong);
  border-radius: 6px;
  padding: 8px 10px;
}

.clickable {
  cursor: pointer;
}

.clickable:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 18px rgba(20, 30, 50, 0.08);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.38);
}

.modal-sheet {
  width: min(720px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.edit-lesson-form {
  padding: 14px;
}

.payroll-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 14px 0;
}

.payroll-nav strong {
  min-width: 150px;
  text-align: center;
  font-size: 18px;
}

.annual-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #cdeed6;
  border-radius: 8px;
  background: #f7fff8;
}

.annual-card h2 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.1;
}

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

.year-month {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  align-content: center;
  padding: 8px;
  color: var(--ink);
  background: #fff;
}

.year-month.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.year-month span {
  font-size: 12px;
  font-weight: 900;
}

.year-month strong {
  font-size: 13px;
  line-height: 1.1;
}

@media (max-width: 900px) {
  .mobile-tabs {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: 0 -10px 26px rgba(20, 30, 50, 0.08);
  }

  .mobile-tabs button {
    min-height: 44px;
  }

  .layout {
    padding: 10px 10px 86px;
  }

  .top-actions {
    display: flex;
    width: auto;
  }

  .payroll-carousel {
    grid-auto-columns: 86%;
  }

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

  .modal-backdrop {
    align-items: end;
    padding: 10px 10px calc(84px + env(safe-area-inset-bottom));
  }

  .modal-sheet {
    max-height: 78vh;
    border-radius: 12px 12px 8px 8px;
  }
}

/* Focused MVP refinements v4 */
.color-chip {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(16, 24, 40, 0.12);
}

.event-slot-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.event-slot-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.event-slot-choice {
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 3px 8px;
  align-items: center;
  padding: 9px;
  background: #fff;
}

.event-slot-choice .chip {
  grid-row: 1 / span 2;
}

.event-slot-choice strong,
.event-slot-choice small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-slot-choice small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.event-slot-choice:has(input:checked),
.event-slot-choice.selected {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 3px rgba(0, 185, 0, 0.14);
}

.payroll-view-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 12px 14px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1f6;
}

.payroll-view-toggle button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.payroll-view-toggle button.active {
  color: #fff;
  background: var(--blue);
}

body .mobile-tabs {
  z-index: 100;
}

.payroll-focus {
  padding: 14px;
}

.payroll-focus .payroll-card {
  max-width: 560px;
  margin: 0 auto;
}

.payment-field {
  width: 100%;
}

.salary-ring.double {
  position: relative;
  width: 164px;
  overflow: hidden;
  background: conic-gradient(#2563eb calc(var(--planned) * 1%), #e4e7ec 0);
  box-shadow: inset 0 0 0 1px #d0d5dd;
}

.salary-ring.double::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--actual) * 1%), #d7f5de 0);
}

.salary-ring.double .salary-center {
  position: relative;
  z-index: 1;
  width: 104px;
  height: 104px;
  box-shadow: 0 0 0 10px #fff;
}

.salary-ring.double .salary-center strong {
  font-size: 18px;
}

.salary-ring.double .salary-center small {
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
}

.payroll-summary {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.summary-ring {
  display: grid;
  place-items: center;
}

.summary-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.year-month small {
  color: inherit;
  opacity: 0.78;
  font-size: 10px;
  font-weight: 900;
}

@media (max-width: 900px) {
  .event-slot-picker {
    grid-template-columns: 1fr;
  }

  .payroll-summary {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .summary-copy .badges {
    justify-content: center;
  }
}

/* Mobile fit and payroll ring refinements v5 */
html,
body,
.kb-root,
.app {
  max-width: 100%;
  overflow-x: hidden;
}

.screen,
.panel,
.panel-body,
.section,
.list,
.item,
.payroll-card,
.annual-card {
  max-width: 100%;
  min-width: 0;
}

.salary-ring.double {
  width: 174px;
  transform: rotate(-90deg);
  background: conic-gradient(#f4b000 calc(var(--paid-goal) * 1%), #fffaf0 0);
}

.salary-ring.double::before {
  inset: 19px;
  background: conic-gradient(var(--green) calc(var(--planned-goal) * 1%), #d7f5de 0);
}

.salary-ring.double .salary-center {
  transform: rotate(90deg);
  width: 108px;
  height: 108px;
  gap: 2px;
}

.salary-ring.double .salary-center small:last-child {
  color: var(--amber);
}

@media (max-width: 900px) {
  .layout {
    width: 100%;
    max-width: 100%;
    padding-left: 8px;
    padding-right: 8px;
  }

  .panel-head,
  .panel-body,
  .section {
    padding-left: 10px;
    padding-right: 10px;
  }

  .toolbar {
    padding: 10px;
  }

  .month-nav {
    width: 100%;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px auto;
    gap: 6px;
  }

  .month-nav .btn {
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
  }

  .month-title {
    min-width: 0;
    font-size: 16px;
  }

  .calendar-wrap {
    overflow-x: hidden;
    padding: 8px 6px;
  }

  .weekdays,
  .calendar {
    width: 100%;
    min-width: 0;
    gap: 3px;
  }

  .weekday {
    font-size: 10px;
  }

  .day {
    min-width: 0;
    min-height: 58px;
    max-height: none;
    grid-template-rows: 18px 1fr;
    gap: 2px;
    padding: 3px;
    border-radius: 6px;
  }

  .date-num {
    width: 20px;
    height: 18px;
    border-radius: 5px;
    font-size: 11px;
  }

  .day-total {
    display: none;
  }

  .events {
    gap: 2px;
  }

  .pill {
    min-height: 13px;
    padding: 1px 3px;
    border-radius: 4px;
    font-size: 9px;
    line-height: 1.15;
  }

  .pill span {
    display: none;
  }

  .quick-add,
  .payroll-focus,
  .modal-head,
  .edit-lesson-form {
    margin-left: 0;
    margin-right: 0;
    padding-left: 10px;
    padding-right: 10px;
  }

  .event-slot-picker,
  .transport-groups,
  .settings-actions,
  .year-grid {
    grid-template-columns: 1fr;
  }

  .payroll-card {
    box-shadow: none;
  }

  .payroll-lines div,
  .badges,
  .row {
    min-width: 0;
  }

  .badge {
    white-space: normal;
    line-height: 1.25;
  }

  .table {
    font-size: 11px;
  }

  .table th,
  .table td {
    padding: 7px 4px;
  }
}

@media (max-width: 390px) {
  .layout {
    padding-left: 6px;
    padding-right: 6px;
  }

  .calendar-wrap {
    padding-left: 4px;
    padding-right: 4px;
  }

  .calendar,
  .weekdays {
    gap: 2px;
  }

  .day {
    min-height: 54px;
    padding: 2px;
  }

  .pill {
    font-size: 8px;
  }
}

/* v6 polished controls */
.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", "Yu Gothic UI", sans-serif;
  font-size: 44px;
  font-weight: 1000;
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.28) 28%, transparent 48%),
    linear-gradient(145deg, #eafff0 0%, #39e268 20%, #00b900 54%, #00682b 100%);
}

.quick-select {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.quick-select select {
  min-width: 0;
}

.money-preview {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.settings-subtabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1f6;
}

.settings-subtabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.settings-subtabs button.active {
  color: #fff;
  background: var(--blue);
}

.sync-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #cdeed6;
  border-radius: 8px;
  background: #f7fff8;
}

.sync-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.65;
}

.btn.disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.salary-ring.double {
  transform: none;
  background: conic-gradient(from 0deg, #f4b000 calc(var(--paid-goal) * 1%), #fffaf0 0);
}

.salary-ring.double::before {
  background: conic-gradient(from 0deg, var(--green) calc(var(--planned-goal) * 1%), #d7f5de 0);
}

.salary-ring.double .salary-center {
  transform: none;
}

.payment-trend-chart {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  min-height: 260px;
}

.trend-y-axis {
  height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-align: right;
}

.trend-plot {
  position: relative;
  min-width: 0;
  height: 238px;
  display: grid;
  grid-template-rows: 210px 28px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.trend-grid-lines {
  position: absolute;
  inset: 0 0 28px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.trend-grid-lines span {
  height: 1px;
  background: #eef1f6;
}

.line-plot {
  overflow: hidden;
}

.trend-line-svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 210px;
  display: block;
  overflow: visible;
}

.trend-line {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.trend-line-current {
  stroke: var(--green);
}

.trend-line-prev {
  stroke: #a7c7ff;
}

.trend-point {
  stroke: #fff;
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

.trend-point-current,
.legend-current {
  background: var(--green);
  fill: var(--green);
}

.trend-point-prev,
.legend-prev {
  background: #a7c7ff;
  fill: #a7c7ff;
}

.trend-x-axis {
  height: 28px;
  display: grid;
  grid-template-columns: repeat(24, minmax(18px, 1fr));
  gap: 4px;
  align-items: start;
  padding: 0 4px;
}

.trend-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.trend-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.trend-x-axis small {
  writing-mode: vertical-rl;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

@media (max-width: 900px) {
  .settings-subtabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .settings-subtabs button {
    padding-left: 4px;
    padding-right: 4px;
    font-size: 11px;
  }

  .payment-trend-chart {
    grid-template-columns: 62px minmax(0, 1fr);
  }
}

/* v8 lesson/payroll refinements */
.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  font-family: "SF Pro Rounded", "Arial Rounded MT Bold", "Hiragino Maru Gothic ProN", "Yu Gothic UI", sans-serif;
  font-size: 43px;
  font-weight: 950;
  background:
    radial-gradient(circle at 23% 18%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.34) 28%, transparent 54%),
    linear-gradient(145deg, #eafff0 0%, #37e85f 18%, #00b900 54%, #00672a 100%);
}

.app-profile {
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.lesson-add-panel {
  margin: 0;
}

.btn.wide {
  width: 100%;
}

.history-scroll {
  max-height: min(52vh, 430px);
  overflow-y: auto;
  padding-right: 3px;
}

.modal-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #eef1f6;
}

.modal-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 950;
}

.modal-tabs button.active {
  color: #fff;
  background: var(--blue);
}

.goal-line {
  margin: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 950;
  text-align: center;
}

.payroll-diff {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 950;
}

.salary-ring.double .salary-center {
  width: 122px;
  height: 122px;
  padding: 8px;
}

.salary-ring.double .salary-center span,
.salary-ring.double .salary-center small {
  font-size: 10px;
  line-height: 1.25;
}

.salary-ring.double .salary-center strong {
  font-size: 14px;
  line-height: 1.25;
  white-space: normal;
}

.breakdown-list {
  display: grid;
  gap: 6px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 42px 74px minmax(82px, .9fr);
  gap: 6px;
  align-items: center;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}

.breakdown-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breakdown-row span {
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .layout {
    padding-top: 10px;
  }

  .calendar .events {
    display: flex;
    align-items: start;
    align-content: start;
    flex-wrap: wrap;
    gap: 3px;
  }

  .calendar .pill {
    width: 8px;
    height: 8px;
    min-height: 8px;
    border-radius: 999px;
    padding: 0;
    border: 0;
    background: var(--slot-color, #00b900);
    box-shadow: none;
  }

  .calendar .pill strong,
  .calendar .pill span {
    display: none;
  }

  .breakdown-row {
    grid-template-columns: minmax(0, 1.45fr) 38px 68px minmax(74px, .9fr);
    padding: 8px 6px;
    gap: 5px;
    font-size: 11px;
  }

  .salary-ring.double {
    width: 178px;
  }
}

/* v10 responsive app shell, mobile calendar, and payroll ring */
.mobile-settings-topbar,
.mobile-calendar-stack {
  display: none;
}

.desktop-topbar {
  justify-content: flex-start;
}

.desktop-topbar .top-actions {
  margin-left: auto;
}

.day.saturday:not(.holiday) {
  border-color: #38bdf8;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.24);
}

.day.saturday:not(.holiday) .date-num {
  color: #0284c7;
  background: #e0f7ff;
}

.salary-ring.double {
  width: 190px;
  background:
    radial-gradient(circle at center, #fff 0 57%, transparent 58%),
    conic-gradient(from -90deg,
      var(--green) 0 calc(var(--completed-goal) * 1%),
      #bff3c8 0 calc(var(--planned-goal) * 1%),
      #edf2f7 0);
  box-shadow: inset 0 0 0 1px #caead0;
}

.salary-ring.double::before {
  display: none;
}

.salary-ring.double .salary-center {
  width: 132px;
  height: 132px;
  box-shadow: none;
}

.salary-ring.double .salary-center span {
  font-size: 11px;
}

.salary-ring.double .salary-center strong {
  color: var(--green);
  font-size: 17px;
  line-height: 1.18;
}

.salary-ring.double .salary-center small,
.salary-ring.double .salary-center small:last-child {
  color: var(--muted);
  font-size: 11px;
}

.history-title {
  min-width: 0;
  flex-wrap: nowrap;
}

.history-title > div {
  min-width: 0;
}

@media (min-width: 901px) {
  .desktop-topbar {
    display: flex;
  }

  .mobile-settings-topbar {
    display: none;
  }
}

@media (max-width: 900px) {
  .desktop-topbar {
    display: none;
  }

  .mobile-settings-topbar {
    display: flex;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
  }

  .mobile-tabs {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: 0 -10px 26px rgba(20, 30, 50, 0.08);
  }

  .lessons > .panel > .toolbar,
  .lessons > .panel > .calendar-wrap {
    display: none;
  }

  .mobile-calendar-stack {
    display: grid;
    gap: 12px;
    max-height: 58vh;
    overflow-y: auto;
    padding: 10px;
    scroll-snap-type: y proximity;
    background: #f8fafc;
  }

  .mobile-month {
    display: grid;
    gap: 6px;
    scroll-snap-align: start;
    padding: 10px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .mobile-month-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 14px;
    font-weight: 950;
  }

  .mobile-month-head span {
    color: var(--green);
    font-size: 11px;
  }

  .mobile-month .weekdays,
  .mobile-month .calendar {
    width: 100%;
    min-width: 0;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0 0 calc(74px + env(safe-area-inset-bottom));
  }

  .modal-sheet {
    width: 100%;
    max-height: calc(100vh - 82px - env(safe-area-inset-bottom));
    border-radius: 12px 12px 0 0;
  }

  .edit-lesson-form {
    padding: 8px;
  }

  .edit-lesson-form .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .edit-lesson-form .field {
    gap: 3px;
  }

  .edit-lesson-form .field label {
    font-size: 10px;
  }

  .edit-lesson-form .field input,
  .edit-lesson-form .field select,
  .edit-lesson-form .field textarea {
    min-height: 34px;
    padding: 6px 7px;
    font-size: 12px;
  }

  .edit-lesson-form .field.span {
    grid-column: 1 / -1;
  }

  .edit-lesson-form textarea {
    min-height: 38px;
  }

  .edit-lesson-form .row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .edit-lesson-form .row .btn {
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
  }

  .salary-ring.double {
    width: 184px;
  }
}

/* v11 rounded icon, snapping months, lesson color frames, and SVG payroll rings */
.brand-mark {
  font-family: "M PLUS Rounded 1c", "SF Pro Rounded", "Arial Rounded MT Bold", "Hiragino Maru Gothic ProN", "Yu Gothic UI", sans-serif;
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 1;
  overflow: hidden;
  color: transparent;
  background-image: url("icon.svg");
  background-size: cover;
  background-position: center;
}

.lesson-item {
  border-color: var(--slot-color, #00b900);
  box-shadow: inset 5px 0 0 var(--slot-color, #00b900);
}

.lesson-item:hover {
  border-color: var(--slot-color, #00b900);
  box-shadow: inset 5px 0 0 var(--slot-color, #00b900), 0 8px 18px rgba(20, 30, 50, 0.08);
}

.salary-ring.double {
  position: relative;
  width: 198px;
  aspect-ratio: 1;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.salary-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ring-track,
.ring-progress {
  fill: none;
  transform: rotate(-90deg);
  transform-origin: 100px 100px;
}

.ring-track.outer {
  stroke: #edf2f7;
  stroke-width: 18;
}

.ring-track.inner {
  stroke: #fff8d6;
  stroke-width: 12;
}

.ring-progress {
  stroke-linecap: round;
  stroke-dasharray: 0 100;
}

.ring-progress.planned {
  stroke: #bff3c8;
  stroke-width: 18;
  stroke-dasharray: var(--planned-goal) 100;
}

.ring-progress.completed {
  stroke: var(--green);
  stroke-width: 18;
  stroke-dasharray: var(--completed-goal) 100;
}

.ring-progress.paid {
  stroke: #f4b000;
  stroke-width: 12;
  stroke-dasharray: var(--paid-goal) 100;
}

.salary-ring.double::before {
  display: none;
}

.salary-ring.double .salary-center {
  position: relative;
  z-index: 1;
  width: 126px;
  height: 126px;
  padding: 9px;
  box-shadow: none;
}

.salary-ring.double .salary-center span {
  font-size: 11px;
  line-height: 1.2;
}

.salary-ring.double .salary-center strong {
  color: var(--green);
  font-size: 17px;
  line-height: 1.16;
}

.salary-ring.double .salary-center .salary-paid,
.salary-ring.double .salary-center small:last-child {
  color: #f4b000;
  font-size: 11px;
}

.salary-ring.double .salary-center .salary-transport {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.14;
}

.trend-x-axis {
  height: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  gap: 10px;
}

.trend-x-axis small {
  writing-mode: horizontal-tb;
  transform: none;
  min-width: 28px;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .payment-trend-chart {
    min-height: 286px;
  }

  .trend-plot {
    height: 246px;
    grid-template-rows: 210px 36px;
    overflow: hidden;
  }

  .line-plot {
    overflow: hidden;
  }

  .trend-grid-lines {
    inset: 0 0 36px 0;
  }

  .mobile-calendar-stack {
    scroll-snap-type: y mandatory;
    overscroll-behavior-y: contain;
  }

  .mobile-month {
    min-height: calc(58vh - 20px);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .salary-ring.double {
    width: 190px;
  }

  .trend-x-axis {
    height: 36px;
  }

  .trend-x-axis small {
    font-size: 9px;
  }
}

/* v13 schedule, per-slot payment, and mobile interaction refinements */
.toolbar {
  justify-content: space-between;
}

.btn.mini {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
}

.mobile-lesson-tools {
  display: none;
}

.weekday.sunday {
  color: var(--red);
}

.weekday.saturday {
  color: #0284c7;
}

.day.sunday,
.day.holiday {
  border-color: var(--red);
  background: #fffafa;
}

.day.saturday:not(.holiday) {
  border-color: #38bdf8;
  background: #f6fcff;
}

.other-pill {
  --slot-color: #98a2b3;
  border-color: #cbd5e1;
  background: #f8fafc;
}

.gap-row {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
}

.other-item {
  border-color: #cbd5e1;
  box-shadow: inset 5px 0 0 #98a2b3;
  background: #fbfcfe;
}

.other-schedule-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px 112px auto;
  gap: 8px;
  align-items: center;
}

.other-schedule-form input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--strong);
  border-radius: 6px;
  padding: 8px 10px;
}

.history-item {
  touch-action: pan-y;
  transition: transform .18s ease, background .18s ease;
}

.slot-breakdown-row {
  grid-template-columns: minmax(0, 1.45fr) 40px 72px minmax(86px, .9fr) minmax(128px, 1fr);
  border-color: color-mix(in srgb, var(--slot-color, #00b900) 42%, var(--line));
  box-shadow: inset 5px 0 0 var(--slot-color, #00b900);
}

.slot-payment-field {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  color: #b77900;
  font-size: 11px;
  font-weight: 950;
}

.slot-payment-field input {
  min-width: 0;
  min-height: 34px;
  border: 1px solid #f5d56a;
  border-radius: 6px;
  padding: 6px 8px;
  color: #9a6700;
  background: #fffbe8;
  text-align: right;
  font-weight: 950;
}

.mobile-settings-topbar .top-actions {
  margin-left: auto;
}

.mobile-settings-topbar .save-state {
  display: none;
}

.settings-profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.settings-profile .brand {
  min-width: 0;
}

.settings-profile h2 {
  margin: 0;
  font-size: 20px;
}

.settings-profile small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.payroll-card {
  gap: 9px;
}

.payroll-focus {
  padding-bottom: 8px;
}

@media (max-width: 900px) {
  .mobile-lesson-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px 10px 0;
  }

  .mobile-calendar-stack {
    max-height: 50vh;
    padding: 8px;
  }

  .mobile-month {
    min-height: calc(50vh - 16px);
  }

  .selected-day .panel-head {
    padding-top: 10px;
    padding-bottom: 8px;
  }

  .selected-day .panel-head h2 {
    font-size: 17px;
  }

  .quick-add {
    gap: 8px;
    padding: 10px;
  }

  .other-schedule-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .other-schedule-form input[name="otherTitle"],
  .other-schedule-form .btn {
    grid-column: 1 / -1;
  }

  .payroll-view-toggle,
  .payroll-nav {
    gap: 6px;
  }

  .payroll-nav {
    padding: 7px 8px 0;
  }

  .payroll-nav strong {
    min-width: 92px;
    font-size: 14px;
  }

  .payroll-nav .btn {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .payroll-focus {
    padding: 8px 6px 4px;
  }

  .payroll-card {
    padding: 10px;
    gap: 7px;
  }

  .goal-line {
    font-size: 12px;
  }

  .salary-ring.double {
    width: min(224px, 72vw);
  }

  .salary-ring.double .salary-center {
    width: 142px;
    height: 142px;
  }

  .salary-ring.double .salary-center span {
    font-size: 12px;
  }

  .salary-ring.double .salary-center .salary-transport {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.12;
  }

  .salary-ring.double .salary-center strong {
    font-size: 18px;
  }

  .salary-ring.double .salary-center .salary-paid,
  .salary-ring.double .salary-center small:last-child {
    font-size: 12px;
  }

  .payroll-diff {
    min-height: 30px;
    padding: 5px 12px;
    font-size: 12px;
  }

  .slot-breakdown-row {
    grid-template-columns: minmax(0, 1fr) minmax(128px, 42%);
    gap: 5px;
  }

  .slot-payment-field {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .slot-breakdown-row .breakdown-name {
    grid-column: 1;
    white-space: normal;
  }

  .slot-breakdown-row .breakdown-count,
  .slot-breakdown-row .breakdown-time,
  .slot-breakdown-row .breakdown-total {
    grid-column: 1;
    text-align: left;
  }

  .slot-breakdown-row .breakdown-count,
  .slot-breakdown-row .breakdown-time {
    display: inline;
  }

  .slot-breakdown-row .breakdown-total {
    color: var(--muted);
    font-size: 10px;
  }

  .slot-payment-field {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .trend-x-axis {
    overflow: visible;
    gap: 6px;
    padding-top: 2px;
  }

  .trend-x-axis small {
    transform: none;
    min-width: 34px;
    text-align: center;
    white-space: nowrap;
  }

  .settings-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
  }

  .settings-profile .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .settings-profile .brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .settings-profile h2 {
    font-size: 14px;
  }

  .settings-profile .brand p {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .settings-profile .btn {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 12px;
  }
}

@supports not (color: color-mix(in srgb, #000 50%, #fff)) {
  .slot-breakdown-row {
    border-color: var(--slot-color, #00b900);
  }
}

/* v15 income wording, compact calendars, and mobile form tuning */
.payroll-view-toggle {
  grid-template-columns: auto repeat(2, minmax(0, 1fr));
  align-items: center;
}

.view-label,
.mobile-tool-label {
  color: var(--green);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.ring-track.outer,
.ring-progress.planned,
.ring-progress.completed {
  stroke-width: 14;
}

.salary-ring.double .salary-center {
  width: 136px;
  height: 136px;
}

.salary-ring.double .salary-center span {
  font-size: 12px;
}

.salary-ring.double .salary-center strong {
  font-size: 19px;
  line-height: 1.12;
}

.salary-ring.double .salary-center .salary-paid {
  font-size: 12px;
}

.calendar-wrap {
  padding-top: 8px;
  padding-bottom: 8px;
}

.calendar {
  gap: 4px;
}

.day {
  min-height: 92px;
  grid-template-rows: 24px 1fr;
  padding: 5px;
}

.pill {
  padding: 3px 5px;
}

.more-count {
  justify-self: start;
  min-height: 18px;
  padding: 2px 6px;
}

.history-item::after {
  display: none;
}

.history-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
}

.history-title small {
  display: grid;
  gap: 2px;
  white-space: normal;
}

.history-title small span {
  min-width: 0;
}

@media (max-width: 900px) {
  .mobile-lesson-tools {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .mobile-calendar-stack {
    max-height: 44vh;
  }

  .mobile-month {
    min-height: calc(44vh - 16px);
  }

  .day {
    min-height: 46px;
    grid-template-rows: 17px 1fr;
  }

  .date-num {
    width: 19px;
    height: 17px;
    font-size: 10px;
  }

  .calendar .events {
    gap: 2px;
  }

  .more-count {
    min-height: 12px;
    padding: 0 3px;
    font-size: 8px;
    line-height: 1.1;
  }

  .payroll-view-toggle {
    grid-template-columns: auto repeat(2, minmax(0, 1fr));
  }

  .view-label {
    padding-left: 6px;
    font-size: 12px;
  }

  .salary-ring.double {
    width: min(210px, 68vw);
  }

  .salary-ring.double .salary-center {
    width: 146px;
    height: 146px;
  }

  .salary-ring.double .salary-center strong {
    font-size: 20px;
  }

  .history-panel {
    padding-left: 8px;
    padding-right: 8px;
  }

  .history-item .item-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .history-title {
    align-items: start;
  }

  .history-actions .btn.icon {
    width: 34px;
    min-height: 34px;
    flex-basis: 34px;
  }

  .edit-lesson-form .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .edit-lesson-form .event-slot-field,
  .edit-lesson-form .event-date-field,
  .edit-lesson-form .event-name-field {
    grid-column: 1 / -1;
  }

  .edit-lesson-form .event-time-field {
    grid-column: auto;
  }

  .edit-lesson-form .quick-select {
    grid-template-columns: 24px minmax(0, 1fr);
  }
}

/* v16 weekly availability export and wide lesson layout */
.trend-line-current {
  stroke: #f4b000;
}

.trend-line-prev {
  stroke: #ffe28a;
}

.trend-point-current,
.legend-current {
  background: #f4b000;
  fill: #f4b000;
}

.trend-point-prev,
.legend-prev {
  background: #ffe28a;
  fill: #ffe28a;
}

.weekly-export-sheet {
  width: min(1040px, calc(100vw - 24px));
}

.weekly-export-table {
  min-width: 860px;
  display: grid;
  grid-template-columns: 104px repeat(7, minmax(92px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.weekly-table-scroll {
  overflow-x: auto;
  padding-bottom: 2px;
}

.weekly-export-head,
.weekly-time-label,
.availability-cell {
  min-height: 42px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  place-items: center;
  padding: 6px;
  text-align: center;
  font-weight: 950;
}

.weekly-export-head {
  background: #f3f6fa;
  color: var(--ink);
}

.weekly-export-head small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.weekly-time-label {
  color: var(--muted);
  background: #fbfcfe;
  font-size: 11px;
}

.availability-cell {
  border-top: 0;
  border-left: 0;
  border-radius: 0;
  background: #fff;
  font-size: 18px;
}

.availability-cell.available {
  color: var(--green);
  background: #f3fff6;
}

.availability-cell.unavailable {
  color: var(--red);
  background: #fff4f4;
}

.weekly-export-actions {
  margin-top: 12px;
}

/* v17 tablet breakpoints, weekly export controls, account forms */
.copy-week-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.copy-week-actions .btn {
  width: 100%;
  white-space: normal;
}

.gap-mark {
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: #7a4b00;
  background: #ffe58a;
  font-size: 11px;
  font-weight: 1000;
}

.weekly-time-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}

.weekly-time-settings label,
.mini-check {
  min-height: 38px;
  display: grid;
  gap: 4px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mini-check {
  grid-auto-flow: column;
  justify-content: start;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.account-forms {
  display: grid;
  gap: 10px;
}

.slot-settings .field:has([name="slotClosingDay"]),
.slot-settings .field:has([name="slotPaymentMonthOffset"]),
.slot-settings .field:has([name="slotPaymentDay"]),
.slot-settings .badges .badge:last-child {
  display: none;
}

@media (max-width: 900px) {
  .mobile-month .day {
    min-height: 58px;
  }

  .mobile-month .calendar .events {
    display: grid;
    gap: 2px;
  }

  .mobile-month .calendar .pill {
    width: 100%;
    height: auto;
    min-height: 14px;
    border-radius: 4px;
    padding: 1px 3px;
  }

  .mobile-month .calendar .pill strong {
    display: block;
    font-size: 8px;
    line-height: 1.1;
  }

  .mobile-month .calendar .pill span {
    display: none;
  }

  .slot-breakdown-row {
    grid-template-columns: minmax(0, 1fr) auto 104px;
    gap: 5px 8px;
    align-items: center;
  }

  .slot-breakdown-row .breakdown-name {
    grid-column: 1;
    grid-row: 1;
  }

  .slot-breakdown-row .breakdown-count {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }

  .slot-breakdown-row .breakdown-time {
    grid-column: 1;
    grid-row: 2;
    justify-self: end;
  }

  .slot-breakdown-row .breakdown-total {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
  }

  .slot-breakdown-row .slot-payment-field {
    grid-column: 3;
    grid-row: 1 / span 2;
    min-width: 96px;
  }

  .slot-breakdown-row .slot-payment-field input {
    width: 96px;
  }
}

@media (min-width: 901px) {
  .lessons > .panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(390px, 430px);
    align-items: start;
  }

  .lessons > .panel > .toolbar,
  .lessons > .panel > .mobile-lesson-tools,
  .lessons > .panel > .mobile-calendar-stack {
    grid-column: 1 / -1;
  }

  .lessons > .panel > .calendar-wrap {
    grid-column: 1;
  }

  .lessons > .panel > .selected-day {
    grid-column: 2;
    border-top: 0;
    border-left: 1px solid var(--line);
    max-height: calc(100vh - 120px);
    overflow: auto;
    position: sticky;
    top: 12px;
  }
}

@media (max-width: 900px) {
  .weekly-export-sheet {
    width: 100%;
  }

  .weekly-export-table {
    min-width: 760px;
    grid-template-columns: 86px repeat(7, 92px);
  }

  .weekly-export-head,
  .weekly-time-label,
  .availability-cell {
    min-height: 38px;
  }
}

/* v18 kaizen: mobile input reliability, slot modal editing, compact payroll rows */
input[type="date"],
input[type="time"] {
  appearance: auto;
  -webkit-appearance: textfield;
  min-width: 0;
  touch-action: manipulation;
}

.slot-modal-sheet {
  width: min(680px, calc(100vw - 24px));
}

.modal-slot-form .grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-slot-form .field.span {
  grid-column: 1 / -1;
}

.history-scroll {
  max-height: min(70vh, 620px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-width: 900px) {
  .lessons > .panel > .mobile-calendar-stack {
    display: block;
    position: sticky;
    top: 0;
    z-index: 30;
    max-height: min(46vh, 430px);
    overflow-y: auto;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
  }

  .history-scroll {
    max-height: calc(100vh - 250px);
  }

  .edit-lesson-form .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .edit-lesson-form .event-date-field,
  .edit-lesson-form .event-name-field {
    grid-column: auto;
  }

  .edit-lesson-form .field.span.event-date-field,
  .edit-lesson-form .field.span.event-name-field {
    grid-column: auto;
  }

  .edit-lesson-form .event-slot-field {
    grid-column: 1 / -1;
  }

  .edit-lesson-form .event-time-field {
    grid-column: auto;
    min-width: 0;
  }

  .edit-lesson-form input[type="date"],
  .edit-lesson-form input[type="time"],
  .edit-lesson-form input,
  .edit-lesson-form select,
  .edit-lesson-form textarea,
  .modal-slot-form input,
  .modal-slot-form select {
    font-size: 16px;
  }

  .edit-lesson-form .event-time-field input[type="time"] {
    width: 100%;
    letter-spacing: 0;
  }

  .slot-breakdown-row {
    grid-template-columns: minmax(0, 1fr) 88px 100px;
    gap: 4px 6px;
  }

  .slot-breakdown-row .breakdown-count,
  .slot-breakdown-row .breakdown-time {
    font-size: 11px;
    font-weight: 650;
    color: var(--muted);
    line-height: 1.2;
  }

  .slot-breakdown-row .breakdown-time {
    justify-self: start;
    margin-left: 48px;
  }

  .slot-breakdown-row .breakdown-total {
    font-size: 13px;
  }

  .slot-breakdown-row .slot-payment-field,
  .slot-breakdown-row .slot-payment-field input {
    min-width: 92px;
    width: 92px;
  }

  .modal-slot-form .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* v19 Phase 1 responsive polish */
.brand-mark {
  background: #00b900 url("icon.svg") center / cover no-repeat !important;
  color: transparent !important;
  text-indent: -999px;
  overflow: hidden;
}

.lesson-fixed-head {
  position: sticky;
  top: 0;
  z-index: 45;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.lesson-head-title {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.lesson-head-title strong {
  font-size: 16px;
}

.lesson-head-title span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.lesson-head-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn.compact {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.desktop-calendar-toolbar {
  justify-content: flex-end;
  padding: 8px 12px 0;
}

.desktop-calendar-toolbar .month-nav {
  justify-content: flex-end;
}

.day.selected {
  position: relative;
  border-color: #111827 !important;
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(0, 185, 0, 0.2), 0 8px 18px rgba(17, 24, 39, 0.1) !important;
  font-weight: 900;
}

.day.selected::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #111827;
}

.day.selected .date-num {
  color: #fff !important;
  background: #111827 !important;
}

.day.saturday {
  border-color: #38bdf8;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.24);
}

.day.saturday .date-num {
  color: #0284c7;
  background: #e0f2fe;
}

.overlap-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: #dc2626;
  font-size: 12px;
  font-weight: 1000;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.16);
}

.has-overlap {
  border-color: #dc2626 !important;
}

.modal-sheet {
  max-height: 90vh;
  overflow: auto;
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
}

input,
select,
textarea {
  font-size: max(16px, 1rem);
}

.three-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.three-actions .btn {
  min-width: 0;
  padding-inline: 5px;
  font-size: 11px;
  letter-spacing: 0;
  white-space: normal;
  line-height: 1.25;
}

.other-schedule-form {
  display: grid;
  gap: 8px;
}

.other-all-day-dates,
.other-time-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.other-time-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  align-items: center;
}

.large-goal {
  font-size: 17px;
  font-weight: 1000;
}

.phase1-ring .ring-progress.planned {
  stroke-width: 11px;
}

.phase1-ring .ring-progress.completed {
  stroke-width: 9px;
}

.phase1-ring .ring-progress.paid {
  stroke-width: 13px;
}

.ring-line {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.ring-line i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}

.paid-line {
  color: #d7a100;
  font-weight: 1000;
}

.paid-line i {
  background: #f4b000;
}

.planned-line i {
  background: #b9eec6;
}

.completed-line {
  color: #667085;
}

.completed-line i {
  background: #00b900;
}

.work-time-total {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.breakdown-total small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.transport-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  gap: 8px;
}

.weekly-block-settings {
  margin-top: 10px;
  overflow-x: auto;
}

.weekly-block-grid {
  min-width: 680px;
  display: grid;
  grid-template-columns: 90px repeat(7, minmax(70px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.weekly-block-head {
  padding: 7px 5px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.availability-cell small {
  display: block;
  margin-top: 2px;
  color: inherit;
  font-size: 9px;
  line-height: 1.2;
  opacity: 0.8;
}

.trend-point-current {
  fill: #f4b000;
}

.trend-point-prev {
  fill: #ffe28a;
}

@media (max-width: 900px) {
  .lesson-fixed-head {
    top: 0;
    padding: 8px 10px;
  }

  .lesson-head-title strong {
    font-size: 14px;
  }

  .lesson-head-title span {
    font-size: 12px;
  }

  .lesson-head-actions .btn {
    min-height: 30px;
    padding: 5px 8px;
  }

  .desktop-calendar-toolbar,
  .calendar-wrap {
    display: none;
  }

  .mobile-calendar-stack {
    max-height: 318px !important;
  }

  .mobile-month {
    scroll-snap-align: start;
  }

  .mobile-month .calendar {
    gap: 3px;
  }

  .mobile-month .day {
    min-height: 42px;
    max-height: 48px;
    grid-template-rows: 18px 1fr;
    gap: 1px;
    padding: 2px 3px;
    border-radius: 6px;
  }

  .mobile-month .day-total {
    display: none;
  }

  .mobile-month .date-num {
    width: 20px;
    height: 18px;
    border-radius: 999px;
    font-size: 11px;
  }

  .mobile-month .events {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-content: flex-start;
    justify-content: center;
  }

  .mobile-month .pill,
  .mobile-month .other-pill {
    width: 6px;
    min-width: 6px;
    height: 6px;
    min-height: 6px;
    border-radius: 50%;
    padding: 0;
    border: 0;
    font-size: 0;
    box-shadow: none;
  }

  .mobile-month .pill strong,
  .mobile-month .pill span,
  .mobile-month .other-pill strong,
  .mobile-month .other-pill span {
    display: none;
  }

  .mobile-month .calendar .pill strong,
  .mobile-month .calendar .pill span,
  .mobile-month .calendar .other-pill strong,
  .mobile-month .calendar .other-pill span {
    display: none !important;
  }

  .mobile-month .more-count {
    min-width: 12px;
    height: 10px;
    padding: 0 2px;
    font-size: 8px;
    line-height: 10px;
  }

  .overlap-mark {
    width: 14px;
    height: 14px;
    font-size: 10px;
  }

  .edit-lesson-form .grid {
    gap: 12px 14px;
  }

  .edit-lesson-form .field.span.event-date-field,
  .edit-lesson-form .field.span.event-name-field {
    grid-column: auto !important;
  }

  .edit-lesson-form .event-time-field + .event-time-field {
    margin-left: 2px;
  }

  .history-panel {
    max-height: 78vh;
    overflow: hidden;
  }

  .history-scroll {
    max-height: calc(78vh - 16px);
  }

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

  .three-actions .btn {
    min-height: 42px;
    padding: 4px 3px;
    font-size: 10px;
  }

  .other-all-day-dates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .other-time-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
    gap: 5px;
  }

  .other-time-row .btn {
    padding-inline: 9px;
  }

  .salary-ring.double {
    width: min(82vw, 296px);
    height: min(82vw, 296px);
  }

  .salary-center {
    gap: 3px;
    font-size: 12px;
  }

  .salary-center strong {
    font-size: 14px;
  }

  .payroll-card {
    padding: 10px;
  }

  .annual-mobile-stack {
    gap: 8px;
  }

  .annual-trend-section {
    padding: 10px 8px;
  }

  .payment-trend-chart {
    min-height: 210px;
  }

  .trend-x-axis small {
    transform: rotate(-34deg);
    transform-origin: top center;
  }

  .slot-breakdown-row {
    grid-template-columns: minmax(0, 1fr) 74px 94px;
  }

  .slot-breakdown-row .breakdown-total {
    justify-self: start;
    text-align: left;
  }

  .transport-form-grid {
    grid-template-columns: minmax(0, 1fr) 110px auto;
  }

  .weekly-export-sheet {
    max-height: 90vh;
  }
}

