.case-actions { margin-block-start: 12px; }
.delfin-result .proof-invitation { margin-block-start: 12px; }

.case-link, .case-close {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.case-link {
  color: #246b45;
  font-size: .875rem;
  font-weight: 550;
  text-decoration: underline;
  text-underline-offset: .3em;
}

html:has(.case-dialog[open]) { overflow: hidden; scrollbar-gutter: stable; }

.case-dialog {
  --paper: #fbfcfa;
  --ink: #182620;
  --muted: #475a52;
  --line: #d4dfdb;
  --accent: #155670;
  --stage: #dcebed;
  --gutter: clamp(22px, 5vw, 62px);
  position: fixed;
  inset: 0;
  width: min(1080px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  overscroll-behavior: contain;
}

#case-junior {
  --accent: #a32427;
  --stage: #eae6dd;
}

.case-dialog::backdrop { background: #13251dcc; }
.case-dialog :is(button, a):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.case-toolbar {
  position: sticky;
  z-index: 2;
  inset-block-start: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px var(--gutter);
  border-block-end: 1px solid var(--line);
  background: var(--paper);
}

.case-toolbar p {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin: 0;
}
.case-toolbar strong { font-weight: 640; letter-spacing: -.02em; }
.case-toolbar p span { color: var(--muted); font-size: .8125rem; }
.case-toolbar form { margin: 0; }
.case-close {
  display: grid;
  width: 44px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--stage);
  font-size: 1.5rem;
  line-height: 1;
}
.case-close:hover { color: var(--accent); }

.case-intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px 34px;
  margin-inline: var(--gutter);
  padding-block: clamp(28px, 5vw, 50px);
  border-block-end: 1px solid var(--line);
}
.case-intro h2 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(2.15rem, 5vw, 3.85rem);
  font-weight: 610;
  line-height: 1.02;
  letter-spacing: -.043em;
  text-wrap: balance;
}
.case-intro h2:focus { outline: none; }
.case-scale {
  max-width: 42ch;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .9375rem;
  line-height: 1.5;
}
.case-result {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 250px;
  margin: 0;
  font-size: .875rem;
  line-height: 1.35;
}
.case-result strong {
  color: var(--accent);
  font-size: clamp(2.7rem, 5.5vw, 4rem);
  font-weight: 620;
  line-height: 1;
  letter-spacing: -.045em;
}
.case-result small { display: block; margin-top: 3px; color: var(--muted); font-size: .75rem; }

.case-section { padding: 30px var(--gutter) 34px; }
.case-section + .case-section { border-block-start: 1px solid var(--line); }
.case-section > header { margin-block-end: 19px; }
.case-section h3 {
  margin: 0;
  font-size: clamp(1.45rem, 3.25vw, 2.3rem);
  font-weight: 600;
  line-height: 1.13;
  letter-spacing: -.04em;
  text-wrap: pretty;
}
.case-section header > p {
  max-width: 65ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .9375rem;
  line-height: 1.55;
}

.case-devices {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) minmax(145px, 1fr);
  align-items: end;
  gap: clamp(14px, 3.5vw, 34px);
  padding: clamp(15px, 4vw, 38px);
  border-radius: 15px;
  background: var(--stage);
}
.case-devices figure { min-width: 0; margin: 0; }
.case-devices figcaption {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 540;
}
.case-devices figcaption a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  text-underline-offset: .26em;
}
.case-browser {
  overflow: hidden;
  border: 1px solid #183c333a;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 13px 32px -15px #183c3370;
}
.case-browser-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  border-block-end: 1px solid #dce3df;
  background: #f2f5f3;
  color: #40554c;
  font-size: .66rem;
}
.case-browser-bar i { width: 5px; height: 5px; border-radius: 50%; background: #8c9e97; }
.case-browser-bar span { margin-inline-start: 6px; }
.case-browser img { display: block; width: 100%; height: auto; }

.case-mobile { justify-self: center; width: min(100%, 195px); }
.case-phone {
  overflow: hidden;
  border: 5px solid #1c2624;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 28px -14px #18251e80;
}
.case-phone img { display: block; width: 100%; height: auto; }

.case-source { margin: 10px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.case-site-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--accent);
  font-size: .875rem;
  font-weight: 550;
  text-underline-offset: .3em;
}

