.fl-habit-arena-topbar {
  align-items: stretch;
  gap: 14px;
}

.fl-habit-arena-tabs {
  padding: 10px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(6, 12, 24, 0.96), rgba(4, 10, 21, 0.92));
  border: 1px solid rgba(82, 100, 135, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.fl-habit-arena-tabs .fl-task-arena-tab {
  min-height: 60px;
  padding: 0 18px;
  border-radius: 20px;
  color: rgba(226, 232, 240, 0.72);
  box-shadow: inset 0 0 0 1px transparent;
}

.fl-habit-arena-tabs .fl-task-arena-tab strong {
  min-width: 26px;
  height: 26px;
}

.fl-habit-arena-tabs .fl-task-arena-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(82, 100, 135, 0.24);
}

.fl-habit-arena-tabs .fl-task-arena-tab.is-active {
  background: linear-gradient(180deg, #ff3131, #ff2020);
  box-shadow: 0 16px 30px rgba(255, 49, 49, 0.28);
}

.fl-habit-topbar-actions .fl-icon-btn,
.fl-habit-topbar-actions .fl-mini-btn {
  min-width: 46px;
  min-height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(82, 100, 135, 0.26);
  background: linear-gradient(180deg, rgba(6, 12, 24, 0.96), rgba(4, 10, 21, 0.92));
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.28);
}

.fl-habit-topbar-actions .fl-mini-btn {
  min-width: 82px;
  padding: 0 18px;
  font-size: 0.95rem;
}


.fl-habit-command-row {
  display: grid;
  align-items: end;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr);
}

.fl-habit-command-row > * {
  min-width: 0;
}

.fl-habit-command-row form,
.fl-habit-command-row input,
.fl-habit-command-row select,
.fl-habit-command-row button {
  min-width: 0;
}

.fl-habit-quick-add-inline {
  width: 100%;
  max-width: 100%;
  justify-self: stretch;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr) repeat(4, minmax(0, 0.72fr)) minmax(138px, 0.92fr);
}

.fl-habit-quick-add-inline > * {
  width: 100%;
  min-width: 0;
}

.fl-habit-quick-add-inline .fl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.fl-habit-command-row > div:first-child {
  display: grid;
  gap: 6px;
}

.fl-habit-quick-add-inline label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.fl-habit-quick-add-inline .fl-btn {
  min-height: 48px;
  padding-inline: 20px;
  white-space: nowrap;
  font-size: 0.95rem;
}

.fl-habit-progress-track-labeled,
.fl-habit-week-summary-track {
  position: relative;
  overflow: hidden;
}

.fl-habit-progress-track-labeled strong,
.fl-habit-week-summary-track strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  z-index: 1;
}

.fl-habit-goal-ring {
  position: relative;
  overflow: hidden;
  place-items: center;
}

.fl-habit-goal-ring::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.1), rgba(8, 15, 29, 0.9));
}

.fl-habit-goal-ring-content {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 4px;
  text-align: center;
}

.fl-habit-kpi-card-centered,
.fl-habit-dashboard-tile-centered {
  align-content: center;
  justify-items: center;
  text-align: center;
  min-height: 148px;
}

.fl-habit-kpi-card-centered small,
.fl-habit-dashboard-tile-centered small,
.fl-habit-dashboard-tile-centered span {
  text-align: center;
}

.fl-habit-week-board {
  display: grid;
  gap: 16px;
}

