:root {
  color-scheme: light;
  --bg: #fff5f7;
  --surface: #ffffff;
  --calendar-workday: #ffffff;
  --calendar-friday: #fff0f5;
  --calendar-weekend: #f8ecff;
  --calendar-holiday: #fff4dc;
  --ink: #351721;
  --muted: #8a6470;
  --line: #f1c9d3;
  --accent: #d6336c;
  --accent-strong: #a61e4d;
  --theme-tint: #fff6f8;
  --theme-soft: #fff7fa;
  --theme-line-strong: #f4d2da;
  --theme-focus: rgba(214, 51, 108, 0.14);
  --theme-shadow: rgba(156, 45, 83, 0.12);
  --theme-shadow-soft: rgba(156, 45, 83, 0.08);
  --theme-shadow-strong: rgba(156, 45, 83, 0.22);
  --theme-inset: rgba(214, 51, 108, 0.12);
  --theme-pill: #ffd7e4;
  --theme-rest-pill: #f8dde6;
  --blue: #8b4b8f;
  --amber: #c65f43;
  --red: #cf2446;
  --soft-green: #ffe5ec;
  --soft-blue: #f7e8ff;
  --soft-amber: #fff0df;
  --soft-red: #ffe0e6;
  --friday: var(--calendar-friday);
  --shadow: 0 14px 36px var(--theme-shadow);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.floating-decor-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.floating-decor-item {
  position: absolute;
  top: -10%;
  will-change: transform, opacity;
  animation-name: decor-fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes decor-fall {
  0% {
    transform: translate3d(0, -20px, 0) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 0.9;
  }
  100% {
    transform: translate3d(var(--drift, 0px), 115vh, 0) rotate(360deg);
    opacity: 0;
  }
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button:disabled:hover {
  border-color: var(--line);
  color: var(--ink);
}

.app-shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 8px 0 22px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

h1 {
  font-size: 34px;
  line-height: 1.15;
}

.settings-panel {
  position: relative;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.settings-panel summary {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.settings-panel summary::-webkit-details-marker {
  display: none;
}

.settings-panel[open] summary,
.settings-panel summary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.settings-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

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

.settings-head strong {
  color: var(--accent-strong);
  font-size: 15px;
}

.settings-close {
  display: grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

.settings-menu label {
  display: grid;
  gap: 6px;
}

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

.settings-menu input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  outline: none;
}

.settings-menu input[type="color"] {
  height: 42px;
  padding: 5px;
  cursor: pointer;
}

.settings-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
}

.settings-actions button {
  padding: 0 12px;
  white-space: nowrap;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
}

input[type="month"],
input[type="time"],
input[type="number"],
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--theme-focus);
}

.app-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding-top: 14px;
}

.calendar-area {
  min-width: 0;
}

.stats-sidebar {
  position: sticky;
  top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(180deg, #fff, var(--theme-tint));
  box-shadow: 0 10px 24px var(--theme-shadow-soft);
}

.stats-sidebar-title {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
  padding: 0 2px 10px;
  border-bottom: 1px solid var(--theme-line-strong);
}

.stats-sidebar-title strong {
  color: var(--accent-strong);
  font-size: 15px;
  line-height: 1.2;
}

.stats-sidebar-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

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

.stats-grid {
  display: grid;
  gap: 6px;
}

.stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 0 0 1px #f4d5dc;
}

.stat-card span {
  order: 2;
  display: block;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
}

.stat-card small {
  order: 1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.target-hint {
  margin: 10px 0 0;
  border: 1px solid #f0b3c5;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff2f6;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
}

.target-hint.is-done {
  border-color: #e8c173;
  background: #fff8e7;
  color: #9b5c00;
}

.today-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(280px, 1.3fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid #f0b3c5;
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(135deg, #fff, #fff1f5);
  box-shadow: var(--shadow);
}

.today-copy {
  display: grid;
  gap: 5px;
}

.today-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.today-copy strong {
  font-size: 22px;
  line-height: 1.2;
}

.today-copy span:last-child {
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
}

.today-countdown {
  display: grid;
  gap: 10px;
}

.today-countdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.today-countdown-head strong {
  font-size: 18px;
}

.today-countdown-head span {
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 900;
}

.today-progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #f6d4dc;
}

.today-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8fab, var(--red));
  transition: width 0.25s ease;
}

