/* ============================================================
   GrafikGO — design system
   Светлый «воздушный» финтех + мягкая физика Framer Motion
   ============================================================ */

/* ------------------------------ Tokens ------------------------------ */
:root {
  /* surfaces */
  --bg: #F4F7FA;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --surface-3: #E9F0F7;
  --border: #E2E8F0;

  /* typography */
  --text: #0F172A;
  --text-soft: #334155;
  --muted: #64748B;

  /* brand */
  --accent: #0EA5E9;
  --accent-strong: #0284C7;
  --accent-soft: #E0F2FE;
  --teal: #14B8A6;

  /* shift palette */
  --day: #F59E0B;
  --day-soft: #FEF3C7;
  --night: #6366F1;
  --night-soft: #E0E7FF;
  --off: #10B981;
  --off-soft: #D1FAE5;
  --empty: #CBD5E1;

  --day-tint: rgba(245, 158, 11, 0.14);
  --night-tint: rgba(99, 102, 241, 0.14);
  --off-tint: rgba(16, 185, 129, 0.14);

  --success-text: #047857;
  --warning-text: #B45309;

  /* elevation */
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 26px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 14px 30px rgba(15, 23, 42, 0.08);
  --shadow-accent: 0 8px 20px rgba(14, 165, 233, 0.22);

  /* chrome */
  --header-bg: rgba(244, 247, 250, 0.78);
  --nav-bg: rgba(255, 255, 255, 0.88);
  --sheet-bg: #FFFFFF;

  /* geometry */
  --radius: 20px;
  --radius-sm: 14px;
  --radius-lg: 26px;

  /* motion */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0B1220;
  --surface: #111A2B;
  --surface-2: #162033;
  --surface-3: #1B273C;
  --border: #22304A;

  --text: #E6EDF7;
  --text-soft: #C3D0E2;
  --muted: #8FA3BD;

  --accent: #38BDF8;
  --accent-strong: #7DD3FC;
  --accent-soft: rgba(56, 189, 248, 0.16);
  --teal: #2DD4BF;

  --day-soft: rgba(245, 158, 11, 0.18);
  --night-soft: rgba(99, 102, 241, 0.22);
  --off-soft: rgba(16, 185, 129, 0.18);
  --empty: #3B4A63;

  --day-tint: rgba(245, 158, 11, 0.16);
  --night-tint: rgba(99, 102, 241, 0.20);
  --off-tint: rgba(16, 185, 129, 0.16);

  --success-text: #6EE7B7;
  --warning-text: #FCD34D;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 28px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 16px 36px rgba(0, 0, 0, 0.45);
  --shadow-accent: 0 8px 22px rgba(56, 189, 248, 0.25);

  --header-bg: rgba(11, 18, 32, 0.76);
  --nav-bg: rgba(17, 26, 43, 0.9);
  --sheet-bg: #111A2B;
}

html[data-theme="dark"] { color-scheme: dark; }

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

[hidden] { display: none !important; }

html,
body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 560px at 8% -12%, rgba(14, 165, 233, 0.09), transparent 62%),
    radial-gradient(900px 520px at 108% 2%, rgba(20, 184, 166, 0.07), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

body.sheet-open { overflow: hidden; }

button {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent-strong); }

h1, h2, h3, p { margin: 0; }

::selection { background: rgba(14, 165, 233, 0.22); }

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------ Onboarding ------------------------------ */
.onboarding {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  overflow: hidden;
  background:
    radial-gradient(90% 70% at 50% -10%, #E0F2FE 0%, rgba(224, 242, 254, 0) 60%),
    var(--bg);
  transition: opacity 0.42s var(--ease-spring), transform 0.42s var(--ease-spring);
}

.onboarding.is-hiding {
  opacity: 0;
  transform: scale(1.015);
  pointer-events: none;
}

.onboarding-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.55;
  pointer-events: none;
}

.onboarding-blob--1 {
  width: 280px;
  height: 280px;
  left: -90px;
  top: 12%;
  background: rgba(14, 165, 233, 0.22);
  animation: blobFloat 12s ease-in-out infinite;
}

.onboarding-blob--2 {
  width: 240px;
  height: 240px;
  right: -80px;
  bottom: 8%;
  background: rgba(20, 184, 166, 0.2);
  animation: blobFloat 15s ease-in-out infinite reverse;
}

@keyframes blobFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(14px, -18px, 0) scale(1.07); }
}