.fl-habit-week-board-main {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.fl-habit-week-sidebar {
  display: grid;
  gap: 10px;
}

.fl-habit-week-sidebar-head,
.fl-habit-week-side-card,
.fl-habit-week-column-head,
.fl-habit-week-track-cell {
  min-height: 82px;
}

.fl-habit-week-sidebar-head {
  border-radius: 18px;
  border: 1px solid rgba(82, 100, 135, 0.18);
  background: rgba(7, 13, 27, 0.82);
  padding: 16px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.fl-habit-week-sidebar-head span,
.fl-habit-week-sidebar-head small,
.fl-habit-week-side-title span,
.fl-habit-week-column-meta span,
.fl-habit-week-column-meta small,
.fl-habit-week-summary-head span,
.fl-habit-week-summary-card small,
.fl-habit-week-day-heads span small {
  color: var(--fl-text-soft);
}

.fl-habit-week-side-card {
  border-radius: 18px;
  border: 1px solid rgba(82, 100, 135, 0.18);
  background: rgba(7, 13, 27, 0.82);
  padding: 14px 16px;
  display: grid;
  align-content: center;
  gap: 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.fl-habit-week-side-card:hover,
.fl-habit-week-side-card:focus-visible {
  border-color: rgba(248, 113, 113, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.24);
}

.fl-habit-week-side-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.fl-habit-week-side-title strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.fl-habit-week-side-title span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fl-habit-week-side-title strong,
.fl-habit-week-column-meta strong,
.fl-habit-week-summary-head strong,
.fl-habit-week-summary-rate {
  font-size: 1.05rem;
}

.fl-habit-progress-inline-strong {
  gap: 10px;
}

.fl-habit-progress-inline-strong small {
  min-width: 40px;
  font-weight: 700;
}

.fl-habit-week-scroll {
  display: grid;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(248, 113, 113, 0.95) rgba(255, 255, 255, 0.08);
}

.fl-habit-week-scroll::-webkit-scrollbar {
  height: 12px;
}

.fl-habit-week-scroll::-webkit-scrollbar-track {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(148, 163, 184, 0.1));
  border: 1px solid rgba(82, 100, 135, 0.22);
}

.fl-habit-week-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 67, 67, 0.94), rgba(248, 113, 113, 0.94));
  border: 2px solid rgba(7, 13, 27, 0.86);
  box-shadow: 0 6px 18px rgba(255, 67, 67, 0.22);
}

.fl-habit-week-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, rgba(255, 49, 49, 0.98), rgba(251, 113, 133, 0.98));
}

.fl-habit-week-columns,
.fl-habit-week-summary-row {
  display: grid;
  gap: 12px;
  min-width: max-content;
}

.fl-habit-week-column {
  display: grid;
  gap: 10px;
}

.fl-habit-week-column-head,
.fl-habit-week-track-cell,
.fl-habit-week-summary-card {
  border-radius: 18px;
  border: 1px solid rgba(82, 100, 135, 0.18);
  background: rgba(7, 13, 27, 0.8);
  padding: 12px;
}

.fl-habit-week-column.is-current .fl-habit-week-column-head,
.fl-habit-week-summary-card.is-current {
  border-color: rgba(248, 113, 113, 0.3);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.08);
}

.fl-habit-week-column-head {
  display: grid;
  gap: 12px;
  align-content: start;
}

.fl-habit-week-column-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.fl-habit-week-day-heads,
.fl-habit-week-day-grid {
  display: grid;
  gap: 6px;
}

.fl-habit-week-day-heads span {
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 4px 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.fl-habit-week-day-heads span.is-locked {
  opacity: 0.46;
}

.fl-habit-week-day-heads span.is-today {
  outline: 1px solid rgba(255, 255, 255, 0.42);
  outline-offset: 1px;
}

.fl-habit-week-track-cell {
  display: grid;
  align-content: center;
}

.fl-habit-day-toggle {
  inline-size: min(100%, 42px);
  aspect-ratio: 1 / 1;
  min-height: 34px;
  justify-self: center;
  align-self: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.012));
  color: rgba(255, 255, 255, 0.72);
  display: grid;
  place-items: center;
  padding: 0;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.fl-habit-day-toggle:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(248, 113, 113, 0.32);
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.16);
}

.fl-habit-day-toggle.is-done {
  border-color: rgba(255, 93, 93, 0.58);
  background: radial-gradient(circle at 50% 30%, rgba(255, 237, 237, 0.9), rgba(255, 102, 102, 0.98) 46%, rgba(226, 37, 61, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 10px 18px rgba(226, 37, 61, 0.22);
}

.fl-habit-day-toggle.is-today {
  outline: 1px solid rgba(255, 255, 255, 0.42);
  outline-offset: 1px;
}

.fl-habit-day-toggle.is-locked,
.fl-habit-day-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.015);
  box-shadow: none;
}

.fl-habit-day-toggle span {
  font-size: 0.95rem;
  line-height: 1;
}

.fl-habit-week-summary-row {
  align-items: stretch;
}

.fl-habit-week-summary-card {
  min-height: 148px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.fl-habit-week-summary-card.is-future {
  opacity: 0.74;
}

.fl-habit-week-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.fl-habit-week-summary-rate {
  font-size: 1.9rem;
  line-height: 1;
  text-align: center;
}

.fl-habit-week-summary-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.fl-habit-week-summary-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.95), rgba(248, 113, 113, 0.92));
}

