/* Canonical CSS owner: controls. Historical layers consolidated 2026-08-02. */
.lucide {
  width: 18px;

  height: 18px;

  flex: 0 0 auto;

  stroke-width: 1.75;
}

@media (max-width: 767px) {
  .header-command-group .command-button {
    width: 100%;

    min-height: 38px;

    justify-content: flex-start;

    padding: 0px 10px;

    border-color: transparent;

    background: transparent;
  }
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: rgba(8, 127, 174, 0.48) solid 2px;

  outline-offset: 2px;
}

.icon-button:active {
  transform: translateY(1px) scale(0.985);

  box-shadow: none;
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;

  opacity: 0.58;

  transform: none;

  box-shadow: none;
}

.button.danger-button {
  border-color: rgb(226, 170, 163);

  color: rgb(185, 54, 39);
}

.button.danger-button:hover {
  border-color: var(--coral);

  background: var(--coral-soft);

  color: rgb(167, 44, 30);
}

.date-input:focus,
.search-field input:focus {
  border-color: var(--blue);

  box-shadow: rgba(8, 127, 174, 0.13) 0px 0px 0px 2px;
}

.form-field {
  display: grid;

  gap: 7px;

  font-weight: 650;
}

.command-button .lucide {
  width: 16px;

  height: 16px;
}

.sidebar-collapse-button:hover {
  background: var(--control-hover);

  color: var(--text-primary);
}

.mobile-market-selector {
  display: none;
}

.button:focus-visible,
.icon-button:focus-visible,
.sidebar-collapse-button:focus-visible {
  outline-color: rgba(29, 101, 193, 0.48);
}

body.sidebar-collapsed .sidebar-collapse-button .lucide {
  transform: rotate(180deg);
}

@media (min-width: 768px) and (max-width: 1279px) {
  .command-button {
    width: 32px;

    padding: 0px;
  }

  .command-button > span {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .sidebar-collapse-button span {
    display: none;
  }

  .sidebar-collapse-button {
    justify-content: center;

    padding: 0px;

    display: none;
  }
}

@media (max-width: 767px) {
  .header-command-group .button.primary {
    border-color: var(--action);

    background: var(--action);
  }

  .mobile-market-selector > span {
    display: inline-flex;

    align-items: center;

    gap: 7px;

    color: var(--text-secondary);

    font-size: 12px;
  }

  .mobile-market-selector > span .lucide {
    width: 16px;

    height: 16px;

    color: var(--action);
  }

  .mobile-market-selector > span b {
    font-weight: 650;
  }

  .mobile-market-selector > .lucide {
    width: 16px;

    height: 16px;

    pointer-events: none;
  }
}

.stock-heaven-button {
  display: inline-flex;

  align-items: center;

  gap: 5px;
}

.stock-heaven-button .lucide {
  width: 15px;

  height: 15px;
}

@media (max-width: 767px) {
  .stock-heaven-button span {
    display: none;
  }

  .stock-heaven-button {
    width: 36px;

    padding: 0px;

    justify-content: center;
  }
}

.icon-button:hover {
  border-color: rgb(148, 181, 216);

  background: var(--surface-selected);

  color: var(--action-hover);

  box-shadow: none;
}

.button .lucide,
.icon-button .lucide {
  width: 16px;

  height: 16px;

  stroke-width: 1.8;
}

.command-button {
  display: inline-flex;

  align-items: center;

  justify-content: center;

  gap: 6px;

  padding: 0px 10px;

  min-height: 36px;
}

.form-field > span {
  color: rgb(51, 65, 80);

  font-size: 12.5px;

  font-weight: 670;
}

@media (min-width: 768px) and (max-width: 1279px) {
  .sidebar-collapse-button span {
    display: none;
  }

  .sidebar-collapse-button {
    justify-content: center;

    padding: 0px;
  }
}

@media (max-width: 767px) {
  .header-menu-button {
    width: 34px;

    min-height: 34px;

    border-color: var(--border);

    display: grid;
  }

  .mobile-market-selector select {
    width: 100%;

    height: 38px;

    padding: 0px 4px;

    border: 0px;

    outline: 0px;

    background: transparent;

    color: var(--text-primary);

    font-weight: 680;

    text-align: right;

    appearance: none;

    font-size: 13px;
  }

  .button,
  .icon-button {
    min-height: 42px;
  }

  .form-field input,
  .form-field select,
  .search-field input {
    min-height: 44px;

    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .icon-button {
    animation: auto ease 0s 1 normal none running none;

    transition: none;
  }
}

.text-button {
  padding: 2px;

  border: 0px;

  background: transparent;

  color: var(--blue);

  cursor: pointer;

  font-size: 12px;
}

@media (max-width: 860px) {
  .search-field {
    min-width: 180px;

    flex: 1 1 0%;
  }

  .search-field input {
    width: 100%;
  }
}

.search-field input {
  width: 220px;

  padding: 0px 10px;

  border: 1px solid var(--line-strong);

  border-radius: 4px;

  outline: none;

  height: 36px;

  background: var(--surface);

  color: var(--text-primary);

  font-size: 12.5px;
}

.checkbox-control {
  min-height: 34px;

  display: inline-flex;

  align-items: center;

  gap: 6px;

  white-space: nowrap;
}

#heartReveal #interpretHeartButton {
  opacity: 0;

  transition: opacity 1s;
}

#heartReveal #interpretHeartButton.is-ready {
  opacity: 1;
}