.onboarding-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 30px 24px 24px;
  border-radius: 28px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  animation: onboardEnter 0.7s var(--ease-spring) both;
}

[data-theme="dark"] .onboarding-card {
  background: rgba(17, 26, 43, 0.86);
  border-color: rgba(34, 48, 74, 0.9);
}

@keyframes onboardEnter {
  from { opacity: 0; transform: translateY(22px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.onboarding-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 26px;
}

.brand-mark { display: block; }

.brand-mark--xl {
  width: 82px;
  height: 82px;
  filter: drop-shadow(0 14px 26px rgba(14, 165, 233, 0.28));
  animation: logoFloat 5s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(-2deg); }
}

.onboarding-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, #0EA5E9, #14B8A6 55%, #0284C7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.onboarding-tagline {
  font-size: 13px;
  color: var(--muted);
  max-width: 290px;
}

.onboarding-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.onboarding-title-sub {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}

.lang-cards {
  display: grid;
  gap: 10px;
}

.lang-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: all 0.35s var(--ease-spring);
  animation: langCardEnter 0.6s var(--ease-spring) both;
  animation-delay: var(--delay, 0s);
}

@keyframes langCardEnter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.lang-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.5) 50%, transparent 75%);
  transform: translateX(-130%);
  transition: transform 0.7s var(--ease-spring);
  pointer-events: none;
}

.lang-card:hover {
  transform: translateY(-3px);
  border-color: rgba(14, 165, 233, 0.5);
  box-shadow: 0 14px 32px rgba(14, 165, 233, 0.16);
}

.lang-card:hover::after { transform: translateX(130%); }

.lang-card:active { transform: translateY(1px) scale(0.98); }

.lang-card.is-chosen {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14);
}

.lang-flag {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
}

.lang-flag svg {
  display: block;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
}

.lang-card-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.lang-card-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.lang-card-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.lang-check {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #0EA5E9, #0284C7);
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.32s var(--ease-spring);
}

.lang-card.is-chosen .lang-check { opacity: 1; transform: scale(1); }

.onboarding-hint {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ------------------------------ App shell ------------------------------ */
.app {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

.app-main {
  padding: 4px 16px 8px;
}

/* ------------------------------ Header ------------------------------ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(12px + env(safe-area-inset-top)) 14px 10px;
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  border-bottom: 1px solid transparent;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: all 0.35s var(--ease-spring);
}

.brand-mark-wrap {
  display: grid;
  place-items: center;
  padding: 2px;
  border-radius: 14px;
  transition: all 0.35s var(--ease-spring);
}

.brand-logo .brand-mark {
  width: 38px;
  height: 38px;
  transition: transform 0.35s var(--ease-spring), filter 0.35s var(--ease-spring);
}

.brand-logo:hover .brand-mark-wrap {
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
  background: rgba(14, 165, 233, 0.06);
}

.brand-logo:hover .brand-mark {
  transform: scale(1.06) rotate(-4deg);
}

.brand-logo:active { transform: scale(0.98); }

.brand-logo.is-spinning .brand-mark {
  animation: logoSpin 0.7s var(--ease-spring);
}

@keyframes logoSpin {
  from { transform: rotate(0) scale(1); }
  55% { transform: rotate(-14deg) scale(1.1); }
  to { transform: rotate(0) scale(1); }
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(90deg, var(--text) 0%, var(--text) 40%, #0EA5E9 62%, #14B8A6 78%, var(--text) 100%);
  background-size: 240% 100%;
  background-position: 0% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: background-position 0.6s var(--ease-spring);
}

.brand-logo:hover .brand-name {
  background-position: 100% 0;
}

.brand-tab {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.lang-btn {
  position: relative;
  padding: 6px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.25s var(--ease-spring);
}

.lang-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.45) 50%, transparent 75%);
  transform: translateX(-135%);
  transition: transform 0.55s var(--ease-spring);
  pointer-events: none;
}

.lang-btn:hover::after { transform: translateX(135%); }

.lang-btn:hover {
  color: var(--accent-strong);
  transform: translateY(-2.5px);
  box-shadow: var(--shadow-accent);
}

.lang-btn:active { transform: translateY(1px) scale(0.97); }

.lang-btn.active {
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.theme-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}

.theme-btn:hover {
  transform: translateY(-2.5px);
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: var(--shadow-accent);
}

.theme-btn:active { transform: translateY(1px) scale(0.97); }

/* ------------------------------ Views ------------------------------ */
.view { display: none; }

.view.active {
  display: block;
  animation: viewEnter 0.28s var(--ease-spring) both;
}

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

.view-head {
  padding: 8px 2px 14px;
}

.date-line {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.greeting {
  margin-top: 3px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
}

.view-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 22px 2px 10px;
}

.section-head h2 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-hint {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  max-width: 58%;
}

.section-label {
  margin: 0 2px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------ Cards ------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 18px;
  transition:
    transform 0.3s var(--ease-spring),
    box-shadow 0.3s var(--ease-spring),
    border-color 0.3s var(--ease-spring);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(14, 165, 233, 0.35);
}

/* ------------------------------ Buttons ------------------------------ */
.btn,
.pill-btn,
.reminder-btn,
.lang-btn {
  transition: all 0.25s var(--ease-spring);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 22%, rgba(255, 255, 255, 0.5) 50%, transparent 78%);
  transform: translateX(-125%);
  transition: transform 0.65s var(--ease-spring);
  pointer-events: none;
}

.btn:hover {
  transform: translateY(-2.5px);
  border-color: rgba(14, 165, 233, 0.5);
  box-shadow: var(--shadow-accent);
}

.btn:hover::after { transform: translateX(125%); }

.btn:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.18);
}