.case-ad-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 20px clamp(22px, 5vw, 58px);
}
.case-creative {
  margin: 0;
}
.case-creative-preview {
  overflow: hidden;
  border: 1px solid #dce0e5;
  border-radius: 9px;
  background: #fff;
  color: #1c1e21;
  font-family: "Segoe UI", Arial, sans-serif;
  box-shadow: 0 15px 26px -22px #183c3370;
}
.case-meta-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px 8px;
  font-size: .875rem;
  line-height: 1.3;
}
.case-meta-avatar {
  display: block;
  flex: 0 0 36px;
  height: 36px;
  overflow: hidden;
  border: 1px solid #e1e4e9;
  border-radius: 50%;
  background: #fff;
}
.case-meta-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.case-meta-header div strong,
.case-meta-header div span,
.case-meta-destination div span,
.case-meta-destination div strong {
  display: block;
}
.case-meta-header div span,
.case-meta-destination div span { color: #606770; font-size: .75rem; }
.case-meta-chrome {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-inline-start: auto;
  color: #606770;
}
.case-meta-chrome i { font-size: 1.2rem; font-style: normal; font-weight: 650; line-height: 1; }
.case-meta-copy { padding: 0 14px 11px; font-size: .875rem; line-height: 1.45; }
.case-meta-copy p { margin: 0; }
.case-meta-copy p + p { margin-block-start: 6px; }
.case-meta-media {
  display: block;
  width: 100%;
  height: auto;
}
.case-meta-softened {
  overflow: hidden;
}
.case-meta-softened .case-meta-media {
  filter: blur(clamp(4px, 1vw, 7px));
  transform: scale(1.12);
}
.case-meta-destination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: #f0f2f5;
  font-size: .875rem;
  line-height: 1.26;
}
.case-meta-destination div span { margin-block-end: 3px; }
.case-meta-destination b {
  flex-shrink: 0;
  padding: 7px 9px;
  border-radius: 6px;
  background: #e1e5eb;
  color: #24272d;
  font-size: .75rem;
}
.case-meta-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 9px 4px;
  border-top: 1px solid #e4e6eb;
  color: #606770;
  font-size: .75rem;
  font-weight: 620;
  text-align: center;
}
.case-creative figcaption { margin-top: 9px; color: var(--muted); font-size: .75rem; line-height: 1.45; }

.case-numbers { margin: 0; font-variant-numeric: tabular-nums; }
.case-numbers > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 12px;
  padding-block: 11px;
  border-block-start: 1px solid var(--line);
  font-size: .875rem;
  line-height: 1.4;
}
.case-numbers dd { margin: 0; }
.case-numbers div:not(.case-report-note) dd {
  color: var(--accent);
  font-size: 2rem;
  font-weight: 620;
  line-height: 1;
  letter-spacing: -.04em;
}
.case-numbers .case-report-note { grid-template-columns: 1fr; font-size: .75rem; color: var(--muted); }
.case-report-note dt { font-weight: 600; }
.case-numbers .case-enrollment-result {
  margin-block-start: 6px;
  padding: 14px;
  border: 1px solid #d5e3d6;
  border-radius: 8px;
  background: #edf4ec;
}
.case-enrollment-result dt { font-weight: 620; }
.case-enrollment-result small {
  display: block;
  margin-block-start: 4px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 400;
}

.case-backoffice { background: #eff3ee; }
.case-register { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.case-register figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px 12px;
  padding: 16px clamp(13px, 3vw, 25px) 10px;
}
.case-register figcaption span { color: var(--muted); font-size: .75rem; }
.case-register-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 0 clamp(13px, 3vw, 25px) 8px;
}
.case-register-filters[hidden],
.case-register-list li[hidden] { display: none; }
.case-register-filters button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: .8125rem;
  font-weight: 550;
  cursor: pointer;
}
.case-register-filters button:hover,
.case-register-filters button[aria-pressed="true"] { color: #246b45; }
.case-register-filters button[aria-pressed="true"] { border-color: #246b45; }
.case-register-filters button span {
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef3ee;
  color: #475a52;
  font-size: .7rem;
  font-variant-numeric: tabular-nums;
}
.case-register-list { margin: 0; padding: 0; list-style: none; }
.case-register-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(126px, .76fr) minmax(0, 1.6fr);
  align-items: start;
  gap: 8px 17px;
  padding: 15px clamp(13px, 3vw, 25px);
  border-block-start: 1px solid var(--line);
  font-size: .8125rem;
  line-height: 1.45;
}
.case-register-list li[data-stage="follow-up"] { background: #f9fbf8; }
.case-entry strong, .case-next strong { display: block; font-weight: 620; }
.case-entry span, .case-next span { display: block; margin-top: 2px; color: var(--muted); }
.case-state {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 6px;
  background: #e7f1e8;
  color: #215737;
  font-size: .75rem;
  font-weight: 600;
}
[data-stage="follow-up"] .case-state { background: #f7eedb; color: #6c4b1a; }

@media (max-width: 660px) {
  .case-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 14px; }
  .case-intro { align-items: start; flex-direction: column; }
  .case-devices { grid-template-columns: minmax(0, 1fr); }
  .case-mobile { width: min(100%, 200px); }
  .case-ad-layout { grid-template-columns: minmax(0, 1fr); }
  .case-register-filters { gap: 2px 7px; }
  .case-register-filters button { font-size: .75rem; }
  .case-register-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .case-next { grid-column: 1 / -1; }
  .case-state { justify-self: end; max-width: 13ch; }
}

@media (max-width: 360px) {
  .case-meta-destination { flex-wrap: wrap; }
}
