/* Tactile controls and short, deliberate transitions over the dark interface. */
:root {
  --ease-ui: cubic-bezier(.2, .75, .25, 1);
  --control-border: rgba(130, 179, 205, .2);
  --control-glow: rgba(83, 234, 210, .13);
}

button, a, select, summary {
  -webkit-tap-highlight-color: transparent;
}
button, a.light-button, .source-links a, select, summary {
  transition: color 180ms ease, background-color 180ms ease,
    border-color 180ms ease, box-shadow 220ms ease,
    transform 180ms var(--ease-ui);
}
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid #7cebd9;
  outline-offset: 4px;
  box-shadow: 0 0 0 5px #53ead20b;
}
button:disabled, button[aria-disabled=true] {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* A single bright action is balanced by quieter glass controls. */
.auth-submit, .primary-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(153, 255, 234, .68);
  border-radius: 12px;
  background: linear-gradient(115deg, #71f1d6 0%, #4edcd1 48%, #45c8df 100%);
  color: #03252a;
  font-weight: 700;
  letter-spacing: .1px;
  box-shadow: inset 0 1px 0 #e2fff76b, 0 5px 18px #18a99f1c;
}
.auth-submit { min-height: 50px; }
.primary-button { min-height: 40px; padding: 10px 17px; }
.auth-submit::after, .primary-button::after {
  content: "";
  position: absolute;
  inset: -45% auto -45% -65%;
  width: 40%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, #ffffff65, transparent);
  transform: skewX(-20deg) translateX(0);
  opacity: 0;
  transition: transform 550ms var(--ease-ui), opacity 250ms ease;
}

.light-button, .refresh-button, .session-card button,
.icon-button, .favorite-button, .table-arrow {
  border: 1px solid var(--control-border);
  border-radius: 10px;
  background: linear-gradient(150deg, #18324380, #0c1a28b3);
  color: #bcd7e3;
  box-shadow: inset 0 1px 0 #dcf7ff06, 0 3px 10px #00000012;
}
.light-button { min-height: 38px; padding: 9px 15px; font-weight: 550; }
.refresh-button { min-height: 34px; padding: 7px 11px; font-weight: 550; }
.icon-button, .table-arrow, .favorite-button {
  width: 32px;
  height: 32px;
  flex: none;
}
.icon-button svg, .table-arrow svg, .favorite-button svg { width: 15px; height: 15px; }
.favorite-button { border-color: transparent; background: #779db508; box-shadow: none; }
.favorite-button.is-favorite { color: #f0cd88; border-color: #d9b56b36; background: #e9bd790c; }
.favorite-button.is-favorite svg { fill: #f0cd8828; }
.session-card {
  margin-top: auto;
  padding: 18px 4px 3px;
  border-top: 1px solid #86aebe1c;
}
.session-card button { min-height: 34px; padding: 8px 12px; font-weight: 550; }
.session-card small { font-size: 10px; }
.session-card strong { margin-top: 5px; }

.nav-item {
  position: relative;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 11px;
}
.nav-item.active {
  border-color: #5ce2c82e;
  background: linear-gradient(105deg, #53ead21a, #3f9db711);
  box-shadow: inset 2px 0 #68f0d5, 0 3px 18px #0000000d;
}
.nav-item svg { transition: color 180ms ease, transform 220ms var(--ease-ui); }

.basis-buttons, .comparison-switch, .segmented {
  padding: 5px;
  gap: 5px;
  border: 1px solid #779db51a;
  border-radius: 12px;
  background: #06101bc7;
  box-shadow: inset 0 2px 8px #00000018;
}
.basis-buttons button, .comparison-switch button, .segmented button {
  position: relative;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 550;
}
.basis-buttons button { padding: 8px 13px; }
.comparison-switch button { padding: 8px 12px; }
.segmented { padding: 3px; gap: 3px; border-radius: 9px; }
.segmented button { min-height: 29px; padding: 5px 8px; border-radius: 6px; }
.basis-buttons button.active, .comparison-switch button.active, .segmented button.active {
  color: #b1ffec;
  border-color: #62e4ce33;
  background: linear-gradient(130deg, #3c998136, #245c6b2b);
  box-shadow: inset 0 1px 0 #b2fff111, 0 3px 9px #0000001f;
}
.filter-chip, .scale-presets button {
  border: 1px solid #7fa9c120;
  border-radius: 9px;
  background: #11233066;
  min-height: 33px;
  color: #a1bbce;
  font-weight: 550;
}
.filter-chip { padding: 7px 12px; }
.filter-chip.active, .scale-presets button.active {
  color: #b5f9e6;
  border-color: #53ead244;
  background: linear-gradient(120deg, #53ead21a, #41d6f00e);
  box-shadow: inset 0 1px 0 #b0ffe90b;
}
.basis-comparison-card {
  border-radius: 12px;
  box-shadow: inset 0 1px 0 #c8f4ff05;
}
.basis-comparison-card.active {
  background: linear-gradient(140deg, #244f425c, #13374955);
  border-color: #69e5cf55;
  box-shadow: inset 0 1px 0 #b2ffed0b, 0 5px 20px #0000001a;
}
.panel-link {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
}
.panel-link svg { transition: transform 200ms var(--ease-ui); }
.chart-legend button {
  min-height: 30px;
  padding: 5px 7px;
  border-radius: 7px;
}
.resource-row {
  border-radius: 11px;
  box-shadow: inset 0 1px 0 #ccfaff04;
}
.resource-row svg { transition: transform 200ms var(--ease-ui); }
.source-links a { border-radius: 8px; padding: 8px 11px; }

/* All hover displacement is restricted to devices with a precise pointer. */
@media (hover:hover) and (pointer:fine) {
  .auth-submit:not(:disabled):hover, .primary-button:not(:disabled):hover {
    background: linear-gradient(115deg, #91f9e0, #62e9d8 48%, #66dced);
    border-color: #b4fff0;
    box-shadow: inset 0 1px 0 #e2fff780, 0 8px 28px #2ce1c62c;
    transform: translateY(-1px);
  }
  .auth-submit:not(:disabled):hover::after, .primary-button:not(:disabled):hover::after {
    opacity: .7;
    transform: skewX(-20deg) translateX(480%);
  }
  .light-button:hover, .refresh-button:not(:disabled):hover,
  .session-card button:not(:disabled):hover, .icon-button:not(:disabled):hover,
  .table-arrow:not(:disabled):hover {
    color: #e2fff8;
    background: linear-gradient(150deg, #224958a3, #112b37e0);
    border-color: #70e5d362;
    box-shadow: inset 0 1px 0 #dcfff20b, 0 5px 18px #00000025, 0 0 18px #53ead209;
    transform: translateY(-1px);
  }
  .favorite-button:hover { color: #f4d797; border-color: #e9bd7938; background: #e9bd7910; transform: translateY(-1px); }
  .nav-item:hover { color: #e5f9fb; background: #7cc8d70b; border-color: #6ca1ba21; }
  .nav-item:hover svg { transform: translateX(1px); color: #83ead8; }
  .nav-item.active:hover { border-color: #68e8d14a; background: linear-gradient(105deg, #53ead222, #3f9db716); }
  .basis-buttons button:hover, .comparison-switch button:hover, .segmented button:hover {
    color: #c9fff3;
    background-color: #77e4cf0a;
    border-color: #8cd8cb18;
  }
  .filter-chip:hover, .scale-presets button:hover {
    color: #d9faf0;
    border-color: #6dd9c845;
    background: #17343ca3;
    transform: translateY(-1px);
  }
  .basis-comparison-card:hover { border-color: #6adfc65c; transform: translateY(-2px); }
  .panel-link:hover { color: #befff0; background: #53ead20b; border-color: #53ead220; }
  .panel-link:hover svg, .resource-row:hover svg { transform: translateX(2px); }
  .chart-legend button:hover { background: #81bec711; }
  .resource-row:hover { background: #16364282; border-color: #63d5c740; }
  .source-links a:hover { border-color: #68d4c74d; background: #53ead211; }
}
button:not(:disabled):active, a.light-button:active, .source-links a:active {
  transform: translateY(0) scale(.985);
  transition-duration: 80ms;
}
.icon-button:not(:disabled):active, .favorite-button:not(:disabled):active, .table-arrow:not(:disabled):active { transform: scale(.93); }

/* Native selection remains available; supporting browsers gain a proper animated picker. */
.toolbar select, .chart-selector select, .native-select {
  min-height: 38px;
  border: 1px solid var(--control-border);
  border-radius: 10px;
  padding: 8px 12px;
  color: #c4dce8;
  background-color: #0a1927;
  box-shadow: inset 0 1px 0 #d2f5ff04;
  cursor: pointer;
}
.chart-selector select { min-width: 130px; max-width: 220px; }
.toolbar select:focus-visible, .chart-selector select:focus-visible, .native-select:focus-visible {
  border-color: #6addcd;
  outline: none;
  box-shadow: 0 0 0 3px #53ead216;
}
@supports (appearance:base-select) {
  select, select::picker(select) { appearance: base-select; }
  select::picker-icon {
    color: #6e9eaf;
    margin-inline-start: 10px;
    transition: rotate 200ms var(--ease-ui), color 180ms ease;
  }
  select:open::picker-icon { color: #7aebd6; rotate: 180deg; }
  select:open { border-color: #72dfca66; background-color: #102b38; }
  select::picker(select) {
    min-inline-size: anchor-size(width);
    max-inline-size: min(420px, calc(100vw - 28px));
    max-block-size: min(360px, 60vh);
    margin-block: 8px;
    padding: 6px;
    border: 1px solid #70b7c745;
    border-radius: 13px;
    background: linear-gradient(145deg, #132735f5, #0b1725fa);
    color: #cce4ed;
    box-shadow: 0 15px 50px #00000066, inset 0 1px 0 #bdfff00a;
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    overflow: auto;
    opacity: 0;
    transform: translateY(-6px) scale(.985);
    transform-origin: top center;
    transition: opacity 180ms ease, transform 220ms var(--ease-ui),
      display 220ms allow-discrete, overlay 220ms allow-discrete;
  }
  select:open::picker(select) { opacity: 1; transform: translateY(0) scale(1); }
  @starting-style {
    select:open::picker(select) { opacity: 0; transform: translateY(-6px) scale(.985); }
  }
  select option {
    min-block-size: 36px;
    padding: 9px 12px;
    gap: 10px;
    border-radius: 7px;
    background: transparent;
    color: #a9c4d3;
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
    cursor: pointer;
    transition: background-color 130ms ease, color 130ms ease;
  }
  select option:hover, select option:focus-visible { background: #67cbbb12; color: #e1fff7; outline: none; }
  select option:checked { background: linear-gradient(100deg, #53ead21b, #41d6f00d); color: #b2f9e8; }
  select option::checkmark { color: #74e9cd; }
}

/* Disclosure animation uses native details and preserves keyboard/accessibility behavior. */
.scan-details>summary, .quote-outcomes>summary, .scale-override>summary {
  padding-block: 7px;
  min-height: 31px;
  border-radius: 7px;
  color: #a4c7d2;
}
.scan-details>summary::marker, .quote-outcomes>summary::marker, .scale-override>summary::marker { color: #6adbc8; }
.scan-details[open]>summary, .quote-outcomes[open]>summary, .scale-override[open]>summary { color: #d1f6ed; }
@supports (interpolate-size:allow-keywords) and selector(::details-content) {
  .scan-details, .quote-outcomes, .scale-override { interpolate-size: allow-keywords; }
  .scan-details::details-content, .quote-outcomes::details-content, .scale-override::details-content {
    block-size: 0;
    opacity: 0;
    overflow: clip;
    transition: block-size 240ms var(--ease-ui), opacity 180ms ease, content-visibility 240ms allow-discrete;
  }
  .scan-details[open]::details-content, .quote-outcomes[open]::details-content, .scale-override[open]::details-content {
    block-size: auto;
    opacity: 1;
  }
}
@supports not (interpolate-size:allow-keywords) {
  .scan-details[open]>.scan-coverage, .quote-outcomes[open]>.quote-outcome-list,
  .scale-override[open]>:not(summary) { animation: disclosure-reveal 180ms ease both; }
}
@keyframes disclosure-reveal { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* Drawer entrance is owned by the motion controller rather than duplicated by the old base rule. */
.detail-drawer { animation: none; }

@media (max-width:600px) {
  .auth-submit { min-height: 49px; }
  .light-button { min-height: 38px; padding: 9px 12px; }
  .icon-button, .favorite-button, .table-arrow { width: 34px; height: 34px; }
  .mobile-menu { width: 36px; height: 36px; }
  .basis-buttons { gap: 4px; }
  .basis-buttons button { min-height: 41px; padding: 9px 7px; }
  .comparison-switch button { min-height: 40px; }
  .segmented button { min-height: 30px; }
  .session-card { padding-top: 17px; padding-bottom: 5px; }
  .session-card button { min-height: 38px; }
  .chart-selector select { min-width: 100px; max-width: 175px; padding-inline: 8px; }
  .toolbar select { max-width: 100%; }
}

@media (prefers-reduced-motion:reduce) {
  .sidebar, .drawer-backdrop, .detail-drawer { transition: none !important; animation: none !important; }
  button, a.light-button, .source-links a, select, summary,
  .nav-item svg, .panel-link svg, .resource-row svg {
    transition: none !important;
  }
  button:not(:disabled):active, a.light-button:active, .source-links a:active { transform: none !important; }
  .auth-submit::after, .primary-button::after { display: none; }
  .scan-details::details-content, .quote-outcomes::details-content, .scale-override::details-content {
    transition: none !important;
  }
  .scan-details[open]>.scan-coverage, .quote-outcomes[open]>.quote-outcome-list,
  .scale-override[open]>:not(summary) { animation: none !important; }
  @supports (appearance:base-select) {
    select::picker(select), select::picker-icon { transition: none !important; }
    select::picker(select), select:open::picker(select) { transform: none; }
  }
  @media (hover:hover) and (pointer:fine) {
    button:hover, a.light-button:hover, .source-links a:hover, .nav-item:hover svg,
    .panel-link:hover svg, .resource-row:hover svg { transform: none !important; }
  }
}