.btn-primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 60%, #0369A1 100%);
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.28);
}

.btn-primary:hover {
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(14, 165, 233, 0.34);
}

.btn-primary::after {
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.35) 50%, transparent 75%);
}

.btn-ghost {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  font-weight: 600;
}

.btn-ghost:hover {
  color: var(--accent-strong);
  background: var(--surface);
}

.btn-block {
  width: 100%;
  margin-bottom: 14px;
}

.btn-ico {
  font-size: 15px;
  line-height: 1;
}

.link-btn {
  border: 0;
  background: transparent;
  padding: 4px 2px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.25s var(--ease-spring);
}

.link-btn:hover {
  transform: translateY(-2px);
  text-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
}

.link-btn:active { transform: translateY(1px) scale(0.97); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}

.icon-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  transform: translateY(-2.5px);
  color: var(--accent-strong);
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: var(--shadow-accent);
}

.icon-btn:active { transform: translateY(1px) scale(0.95); }

/* ------------------------------ Hero shift card ------------------------------ */
.hero-shift-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 0;
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(14, 165, 233, 0.15) 0%, rgba(14, 165, 233, 0) 55%),
    linear-gradient(150deg, #FFFFFF 0%, #F8FBFF 55%, #EEF8FF 100%);
  border-color: rgba(14, 165, 233, 0.22);
  box-shadow: 0 16px 36px rgba(14, 165, 233, 0.1), var(--shadow-1);
}

