/* ==========================================================================
   DVMReady Calculator Shell v2
   Scoped modern clinical UI — overrides existing design ONLY when
   body has .calc-shell-v2 (added alongside existing .dose-page).
   Loaded AFTER tools-shell.css → uses equal or higher specificity.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Scope & Accent Custom Properties
   -------------------------------------------------------------------------- */

.calc-shell-v2 {
  /* Inherit existing tokens where available */
  --v2-bg: #f6f1e8;
  --v2-surface: #ffffff;
  --v2-surface-warm: #fffdfb;
  --v2-text: #1c2729;
  --v2-text-muted: #68777a;
  --v2-border: rgba(0, 0, 0, 0.06);
  --v2-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
  --v2-radius-sm: 8px;
  --v2-radius-md: 12px;
  --v2-radius-lg: 14px;
  --v2-radius-pill: 999px;
  --v2-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --v2-input-height: 50px;
  --v2-gap-mobile: 20px;
  --v2-gap-desktop: 28px;

  /* Default accent (violet) */
  --v2-accent: #7c3aed;
  --v2-accent-soft: #f5f3ff;
  --v2-accent-text: #5b21b6;
}

/* Accent overrides via data-accent */
.calc-shell-v2[data-accent="violet"] {
  --v2-accent: #7c3aed;
  --v2-accent-soft: #f5f3ff;
  --v2-accent-text: #5b21b6;
}

.calc-shell-v2[data-accent="teal"] {
  --v2-accent: #0d9488;
  --v2-accent-soft: #f0fdfa;
  --v2-accent-text: #115e59;
}

.calc-shell-v2[data-accent="amber"] {
  --v2-accent: #d97706;
  --v2-accent-soft: #fffbeb;
  --v2-accent-text: #92400e;
}

.calc-shell-v2[data-accent="rose"] {
  --v2-accent: #e11d48;
  --v2-accent-soft: #fff1f2;
  --v2-accent-text: #9f1239;
}

.calc-shell-v2[data-accent="emerald"] {
  --v2-accent: #059669;
  --v2-accent-soft: #ecfdf5;
  --v2-accent-text: #065f46;
}

.calc-shell-v2[data-accent="sky"] {
  --v2-accent: #0284c7;
  --v2-accent-soft: #f0f9ff;
  --v2-accent-text: #075985;
}

.calc-shell-v2[data-accent="indigo"] {
  --v2-accent: #4f46e5;
  --v2-accent-soft: #eef2ff;
  --v2-accent-text: #3730a3;
}

/* --------------------------------------------------------------------------
   Status Variants (for result status badge + card borders)
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-status-normal {
  --status-color: #059669;
  --status-bg: #ecfdf5;
}

.calc-shell-v2 .calc-v2-status-mild {
  --status-color: #d97706;
  --status-bg: #fffbeb;
}

.calc-shell-v2 .calc-v2-status-elevated {
  --status-color: #ea580c;
  --status-bg: #fff7ed;
}

.calc-shell-v2 .calc-v2-status-critical {
  --status-color: #b91c1c;
  --status-bg: #fef2f2;
}

/* Status border override on primary result (non-print) */
.calc-shell-v2 .calc-v2-result-panel.calc-v2-status-normal .calc-v2-result-primary,
.calc-shell-v2 .calc-v2-result-panel.calc-v2-status-mild .calc-v2-result-primary,
.calc-shell-v2 .calc-v2-result-panel.calc-v2-status-elevated .calc-v2-result-primary,
.calc-shell-v2 .calc-v2-result-panel.calc-v2-status-critical .calc-v2-result-primary {
  border-left-color: var(--status-color);
}

/* --------------------------------------------------------------------------
   Global hidden state
   -------------------------------------------------------------------------- */

