:root {
  color-scheme: light;
  --paper: #f4f7f8;
  --surface: #ffffff;
  --surface-blue: #edf4ff;
  --ink: #13212a;
  --muted: #65747d;
  --quiet: #8d9aa1;
  --rule: #d8e0e4;
  --rule-strong: #bdc9cf;
  --blue: #165dff;
  --blue-deep: #0b3fb5;
  --orange: #d85f21;
  --orange-soft: #fff1e9;
  --red: #b93838;
  --red-soft: #fff0f0;
  --green: #147a55;
  --green-soft: #eaf7f1;
  --purple: #6652b8;
  --purple-soft: #f0edff;
  --shadow: 0 18px 50px rgba(24, 49, 63, 0.1), 0 3px 10px rgba(24, 49, 63, 0.06);
  --font: "MiSans", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

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

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(22, 93, 255, 0.28);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 50%;
  box-shadow: 0 3px 0 var(--blue-deep);
  font-size: 20px;
  font-weight: 800;
}

.brand-lockup p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.brand-lockup strong {
  font-size: 18px;
  letter-spacing: -0.03em;
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 800;
}

.calendar-head h1,
.dialog-head h2 {
  margin: 0;
  letter-spacing: -0.035em;
}

.form-grid > label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  padding: 0 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  min-height: 94px;
  resize: vertical;
  padding-block: 12px;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(22, 93, 255, 0.1);
}

::placeholder {
  color: #7b8a92;
}

.primary-button,
.secondary-button,
.danger-button,
.today-button,
.text-button {
  min-height: 44px;
  border-radius: 9px;
  padding: 0 18px;
  font-weight: 750;
}

.primary-button {
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
  box-shadow: 0 3px 0 var(--blue-deep);
}

.primary-button:hover {
  background: #0d50e8;
}

.primary-button:active {
  box-shadow: 0 1px 0 var(--blue-deep);
  transform: translateY(2px);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.inline-action:disabled,
.icon-button:disabled,
.today-button:disabled,
.topbar-login button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.dashboard {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  border-bottom: 1px solid rgba(189, 201, 207, 0.8);
  background: rgba(244, 247, 248, 0.94);
  padding: 10px max(24px, calc((100vw - 1320px) / 2));
  backdrop-filter: blur(12px);
}

.brand-lockup.compact .brand-mark {
  width: 38px;
  height: 38px;
  font-size: 17px;
}

.brand-lockup.compact strong {
  font-size: 16px;
}

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

.topbar-login {
  position: relative;
}

.topbar-login-fields {
  display: flex;
  align-items: center;
  border: 1px solid var(--rule-strong);
  border-radius: 9px;
  background: var(--surface);
  padding: 2px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.topbar-login-fields:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(22, 93, 255, 0.1);
}

.topbar-login input {
  width: clamp(112px, 18vw, 180px);
  min-height: 38px;
  border: 0;
  background: transparent;
  padding: 0 10px;
}

.topbar-login input:focus {
  border: 0;
  box-shadow: none;
}

.topbar-login button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--blue);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 750;
}

.topbar-login button:hover {
  background: #0d50e8;
}

.topbar-login-error {
  position: absolute;
  z-index: 2;
  top: calc(100% + 9px);
  right: 0;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  border: 1px solid #e7bcbc;
  border-radius: 8px;
  color: var(--red);
  background: var(--red-soft);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 7px 18px rgba(88, 26, 26, 0.12);
}

.topbar-login-error:empty {
  display: none;
}

.sync-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--quiet);
}

.sync-state.synced .sync-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.sync-state.syncing .sync-dot {
  background: var(--blue);
  animation: pulse 1s ease-in-out infinite;
}

.sync-state.failed .sync-dot {
  background: var(--red);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--rule);
  border-radius: 99px;
  background: var(--surface);
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--rule-strong);
  border-radius: 9px;
  background: var(--surface);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.icon-button:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--surface-blue);
}

.icon-button svg {
  width: 20px;
}

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

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

.main-content {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.calendar-workspace {
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.calendar-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 32px 22px;
}

.month-heading {
  display: flex;
  align-items: baseline;
  gap: 13px;
}

.calendar-head h1 {
  font-size: clamp(30px, 3.2vw, 46px);
  font-variant-numeric: tabular-nums;
}

.month-code {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

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

.today-button,
.secondary-button {
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  background: var(--surface);
}

.today-button:hover,
.secondary-button:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--surface-blue);
}