@media (max-width: 1440px) {
  .fl-habit-command-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .fl-habit-quick-add-inline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fl-habit-quick-add-inline .fl-btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1080px) {
  .fl-habit-quick-add-inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fl-habit-day-toggle {
    inline-size: min(100%, 36px);
    min-height: 30px;
  }
}

@media (max-width: 1100px) {
  .fl-habit-week-board-main {
    grid-template-columns: 1fr;
  }

  .fl-habit-week-sidebar {
    position: sticky;
    left: 0;
  }

  .fl-habit-week-columns,
  .fl-habit-week-summary-row {
    min-width: 760px;
  }
}

@media (max-width: 760px) {
  .fl-habit-arena-tabs {
    grid-template-columns: 1fr;
  }

  .fl-habit-topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .fl-habit-quick-add-inline {
    grid-template-columns: 1fr;
  }

  .fl-habit-week-board {
    gap: 12px;
  }

  .fl-habit-week-board-main {
    grid-template-columns: minmax(156px, 172px) minmax(680px, 1fr);
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(248, 113, 113, 0.95) rgba(255, 255, 255, 0.08);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .fl-habit-week-board-main::-webkit-scrollbar {
    height: 12px;
  }

  .fl-habit-week-board-main::-webkit-scrollbar-track {
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(148, 163, 184, 0.1));
    border: 1px solid rgba(82, 100, 135, 0.22);
  }

  .fl-habit-week-board-main::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 67, 67, 0.94), rgba(248, 113, 113, 0.94));
    border: 2px solid rgba(7, 13, 27, 0.86);
    box-shadow: 0 6px 18px rgba(255, 67, 67, 0.22);
  }

  .fl-habit-week-board-main::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, rgba(255, 49, 49, 0.98), rgba(251, 113, 133, 0.98));
  }

  .fl-habit-week-sidebar {
    position: sticky;
    left: 0;
    z-index: 3;
    gap: 8px;
  }

  .fl-habit-week-sidebar-head,
  .fl-habit-week-side-card,
  .fl-habit-week-column-head,
  .fl-habit-week-track-cell {
    min-height: 74px;
  }

  .fl-habit-week-sidebar-head,
  .fl-habit-week-side-card {
    padding-inline: 12px;
  }

  .fl-habit-week-side-title strong {
    font-size: 0.98rem;
    line-height: 1.24;
  }

  .fl-habit-week-side-title span,
  .fl-habit-progress-inline-strong small {
    font-size: 0.8rem;
  }

  .fl-habit-week-scroll {
    overflow: visible;
    padding: 0;
    min-width: 680px;
  }

  .fl-habit-week-columns,
  .fl-habit-week-summary-row {
    min-width: 680px;
  }

  .fl-habit-week-day-grid {
    gap: 4px;
    justify-items: center;
    align-items: center;
  }

  .fl-habit-week-track-cell {
    padding: 10px 8px;
  }

  .fl-habit-day-toggle {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px;
    max-height: 24px;
    inline-size: 24px;
    aspect-ratio: auto;
    border-radius: 50%;
    justify-self: center;
    align-self: center;
  }

  .fl-habit-kpi-card-centered,
  .fl-habit-dashboard-tile-centered {
    min-height: 132px;
  }
}

@media (max-width: 560px) {
  .fl-habit-week-board-main {
    grid-template-columns: minmax(144px, 156px) minmax(620px, 1fr);
    gap: 8px;
  }

  .fl-habit-week-sidebar-head,
  .fl-habit-week-side-card {
    padding-inline: 10px;
  }

  .fl-habit-week-day-grid {
    gap: 3px;
  }

  .fl-habit-week-track-cell {
    padding: 8px 6px;
  }

  .fl-habit-week-scroll,
  .fl-habit-week-columns,
  .fl-habit-week-summary-row {
    min-width: 620px;
  }

  .fl-habit-day-toggle {
    width: 21px;
    height: 21px;
    min-width: 21px;
    min-height: 21px;
    max-width: 21px;
    max-height: 21px;
    inline-size: 21px;
  }

  .fl-habit-day-toggle span {
    font-size: 0.72rem;
  }
}