.calc-shell-v2 [hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-workspace {
  display: grid;
  gap: var(--v2-gap-mobile);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-workspace {
    grid-template-columns: 1fr 400px;
    gap: var(--v2-gap-desktop);
    align-items: start;
    padding-left: 24px;
    padding-right: 24px;
  }
}

.calc-shell-v2 .calc-v2-input-panel {
  min-width: 0;
}

.calc-shell-v2 .calc-v2-result-panel {
  min-width: 0;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-result-panel {
    position: sticky;
    top: 104px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-gutter: stable;
  }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-header {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 24px 16px 16px;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-header {
    padding: 32px 24px 20px;
  }
}

.calc-shell-v2 .calc-v2-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--v2-text);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-title {
    font-size: 32px;
  }
}

.calc-shell-v2 .calc-v2-subtitle {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--v2-text-muted);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-form {
  display: grid;
  gap: 16px;
}

.calc-shell-v2 .calc-v2-field-row {
  display: grid;
  gap: 16px;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-field-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.calc-shell-v2 .calc-v2-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calc-shell-v2 .calc-v2-field span {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--v2-text);
}

.calc-shell-v2 .calc-v2-field small {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--v2-text-muted);
  margin-top: -2px;
  margin-bottom: 2px;
}

.calc-shell-v2 .calc-v2-field input,
.calc-shell-v2 .calc-v2-field select {
  min-height: var(--v2-input-height);
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--v2-text);
  background-color: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-lg);
  box-shadow: none;
  transition: border-color var(--v2-transition), box-shadow var(--v2-transition);
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
}

.calc-shell-v2 .calc-v2-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2368777a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.calc-shell-v2 .calc-v2-field input::placeholder {
  color: #a0aeb0;
}

.calc-shell-v2 .calc-v2-field input:focus,
.calc-shell-v2 .calc-v2-field select:focus {
  outline: none;
  border-color: var(--v2-accent);
  box-shadow: 0 0 0 3px var(--v2-accent-soft);
}

.calc-shell-v2 .calc-v2-field input:focus-visible,
.calc-shell-v2 .calc-v2-field select:focus-visible {
  outline: none;
  border-color: var(--v2-accent);
  box-shadow: 0 0 0 3px var(--v2-accent-soft);
}

.calc-shell-v2 .calc-v2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  align-items: center;
}

.calc-shell-v2 .calc-v2-actions button,
.calc-shell-v2 .calc-v2-actions input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--v2-input-height);
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  color: #ffffff;
  background-color: #1c2729;
  border: none;
  border-radius: var(--v2-radius-lg);
  cursor: pointer;
  transition: background-color var(--v2-transition), transform var(--v2-transition), box-shadow var(--v2-transition);
  font-family: inherit;
}

.calc-shell-v2 .calc-v2-actions button:hover,
.calc-shell-v2 .calc-v2-actions input[type="submit"]:hover {
  background-color: #0d1722;
}

.calc-shell-v2 .calc-v2-actions button:active,
.calc-shell-v2 .calc-v2-actions input[type="submit"]:active {
  transform: translateY(1px);
}

.calc-shell-v2 .calc-v2-actions button:focus-visible,
.calc-shell-v2 .calc-v2-actions input[type="submit"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--v2-accent-soft);
}

.calc-shell-v2 .calc-v2-disclaimer {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--v2-text-muted);
  margin-top: 4px;
  flex-basis: 100%;
}

