/* Shared, restrained motion for process visibility and analytic drill-downs. */
.process-launcher {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 16px 4px;
  padding: 12px 16px;
  border: 1px solid #d7e7f0;
  background: linear-gradient(115deg, #fff, #eef8fe);
  border-radius: 16px;
  text-align: left;
  color: #23475d;
  transition:
    box-shadow 0.25s,
    transform 0.25s;
}
.process-launcher b {
  margin-left: auto;
  background: #e0f2fe;
  border-radius: 9px;
  min-width: 26px;
  text-align: center;
}
.process-launch-icon {
  font-size: 26px;
  color: #0284c7;
  line-height: 1;
}
.process-launcher.running {
  animation: process-glow 4s ease-in-out infinite;
}
.process-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px #0284c718;
}
.process-dock-head {
  display: flex;
  align-items: center;
  background: linear-gradient(110deg, #102330, #183f56);
}
.process-dock-head .process-dock-toggle {
  flex: 1;
  min-width: 0;
  background: none;
  box-shadow: none;
}
#process-hide {
  background: transparent;
  color: #b6dcee;
  border: 0;
  font-size: 24px;
  padding: 10px 16px;
}
#process-dock {
  width: 430px;
  max-width: calc(100vw - 24px);
  animation: surface-in 0.3s ease-out;
}
#process-dock-list {
  max-height: min(65vh, 620px);
  overscroll-behavior: contain;
}
.process-tabs {
  display: flex;
  gap: 8px;
  position: sticky;
  top: -12px;
  padding: 8px 0;
  background: #fff;
  z-index: 1;
}
.process-tabs button {
  flex: 1;
  font-size: 12px;
  padding: 9px 6px;
  border-radius: 10px;
  box-shadow: none;
}
.process-tabs button[aria-pressed="true"] {
  background: #112c3e;
  color: #fff;
  border-color: #112c3e;
}
.process-queue-note,
.process-empty {
  font-size: 12px;
  line-height: 1.6;
  color: #64798a;
  padding: 4px 6px 10px;
}
.process-heading strong {
  font-size: 14px;
  line-height: 1.45;
  display: block;
  overflow-wrap: anywhere;
}
.process-heading small {
  margin-top: 5px;
  color: #48738d;
}
.process-finished {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-top: 1px solid #e3edf4;
  padding: 16px 6px;
  animation: surface-in 0.3s ease-out;
}
.process-finished strong {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.process-finished small {
  display: block;
  font-size: 11px;
  color: #667b88;
  margin: 6px 0;
}
.process-result-icon {
  background: #e6f5ff;
  color: #0284c7;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  flex-shrink: 0;
}
.process-finished .text-button {
  font-size: 12px;
}
.metric-link {
  text-align: left;
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  border: 1px solid #dfebf3 !important;
  box-shadow: none;
  white-space: normal;
  transition:
    transform 0.25s,
    box-shadow 0.25s,
    border-color 0.25s;
}
.metric-link:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: #7dd3fc !important;
  box-shadow: 0 10px 30px #0284c71c;
}
.metric-link .label {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.metric-link strong {
  margin: 0 !important;
  line-height: 1.2;
}
.metric-link small {
  font-weight: 400;
  line-height: 1.5;
  flex: 1;
}
.metric-hint {
  font-size: 11px;
  color: #5a839d;
  font-weight: 500;
}
.stats .metric-link:first-child .metric-hint {
  color: #a8ddfb;
}
.analytics-bar {
  width: 100%;
  display: block;
  text-align: left;
  background: transparent;
  border: 0;
  box-shadow: none !important;
  padding: 10px;
  border-radius: 10px;
  white-space: normal;
  color: #243847;
}
.analytics-bar:hover:not(:disabled) {
  background: #eef8fe;
  transform: translateX(2px);
}
.analytics-track span {
  transform-origin: left;
  animation: chart-reveal 0.5s ease-out;
}
.chart-legend li {
  display: block;
  padding: 0;
  border: 0;
}
.legend-button {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
  background: transparent;
  padding: 10px 6px;
  text-align: left;
  font-size: 12px;
  white-space: normal;
}
.legend-button:hover:not(:disabled) {
  background: #edf8ff;
}
svg [data-drill] {
  cursor: pointer;
  transition:
    opacity 0.2s,
    filter 0.2s;
}
svg [data-drill]:hover,
svg [data-drill]:focus {
  filter: drop-shadow(0 0 5px #38bdf8);
  opacity: 0.8;
  outline: none;
}
.timeline-data {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  max-height: 280px;
  overflow: auto;
  padding: 16px;
}
.expense-register {
  margin-top: 20px;
}
.expense-register > button {
  margin: 0 0 18px;
}
.expense-total {
  font-size: 36px;
  display: block;
  color: #0284c7;
  margin: 20px 0;
  overflow-wrap: anywhere;
}
.expense-detail .research-step-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}
.analytics-modal {
  width: min(960px, 94vw);
}
.slice-intro p {
  color: #587284;
  line-height: 1.6;
}
.slice-tools {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 24px 0 16px;
}
.slice-tools input {
  flex: 1;
  min-width: 0;
}
.slice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(100px, 0.4fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid #e4edf3;
}
.slice-row strong,
.slice-row small,
.slice-row span {
  display: block;
  overflow-wrap: anywhere;
}
.slice-row small {
  margin-top: 6px;
  font-size: 12px;
  color: #647c8d;
}
.slice-row > div:nth-child(2) {
  font-size: 12px;
  color: #587284;
  line-height: 1.7;
}
.slice-message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.7;
}
#slice-return {
  margin-bottom: 20px;
}
#analytics-body {
  animation: surface-in 0.3s ease-out;
}
.research-studio:focus-within {
  box-shadow:
    0 12px 55px #0284c712,
    0 0 0 1px #bce9ff;
}
@keyframes surface-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (min-width: 1100px) {
  .process-panel-open .studio-controls {
    flex-direction: column;
    align-items: flex-start;
  }
}
@keyframes chart-reveal {
  from {
    transform: scaleX(0.05);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes process-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 #38bdf800;
  }
  50% {
    box-shadow: 0 0 20px 2px #38bdf822;
  }
}
@media (max-width: 700px) {
  .slice-tools {
    flex-wrap: wrap;
  }
  .slice-tools input {
    flex-basis: 100%;
  }
  .slice-row {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }
  .slice-row > div:first-child {
    grid-column: 1/-1;
  }
  .stats .metric-link strong {
    font-size: 25px;
  }
  #process-dock {
    right: 12px;
    bottom: 12px;
  }
  .expense-total {
    font-size: 28px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .process-launcher.running,
  #process-dock,
  .process-finished,
  .analytics-track span,
  #analytics-body {
    animation: none;
  }
  .process-launcher,
  .metric-link,
  .analytics-bar,
  svg [data-drill] {
    transition: none;
  }
  .metric-link:hover:not(:disabled),
  .analytics-bar:hover:not(:disabled),
  .process-launcher:hover {
    transform: none;
  }
}
