/* Radius tuning and floating active workout resume dock */

/* Slightly sharper corners: keeps the glass style, but feels less bubbly. */
.home-hero,
.home-progress-card,
.home-moments-card,
.home-history-card,
.day-card,
.history-rich-card,
.active-workout-panel {
  border-radius: 20px;
}
.hero-launch-card,
.active-ex-card,
.stat-card,
.chart-wrapper,
.history-card,
.profile-bio-card,
.home-weight-card,
.home-resume-card {
  border-radius: 15px;
}
@media(max-width:430px){
  .home-hero,
  .home-progress-card,
  .home-moments-card,
  .home-history-card,
  .day-card,
  .history-rich-card,
  .active-workout-panel { border-radius: 18px; }
  .hero-launch-card,
  .active-ex-card,
  .stat-card,
  .chart-wrapper,
  .history-card,
  .profile-bio-card,
  .home-weight-card,
  .home-resume-card { border-radius: 14px; }
  .home-week-card { padding: 11px; }
  .home-week-grid { gap: 4px; }
  .home-wday { min-height: 58px; border-radius: 10px; padding: 6px 1px; }
  .home-wday-abbr { font-size: 6.5px; letter-spacing: .55px; margin-bottom: 4px; }
  .home-wday-num { font-size: 17px; }
  .home-wday-status { width: 12px; height: 12px; border-radius: 4px; font-size: 8px; margin-top: 3px; }
  body.workout-mode .active-workout-head {
    padding: calc(10px + env(safe-area-inset-top, 0px)) 8px 8px;
    gap: 8px;
  }
  body.workout-mode .active-workout-title {
    font-size: 20px;
    padding-right: 42px;
  }
  body.workout-mode .active-workout-inline {
    padding-right: 42px;
    gap: 4px;
  }
  body.workout-mode .active-workout-exercises {
    padding: 8px 9px 10px;
  }
  body.workout-mode .active-workout-finish-row {
    padding: 9px 9px calc(9px + env(safe-area-inset-bottom, 0px));
  }
  body.workout-mode .active-screen-close {
    top: max(18px, calc(9px + env(safe-area-inset-top, 0px)));
    right: 9px;
    width: 36px;
    height: 36px;
    border-radius: 13px;
    font-size: 19px;
  }
}