/* --------------------------------------------------------------------------
   Assumptions (outside form)
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-assumptions {
  margin-top: 24px;
  border-top: 1px solid var(--v2-border);
}

.calc-shell-v2 .calc-v2-assumptions summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--v2-text-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color var(--v2-transition);
}

.calc-shell-v2 .calc-v2-assumptions summary::-webkit-details-marker {
  display: none;
}

.calc-shell-v2 .calc-v2-assumptions summary::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--v2-transition);
  flex-shrink: 0;
}

.calc-shell-v2 .calc-v2-assumptions[open] summary::before {
  transform: rotate(45deg);
}

.calc-shell-v2 .calc-v2-assumptions summary:hover {
  color: var(--v2-text);
}

.calc-shell-v2 .calc-v2-assumptions summary:focus-visible {
  outline: none;
  color: var(--v2-accent-text);
}

.calc-shell-v2 .calc-v2-assumptions-body {
  padding: 0 0 20px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--v2-text-muted);
}

.calc-shell-v2 .calc-v2-assumptions-body p {
  margin: 0 0 12px;
}

.calc-shell-v2 .calc-v2-assumptions-body p:last-child {
  margin-bottom: 0;
}

.calc-shell-v2 .calc-v2-assumptions-body ul,
.calc-shell-v2 .calc-v2-assumptions-body ol {
  margin: 0 0 12px;
  padding-left: 20px;
}

.calc-shell-v2 .calc-v2-assumptions-body li {
  margin-bottom: 6px;
}

/* --------------------------------------------------------------------------
   Results — Primary (Hero)
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-result-primary {
  background-color: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-left: 4px solid var(--v2-accent);
  border-radius: var(--v2-radius-md);
  box-shadow: var(--v2-shadow);
  padding: 24px;
  margin-bottom: 16px;
  transition: border-left-color var(--v2-transition), opacity var(--v2-transition), transform var(--v2-transition);
}

.calc-shell-v2 .calc-v2-result-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--v2-text-muted);
  margin-bottom: 8px;
}

.calc-shell-v2 .calc-v2-result-hero {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.calc-shell-v2 .calc-v2-result-value {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--v2-text);
  letter-spacing: -0.02em;
  word-break: break-word;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-result-value {
    font-size: 56px;
  }
}

.calc-shell-v2 .calc-v2-result-unit {
  display: inline;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--v2-text-muted);
  margin-left: 6px;
  vertical-align: middle;
}

.calc-shell-v2 .calc-v2-result-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--status-color, var(--v2-accent-text));
  background-color: var(--status-bg, var(--v2-accent-soft));
  border-radius: var(--v2-radius-pill);
}

.calc-shell-v2 .calc-v2-result-note {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--v2-text-muted);
  margin-top: 12px;
}

/* --------------------------------------------------------------------------
   Results — Secondary (Mini Cards)
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-result-secondary {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-result-secondary {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  .calc-shell-v2 .calc-v2-result-secondary:has(> .calc-v2-mini-card:nth-child(4)) {
    grid-template-columns: repeat(2, 1fr);
  }
}

.calc-shell-v2 .calc-v2-mini-card {
  background-color: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-md);
  box-shadow: var(--v2-shadow);
  padding: 16px;
  transition: transform var(--v2-transition), box-shadow var(--v2-transition);
}

.calc-shell-v2 .calc-v2-mini-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), 0 6px 18px rgba(0, 0, 0, 0.04);
}

.calc-shell-v2 .calc-v2-mini-card-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--v2-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.calc-shell-v2 .calc-v2-mini-card-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--v2-accent);
  word-break: break-word;
}

.calc-shell-v2 .calc-v2-mini-card-note {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--v2-text-muted);
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Escalation Banner
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-escalation-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--status-color, var(--v2-accent-text));
  background-color: var(--status-bg, var(--v2-accent-soft));
  border-left: 4px solid var(--status-color, var(--v2-accent));
  border-radius: var(--v2-radius-sm);
  margin-bottom: 16px;
  box-sizing: border-box;
}

.calc-shell-v2 .calc-v2-escalation-banner::before {
  content: "⚠";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Next Steps
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-next-steps {
  margin-top: 8px;
  border-top: 1px solid var(--v2-border);
}

.calc-shell-v2 .calc-v2-next-steps summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--v2-text-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color var(--v2-transition);
}

.calc-shell-v2 .calc-v2-next-steps summary::-webkit-details-marker {
  display: none;
}

.calc-shell-v2 .calc-v2-next-steps summary::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--v2-transition);
  flex-shrink: 0;
}

.calc-shell-v2 .calc-v2-next-steps[open] summary::before {
  transform: rotate(45deg);
}

.calc-shell-v2 .calc-v2-next-steps summary:hover {
  color: var(--v2-text);
}

.calc-shell-v2 .calc-v2-next-steps summary:focus-visible {
  outline: none;
  color: var(--v2-accent-text);
}

.calc-shell-v2 .calc-v2-next-steps-list {
  list-style: none;
  margin: 0;
  padding: 0 0 20px;
}

.calc-shell-v2 .calc-v2-next-steps-list li {
  position: relative;
  padding-left: 24px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--v2-text-muted);
  margin-bottom: 8px;
}

.calc-shell-v2 .calc-v2-next-steps-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--v2-accent);
  background-color: var(--v2-accent-soft);
  border-radius: var(--v2-radius-pill);
}

.calc-shell-v2 .calc-v2-next-steps-list li:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Copy Action
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-copy-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.calc-shell-v2 .calc-v2-copy-action button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--v2-text-muted);
  background-color: transparent;
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-sm);
  cursor: pointer;
  transition: color var(--v2-transition), border-color var(--v2-transition), background-color var(--v2-transition);
  font-family: inherit;
}

.calc-shell-v2 .calc-v2-copy-action button:hover {
  color: var(--v2-accent-text);
  border-color: var(--v2-accent);
  background-color: var(--v2-accent-soft);
}

.calc-shell-v2 .calc-v2-copy-action button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--v2-accent-soft);
}

.calc-shell-v2 .calc-v2-copy-action .dose-copy-status {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: var(--v2-accent);
  opacity: 0;
  transition: opacity var(--v2-transition);
}

.calc-shell-v2 .calc-v2-copy-action .dose-copy-status.is-visible {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Details Below Workspace
   -------------------------------------------------------------------------- */