[data-theme="dark"] .hero-shift-card {
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(56, 189, 248, 0.16) 0%, rgba(56, 189, 248, 0) 55%),
    linear-gradient(150deg, #131E31 0%, #111B2D 55%, #0F2234 100%);
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.hero-watermark {
  position: absolute;
  top: -38px;
  right: -44px;
  width: 232px;
  height: 232px;
  opacity: 0.07;
  pointer-events: none;
  transform: rotate(-10deg);
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.hero-today {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: var(--off-soft);
  color: var(--success-text);
  transition: all 0.3s var(--ease-spring);
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.is-live {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-badge.is-live::before {
  animation: livePulse 1.7s ease-out infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(14, 165, 233, 0); }
  100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}

.status-badge.is-today {
  background: var(--day-soft);
  color: var(--warning-text);
}

.status-badge.is-done {
  background: var(--surface-2);
  color: var(--muted);
}

.hero-time {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.06;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(100deg, var(--text), #0F172A 60%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-theme="dark"] .hero-time {
  background: linear-gradient(100deg, #F1F7FF, #BAE6FD);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-sub {
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.progress {
  position: relative;
  height: 7px;
  margin: 14px 0 2px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0EA5E9, #14B8A6);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.5);
  transition: width 0.9s var(--ease-spring);
}

.hero-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

[data-theme="dark"] .hero-next {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.hero-next-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.hero-next-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-next-value {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.next-part { white-space: nowrap; }

.reminder-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(14, 165, 233, 0.28);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
}

.reminder-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 22%, rgba(255, 255, 255, 0.6) 50%, transparent 78%);
  transform: translateX(-125%);
  transition: transform 0.6s var(--ease-spring);
  pointer-events: none;
}

.reminder-btn:hover {
  transform: translateY(-2.5px);
  border-color: rgba(14, 165, 233, 0.55);
  box-shadow: var(--shadow-accent);
}

.reminder-btn:hover::after { transform: translateX(125%); }

.reminder-btn:active { transform: translateY(1px) scale(0.96); }

.reminder-btn.is-on {
  background: var(--off-soft);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--success-text);
}

.reminder-bell { font-size: 12px; line-height: 1; }

.reminder-btn.is-on .reminder-bell {
  animation: bellRing 2.4s ease-in-out infinite;
  transform-origin: 50% 20%;
}

@keyframes bellRing {
  0%, 82%, 100% { transform: rotate(0); }
  86% { transform: rotate(12deg); }
  90% { transform: rotate(-10deg); }
  94% { transform: rotate(6deg); }
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 16px -18px 0;
  padding: 14px 8px 16px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.35);
}

[data-theme="dark"] .hero-metrics { background: rgba(255, 255, 255, 0.02); }

.metric {
  text-align: center;
  padding: 0 6px;
  min-width: 0;
}

.metric + .metric { border-left: 1px solid var(--border); }

.metric-value {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-value.accent {
  color: var(--accent-strong);
}

.metric-label {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------ Week strip ------------------------------ */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.week-day-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 0 9px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 0.28s var(--ease-spring),
    box-shadow 0.28s var(--ease-spring),
    border-color 0.28s var(--ease-spring),
    background 0.28s var(--ease-spring);
}

.week-day-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(14, 165, 233, 0.35);
}

.week-day-card:active { transform: translateY(1px) scale(0.96); }

.week-day-card.is-today {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.1), rgba(14, 165, 233, 0.02));
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.wd-name {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.week-day-card.is-today .wd-name { color: var(--accent-strong); }

.wd-num {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.wd-dot,
.dot,
.cal-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--empty);
  flex: none;
}

.wd-dot { width: 6px; height: 6px; }

.dot-day { background: var(--day); box-shadow: 0 0 8px rgba(245, 158, 11, 0.55); }
.dot-night { background: var(--night); box-shadow: 0 0 8px rgba(99, 102, 241, 0.55); }
.dot-off { background: var(--off); box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.dot-empty { background: var(--empty); box-shadow: none; }

/* ------------------------------ Upcoming list ------------------------------ */
.event-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 13px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.28s var(--ease-spring),
    box-shadow 0.28s var(--ease-spring),
    border-color 0.28s var(--ease-spring);
}

.event-row:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(14, 165, 233, 0.35);
}

.event-row:active { transform: translateY(1px) scale(0.985); }

.event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.event-wd {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

.event-date strong {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.event-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.event-title {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-sub {
  font-size: 11px;
  color: var(--muted);
}

.event-pay {
  font-size: 12px;
  font-weight: 800;
  color: var(--success-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: none;
}

.empty-state {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

/* ------------------------------ Calendar ------------------------------ */
.month-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.month-label {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  flex: 1;
}

.calendar-card { padding: 14px; }

.cal-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 7px;
}

.cal-head span {
  text-align: center;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.25s var(--ease-spring),
    background 0.25s var(--ease-spring),
    box-shadow 0.25s var(--ease-spring),
    border-color 0.25s var(--ease-spring);
  font-variant-numeric: tabular-nums;
}

.cal-cell.empty {
  background: transparent;
  cursor: default;
  pointer-events: none;
}

.cal-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  border-color: rgba(14, 165, 233, 0.35);
}

.cal-cell:active { transform: scale(0.94); }

.cal-cell.type-day { background: var(--day-tint); }
.cal-cell.type-night { background: var(--night-tint); }
.cal-cell.type-off { background: var(--off-tint); }

.cal-cell.is-today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1.5px var(--accent);
  background: var(--accent-soft);
}

.cal-cell.is-today .cal-num { color: var(--accent-strong); }

.cal-num { line-height: 1; }

.cal-dot { width: 5px; height: 5px; }

.cal-cell.type-empty .cal-dot { opacity: 0.5; }

.legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.legend-item .dot { width: 8px; height: 8px; }

.month-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.month-summary .sum-pay { color: var(--accent-strong); }

/* ------------------------------ Friends ------------------------------ */
.common-card {
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(20, 184, 166, 0.16) 0%, rgba(20, 184, 166, 0) 60%),
    linear-gradient(150deg, #FFFFFF 0%, #F5FDFB 100%);
  border-color: rgba(16, 185, 129, 0.25);
}

[data-theme="dark"] .common-card {
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(45, 212, 191, 0.16) 0%, rgba(45, 212, 191, 0) 60%),
    linear-gradient(150deg, #131E31, #11202A);
  border-color: rgba(45, 212, 191, 0.22);
}

.common-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.common-emoji {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 13px;
  font-size: 19px;
  background: var(--off-soft);
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.16);
  animation: wave 5s ease-in-out infinite;
  transform-origin: 70% 70%;
}

@keyframes wave {
  0%, 80%, 100% { transform: rotate(0); }
  84% { transform: rotate(-9deg); }
  88% { transform: rotate(7deg); }
  92% { transform: rotate(-4deg); }
}

.common-head-text { min-width: 0; }

.common-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.common-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.common-date {
  margin-top: 13px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.common-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--off-soft);
  color: var(--success-text);
  font-size: 11px;
  font-weight: 800;
}

.common-badge.is-today { background: var(--accent-soft); color: var(--accent-strong); }

.common-empty {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 10px;
}

.avatar-stack {
  display: flex;
  margin-top: 12px;
}

.mini-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-left: -8px;
}