@media (max-width: 860px) {
  .date-input {
    min-width: 134px;

    flex: 1 1 0%;
  }
}

.date-input {
  width: 138px;

  height: 34px;

  padding: 0px 8px;

  background: var(--surface);

  color: var(--text);

  font-weight: 650;

  min-height: var(--control-height);

  border-color: var(--border-strong);

  border-radius: var(--radius-md);

  box-shadow: none;
}

.icon-button {
  background: var(--surface);

  cursor: pointer;

  transition: transform var(--motion-fast) var(--ease-out), border-color var(--motion-fast) ease, background-color var(--motion-fast) ease, color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;

  padding: 0px;

  display: grid;

  place-items: center;

  font-size: 22px;

  line-height: 1;

  width: 36px;

  color: rgb(68, 83, 99);

  min-height: var(--control-height);

  border-color: var(--border-strong);

  border-radius: var(--radius-md);

  box-shadow: none;
}

.button {
  cursor: pointer;

  white-space: nowrap;

  display: inline-flex;

  align-items: center;

  justify-content: center;

  gap: 6px;

  min-height: var(--control-height);

  border-color: var(--control-border);

  border-radius: var(--radius-md);

  box-shadow: none;

  padding: 0px 12px;

  background: var(--control-surface);

  color: var(--text-primary);

  font-size: var(--font-size-label);

  font-weight: var(--font-weight-semibold);

  transition: border-color var(--duration-fast), color var(--duration-fast), background var(--duration-fast), transform var(--duration-fast);
}

.button:hover {
  box-shadow: none;

  border-color: var(--color-action-line);

  color: var(--primary);

  background: var(--control-hover);
}

.button:active {
  box-shadow: none;

  transform: scale(.98);
}

.button.primary {
  border-color: var(--primary);

  background: var(--primary);

  color: var(--on-action);
}

.button.primary:hover {
  border-color: var(--primary-hover);

  background: var(--primary-hover);

  color: var(--on-action);
}

.form-field input {
  width: 100%;

  min-width: 0px;

  height: 40px;

  padding: 0px 10px;

  outline: none;

  border-color: var(--border-strong);

  border-radius: var(--radius-md);

  background: var(--control-surface);

  box-shadow: none;
}

.form-field select,
.search-field {
  border-color: var(--border-strong);

  border-radius: var(--radius-md);

  background: var(--control-surface);

  box-shadow: none;
}