.calc-shell-v2 .calc-v2-details {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 40px;
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 1024px) {
  .calc-shell-v2 .calc-v2-details {
    padding-left: 24px;
    padding-right: 24px;
  }
}

.calc-shell-v2 .calc-v2-detail-panel {
  margin-bottom: 12px;
  background-color: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-radius-md);
  box-shadow: var(--v2-shadow);
  overflow: hidden;
}

.calc-shell-v2 .calc-v2-detail-panel summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--v2-text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color var(--v2-transition);
}

.calc-shell-v2 .calc-v2-detail-panel summary::-webkit-details-marker {
  display: none;
}

.calc-shell-v2 .calc-v2-detail-panel summary::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--v2-transition);
  flex-shrink: 0;
}

.calc-shell-v2 .calc-v2-detail-panel[open] summary::before {
  transform: rotate(45deg);
}

.calc-shell-v2 .calc-v2-detail-panel summary:hover {
  background-color: rgba(0, 0, 0, 0.015);
}

.calc-shell-v2 .calc-v2-detail-panel summary:focus-visible {
  outline: none;
  background-color: var(--v2-accent-soft);
}

.calc-shell-v2 .calc-v2-detail-panel > div,
.calc-shell-v2 .calc-v2-detail-panel > article,
.calc-shell-v2 .calc-v2-detail-panel > section {
  padding: 0 20px 20px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--v2-text-muted);
}

.calc-shell-v2 .calc-v2-detail-panel p {
  margin: 0 0 12px;
}

.calc-shell-v2 .calc-v2-detail-panel p:last-child {
  margin-bottom: 0;
}

.calc-shell-v2 .calc-v2-detail-panel ul,
.calc-shell-v2 .calc-v2-detail-panel ol {
  margin: 0 0 12px;
  padding-left: 20px;
}

.calc-shell-v2 .calc-v2-detail-panel li {
  margin-bottom: 6px;
}

.calc-shell-v2 .calc-v2-detail-panel code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  padding: 2px 6px;
  background-color: rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  color: var(--v2-text);
}

.calc-shell-v2 .calc-v2-detail-panel pre {
  overflow-x: auto;
  padding: 14px;
  background-color: rgba(0, 0, 0, 0.04);
  border-radius: var(--v2-radius-sm);
  font-size: 13px;
  line-height: 1.6;
}

.calc-shell-v2 .calc-v2-detail-panel pre code {
  padding: 0;
  background: none;
}

/* Specific detail panel modifiers */
.calc-shell-v2 .calc-v2-detail-safety summary {
  color: #9f1239;
}