.mini-avatar:first-child { margin-left: 0; }

.friend-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.friend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 13px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.28s var(--ease-spring),
    box-shadow 0.28s var(--ease-spring),
    border-color 0.28s var(--ease-spring);
}

.friend-row:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(14, 165, 233, 0.35);
}

.friend-row:active { transform: translateY(1px) scale(0.985); }

.friend-row.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.friend-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

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

.friend-name {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-chevron {
  flex: none;
  color: var(--muted);
  opacity: 0.75;
}

.friend-chevron svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.friend-row.is-selected .friend-chevron { color: var(--accent-strong); opacity: 1; }

.friend-me {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 7px;
  margin-left: 4px;
}

/* ------------------------------ Settings ------------------------------ */
.settings-card { margin-bottom: 12px; padding: 16px 16px 8px; }

.card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 6px;
}

.card-head .switch { margin-left: auto; }

.card-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 14px;
  flex: none;
}

.card-title {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

.setting-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  min-width: 0;
}

.setting-label .dot { width: 7px; height: 7px; }

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  flex: none;
}

.seg-btn {
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}

.seg-btn:hover:not(.active) { color: var(--accent-strong); }

.seg-btn:active { transform: scale(0.95); }

.seg-btn.active {
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.09);
}

.segmented-wide { width: 100%; }

.segmented-wide .seg-btn { flex: 1; text-align: center; padding: 10px 12px; }

.input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 4px 10px 4px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: all 0.25s var(--ease-spring);
}

.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14);
  background: var(--surface);
}

.field {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.25s var(--ease-spring);
  font-variant-numeric: tabular-nums;
}

.field:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14);
}

.field-inline {
  width: 84px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  text-align: right;
  font-size: 14px;
  font-weight: 800;
}

.field-inline:focus { outline: none; box-shadow: none; background: transparent; }

.field-time {
  width: 92px;
  padding: 8px 9px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.input-suffix {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.input-prefix {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.time-pair { display: flex; align-items: center; gap: 3px; flex: none; }

.time-dash { color: var(--muted); font-size: 11px; }

.preview-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0 13px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}

.preview-line strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent-strong);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.switch {
  position: relative;
  width: 46px;
  height: 27px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--surface-3);
  cursor: pointer;
  transition: background 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring);
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
  transition: transform 0.32s var(--ease-spring);
}

.switch[aria-checked="true"] {
  background: linear-gradient(135deg, #0EA5E9, #0284C7);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.3);
}

.switch[aria-checked="true"]::after { transform: translateX(19px); }

.switch:active::after { width: 23px; }

/* Version */
.version-card { padding: 16px; }

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

.version-text { min-width: 0; flex: 1; }

.version-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.version-sub { font-size: 11px; color: var(--muted); }

.version-tag {
  flex: none;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.version-note {
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

/* ------------------------------ Bottom nav ------------------------------ */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(456px, calc(100% - 24px));
  padding: 6px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--nav-bg);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
}

.nav-indicator {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: calc((100% - 12px) / 4);
  border-radius: 16px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.14);
  transition: transform 0.42s var(--ease-spring), background 0.3s var(--ease-spring);
  pointer-events: none;
}

.nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0 7px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring), color 0.25s var(--ease-spring);
}

.nav-ico {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease-spring), color 0.25s var(--ease-spring);
}

.nav-item:hover { color: var(--accent-strong); }

.nav-item:hover .nav-ico { transform: translateY(-2px); }