/* Compact floating active workout indicator */
.home-resume-card {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px);
  width: min(340px, calc(100vw - 28px));
  margin: 0;
  padding: 9px 10px;
  border-radius: 18px;
  z-index: 180;
  cursor: pointer;
  background:
    radial-gradient(circle at 12% 0%, rgba(77,255,160,0.18), transparent 42%),
    linear-gradient(135deg, rgba(24,24,34,0.96), rgba(17,17,25,0.96));
  border: 1px solid rgba(77,255,160,0.20);
  box-shadow: 0 14px 36px rgba(0,0,0,0.46), inset 0 1px 0 rgba(255,255,255,0.10);
  transform: translateX(calc(-50% + var(--resume-swipe-x, 0px)));
  animation: activeMiniDockIn .34s var(--spring) both;
}
.home-resume-card::after {
  inset: auto -10% -80% 8%;
  height: 90px;
  opacity: .6;
}
.home-resume-top {
  margin-bottom: 0;
  align-items: center;
  gap: 10px;
}
.home-resume-top > div:first-child {
  min-width: 0;
}
.home-resume-kicker {
  font-size: 7px;
  letter-spacing: 2px;
  margin-bottom: 3px;
}
.home-resume-title {
  font-family: -apple-system, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.15;
  letter-spacing: .1px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-resume-sub {
  margin-top: 3px;
  color: var(--green);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 17px;
  letter-spacing: 1px;
  line-height: 1;
}
.home-resume-actions {
  gap: 7px;
}
.home-resume-btn,
.home-resume-finish-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}
.home-resume-btn {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-color: rgba(255,255,255,0.12);
  box-shadow: none;
}
.home-resume-finish-btn {
  background: rgba(232,244,77,0.14);
  color: var(--accent);
}
.home-resume-stats {
  display: none !important;
}
@keyframes activeMiniDockIn {
  from { opacity: 0; transform: translateX(-50%) translateY(18px) scale(.98); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@media(max-width:430px){
  .home-resume-card {
    bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px);
    width: min(332px, calc(100vw - 20px));
    padding: 8px 9px;
    border-radius: 17px;
  }
  .home-resume-actions {
    width: auto;
    display: flex;
    gap: 6px;
  }
  .home-resume-btn,
  .home-resume-finish-btn {
    width: 33px;
    height: 33px;
    padding: 0;
    border-radius: 13px;
  }
}

/* Final dock tuning: keep the active workout strip attached to the viewport. */
#page-home.page.active {
  animation: none !important;
  transform: none !important;
}
.home-resume-card {
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 7px) !important;
  width: min(318px, calc(100vw - 38px)) !important;
  min-height: 38px;
  padding: 4px 6px !important;
  border-radius: 14px !important;
  display: grid;
  grid-template-columns: 31px minmax(0,1fr) 31px;
  gap: 6px;
  align-items: center;
  overflow: visible;
}
.home-resume-card::before {
  content: '🗑';
  position: absolute;
  inset: 0 auto 0 100%;
  width: 54px;
  margin-left: 7px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  background: rgba(255,92,58,0.14);
  border: 1px solid rgba(255,92,58,0.28);
  opacity: 0;
  transform: scale(.92);
  transition: opacity .18s ease, transform .18s var(--spring);
  pointer-events: none;
}
.home-resume-card.swipe-delete::before {
  opacity: 1;
  transform: scale(1);
}
.home-resume-card::after {
  display: none;
}
.home-resume-top {
  width: 100%;
  display: contents;
  margin: 0 !important;
  gap: 8px !important;
}
.home-resume-kicker {
  display: none;
}
.home-resume-top > div:first-child {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  grid-column: 2;
  grid-row: 1;
}
.home-resume-title {
  font-size: 12px !important;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 150px;
  text-align: right;
}
.home-resume-sub {
  margin: 0 !important;
  flex: 0 0 auto;
  font-size: 15px !important;
}
.home-resume-actions {
  display: contents !important;
}
.home-resume-btn,
.home-resume-finish-btn {
  width: 31px !important;
  height: 31px !important;
  border-radius: 11px !important;
  font-size: 15px !important;
}
.home-resume-btn { grid-column: 1; grid-row: 1; }
.home-resume-finish-btn { grid-column: 3; grid-row: 1; }
@media(max-width:430px){
  .home-resume-card {
    bottom: calc(var(--nav-h) + var(--safe-bottom) + 7px) !important;
    width: min(318px, calc(100vw - 32px)) !important;
    min-height: 38px;
    padding: 4px 6px !important;
  }
  .home-resume-title { max-width: 136px; }
}

/* Player-style active workout dock */
.home-resume-card {
  width: min(352px, calc(100vw - 30px)) !important;
  min-height: 58px !important;
  padding: 0 8px !important;
  border-radius: 28px !important;
  grid-template-columns: 54px minmax(0,1fr) 54px !important;
  gap: 8px !important;
  background: linear-gradient(135deg, rgba(30,31,36,.98), rgba(18,18,26,.98)) !important;
  border-color: rgba(255,255,255,.10) !important;
  box-shadow: 0 18px 48px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.08) !important;
  transform: translateX(calc(-50% + var(--resume-swipe-x, 0px))) !important;
  transition: transform .22s var(--spring), box-shadow .22s var(--spring);
  touch-action: pan-y;
}
.home-resume-card::before {
  content: "\1F5D1";
  right: -62px;
  left: auto;
  inset: 0 auto 0 auto;
  width: 54px;
  height: 54px;
  margin: auto 0;
  border-radius: 50%;
  font-size: 23px;
  color: var(--red);
  background: rgba(255,92,58,.16);
  border: 1px solid rgba(255,92,58,.24);
}
.home-resume-top > div:first-child {
  display: block !important;
  position: relative;
  padding-left: 18px;
}
.home-resume-top > div:first-child::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #39d426;
  box-shadow: 0 0 14px rgba(57,212,38,.58);
  animation: resumeLivePulse 1.45s ease-in-out infinite;
}
.home-resume-title {
  display: block;
  max-width: none !important;
  text-align: left !important;
  font-size: 15px !important;
  line-height: 1.05 !important;
  color: var(--text);
}
.home-resume-title::after {
  content: ' ' attr(data-time);
  color: var(--green);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: .8px;
  margin-left: 5px;
}
.home-resume-sub {
  display: block;
  margin-top: 4px !important;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255,255,255,.42) !important;
  font-family: -apple-system, system-ui, sans-serif !important;
  font-size: 12px !important;
  letter-spacing: 0 !important;
}
.home-resume-btn,
.home-resume-finish-btn {
  width: 54px !important;
  height: 54px !important;
  border-radius: 50% !important;
}
.home-resume-btn svg,
.home-resume-finish-btn svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.home-resume-btn {
  background: rgba(255,255,255,.075) !important;
  color: var(--text) !important;
  border-color: rgba(255,255,255,.08) !important;
}
.home-resume-finish-btn {
  background: rgba(232,244,77,.14) !important;
  color: var(--accent) !important;
  border-color: rgba(232,244,77,.22) !important;
}
@keyframes resumeLivePulse {
  0%,100% { opacity: .78; transform: scale(.82); }
  50% { opacity: 1; transform: scale(1.08); }
}
@media(max-width:430px){
  .home-resume-card {
    width: min(342px, calc(100vw - 26px)) !important;
    min-height: 56px !important;
    grid-template-columns: 52px minmax(0,1fr) 52px !important;
  }
  .home-resume-btn,
  .home-resume-finish-btn {
    width: 52px !important;
    height: 52px !important;
  }
  .home-resume-sub { max-width: 170px; }
}