.calc-shell-v2 .calc-v2-detail-safety[open] summary {
  background-color: #fff1f2;
}

.calc-shell-v2 .calc-v2-detail-basis summary {
  color: var(--v2-accent-text);
}

.calc-shell-v2 .calc-v2-detail-basis[open] summary {
  background-color: var(--v2-accent-soft);
}

.calc-shell-v2 .calc-v2-detail-formula summary {
  color: #075985;
}

.calc-shell-v2 .calc-v2-detail-formula[open] summary {
  background-color: #f0f9ff;
}

.calc-shell-v2 .calc-v2-detail-related summary {
  color: #065f46;
}

.calc-shell-v2 .calc-v2-detail-related[open] summary {
  background-color: #ecfdf5;
}

/* --------------------------------------------------------------------------
   Result Panel States
   -------------------------------------------------------------------------- */

/* When result panel has calculated results */
.calc-shell-v2 .calc-v2-result-panel.is-calculated {
  /* Subtle entrance animation handled by opacity/transform on children */
}

.calc-shell-v2 .calc-v2-result-panel.is-calculated .calc-v2-result-primary {
  animation: calcV2FadeIn 250ms ease-out;
}

.calc-shell-v2 .calc-v2-result-panel.is-calculated .calc-v2-mini-card {
  animation: calcV2FadeInUp 250ms ease-out backwards;
}

.calc-shell-v2 .calc-v2-result-panel.is-calculated .calc-v2-mini-card:nth-child(1) { animation-delay: 50ms; }
.calc-shell-v2 .calc-v2-result-panel.is-calculated .calc-v2-mini-card:nth-child(2) { animation-delay: 100ms; }
.calc-shell-v2 .calc-v2-result-panel.is-calculated .calc-v2-mini-card:nth-child(3) { animation-delay: 150ms; }

@keyframes calcV2FadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes calcV2FadeInUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* When validation errors exist */
.calc-shell-v2 .calc-v2-result-panel.has-errors {
  opacity: 0.6;
  pointer-events: none;
  filter: grayscale(0.3);
  transition: opacity var(--v2-transition), filter var(--v2-transition);
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */

@media print {
  .calc-shell-v2 .calc-v2-header,
  .calc-shell-v2 .calc-v2-actions,
  .calc-shell-v2 .calc-v2-assumptions,
  .calc-shell-v2 .calc-v2-next-steps,
  .calc-shell-v2 .calc-v2-details,
  .calc-shell-v2 .calc-v2-copy-action,
  .calc-shell-v2 .site-header,
  .calc-shell-v2 .site-footer,
  .calc-shell-v2 .scope-strip,
  .calc-shell-v2 .tool-header,
  .calc-shell-v2 .related-tools-section,
  .calc-shell-v2 .tool-favorite-toggle-page {
    display: none !important;
  }

  .calc-shell-v2 .calc-v2-workspace {
    display: block;
    padding: 0;
  }

  .calc-shell-v2 .calc-v2-result-panel {
    position: static !important;
    page-break-inside: avoid;
  }

  .calc-shell-v2 .calc-v2-result-primary,
  .calc-shell-v2 .calc-v2-mini-card {
    border: 1px solid #ccc;
    box-shadow: none;
    background: white;
    page-break-inside: avoid;
  }

  .calc-shell-v2 .calc-v2-result-primary {
    border-left: 4px solid var(--v2-accent);
  }

  .calc-shell-v2 .calc-v2-result-panel.calc-v2-status-normal .calc-v2-result-primary,
  .calc-shell-v2 .calc-v2-result-panel.calc-v2-status-mild .calc-v2-result-primary,
  .calc-shell-v2 .calc-v2-result-panel.calc-v2-status-elevated .calc-v2-result-primary,
  .calc-shell-v2 .calc-v2-result-panel.calc-v2-status-critical .calc-v2-result-primary {
    border-left-color: var(--status-color);
  }

  .calc-shell-v2 .calc-v2-result-value {
    color: #000;
  }

  .calc-shell-v2 .calc-v2-mini-card-value {
    color: var(--v2-accent);
  }
}