.form-field textarea {
  width: 100%;

  min-height: 104px;

  resize: vertical;

  padding: 9px 10px;

  color: var(--text);

  font-style: inherit;

  font-variant: inherit;

  font-weight: inherit;

  font-stretch: inherit;

  font-size: inherit;

  font-family: inherit;

  font-optical-sizing: inherit;

  font-size-adjust: inherit;

  font-kerning: inherit;

  font-feature-settings: inherit;

  font-variation-settings: inherit;

  font-language-override: inherit;

  line-height: 1.6;

  outline: none;

  border-color: var(--border-strong);

  border-radius: var(--radius-md);

  background: var(--control-surface);

  box-shadow: none;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.search-field:focus-within {
  border-color: var(--action);

  box-shadow: 0 0 0 3px var(--focus-ring);
}

@media (max-width: 767px) {
  .module-nav .sidebar-collapse-button {
    display: none;
  }

  .mobile-market-selector:not([hidden]) {
    position: relative;

    display: grid;

    grid-template-columns: auto minmax(0px, 1fr) 18px;

    align-items: center;

    gap: 8px;

    padding: 0px 11px;

    background: var(--surface);

    height: 44px;

    border-color: var(--border);

    border-radius: 7px;

    box-shadow: var(--shadow-soft);

    margin-bottom: 8px;
  }
}

.date-input::-webkit-calendar-picker-indicator {
  opacity: 0.48;
}

.header-command-group .command-button .lucide {
  width: 14px;

  height: 14px;
}

@media (min-width: 1280px) {
  .header-command-group .command-button:not(.account-button) {
    width: 32px;

    min-width: 32px;

    padding: 0px;
  }

  .header-command-group .command-button:not(.account-button) > span {
    display: none;
  }
}

.toolbar-controls .search-field {
  height: 34px;
}

.sidebar-collapse-button {
  width: 100%;

  cursor: pointer;

  text-align: left;

  height: var(--size-statusbar);

  min-height: var(--size-statusbar);

  display: flex;

  align-items: center;

  gap: 8px;

  margin: auto -8px -8px;

  padding: 0 16px;

  border-right: 0px;

  border-bottom: 0px;

  border-left: 0px;

  border-image: none;

  border-top: 1px solid var(--r2-line-soft);

  border-radius: 0px;

  background: var(--surface);

  color: var(--r2-sub);

  font-size: 12px;
}

.sidebar-collapse-button .lucide {
  width: 14px;

  height: 14px;
}

body.sidebar-collapsed .sidebar-collapse-button span {
  display: none;
}

body.sidebar-collapsed .sidebar-collapse-button {
  padding: 0px;

  justify-content: center;

  padding-inline: 0px;
}

.header-menu-button {
  width: 30px;

  min-height: 30px;

  height: 30px;

  padding: 0px;

  border: 1px solid var(--r2-line);

  border-radius: 7px;

  background: var(--surface);

  color: rgb(75, 85, 99);

  box-shadow: none;
}

.header-command-group .command-button {
  min-height: 30px;

  height: 30px;

  padding: 0px 10px;

  border: 1px solid var(--r2-line);

  border-radius: 7px;

  background: var(--surface);

  color: rgb(55, 65, 81);

  font-size: 12px;

  font-weight: 500;

  box-shadow: none;
}

.header-command-group .command-button.primary {
  border-color: var(--r2-blue);

  background: var(--r2-blue);

  color: var(--text-inverse);
}

@media (max-width: 1023px) and (min-width: 768px) {
  .sidebar-collapse-button span {
    display: none;
  }

  .sidebar-collapse-button {
    justify-content: center;

    padding-inline: 0px;
  }
}

button {
  font: inherit;

  letter-spacing: 0px;

  cursor: pointer;

  border-width: medium;

  border-style: none;

  border-color: currentcolor;

  border-image: none;

  background: none;

  color: inherit;
}

input,
select,
textarea {
  border-radius: 6px;

  font-style: inherit;

  font-variant: inherit;

  font-weight: inherit;

  font-stretch: inherit;

  line-height: inherit;

  font-optical-sizing: inherit;

  font-size-adjust: inherit;

  font-kerning: inherit;

  font-feature-settings: inherit;

  font-variation-settings: inherit;

  font-language-override: inherit;

  letter-spacing: 0px;

  font-family: inherit;

  font-size: 13px;

  color: var(--ink);
}

.seg button {
  padding: 4px 12px;

  border-radius: 6px;

  font-size: 12px;

  color: var(--sub);
}

.seg button.on {
  background: var(--surface);

  color: var(--ink);

  font-weight: 600;

  box-shadow: rgba(0, 0, 0, 0.08) 0px 1px 2px;
}

.seg button .n {
  font-size: 11px;

  color: var(--faint);

  margin-left: 2px;
}

.seg button.on .n {
  color: var(--blue);
}

.search input {
  border-width: medium;

  border-style: none;

  border-color: currentcolor;

  border-image: none;

  outline: none;

  width: 150px;

  font-size: 12.5px;
}

.field input[type="text"],
.field select {
  width: 100%;

  border: 1px solid var(--line);

  border-radius: 7px;

  padding: 8px 10px;

  outline: none;
}

.field textarea {
  width: 100%;

  border: 1px solid var(--line);

  border-radius: 7px;

  padding: 8px 10px;

  outline: none;

  min-height: 90px;

  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--blue-line);
}