/* Softer active workout dock */
.home-resume-card {
  width: min(336px, calc(100vw - 30px)) !important;
  min-height: 48px !important;
  padding: 0 7px !important;
  border-radius: 24px !important;
  grid-template-columns: 42px minmax(0,1fr) 42px !important;
  background: linear-gradient(135deg, rgba(31,32,37,.82), rgba(17,18,25,.78)) !important;
  backdrop-filter: blur(22px) saturate(1.55);
  -webkit-backdrop-filter: blur(22px) saturate(1.55);
  border-color: rgba(255,255,255,.075) !important;
  box-shadow: 0 12px 34px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.07) !important;
}
.home-resume-card::before {
  right: -51px;
  width: 42px;
  height: 42px;
  font-size: 19px;
  opacity: 0;
  transform: translateX(10px) scale(.88);
  transition: opacity .2s ease, transform .24s var(--spring);
}
.home-resume-card.swipe-delete::before {
  opacity: 1;
  transform: translateX(0) scale(1);
}
.home-resume-btn,
.home-resume-finish-btn {
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
}
.home-resume-btn svg,
.home-resume-finish-btn svg {
  width: 21px;
  height: 21px;
  stroke-width: 2.7;
}
.home-resume-title {
  font-size: 14px !important;
}
.home-resume-title::after {
  font-size: 15px;
}
.home-resume-sub {
  margin-top: 2px !important;
  font-size: 11px !important;
}
.home-resume-top > div:first-child {
  padding-left: 16px;
}
.home-resume-top > div:first-child::before {
  top: 4px;
  width: 9px;
  height: 9px;
}
@media(max-width:430px){
  .home-resume-card {
    width: min(330px, calc(100vw - 26px)) !important;
    min-height: 48px !important;
    grid-template-columns: 42px minmax(0,1fr) 42px !important;
  }
  .home-resume-btn,
  .home-resume-finish-btn {
    width: 42px !important;
    height: 42px !important;
  }
}