.salary-note {
  margin: 0;
  border: 1px solid #f0c66f;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff8e7;
  color: #9b5c00;
  font-size: 14px;
  font-weight: 900;
}

.salary-note[hidden] {
  display: none;
}

.clock-card {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  border: 1px solid #f0b3c5;
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(140deg, #fff, #fff4f7);
  box-shadow: 0 10px 20px var(--theme-shadow-soft);
}

.clock-card.compact {
  margin-bottom: 0;
}

.clock-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.clock-card-head strong {
  color: var(--accent-strong);
  font-size: 14px;
}

.clock-card-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.clock-card-time {
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
}

.clock-card-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.clock-action-button {
  min-height: 38px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 12px 22px var(--theme-shadow);
}

.clock-action-button:hover:not(:disabled) {
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 16px 26px var(--theme-shadow-strong);
  filter: saturate(1.03);
}

.clock-action-button:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}

.clock-action-button.is-done {
  border-color: #9fd8b7;
  background: linear-gradient(120deg, #2d9e62, #20794b);
}

.clock-action-button.is-fail {
  border-color: #ff9eb1;
  background: linear-gradient(120deg, #d95872, #c9183a);
}

.calendar-panel {
  overflow: visible;
  padding: 16px;
}

.hourly-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  border: 1px dashed #f0b3c5;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fffafb;
  color: var(--muted);
}

.hourly-title strong {
  color: var(--accent-strong);
  font-size: 14px;
}

.hourly-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
}

.hourly-fields label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.hourly-fields input {
  width: 132px;
  min-height: 36px;
}

.hourly-metric {
  display: grid;
  gap: 4px;
  min-width: 112px;
  border: 1px solid #f1d0d8;
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
}

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

.hourly-metric strong {
  color: var(--ink);
  font-size: 15px;
}

.hourly-rate strong {
  color: var(--accent-strong);
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
}

