
/* === Consistent mobile layout & text scaling guard (Telegram WebApp) === */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body, #root { height: 100%; height: 100dvh; height: 100svh; overflow-x: hidden; background: var(--bg); }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; touch-action: manipulation; overscroll-behavior: contain; }
.wrap { width: 100%; max-width: 480px; margin: 0 auto; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.calendar .day { min-width: 0; }
.day .head, .day .meta { font-size: clamp(10px, 2.3vw, 12px); line-height: 1.2; }
.btn { white-space: nowrap; }
/* Safe area + dynamic visible viewport (for iOS keyboard inside Telegram WebApp) */
:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* JS updates these when the keyboard opens/closes */
  --app-vh: 100dvh;
  --kbd: 0px;
}

:root { --pad: 12px; --radius: 14px; --bg: #0e1621; --card: #17212b; --text: #e3e6eb; --muted:#9aa7b5; --accent:#5ea2ff; --danger:#ff6b6b; }
* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
.wrap { max-width: 640px; margin: 0 auto; padding: var(--pad); }
.card { background: var(--card); border-radius: var(--radius); padding: var(--pad); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
.row { display: flex; gap: var(--pad); align-items: center; }
.btn { background: var(--accent); color: #0b1220; border: none; border-radius: 12px; padding: 12px 14px; font-weight: 700; width: 100%; }
.muted{ color: var(--muted); }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { background: #0f1b26; border-radius: 12px; min-height: 70px; padding: 6px; display:flex; flex-direction:column; }
.day .head { display:flex; justify-content:space-between; font-size:12px; color: var(--muted); }
.day .meta { margin-top:auto; font-size: 12px; }
.day.today { outline: 2px solid var(--accent); }
.day.weekend .head span:first-child { color: var(--danger); font-weight: 700; }
.sheet-wrap {
  position: fixed;
  inset: 0;
  display: grid;
  align-items: end;
  z-index: 2000;
  /* Push the whole sheet above the iOS on-screen keyboard */
  padding-bottom: var(--kbd);
}
.backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.sheet {
  position: relative;
  background: var(--card);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 16px;
  box-shadow: 0 -10px 30px rgba(0,0,0,.4);
  z-index: 1;

  /* Ensure content can scroll when the visible area shrinks (keyboard open) */
  max-height: calc(var(--app-vh) - 8px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet input, .sheet textarea, .sheet select { width: 100%; background: #0f1b26; color: var(--text); padding: 10px; border: 1px solid #15202a; border-radius: 10px; }

.sheet input.field-invalid,
.sheet select.field-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px rgba(255,107,107,0.22) !important;
}
.sheet input.field-invalid::placeholder {
  color: #fecaca;
}

.sheet label { display:block; font-size: 12px; margin: 8px 0 4px; color: var(--muted); }
.toolbar { display:flex; gap:8px; margin: 8px 0 12px; }
.grid-head { display:grid; grid-template-columns: repeat(7, 1fr); gap:6px; font-size:12px; color: var(--muted); margin-bottom:6px;}
.chip { font-size:11px; padding:4px 8px; border-radius: 999px; background:#0f1b26; border:1px solid #1c2a36; color:var(--muted); }
.spacer { height: 72px; }
.error-overlay { position: fixed; left: 12px; right: 12px; bottom: 88px; background:#2a0f12; color:#ffd1d1; border:1px solid #552; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.hdr { font-weight: 800; font-size: 20px; margin: 6px 0 12px; letter-spacing: .2px; }
.badge { font-size: 12px; color: var(--muted); }
.toggle { padding:8px 12px; border-radius: 10px; border:1px solid #1c2a36; background:#0f1b26; color:var(--text); }
.toggle.active { background:#1c2a36; }
/* --- totals bar --- */
.totals-bar{ position: sticky; top: 0; z-index: 10; }
.totals-row{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.totals-row .vr{
  width:1px;
  height:20px;
  background: rgba(255,255,255,0.14);
}
.btn-sm{
  background:#2c7be5;
  color:#fff;
  border:none;
  border-radius:8px;
  padding:6px 10px;
  cursor:pointer;
}
.btn-sm:hover{opacity:0.92}
.totals-bar input[type="number"]{
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
}

.totals-bar{ z-index: 10; }
.modal, .modal-backdrop{ z-index: 1000; }


/* --- overlay & summary fixes --- */
html:has(.sheet-wrap.open) .totals-bar { display: none !important; }
.totals-bar { position: sticky; bottom: 0; z-index: 10; }
.modal, .modal-backdrop { z-index: 1060 !important; }


.btn-danger{ background: var(--danger) !important; color: #fff !important; border: none !important; }


/* --- iOS safe area + sticky toolbar --- */
:root { --safe-bottom: env(safe-area-inset-bottom, 0px); }
.sheet { padding-bottom: calc(var(--pad) + var(--safe-bottom)); }
.sheet .toolbar { 
  position: sticky; 
  bottom: 0; 
  background: var(--card);
  padding: 8px 0 calc(8px + var(--safe-bottom));
  margin-top: 8px;
}

/* Switch (iOS-like) */
.switch { position: relative; width: 44px; height: 26px; display:inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position:absolute; inset:0; background:#334152; border-radius: 999px; transition: .2s; }
.switch .slider:before { content:""; position:absolute; height:22px; width:22px; left:2px; top:2px; background:white; border-radius:50%; transition:.2s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider:before { transform: translateX(18px); }


/* Tiny 3-line meta block inside day tile */
.meta3 {
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
  font-size: 8.5px;
  line-height: 1.0;
}
.meta3 .ln1, .meta3 .ln2, .meta3 .ln3 { min-height: 10px; }
.tag.ok { color: #22c55e; }         /* green */
.tag.bad { color: var(--danger); }  /* red */
.tag.off { color: var(--accent); }  /* accent for "выходной" */



/* Off-day strike-through */
.day.off { position: relative; }
.day.off::after {
  content: "";
  position: absolute;
  left: 6px; right: 6px;
  top: 50%;
  height: 2px;
  background: rgba(94,162,255,0.6);
  border-radius: 2px;
  pointer-events: none;
}
.day.off .meta3 { opacity: 0.7; }


/* German public holidays (red) */
.day.holiday .date { color: #ef4444; }
.day.holiday { outline: 1px dashed rgba(239,68,68,0.5); outline-offset: -2px; }


/* Stronger holiday highlight */
.day.holiday { box-shadow: inset 0 0 0 2px rgba(239,68,68,0.7); }
.day.holiday .ln1, .day.holiday .ln2, .day.holiday .ln3 { color: #ef4444; }



/* Holiday marking same as weekend */
.day.holiday .date { color: #ef4444; }
.day.holiday .ln1 { color: #ef4444; }
.day.holiday { box-shadow: inset 0 0 0 2px rgba(239,68,68,.7); }


.day.holiday .head span:first-child { color: var(--danger); font-weight: 700; }

.calendar .day.holiday .head span:first-child { color: var(--danger) !important; font-weight: 700; }
.calendar .day.holiday { border: 2px solid rgba(239,68,68,0.9); }

/* === Wide day list calendar (keeps original ES.app dark style) === */
.app-top-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
  margin-bottom: 12px;
}
.app-top-sticky .totals-bar {
  position: static !important;
  top: auto !important;
  bottom: auto !important;
  z-index: auto !important;
}
.calendar-list-card {
  padding: 10px;
}
.calendar-list {
  display: block;
  width: 100%;
}
.cal-week {
  margin-bottom: 10px;
}
.cal-week:last-child {
  margin-bottom: 0;
}
.cal-week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 4px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.cal-week-head span:last-child {
  color: #9ec5ff;
  white-space: nowrap;
}
.day-row {
  width: 100%;
  min-height: 112px;
  margin: 0 0 7px;
  padding: 10px;
  border: 1px solid rgba(28,42,54,.95);
  border-radius: 14px;
  background: #0f1b26;
  color: var(--text);
  text-align: left;
  display: grid;
  grid-template-columns: 48px minmax(0,1fr) 62px;
  gap: 10px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
  font: inherit;
}
.day-row:active {
  transform: scale(.995);
}
.day-row.today {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  scroll-margin-top: var(--today-scroll-margin, 220px);
}
.day-row.weekend {
  background: linear-gradient(90deg, rgba(255,107,107,.12), #0f1b26 44%);
}
.day-row.holiday {
  border-color: rgba(255,107,107,.88);
  box-shadow: inset 0 0 0 1px rgba(255,107,107,.36);
}
.day-row.off {
  background: linear-gradient(90deg, rgba(94,162,255,.11), #0f1b26 45%);
}
.day-row-date {
  min-height: 88px;
  border-radius: 12px;
  background: #0d1823;
  border: 1px solid #1c2a36;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.day-row-num {
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
  color: var(--muted);
}
.day-row-dow {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1;
  color: var(--muted);
  font-weight: 800;
}
.day-row.weekend .day-row-num,
.day-row.holiday .day-row-num {
  color: var(--danger);
}
.day-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.day-row-tags {
  min-height: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.day-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1;
  border-radius: 999px;
  padding: 4px 7px;
  border: 1px solid #1c2a36;
  background: #101c28;
  color: var(--muted);
}
.day-chip.ok {
  color: #86efac;
  border-color: rgba(34,197,94,.35);
  background: rgba(34,197,94,.08);
}
.day-chip.weekend,
.day-chip.holiday {
  color: #fecaca;
  border-color: rgba(255,107,107,.42);
  background: rgba(255,107,107,.08);
}
.day-chip.off {
  color: #bfdbfe;
  border-color: rgba(94,162,255,.4);
  background: rgba(94,162,255,.08);
}
.day-projects {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.day-project-row {
  min-height: 20px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(255,255,255,.025);
}
.project-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 800;
  color: var(--text);
}
.project-hours {
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  color: #dbeafe;
  white-space: nowrap;
}
.day-empty-text {
  margin: auto 0;
  color: #617184;
  font-size: 13px;
  font-weight: 800;
}
.day-row-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
}
.day-total {
  color: #eef5ff;
  font-size: 17px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}
.lodge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1;
  border-radius: 999px;
  padding: 4px 6px;
  border: 1px solid rgba(34,197,94,.32);
  background: rgba(34,197,94,.08);
  color: #86efac;
}
.lodge.no {
  border-color: rgba(255,107,107,.32);
  background: rgba(255,107,107,.08);
  color: #fecaca;
}
.state-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #344455;
}
.state-dot.ok {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.12);
}
@media (max-width: 360px) {
  .day-row {
    grid-template-columns: 44px minmax(0,1fr) 56px;
    gap: 8px;
    padding: 9px;
  }
  .project-name { font-size: 11px; }
  .day-total { font-size: 15px; }
  .day-chip { font-size: 9px; padding: 4px 6px; }
}

/* === Weekly review confirmation modal === */
.week-review-wrap {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.week-review-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}
.week-review-sheet {
  position: relative;
  width: min(100%, 430px);
  max-height: calc(var(--app-vh, 100vh) - 32px);
  overflow-y: auto;
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px 18px 0 0;
  padding: 14px;
  box-shadow: 0 -14px 40px rgba(0,0,0,.35);
}
.week-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.week-review-title {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
}
.week-review-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.week-review-warning {
  margin: 0 0 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255,107,107,.1);
  border: 1px solid rgba(255,107,107,.3);
  color: #fecaca;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}
.week-review-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.week-review-row {
  min-height: 64px;
  display: grid;
  grid-template-columns: 46px minmax(0,1fr) 66px;
  gap: 9px;
  align-items: center;
  background: #0f1b26;
  border: 1px solid rgba(28,42,54,.95);
  border-radius: 14px;
  padding: 8px;
}
.week-review-row.weekend {
  background: linear-gradient(90deg, rgba(255,107,107,.11), #0f1b26 45%);
}
.week-review-date {
  min-height: 48px;
  border-radius: 11px;
  background: #0d1823;
  border: 1px solid #1c2a36;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.week-review-date b {
  font-size: 17px;
  line-height: 1;
}
.week-review-date span {
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
  font-weight: 800;
}
.week-review-main { min-width: 0; }
.week-review-empty {
  color: #7f8fa3;
  font-size: 13px;
  font-weight: 800;
}
.week-review-projects {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.week-review-project {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  line-height: 1.15;
}
.week-review-project span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}
.week-review-project b {
  color: #dbeafe;
  white-space: nowrap;
}
.week-review-more {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.week-review-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.week-review-side b {
  font-size: 14px;
  font-weight: 950;
  white-space: nowrap;
}
.week-review-side span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1;
  border-radius: 999px;
  padding: 4px 6px;
}
.week-review-side span.yes {
  border: 1px solid rgba(34,197,94,.32);
  background: rgba(34,197,94,.08);
  color: #86efac;
}
.week-review-side span.no {
  border: 1px solid rgba(255,107,107,.32);
  background: rgba(255,107,107,.08);
  color: #fecaca;
}
.week-review-total {
  margin-top: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,.16);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.week-review-total b { color: var(--text); }
.week-review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.week-review-actions .btn {
  width: 100%;
  min-height: 44px;
}
.week-review-actions .btn-secondary {
  background: #1c2a36;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.08);
}

/* === Hybrid option 2: horizontal month strip + compact weekly cards === */
.week-calendar-view {
  width: 100%;
}
.month-day-strip {
  display: flex;
  gap: 6px;
  margin: 0 0 10px;
  padding: 2px 2px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.month-day-strip::-webkit-scrollbar { display: none; }
.month-strip-day {
  flex: 0 0 44px;
  min-width: 44px;
  height: 58px;
  padding: 5px 4px;
  border: 1px solid rgba(28,42,54,.75);
  border-radius: 12px;
  background: #0f1b26;
  color: var(--text);
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
  scroll-snap-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.month-strip-day:active { transform: scale(.98); }
.month-strip-day.selected {
  border-color: rgba(94,162,255,.95);
  box-shadow: inset 0 0 0 1px rgba(94,162,255,.55);
  background: #12253a;
}
.month-strip-day.today {
  outline: 2px solid rgba(94,162,255,.8);
  outline-offset: 1px;
}
.month-strip-day.weekend .strip-num,
.month-strip-day.holiday .strip-num { color: var(--danger); }
.month-strip-day.weekend { background: linear-gradient(180deg, rgba(255,107,107,.10), #0f1b26 60%); }
.month-strip-day.holiday { border-color: rgba(255,107,107,.65); }
.strip-num {
  font-size: 16px;
  line-height: 1;
  font-weight: 900;
  color: var(--text);
}
.strip-dow {
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  color: var(--muted);
}
.strip-hours {
  min-height: 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8.5px;
  line-height: 1;
  font-weight: 850;
  color: #dbeafe;
}
.strip-dot {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #344455;
}
.month-strip-day.filled .strip-dot { background: #22c55e; }
.month-strip-day.off .strip-dot { background: var(--accent); }
.selected-week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 3px 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
}
.selected-week-head b {
  color: #9ec5ff;
  white-space: nowrap;
  font-size: 12px;
}
.week-day-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.week-day-card {
  width: 100%;
  min-height: 92px;
  padding: 7px;
  border: 1px solid rgba(28,42,54,.72);
  border-radius: 12px;
  background: #0f1b26;
  color: var(--text);
  text-align: left;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) 56px;
  gap: 7px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
  font: inherit;
}
.week-day-card:active { transform: scale(.997); }
.week-day-card.today {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}
.week-day-card.selected {
  border-color: rgba(94,162,255,.5);
}
.week-day-card.weekend {
  background: linear-gradient(90deg, rgba(255,107,107,.09), #0f1b26 44%);
}
.week-day-card.holiday {
  border-color: rgba(255,107,107,.7);
  box-shadow: inset 0 0 0 1px rgba(255,107,107,.22);
}
.week-day-card.off {
  background: linear-gradient(90deg, rgba(94,162,255,.08), #0f1b26 45%);
}
.week-card-date {
  min-height: 78px;
  border-radius: 10px;
  background: #0d1823;
  border: 1px solid rgba(28,42,54,.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.week-card-num {
  font-size: 19px;
  line-height: 1;
  font-weight: 900;
  color: var(--muted);
}
.week-card-dow {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1;
  color: var(--muted);
  font-weight: 800;
}
.week-day-card.weekend .week-card-num,
.week-day-card.holiday .week-card-num { color: var(--danger); }
.week-card-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.week-card-meta {
  min-height: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}
.thin-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  line-height: 1;
  border-radius: 999px;
  padding: 3px 5px;
  border: 1px solid rgba(28,42,54,.7);
  background: rgba(16,28,40,.8);
  color: var(--muted);
}
.thin-chip.danger {
  color: #fecaca;
  border-color: rgba(255,107,107,.34);
  background: rgba(255,107,107,.07);
}
.thin-chip.off {
  color: #bfdbfe;
  border-color: rgba(94,162,255,.34);
  background: rgba(94,162,255,.07);
}
.thin-chip.empty {
  color: #7f8fa3;
}
.week-card-projects {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.week-card-project {
  min-height: 18px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 5px;
  align-items: center;
  padding: 3px 5px;
  border-radius: 7px;
  background: rgba(255,255,255,.021);
  border: 1px solid rgba(255,255,255,.025);
}
.week-card-project .project-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  line-height: 1.1;
  font-weight: 820;
  color: var(--text);
}
.week-card-project .project-hours {
  font-size: 10.5px;
  line-height: 1;
  font-weight: 900;
  color: #dbeafe;
  white-space: nowrap;
}
.week-card-empty {
  margin: auto 0;
  color: #617184;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
}
.week-card-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
}
.week-total {
  color: #eef5ff;
  font-size: 15px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}
.week-lodge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  line-height: 1;
  border-radius: 999px;
  padding: 3px 5px;
  border: 1px solid rgba(34,197,94,.28);
  background: rgba(34,197,94,.07);
  color: #86efac;
}
.week-lodge.no {
  border-color: rgba(255,107,107,.28);
  background: rgba(255,107,107,.07);
  color: #fecaca;
}
@media (max-width: 360px) {
  .week-day-card { grid-template-columns: 39px minmax(0,1fr) 52px; gap: 6px; padding: 6px; }
  .month-strip-day { flex-basis: 41px; min-width: 41px; }
  .week-card-project .project-name { font-size: 10.8px; }
  .week-total { font-size: 14px; }
}

/* === Compact totals block: reduce sticky header height on small mobile screens === */
.app-top-sticky {
  margin-bottom: 8px;
}
.app-top-sticky > .row {
  margin-bottom: 4px;
}
.totals-bar-compact {
  margin-top: 6px !important;
  padding: 7px 10px !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,0.035) !important;
  border: 1px solid rgba(255,255,255,0.075) !important;
}
.totals-compact-top {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto;
  align-items: center;
  gap: 6px;
}
.totals-main-metric {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.totals-main-metric b,
.totals-compact-sub b,
.payout-compact-main b {
  color: #d7dde6;
}
.payout-eye-btn {
  width: 26px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(15,27,38,.92);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.totals-compact-sub {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
}
.payout-compact {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255,255,255,0.13);
  cursor: pointer;
  user-select: none;
}
.payout-compact-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.15;
  color: var(--muted);
}
.payout-compact-main span {
  color: #d7dde6;
  font-weight: 800;
  white-space: nowrap;
}
.payout-compact-main em {
  margin-left: auto;
  color: rgba(154,167,181,.78);
  font-size: 10.5px;
  font-style: normal;
  white-space: nowrap;
}
.payout-breakdown {
  margin-top: 4px;
  color: rgba(154,167,181,.86);
  font-size: 10.5px;
  line-height: 1.25;
}
.totals-actions-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 7px;
}
.totals-action-btn {
  min-height: 33px;
  padding: 7px 9px;
  border-radius: 11px;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}
.totals-action-btn.details { background: #22c55e; }
.totals-action-btn.payout { background: #ef4444; }
.totals-action-btn.payout span { font-weight: 900; font-size: 13px; }
@media (max-width: 360px) {
  .totals-bar-compact { padding: 7px 8px !important; }
  .totals-main-metric { font-size: 11.5px; }
  .totals-compact-sub { font-size: 10.5px; }
  .totals-action-btn { min-height: 32px; padding: 7px 6px; font-size: 12.5px; }
}