.month-summary {
  display: flex;
  min-height: 54px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: #f9fbfc;
  padding: 0 32px;
}

.signed-out-summary {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.summary-item {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 140px;
  padding: 16px 24px 14px 0;
  color: var(--muted);
  font-size: 12px;
}

.summary-item + .summary-item {
  border-left: 1px solid var(--rule);
  padding-left: 24px;
}

.summary-item strong {
  color: var(--ink);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.summary-item.warning strong {
  color: var(--orange);
}

.calendar-frame {
  position: relative;
}

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

.weekday-row {
  border-bottom: 1px solid var(--rule-strong);
  background: #f9fbfc;
}

.weekday-row span {
  padding: 11px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.weekday-row .weekend {
  color: var(--orange);
}

.calendar-grid {
  border-left: 0;
  min-height: 420px;
}

.signed-out-calendar {
  display: flex;
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  color: var(--muted);
  padding: 40px 24px;
  text-align: center;
}

.signed-out-calendar .empty-stamp {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  place-items: center;
  border: 2px solid var(--blue);
  border-radius: 50%;
  color: var(--blue);
  font-size: 22px;
  font-weight: 800;
  transform: rotate(-4deg);
}

.signed-out-calendar strong {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 18px;
}

.signed-out-calendar > span:last-child {
  font-size: 13px;
}

.calendar-row {
  display: contents;
}

.calendar-day {
  position: relative;
  min-width: 0;
  min-height: 128px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  padding: 11px 11px 10px;
  text-align: left;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day:hover {
  z-index: 1;
  background: #f8fbff;
}

.calendar-day[aria-selected="true"] {
  z-index: 2;
  background: var(--surface-blue);
  box-shadow: inset 0 0 0 2px var(--blue);
}

.calendar-day.outside-month {
  color: var(--quiet);
  background:
    repeating-linear-gradient(
      -45deg,
      transparent 0 9px,
      rgba(101, 116, 125, 0.035) 9px 10px
    ),
    #fafbfb;
}

.calendar-day.future .day-status-list {
  opacity: 0.72;
}

.calendar-day.rest-day:not([aria-selected="true"]) {
  background: #fbfcfc;
}

.day-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}

.day-number {
  display: inline-grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.calendar-day[aria-current="date"] .day-number {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 2px 0 var(--blue-deep);
}

.day-shift {
  overflow: hidden;
  color: var(--quiet);
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rest-day .day-shift {
  color: var(--orange);
}

.day-status-list {
  display: grid;
  gap: 5px;
}

.day-time,
.day-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 10px;
  line-height: 1.3;
}

.day-time {
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.day-time::before,
.day-badge::before {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  content: "";
}

.day-badge.warning {
  color: #9b3e12;
}

.day-badge.warning::before {
  background: var(--orange);
}

.day-badge.danger {
  color: var(--red);
}

.day-badge.danger::before {
  background: var(--red);
}

.day-badge.leave {
  color: var(--purple);
}

.day-badge.leave::before {
  background: var(--purple);
}

.day-badge.success {
  color: var(--green);
}

.day-badge.success::before {
  background: var(--green);
}

.day-empty {
  color: var(--quiet);
  font-size: 10px;
}

.calendar-inline-actions {
  position: relative;
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 82px;
  border-bottom: 1px solid var(--rule-strong);
  color: #eaf1ff;
  background: #123e9a;
  padding: 14px 18px 14px 24px;
}

.calendar-inline-actions::before {
  position: absolute;
  top: -8px;
  left: var(--action-anchor);
  width: 16px;
  height: 16px;
  background: #123e9a;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.selected-day-caption {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto auto;
  gap: 3px 12px;
  min-width: 220px;
  font-size: 11px;
}

.selected-day-caption > span {
  color: #c8d8ff;
  font-weight: 700;
}

.selected-day-caption strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.selected-day-caption small {
  grid-column: 1 / -1;
  color: #c8d8ff;
  font-size: 10px;
}

.inline-action-group {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
}

.inline-action {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  padding: 0 14px;
  font-size: 12px;
  font-weight: 750;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.inline-action:hover:not(:disabled) {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.17);
  transform: translateY(-1px);
}

.inline-action:disabled {
  color: #91a8da;
  background: transparent;
}

.inline-action svg {
  width: 18px;
}

.inline-action.clock-in:not(:disabled) {
  color: #d7ffed;
  border-color: rgba(139, 235, 193, 0.6);
}

.inline-action.clock-out:not(:disabled) {
  color: #ffe2c9;
  border-color: rgba(255, 190, 133, 0.68);
}

.calendar-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.92);
  font-size: 13px;
}

.loading-rule {
  position: relative;
  display: block;
  width: 140px;
  height: 3px;
  overflow: hidden;
  background: var(--rule);
}

.loading-rule::after {
  position: absolute;
  width: 40%;
  height: 100%;
  background: var(--blue);
  content: "";
  animation: load-line 1.15s ease-in-out infinite;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  min-height: 48px;
  border-top: 1px solid var(--rule-strong);
  padding: 10px 32px;
  color: var(--muted);
  font-size: 11px;
}

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

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

.legend-dot.warning {
  background: var(--orange);
}

.legend-dot.leave {
  background: var(--purple);
}

.legend-line {
  width: 12px;
  height: 2px;
  background: var(--rule-strong);
}

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

.dialog-head h2 {
  font-size: 24px;
}

.timeline-empty,
.records-empty {
  display: grid;
  min-height: 112px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.calendar-error {
  grid-column: 1 / -1;
  min-height: 420px;
}

dialog {
  border: 0;
  padding: 0;
}

dialog::backdrop {
  background: rgba(10, 23, 31, 0.48);
  backdrop-filter: blur(3px);
}

.sheet-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: min(820px, calc(100vh - 28px));
  overflow: auto;
  border-radius: 16px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(8, 27, 38, 0.28), 0 5px 15px rgba(8, 27, 38, 0.16);
}

.records-dialog,
.card-log-dialog {
  width: min(760px, calc(100% - 28px));
}

.dialog-panel {
  margin: 0;
  padding: 28px;
}

.dialog-close {
  flex: 0 0 auto;
}

.supply-policy {
  margin: 22px 0;
  border: 1px solid #c9d9ff;
  border-radius: 9px;
  color: #24457e;
  background: var(--surface-blue);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.65;
}

.destructive-note {
  margin: 20px 0 0;
  border-left: 3px solid var(--red);
  color: #7f2424;
  background: var(--red-soft);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-grid label > span small {
  color: var(--muted);
  font-weight: 500;
}

.full-field {
  grid-column: 1 / -1;
}

.segment-field {
  display: flex;
  grid-column: 1 / -1;
  gap: 8px;
  margin: 0;
  border: 0;
  padding: 0;
}

.segment-field legend {
  width: 100%;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.segment-field label {
  position: relative;
}

.segment-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segment-field span {
  display: grid;
  min-width: 100px;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.segment-field input:checked + span {
  border-color: var(--blue);
  color: var(--blue-deep);
  background: var(--surface-blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
}

.record-list {
  display: grid;
  margin-top: 22px;
  border-top: 1px solid var(--rule-strong);
}

.record-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 100px minmax(110px, auto) auto;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  padding: 17px 4px;
}

.card-log-item {
  display: grid;
  grid-template-columns: 38px minmax(180px, 1fr) auto;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  padding: 17px 4px;
}

.card-log-order {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  color: var(--blue-deep);
  background: var(--surface-blue);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.card-log-unavailable {
  color: var(--quiet);
  font-size: 11px;
}

.record-main {
  display: grid;
  gap: 5px;
}

.record-main strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.record-main small,
.record-created {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.record-status {
  justify-self: start;
  border-radius: 99px;
  background: #eef1f2;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.record-status.pending {
  color: #9b3e12;
  background: var(--orange-soft);
}

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

.record-status.cancelled {
  color: var(--muted);
  background: #eef1f2;
}

.record-actions {
  justify-self: end;
}

.record-cancel {
  min-height: 38px;
  border: 1px solid #e6b6b6;
  border-radius: 8px;
  color: var(--red);
  background: var(--red-soft);
  padding: 0 12px;
  font-size: 11px;
  font-weight: 750;
}

.confirm-dialog {
  width: min(400px, calc(100% - 28px));
  border-radius: 15px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(8, 27, 38, 0.3);
}

.confirm-panel {
  margin: 0;
  padding: 30px;
  text-align: center;
}

.confirm-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  margin: 0 auto 17px;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  background: var(--red-soft);
  font-size: 20px;
  font-weight: 900;
}

.confirm-panel h2 {
  margin: 0;
  font-size: 21px;
}

.confirm-panel p {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.confirm-panel .dialog-actions {
  justify-content: center;
}

.danger-button {
  border: 1px solid var(--red);
  color: #fff;
  background: var(--red);
  box-shadow: 0 3px 0 #7f2424;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100% - 40px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(18, 39, 50, 0.17), 0 3px 8px rgba(18, 39, 50, 0.08);
  padding: 13px 15px;
  font-size: 13px;
  line-height: 1.55;
  animation: toast-in 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toast::before {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.toast.error::before {
  background: var(--red);
}

.shake {
  animation: shake 320ms ease;
}

@keyframes load-line {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(350%);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

@keyframes toast-in {
  from {
    clip-path: inset(0 0 100% 0);
    transform: translateY(12px);
  }
  to {
    clip-path: inset(0);
    transform: translateY(0);
  }
}

@keyframes shake {
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
}

@media (max-width: 820px) {
  .main-content {
    width: min(100% - 24px, 1320px);
    padding-top: 22px;
  }

  .topbar {
    padding-inline: 12px;
  }

  .sync-state,
  .user-chip {
    display: none;
  }

  .calendar-head {
    align-items: flex-start;
    padding: 22px 18px 18px;
  }

  .month-summary {
    overflow-x: auto;
    padding-inline: 18px;
  }

  .summary-item {
    min-width: max-content;
  }

  .calendar-day {
    min-height: 104px;
    padding: 8px;
  }

  .day-shift {
    display: none;
  }

  .day-status-list > :nth-child(n + 3) {
    display: none;
  }

  .calendar-inline-actions {
    align-items: flex-start;
    gap: 12px;
    padding-inline: 14px;
  }

  .selected-day-caption {
    min-width: 170px;
  }

  .inline-action-group {
    display: grid;
    flex: 1;
    grid-template-columns: 1fr 1fr;
  }

  .inline-action {
    justify-content: center;
  }
}

@media (max-width: 620px) {
  .topbar {
    gap: 10px;
  }

  .brand-lockup.compact p,
  .brand-lockup.compact div strong {
    display: none;
  }

  .brand-lockup.compact {
    flex: 0 0 auto;
  }

  .topbar-actions {
    min-width: 0;
    flex: 1;
    justify-content: flex-end;
    gap: 4px;
  }

  .topbar-login {
    width: min(100%, 220px);
  }

  .topbar-login-fields {
    width: 100%;
  }

  .topbar-login input {
    width: 0;
    min-width: 0;
    flex: 1;
  }

  .topbar-login button {
    flex: 0 0 auto;
    padding-inline: 11px;
  }

  .text-button {
    padding-inline: 10px;
  }

  .main-content {
    width: calc(100% - 16px);
    padding-bottom: 36px;
  }

  .calendar-workspace {
    border-radius: 13px;
  }

  .calendar-head {
    display: grid;
    gap: 16px;
  }

  .month-controls {
    width: 100%;
  }

  .today-button {
    flex: 1;
  }

  .month-summary {
    min-height: 48px;
  }

  .summary-item {
    padding-block: 13px 11px;
  }

  .weekday-row span {
    padding-inline: 3px;
    font-size: 10px;
  }

  .calendar-day {
    min-height: 82px;
    padding: 6px 5px;
  }

  .day-topline {
    margin-bottom: 6px;
  }

  .day-number {
    width: 25px;
    height: 25px;
    font-size: 12px;
  }

  .day-status-list {
    gap: 3px;
  }

  .day-time,
  .day-badge {
    gap: 3px;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .day-time::before,
  .day-badge::before {
    width: 4px;
    height: 4px;
  }

  .day-empty {
    display: none;
  }

  .calendar-legend {
    gap: 10px 14px;
    padding-inline: 14px;
  }

  .calendar-inline-actions {
    display: grid;
    gap: 12px;
    padding: 15px 10px 12px;
  }

  .selected-day-caption {
    grid-template-columns: 1fr auto;
    min-width: 0;
  }

  .inline-action {
    min-width: 0;
    padding-inline: 7px;
    font-size: 11px;
  }

  .inline-action svg {
    width: 16px;
  }

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

  .full-field,
  .segment-field {
    grid-column: auto;
  }

  .dialog-panel {
    padding: 22px 18px;
  }

  .record-item {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .card-log-item {
    grid-template-columns: 32px 1fr;
    gap: 10px;
  }

  .card-log-item .record-cancel,
  .card-log-unavailable {
    grid-column: 1 / -1;
  }

  .card-log-item .record-cancel {
    width: 100%;
  }

  .record-created {
    display: none;
  }

  .record-actions {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .record-cancel {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