.date-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.date-switcher label {
  display: grid;
  gap: 6px;
  min-width: 112px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.date-switcher select {
  min-height: 40px;
  font-weight: 900;
}

.month-nav {
  width: 42px;
  min-height: 40px;
  padding: 0;
  font-size: 25px;
  line-height: 1;
}

#todayMonth {
  min-height: 40px;
  border: 1px solid var(--line);
  background: #fff7fa;
  color: var(--accent-strong);
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.lunch-toggle,
.workday-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.lunch-toggle {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.lunch-toggle input,
.workday-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

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

.weekday-row {
  position: sticky;
  top: 0;
  z-index: 8;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #fffafb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px var(--theme-shadow-soft);
}

.weekday-row span {
  min-height: 34px;
  border-right: 1px solid var(--line);
  background: inherit;
  display: grid;
  place-items: center;
}

.calendar-grid {
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.day-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 174px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px;
  background: var(--calendar-workday);
  text-align: left;
}

.day-cell:hover {
  filter: brightness(0.99);
}

.day-cell.outside-month {
  background: #fff8fa;
  cursor: default;
}

.day-cell.rest-day {
  background: var(--calendar-workday);
}

.day-cell.has-record {
  background: var(--calendar-workday);
}

.day-cell.friday-cell {
  background: var(--friday);
  box-shadow: inset 0 0 0 2px var(--theme-inset);
}

.day-cell.salary-day {
  box-shadow: inset 0 0 0 2px rgba(240, 198, 111, 0.42);
}

.day-cell.past-day {
  background-image: linear-gradient(rgba(118, 82, 94, 0.08), rgba(118, 82, 94, 0.08));
  color: #76525e;
}

.day-cell.past-day:hover {
  filter: brightness(0.97) saturate(0.9);
}

.day-cell.past-day.friday-cell {
  box-shadow: inset 0 0 0 2px rgba(118, 82, 94, 0.12);
}

.day-cell.past-day.salary-day {
  box-shadow: inset 0 0 0 2px rgba(189, 133, 16, 0.28);
}

.day-cell.rest-cell {
  border-color: #e7c6ee;
  background: var(--calendar-weekend);
}

.day-cell.rest-cell:hover {
  filter: brightness(0.98);
}

.day-cell.holiday-cell {
  border-color: #f1d2a4;
  background: var(--calendar-holiday);
}

.day-cell.holiday-cell:hover {
  filter: brightness(0.98);
}

.day-cell.past-day.rest-cell {
  color: #70556f;
}

.day-cell.past-day.holiday-cell {
  color: #70583e;
}

.day-number {
  display: grid;
  grid-template-columns: minmax(24px, auto) minmax(0, 1fr) auto;
  gap: 6px;
  align-items: start;
  min-height: 54px;
  font-weight: 900;
}

.day-date {
  justify-self: start;
  line-height: 1.15;
}

.day-badges {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding-top: 1px;
}

.day-kind {
  justify-self: end;
  max-width: 72px;
  overflow: hidden;
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--soft-green);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-kind.rest {
  background: var(--theme-rest-pill);
  color: #8a4259;
}

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

.day-kind.adjusted {
  background: var(--soft-blue);
  color: var(--blue);
}

.day-times {
  min-height: 20px;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.day-times.rest-message {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  padding: 0 10px;
  color: #8f5064;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
}

.day-overtime {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.day-overtime.empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.day-worktime {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.friday-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 100%;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--theme-pill);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.salary-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 100%;
  border-radius: 999px;
  padding: 0 8px;
  background: #fff3c4;
  color: #8a5200;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.day-shift {
  margin-top: 6px;
}

.shift-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  max-width: 100%;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.shift-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.shift-pill.normal {
  border: 1px solid #9fd8b7;
  background: #e8f8ef;
  color: #20794b;
}

.shift-pill.small {
  border: 1px solid #f2c184;
  background: #fff2d8;
  color: #a45616;
}

.shift-pill.large {
  border: 1px solid #ff9eb1;
  background: #ffe1e8;
  color: #c9183a;
}

.shift-short {
  display: none;
}

.leave-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  margin-top: 6px;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  margin-top: 8px;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef1ee;
  color: #535b56;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-chip.good {
  background: var(--soft-green);
  color: var(--accent-strong);
}

.status-chip.info {
  background: var(--soft-blue);
  color: var(--blue);
}

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

.status-chip.late-marker {
  min-height: 20px;
  margin-top: 6px;
  padding: 0 6px;
  font-size: 10px;
  line-height: 1;
}

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

.day-dialog {
  width: min(460px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(31, 37, 40, 0.22);
}

.day-dialog::backdrop {
  background: rgba(31, 37, 40, 0.28);
}

.day-editor {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.editor-subtitle {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.icon-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

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

.editor-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.leave-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfa;
}

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

.leave-header strong {
  font-size: 15px;
}

.leave-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.editor-summary div {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.editor-summary span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.editor-summary strong {
  font-size: 16px;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
  color: #fff;
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 30;
  width: min(420px, calc(100% - 42px));
  transform: translate(-50%, -44%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  background: var(--theme-soft);
  color: var(--accent-strong);
  box-shadow: 0 22px 58px var(--theme-shadow-strong);
  text-align: center;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.45;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.toast.normal {
  border-color: #9fd8b7;
  background: #f0fbf5;
  color: #20794b;
}

.toast.small {
  border-color: #f2c184;
  background: #fff5e3;
  color: #9a4d10;
}

.toast.large {
  border-color: #ff9eb1;
  background: #fff0f4;
  color: #c9183a;
  box-shadow: 0 24px 64px rgba(207, 36, 70, 0.26);
}

.toast.milestone {
  border-color: #e8c173;
  background: #fff8e7;
  color: #9b5c00;
  box-shadow: 0 24px 64px rgba(189, 133, 16, 0.22);
}

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

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

  .settings-panel {
    width: 100%;
  }

  .settings-menu {
    position: static;
    width: 100%;
    margin-top: 10px;
  }

  .settings-color-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .settings-actions span {
    display: none;
  }

  #resetThemeColors {
    grid-column: 1 / -1;
  }

  .stats-sidebar {
    position: static;
    padding: 8px;
    overflow: hidden;
  }

  .stats-sidebar-title {
    display: none;
  }

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

  .clock-card-head {
    align-items: start;
    flex-direction: column;
  }

  .hourly-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .hourly-fields {
    justify-content: stretch;
  }

  .hourly-fields label,
  .hourly-metric {
    flex: 1;
    min-width: 150px;
  }

  .hourly-fields input {
    width: 100%;
  }

  .stats-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .stats-grid::-webkit-scrollbar {
    display: none;
  }

  .stat-card {
    flex: 0 0 96px;
    display: grid;
    justify-content: start;
    min-height: 44px;
    padding: 7px 9px;
  }

  .stat-card span,
  .stat-card small {
    order: initial;
  }

  .target-hint {
    margin-top: 8px;
    padding: 8px 10px;
    text-align: center;
  }

  .toolbar-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .date-switcher {
    align-items: stretch;
  }

  .date-switcher label {
    flex: 1;
    min-width: 130px;
  }

  .month-nav,
  #todayMonth {
    flex: 1;
  }

  .toolbar-actions button,
  .lunch-toggle {
    flex: 1;
    justify-content: center;
  }

  .day-cell {
    min-height: 134px;
    padding: 8px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  h1 {
    font-size: 28px;
  }

  .editor-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card {
    flex-basis: 90px;
    min-height: 42px;
    padding: 7px 8px;
  }

  .stat-card span {
    font-size: 16px;
  }

  .stat-card small {
    font-size: 10px;
    white-space: nowrap;
  }

  .weekday-row span {
    font-size: 11px;
  }

  .calendar-panel {
    padding: 10px;
    overflow: visible;
  }

  .clock-card {
    padding: 9px;
  }

  .clock-card-time {
    font-size: 18px;
  }

  .clock-action-button {
    width: 100%;
  }

  .day-cell {
    min-height: 126px;
    padding: 6px;
  }

  .day-number {
    grid-template-columns: minmax(18px, auto) minmax(0, 1fr) auto;
    min-height: 44px;
    gap: 4px;
  }

  .day-badges {
    gap: 3px;
  }

  .day-kind {
    max-width: 40px;
    padding: 2px 5px;
    font-size: 10px;
  }

  .day-times {
    margin-top: 0;
    font-size: 10px;
    line-height: 1.25;
  }

  .day-overtime {
    margin-top: 4px;
    font-size: 10px;
  }

  .day-times.rest-message {
    min-height: 34px;
    padding: 0 4px;
    font-size: 9px;
    line-height: 1.35;
  }

  .day-overtime.empty,
  .day-worktime,
  .friday-badge,
  .salary-badge,
  .shift-pill,
  .leave-chip,
  .status-chip {
    font-size: 10px;
  }

  .shift-pill,
  .leave-chip,
  .status-chip {
    min-height: 20px;
    padding: 0 6px;
  }

  .shift-full {
    display: none;
  }

  .shift-short {
    display: inline;
  }

  .shift-pill {
    gap: 4px;
  }

  .shift-pill::before {
    width: 6px;
    height: 6px;
  }

  .status-chip {
    margin-top: 5px;
  }

  .editor-grid,
  .editor-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .editor-actions button {
    width: 100%;
  }
}
