/* ---------------------------------------- */
/* GLOBAL */
/* ---------------------------------------- */
html, body {
  scrollbar-width: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

* {
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}

input, textarea {
  -webkit-user-select: text;
     -moz-user-select: text;
      -ms-user-select: text;
          user-select: text;
}

/* ---------------------------------------- */
/* SHARED SETTINGS */
/* ---------------------------------------- */

:root {
  /* Site min and max widths: */
  --htb-site-min-width: 360px;
  --htb-site-max-width: 950px;
  
  --htb-activity-title-font-size: 1.5rem;
  --htb-activity-to-log-row-gap: 0.6rem;
  --htb-log-controls-gap: 0.5rem;

  --htb-card-value-label-gap: 0.4rem;
  --htb-card-value-font-size: 1.5rem;
  --htb-card-value-sublabel-gap: 0.3em;
}

html {
  min-width: var(--htb-site-min-width);
}

.htb-page-shell {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--htb-site-max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 0.75rem;
}

/* Sticky app header (off by default). Add htb-page-shell--sticky-header on the shell div to enable. */
.htb-page-shell--sticky-header {
  padding: 0 0.75rem 0.75rem;
}

.htb-page-shell--sticky-header #appShellHeader {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: rgb(2 6 23);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.htb-page-shell--sticky-header #appShellHeader > div:first-child {
  margin-bottom: 0;
}

/* ---------------------------------------- */
/* ENTRY LOGO */
/* ---------------------------------------- */
.htb-entry-box-link {
  display: inline-flex;
}

.htb-entry-box-fill {
  animation: htbEntryBoxFill 1000ms ease-out 0ms forwards;
}

.htb-entry-box-hit {
  animation: htbEntryBoxHit 100ms linear 1000ms forwards;
}

@keyframes htbEntryBoxFill {
  to {
    height: 100%;
  }
}

@keyframes htbEntryBoxHit {
  to {
    opacity: 1;
  }
}

/* ---------------------------------------- */
/* LOG CARD — native inputs */
/* ---------------------------------------- */
#logEntryCard input.log-strip-control--date,
#logEntryCard input.log-strip-control--value {
  appearance: none;
  -webkit-appearance: none;
}

#logEntryCard input.log-strip-control--value {
  font-variant-numeric: tabular-nums;
}

#valueInputClockPicker {
  color-scheme: dark;
}

#date {
  position: relative;
  color-scheme: dark;
}

#date::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

#date::-webkit-datetime-edit,
#date::-webkit-datetime-edit-fields-wrapper {
  text-align: center;
}

#date::-webkit-datetime-edit-fields-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

/* ---------------------------------------- */
/* ACTIVITY TITLE + STAT NUMBERS */
/* ---------------------------------------- */
#activityHeadline {
  font-size: var(--htb-activity-title-font-size);
}

#activitySettingsHeadline,
#infoPageHeadline {
  font-size: var(--htb-activity-title-font-size);
}

.activity-menu-chevron {
  transition: transform 150ms ease;
}

#activityMenuBtn[aria-expanded="true"] .activity-menu-chevron {
  transform: rotate(180deg);
}

#goalsTodayValue,
#goalsWeekValue,
#goalsMonthValue,
#recordsBestSetValue,
#recordsBestDayValue,
#recordsBestMonthValue {
  font-size: var(--htb-card-value-font-size);
  line-height: 1;
  margin-top: var(--htb-card-value-label-gap);
}

#goalsTodayTarget,
#goalsWeekTarget,
#goalsMonthTarget,
#recordsBestSetDate,
#recordsBestDayDate,
#recordsBestMonthDate {
  margin-top: var(--htb-card-value-sublabel-gap);
}

#recordsCardColumns > div,
#goalsCard > div > div {
  white-space: nowrap;
}

#recordsCardColumns > div > :first-child {
  display: block;
  position: relative;
  left: 50%;
  width: max-content;
  transform: translateX(-50%);
}

/* ---------------------------------------- */
/* CHARTS CARD — control strips */
/* ---------------------------------------- */
.control-strip-wrap {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.control-strip-wrap::-webkit-scrollbar {
  display: none;
}

.control-strip {
  display: inline-flex;
  min-width: 100%;
  gap: 0.1rem;
  white-space: nowrap;
}

.control-strip-btn {
  border-radius: 0.5rem;
  padding: 0.3rem 0.6rem;
}

.control-strip-divider {
  padding: 0 0.1rem;
  align-self: center;
  pointer-events: none;
}

/* ---------------------------------------- */
/* ACTIVITY PICKER */
/* ---------------------------------------- */
#activityPickerPanel {
  position: fixed;
  z-index: 1;
  width: min(12rem, 92vw);
}

