/* 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-stat-label-value-gap: 0.4rem;
  --htb-stat-value-font-size: 1.5rem;
  --htb-stat-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;
}

/* 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;
}

#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 {
  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,
#prValue,
#bestDayValue,
#bestMonthValue {
  font-size: var(--htb-stat-value-font-size);
  line-height: 1;
  margin-top: var(--htb-stat-label-value-gap);
}

#goalsTodayTarget,
#goalsWeekTarget,
#goalsMonthTarget,
#prDate,
#bestDayDate,
#bestMonthLabel {
  margin-top: var(--htb-stat-value-sublabel-gap);
}

#statsContainer > div,
#goalsBox > div > div {
  white-space: nowrap;
}

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

/* CHART 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;
  transition: color 120ms ease, background-color 120ms ease;
}

.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-dots {
  display: inline-flex;
  flex-shrink: 0;
  gap: 0.25rem;
}

.activity-goal-dot {
  width: 0.5rem;
  height: 0.5rem;
  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 {
  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 {
    box-sizing: border-box;
    width: 100%;
    min-width: 100%;
    flex-basis: 100%;
    margin-left: 0;
    padding-left: var(--activity-settings-wrap-right-pl);
    justify-content: flex-end;
  }
}

/* HISTORY */
#historyTable {
  --htb-history-edge-x-padding: 1.25rem;

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

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

td.zero-value {
  opacity: 0.5;
}

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

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

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

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

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

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

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

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

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

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

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