/* CC TRADEX Live — responsive interaction polish. The analysis canvas and engine remain untouched. */
:root {
  --ui-ease: cubic-bezier(.2, .8, .2, 1);
  --ui-surface: color-mix(in srgb, var(--panel) 88%, transparent);
  --ui-ring: color-mix(in srgb, var(--ac) 52%, transparent);
  --ui-shadow: 0 8px 24px rgba(0, 0, 0, .16);
}

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: 0;
  overscroll-behavior: none;
}

body {
  gap: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% -18%, color-mix(in srgb, var(--ac) 11%, transparent), transparent 55%),
    var(--bg);
  -webkit-tap-highlight-color: transparent;
}

.bar {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
  gap: 7px;
  margin: 6px 8px 4px;
  padding: 7px 10px;
  border: 1px solid var(--glass-stroke);
  border-radius: 15px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow), inset 0 1px var(--glass-specular);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  scrollbar-width: none;
}

.bar::-webkit-scrollbar,
.decision__checks::-webkit-scrollbar,
.techPanel::-webkit-scrollbar {
  display: none;
}

.bar:before,
.bar:after,
.bar button:before,
.bar button:after,
.bar select:before,
.bar select:after {
  content: none;
  display: none;
}

button,
select {
  min-height: 34px;
  border: 1px solid var(--glass-stroke);
  border-radius: 11px;
  padding: 7px 10px;
  color: var(--fg);
  font: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.015)), var(--button);
  box-shadow: inset 0 1px rgba(255,255,255,.08);
  transition:
    transform .18s var(--ui-ease),
    border-color .18s ease,
    background-color .18s ease,
    box-shadow .18s ease,
    color .18s ease;
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

#cm,
#cp {
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

@media (pointer: coarse) {
  #cm,
  #cp {
    flex-basis: 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
}

button:hover,
select:hover {
  border-color: color-mix(in srgb, var(--ac) 45%, var(--glass-stroke));
  box-shadow: 0 4px 12px rgba(0,0,0,.14), inset 0 1px rgba(255,255,255,.1);
}

button:active {
  transform: scale(.96);
  transition-duration: .08s;
}

button.on,
.bar button.on {
  color: #04111d;
  background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.04)), var(--ac);
  border-color: color-mix(in srgb, var(--ac) 82%, white);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--ac) 22%, transparent), inset 0 1px rgba(255,255,255,.28);
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--ui-ring);
  outline-offset: 2px;
}

select {
  max-width: min(240px, 58vw);
  border-radius: 12px;
}

input[type="range"] {
  accent-color: var(--ac);
  cursor: pointer;
  touch-action: pan-x;
}

.toolGroup {
  gap: 6px;
}

#st {
  flex: 0 0 auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.focus {
  min-height: 38px;
  gap: 8px;
  padding: 8px 12px;
  overflow: hidden;
}

.focus > span {
  min-width: 0;
}

.focus > span:last-child {
  margin-left: auto;
  text-align: right;
}

.decision {
  padding: 9px 12px;
}

.decision__top {
  gap: 8px 10px;
}

.decision__state {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--ac) 28%, var(--ln));
  border-radius: 999px;
  background: color-mix(in srgb, var(--ac) 9%, var(--panel));
  font-size: 10px;
}

.decision__main {
  min-width: 0;
}

.decision__checks {
  gap: 7px;
  margin-top: 6px;
  padding-bottom: 2px;
}

.decision__checks span {
  padding: 3px 7px;
  border: 1px solid var(--ln);
  border-radius: 999px;
  background: color-mix(in srgb, var(--button) 72%, transparent);
}









.techPanel {
  flex: 0 0 auto;
  gap: 7px;
  min-height: 48px;
  margin: 0 8px 5px;
  padding: 5px 2px;
  border: 0;
  background: transparent;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.techMetric {
  min-width: 80px;
  padding: 5px 9px;
  border-color: var(--ln);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  scroll-snap-align: start;
}

#cv {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  min-height: 120px;
  height: 0;
  contain: layout paint;
}

.splash__card {
  animation: splash-arrive .48s var(--ui-ease) both;
}

@keyframes splash-arrive {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 767px) {
  html,
  body {
    font-size: 12px;
  }

  .bar {
    gap: 5px;
    margin: 5px 6px 3px;
    padding: 6px 7px;
    border-radius: 13px;
  }

  #b1 {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  #b1 button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 9px;
  }

  #b1 select {
    flex: 0 0 auto;
    max-width: 50vw;
    min-height: 34px;
  }

  .bar:not(#b1) {
    flex-wrap: wrap;
    gap: 5px 6px;
    overflow: visible;
  }

  .bar:not(#b1) input[type="range"] {
    width: clamp(48px, 16vw, 70px);
  }

  .bar:not(#b1) button {
    min-height: 32px;
    padding: 5px 8px;
  }

  .toolGroup {
    gap: 4px;
  }

  #st {
    margin-left: auto;
    font-size: 11px;
  }

  .focus,
  .decision {
    margin-right: 6px;
    margin-left: 6px;
  }

  .focus {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    min-height: 35px;
    gap: 4px 8px;
    padding: 7px 9px;
    overflow: visible;
    white-space: normal;
  }

  .focus > b { grid-column: 1; grid-row: 1; }

  .focus > strong {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-overflow: ellipsis;
    white-space: normal;
  }

  .focus > span:first-of-type {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-overflow: ellipsis;
    white-space: normal;
  }

  .focus > span:last-child {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    max-width: none;
    margin-left: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    white-space: nowrap;
  }

  .decision {
    padding: 7px 9px;
  }

  .decision__top {
    flex-wrap: nowrap;
    gap: 6px;
    overflow: hidden;
    white-space: nowrap;
  }

  .decision__main,
  .decision__meta {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .decision__meta {
    flex: 0 0 auto;
    max-width: 44%;
    margin-left: auto;
  }

  .decision__checks {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .decision__checks {
    min-height: 25px;
  }

  .decision__checks span {
    flex: 0 0 auto;
  }

  .techPanel {
    gap: 5px;
    min-height: 44px;
    margin: 0 6px 4px;
  }

  .techMetric {
    min-width: 72px;
    padding: 4px 7px;
  }

  #cv {
    min-height: 140px;
  }
}

@media (max-width: 380px) {
  .bar:not(#b1) {
    column-gap: 4px;
  }

  .bar:not(#b1) > span:first-child {
    font-size: 11px;
  }

  .bar:not(#b1) button {
    padding-right: 7px;
    padding-left: 7px;
  }

  .focus > span:last-child {
    max-width: none;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  .bar {
    margin-top: 3px;
    margin-bottom: 2px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .focus,
  .decision {
    margin-bottom: 2px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .decision__checks {
    display: none;
  }

  .techPanel {
    min-height: 38px;
    margin-bottom: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .bar,
  button,
  select {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