#activityPickerScroll {
  scrollbar-gutter: stable;
}

.activity-picker-section .activity-picker-section-body {
  display: none;
}

.activity-picker-section.is-open .activity-picker-section-body {
  display: flex;
}

.activity-goal-boxes {
  display: inline-flex;
  flex-shrink: 0;
  gap: 0.25rem;
}

.activity-goal-category-boxes {
  --goal-box-size: 0.63rem;
  margin-left: auto;
}

.activity-goal-activity-boxes {
  --goal-box-size: 0.5rem;
}

.activity-goal-sub-boxes {
  --goal-box-size: 0.41rem;
}

.activity-goal-box {
  width: var(--goal-box-size);
  aspect-ratio: 1;
  border-radius: 0.125rem;
}

.activity-picker-chevron {
  transition: transform 120ms ease;
}

.activity-picker-section.is-open .activity-picker-chevron {
  transform: rotate(180deg);
}

/* ---------------------------------------- */
/* ACTIVITY SETTINGS */
/* ---------------------------------------- */
.activity-settings-section .activity-settings-section-body {
  display: none;
}

.activity-settings-section.is-open .activity-settings-section-body {
  display: flex;
}

.activity-settings-chevron {
  transition: transform 120ms ease;
}

.activity-settings-section.is-open .activity-settings-chevron {
  transform: rotate(180deg);
}

.activity-settings-row input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

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

.activity-settings-left,
.activity-settings-right,
.activity-settings-opts {
  white-space: nowrap;
}

.activity-settings-right {
  margin-left: auto;
}

/* After wrap (breakpoint): right strip is full row width; its own left inset, not tied to left block width. */
.activity-settings-row {
  --activity-settings-wrap-right-pl: 1.5rem;
}

@media (max-width: 520px) {
  .activity-settings-right,
  .activity-settings-opts {
    box-sizing: border-box;
    width: 100%;
    min-width: 100%;
    flex-basis: 100%;
    margin-left: 0;
  }

  .activity-settings-right {
    padding-left: var(--activity-settings-wrap-right-pl);
    justify-content: flex-end;
  }
}

/* ---------------------------------------- */
/* HISTORY CARD */
/* ---------------------------------------- */
#historyCardTable {
  --htb-history-card-edge-x-padding: 1.25rem;

  --htb-history-card-header-y-padding: 0.5rem;
  
  --htb-history-card-header-x-padding: 0.35rem;
  --htb-history-card-value-x-padding: 0.35rem;

  --htb-history-card-row-y-padding: 0.0rem;
  
}

td.zero-value {
  opacity: 0.5;
}

#historyCardTable th,
#historyCardTable td {
  white-space: nowrap;
}

#historyCardTable .history-card-date-header,
#historyCardTable .history-card-date-cell {
  text-align: left;
}

#historyCardTable .history-card-value-header,
#historyCardTable .history-card-value-cell,
#historyCardTable .history-card-action-header,
#historyCardTable .history-card-action-cell {
  text-align: center;
}

#historyCardTable .history-card-date-header,
#historyCardTable .history-card-value-header {
  padding-top: var(--htb-history-card-header-y-padding);
  padding-bottom: var(--htb-history-card-header-y-padding);
}

#historyCardTable .history-card-date-header,
#historyCardTable .history-card-value-header {
  padding-left: var(--htb-history-card-header-x-padding);
  padding-right: var(--htb-history-card-header-x-padding);
}

#historyCardTable .history-card-date-header {
  padding-left: var(--htb-history-card-edge-x-padding);
}

#historyCardTable .history-card-action-header {
  padding-top: var(--htb-history-card-header-y-padding);
  padding-bottom: var(--htb-history-card-header-y-padding);
}

#historyCardTable .history-card-date-cell,
#historyCardTable .history-card-value-cell,
#historyCardTable .history-card-action-cell {
  padding-top: var(--htb-history-card-row-y-padding);
  padding-bottom: var(--htb-history-card-row-y-padding);
}

#historyCardTable .history-card-date-cell,
#historyCardTable .history-card-value-cell {
  padding-inline: var(--htb-history-card-value-x-padding);
}

#historyCardTable .history-card-date-cell {
  padding-left: var(--htb-history-card-edge-x-padding);
}

#historyCardTable th:last-child,
#historyCardTable td:last-child {
  padding-right: var(--htb-history-card-edge-x-padding);
}