.nav-item:active { transform: scale(0.93); }

.nav-item.active { color: var(--accent-strong); }

.nav-item.active .nav-ico { transform: translateY(-1px); }

.nav-label { line-height: 1.1; }

/* ------------------------------ Sheets ------------------------------ */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s var(--ease-spring);
}

.sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 70;
  width: min(480px, 100%);
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: var(--sheet-bg);
  box-shadow: 0 -24px 60px rgba(15, 23, 42, 0.28);
  transform: translate(-50%, 112%);
  transition: transform 0.45s var(--ease-spring);
  overscroll-behavior: contain;
}

.sheet.open { transform: translate(-50%, 0); }

.sheet-handle {
  width: 44px;
  height: 5px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: var(--border);
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.sheet-head h3 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sheet-sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
}

.sheet-label {
  margin: 16px 0 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.shift-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.shift-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px 11px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}

.shift-option:hover {
  transform: translateY(-2.5px);
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: var(--shadow-accent);
}

.shift-option:active { transform: translateY(1px) scale(0.96); }

.shift-option.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.shift-option-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--empty);
}

.shift-option-dot.dot-day { background: var(--day); }
.shift-option-dot.dot-night { background: var(--night); }
.shift-option-dot.dot-off { background: var(--off); }

.shift-option-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-align: center;
}

.shift-option-text strong {
  font-size: 13px;
  font-weight: 800;
}

.shift-option-text small {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.shift-option-check {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-strong);
}

.sheet-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.sheet-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

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

.time-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
}

.time-form .field { width: 100%; text-align: center; }

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 10px 4px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}

.preset:hover {
  transform: translateY(-2.5px);
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: var(--shadow-accent);
}

.preset:active { transform: translateY(1px) scale(0.95); }

.preset strong { font-size: 14px; font-weight: 800; letter-spacing: -0.02em; }

.preset small { font-size: 9px; color: var(--muted); font-weight: 600; }

.preset.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.preset.is-active small { color: var(--accent-strong); opacity: 0.8; }

.custom-cycle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.custom-cycle label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
}

.custom-cycle .field { width: 100%; text-align: center; }

.cycle-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.cycle-dots { display: flex; flex-wrap: wrap; gap: 4px; }

.cycle-dot {
  width: 11px;
  height: 11px;
  border-radius: 4px;
  background: var(--empty);
}

.cycle-dot.is-work { background: var(--accent); box-shadow: 0 0 8px rgba(14, 165, 233, 0.4); }

.cycle-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

.sheet-apply { margin-top: 14px; }

/* ------------------------------ Toast ------------------------------ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(100px + env(safe-area-inset-bottom));
  z-index: 200;
  max-width: calc(100% - 40px);
  padding: 11px 16px;
  border-radius: 14px;
  background: #0F172A;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.32);
  opacity: 0;
  transform: translate(-50%, 14px) scale(0.96);
  pointer-events: none;
  transition: all 0.34s var(--ease-spring);
}

[data-theme="dark"] .toast {
  background: #E6EDF7;
  color: #0B1220;
}

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

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 450px) {
  .reminder-btn {
    padding: 9px 11px;
  }
}

@media (max-width: 380px) {
  body { font-size: 14px; }

  .app-main { padding: 2px 12px 8px; }

  .greeting { font-size: 21px; }

  .hero-time { font-size: 28px; }

  .hero-shift-card { padding: 16px 15px 0; }

  .hero-metrics { margin-left: -15px; margin-right: -15px; }

  .metric-value { font-size: 13.5px; }

  .week-strip { gap: 5px; }

  .week-day-card { padding: 8px 0 7px; border-radius: 13px; }

  .wd-num { font-size: 14px; }

  .cal-grid, .cal-head { gap: 4px; }

  .cal-cell { font-size: 11.5px; border-radius: 10px; }

  .field-time { width: 82px; padding: 8px 6px; }

  .brand-name { font-size: 15.5px; }

  .brand-tab { font-size: 9px; }

  .brand-logo .brand-mark { width: 34px; height: 34px; }

  .lang-btn { padding: 5px 7px; }

  .theme-btn { width: 34px; height: 34px; }

  .preset-grid { gap: 4px; }

  .preset { padding: 9px 2px; }

  .preset strong { font-size: 12.5px; }
}

@media (max-width: 345px) {
  .brand-tab { display: none; }
}

@media (min-width: 481px) {
  .app-main { padding-top: 10px; }
}

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