.dock-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,.48);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.dock-confirm-overlay.open { display: flex; }
.dock-confirm-sheet {
  width: min(330px, calc(100vw - 34px));
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(28,28,38,.96), rgba(16,16,24,.96));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 70px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08);
  transform: translateY(12px) scale(.98);
  animation: dockConfirmIn .24s var(--spring) both;
}
.dock-confirm-title {
  font-size: 15px;
  font-weight: 950;
  margin-bottom: 8px;
}
.dock-confirm-sub {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted2);
  margin-bottom: 14px;
}
.dock-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.dock-confirm-btn {
  min-height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-weight: 900;
}
.dock-confirm-btn.danger {
  color: #110606;
  background: var(--red);
  border-color: rgba(255,92,58,.45);
}
@keyframes dockConfirmIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Smaller dock controls and drawn icons */
.home-resume-card {
  min-height: 44px !important;
  grid-template-columns: 36px minmax(0,1fr) 36px !important;
  padding: 0 6px !important;
}
.home-resume-btn,
.home-resume-finish-btn {
  width: 36px !important;
  height: 36px !important;
  font-size: 0 !important;
}
.home-resume-btn svg,
.home-resume-finish-btn svg {
  display: none !important;
}
.home-resume-btn::before,
.home-resume-finish-btn::before {
  content: '';
  display: block;
  width: 13px;
  height: 13px;
}
.home-resume-btn::before {
  border-left: 2.7px solid currentColor;
  border-top: 2.7px solid currentColor;
  transform: rotate(45deg) translate(2px, 2px);
}
.home-resume-finish-btn::before {
  width: 15px;
  height: 9px;
  border-left: 2.8px solid currentColor;
  border-bottom: 2.8px solid currentColor;
  transform: rotate(-45deg) translate(1px, -1px);
}
.home-resume-card::before {
  right: -47px;
  width: 40px;
  height: 40px;
  font-size: 18px;
}
.home-resume-title { font-size: 13px !important; }
.home-resume-title::after { font-size: 14px; }
.home-resume-sub { font-size: 10.5px !important; }
@media(max-width:430px){
  .home-resume-card {
    min-height: 44px !important;
    grid-template-columns: 36px minmax(0,1fr) 36px !important;
  }
  .home-resume-btn,
  .home-resume-finish-btn {
    width: 36px !important;
    height: 36px !important;
  }
}

/* Final compact pass for the workout dock */
.home-resume-card {
  width: min(304px, calc(100vw - 42px)) !important;
  min-height: 40px !important;
  grid-template-columns: 32px minmax(0,1fr) 32px !important;
  gap: 6px !important;
  padding: 0 6px !important;
  border-radius: 21px !important;
}
.home-resume-btn,
.home-resume-finish-btn {
  width: 32px !important;
  height: 32px !important;
}
.home-resume-btn::before {
  width: 11px;
  height: 11px;
  border-left-width: 2.4px;
  border-top-width: 2.4px;
}
.home-resume-finish-btn::before {
  width: 13px;
  height: 8px;
  border-left-width: 2.5px;
  border-bottom-width: 2.5px;
}
.home-resume-top > div:first-child {
  padding-left: 14px;
  text-align: center;
}
.home-resume-top > div:first-child::before {
  left: 9px;
  top: 5px;
  width: 8px;
  height: 8px;
}
.home-resume-title {
  text-align: center !important;
  font-size: 12.5px !important;
  padding-left: 14px;
}
.home-resume-title::after {
  font-size: 13.5px;
  margin-left: 4px;
}
.home-resume-sub {
  max-width: 150px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  font-size: 10px !important;
}
.home-resume-card::before {
  right: -42px;
  width: 36px;
  height: 36px;
  font-size: 16px;
}

/* Dock legibility tweaks */
.home-resume-card {
  background: linear-gradient(135deg, rgba(31,32,37,.68), rgba(17,18,25,.62)) !important;
  border-color: rgba(255,255,255,.055) !important;
}
.home-resume-top > div:first-child {
  padding-left: 0 !important;
}
.home-resume-top > div:first-child::before {
  left: calc(50% - 88px) !important;
  top: 5px !important;
}
.home-resume-title {
  padding-left: 0 !important;
}
.home-resume-sub {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  text-align: center !important;
}

/* Final dock text alignment */
.home-resume-top > div:first-child {
  display: grid !important;
  grid-template-columns: 8px auto;
  grid-template-rows: auto auto;
  column-gap: 5px;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  padding-left: 0 !important;
  transform: translateY(2px);
}
.home-resume-top > div:first-child::before {
  position: static !important;
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  align-self: center;
  width: 8px !important;
  height: 8px !important;
}
.home-resume-title {
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
  min-width: 0;
  max-width: 190px !important;
  padding-left: 0 !important;
  text-align: left !important;
}
.home-resume-sub {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: center;
  width: min(190px, 100%) !important;
  margin: 2px auto 0 !important;
  text-align: center !important;
}