.method button {
  padding: 6px 18px;

  border-radius: 7px;

  font-size: 13px;

  color: var(--sub);

  font-weight: 600;

  display: flex;

  align-items: center;

  gap: 6px;
}

.method button.on {
  background: var(--blue);

  color: var(--text-inverse);
}

.factor input[type="range"] {
  flex: 1 1 0%;

  accent-color: var(--blue);
}

.cond input[type="text"],
.cond select {
  border: 1px solid var(--line);

  border-radius: 6px;

  padding: 4px 8px;

  width: 76px;

  font-size: 12px;
}

@media (max-width: 767px), (max-width: 1023px) and (max-height: 600px) {
  .sidebar-collapse-button {
    display: none;
  }
}

:root[data-theme="dark"] :is(.module-tab, .sidebar-collapse-button, .nav-group-label) {
  color: var(--text-secondary);
}

:root[data-theme="dark"] :is(.icon-button, .button, .btn, .date-input, .search, .sidebar-collapse-button, input, textarea, select) {
  border-color: var(--border);

  background-color: var(--surface);

  color: var(--text-primary);
}

:root[data-theme="dark"] .header-date-group .date-input {
  background-color: transparent;
}

:root[data-theme="dark"] :is(input, textarea, select)::placeholder {
  color: var(--text-tertiary);
}

:root[data-theme="dark"] :is(.icon-button, .button, .btn):hover:not(:disabled) {
  border-color: var(--blue-line);

  background-color: var(--surface-muted);

  color: var(--action);
}

:root[data-theme="dark"] :is(.button.primary, .btn.primary) {
  border-color: var(--action);

  background: var(--action);

  color: var(--on-action);
}

:root[data-theme="dark"] :is(.button.primary, .btn.primary):hover:not(:disabled) {
  border-color: var(--action-hover);

  background: var(--action-hover);

  color: var(--on-action);
}

:root[data-theme="dark"] :is(.seg, .segmented, .filter-segment) {
  border-color: var(--border);

  background: var(--surface-muted);
}

:root[data-theme="dark"] :is(.seg button.on, .seg button.active, .segment.active, .filter-segment button.active) {
  background: var(--surface-subtle);

  color: var(--text-primary);

  box-shadow: var(--control-shadow);
}

@media (min-width: 768px) {
  .header-menu-button {
    display: none;
  }
}

/* Mobile control contract. */
@media (max-width: 767px) {
  body.mobile-shell .header-menu-button,
  body.mobile-shell .header-actions > .header-menu-button {
    width: var(--mobile-touch-size);
    min-width: var(--mobile-touch-size);
    height: var(--mobile-touch-size);
    min-height: var(--mobile-touch-size);
    display: grid;
    place-items: center;
  }

  body.mobile-shell .header-command-group .command-button {
    width: 100%;
    height: auto;
    min-height: var(--mobile-touch-size);
    justify-content: flex-start;
    padding: 0 var(--space-12);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--control-surface);
    color: var(--text-primary);
  }

  body.mobile-shell .header-command-group .command-button > span {
    display: inline;
  }

  body.mobile-shell .mobile-command-shortcut {
    width: 100%;
    height: auto;
    min-height: var(--mobile-touch-size);
  }

  body.mobile-shell .mobile-market-selector:not([hidden]) {
    position: relative;
    width: 100%;
    height: var(--mobile-touch-size);
    min-height: var(--mobile-touch-size);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) var(--mobile-nav-icon-size);
    align-items: center;
    gap: var(--space-8);
    margin: var(--mobile-page-pad) 0 0;
    padding: 0 var(--space-12);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: none;
  }

  body.mobile-shell .mobile-market-selector select {
    width: 100%;
    height: calc(var(--mobile-touch-size) - 2px);
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-semibold);
    text-align: right;
    appearance: none;
  }

  body.mobile-shell :is(.button, .icon-button, button) {
    touch-action: manipulation;
  }
}

:root[data-theme="dark"] .mobile-command-shortcut {
  border-color: var(--border);
  background: var(--surface-subtle);
  color: var(--text-secondary);
}
