/* The saved card is presented before the ordinary detail/edit view opens. */
.dc-modal {
  width: min(720px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 36px 120px #06162e66;
  font-family: var(--body, 'IBM Plex Sans', sans-serif);
}
.dc-modal::backdrop { background: #0f2036a8; backdrop-filter: blur(7px); }
.dc-modal[open] { animation: dc-enter 260ms cubic-bezier(.2,.7,.2,1) both; }
.dc-modal *, .dc-modal *::before, .dc-modal *::after { box-sizing: border-box; }
.dc-modal [hidden] { display: none !important; }
.dc-shell { min-width: 0; display:flex; flex-direction:column; max-height:calc(100dvh - 34px); }
.dc-header { flex:none; padding: 28px 32px; background: var(--surface-raised); color: var(--ink); border-bottom: 1px solid var(--line); }
.dc-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.dc-eyebrow { margin: 0; font: 14px/1.5 var(--mono, 'IBM Plex Mono', monospace); letter-spacing: 1.25px; color: var(--muted); }
.dc-close { display: grid; flex: 0 0 48px; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--surface); font: 25px/1 sans-serif; cursor: pointer; }
.dc-close:hover { background: var(--surface-raised); }
.dc-title { margin: 0; max-width: 560px; font: 600 32px/1.2 var(--display, 'Space Grotesk', sans-serif); letter-spacing: -.9px; overflow-wrap: anywhere; }
.dc-description { margin: 12px 0 0; max-width: 530px; font-size: 18px; line-height: 1.55; color: var(--muted); }
.dc-canvas { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding: 25px 28px 20px; background: var(--canvas); }
.dc-document { position: relative; min-width: 0; overflow: hidden; padding: 23px 26px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 16px 30px -19px #102b4565; transform-origin: 50% 30%; animation: dc-document-enter 450ms cubic-bezier(.18,.72,.22,1) both; }
.dc-document::before { position: absolute; top: 0; left: 0; right: 0; height: 4px; content: ''; background: var(--accent); }
.dc-document-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 17px; margin-bottom: 17px; border-bottom: 1px solid var(--line); }
.dc-document-eyebrow { margin: 0; font: 14px/1.5 var(--mono, 'IBM Plex Mono', monospace); letter-spacing: 1.3px; color: var(--muted); }
.dc-document-caption { margin: 4px 0 0; font-size: 14px; line-height: 1.4; color: var(--muted); }
.dc-seal { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid var(--accent); border-radius: 50%; color: var(--warning); background: var(--warning-bg); font-size: 20px; opacity: .3; transform: scale(.85); transition: opacity 250ms, transform 350ms cubic-bezier(.2,.8,.2,1); }
.dc-complete .dc-seal { opacity: 1; transform: scale(1); }
.dc-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 22px; margin: 0; }
.dc-field { min-width: 0; }
.dc-field-wide { grid-column: 1 / -1; }
.dc-field-label { font: 14px/1.5 var(--mono, 'IBM Plex Mono', monospace); color: var(--muted); margin-bottom: 4px; }
.dc-field-value { position: relative; min-width: 0; margin: 0; min-height: 24px; font-size: 18px; line-height: 1.5; color: var(--ink); }
.dc-field:first-child .dc-field-value { font: 500 24px/1.25 var(--display, 'Space Grotesk', sans-serif); letter-spacing: -.5px; }
.dc-value-visual { display: grid; min-width: 0; }
.dc-value-measure, .dc-value-printed { grid-area: 1 / 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-value-measure { visibility: hidden; }
.dc-value-printed { opacity: 0; transition: opacity 120ms; }
.dc-field-ready .dc-value-printed { opacity: 1; }
.dc-field-empty .dc-value-printed { color: var(--muted); font-size: 14px; font-weight: 400; letter-spacing: 0; }
.dc-field-typing .dc-value-printed::after { content: ''; display: inline-block; height: 1em; width: 2px; margin-left: 2px; transform: translateY(2px); background: var(--accent); }
.dc-document-footer { display: flex; align-items: center; gap: 11px; border-top: 1px solid var(--line); margin-top: 19px; padding-top: 13px; }
.dc-document-rule { flex: 0 0 23px; height: 2px; background: var(--accent); }
.dc-document-footer p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.dc-footer { flex:none; padding: 16px 28px 25px; background:var(--surface); border-top:1px solid var(--line); }
.dc-progress { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px; min-height: 85px; }
.dc-progress-track { grid-column: 1 / -1; display: block; overflow: hidden; height: 2px; background: var(--line); }
.dc-progress-fill { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; background: var(--accent); }
.dc-progress-hint { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.dc-skip { padding: 10px 0; background: none; border: 0; color: var(--ink); font: 500 14px/1.5 var(--body, sans-serif); text-decoration: none; cursor: pointer; }
.dc-result-note { margin: 0 0 18px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.dc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dc-button { padding: 12px 17px; min-height: 50px; border-radius: 12px; font: 600 16px/1.4 var(--body, sans-serif); cursor: pointer; transition: background 150ms; }
.dc-button-primary { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); }
.dc-button-primary:hover { filter: brightness(1.06); }
.dc-button-secondary { border: 1px solid var(--line); background: transparent; color: var(--ink); }
.dc-button-secondary:hover { background: var(--surface-raised); }
.dc-modal button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.dc-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@keyframes dc-enter { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes dc-document-enter { from { opacity: 0; transform: translateY(19px) rotate(-1deg) scale(.975); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) {
  .dc-modal { width: calc(100vw - 20px); max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); border-radius: 18px; }
  .dc-shell { max-height:calc(100dvh - 22px); }
  .dc-header { padding: 17px 18px 20px; }
  .dc-title { font-size: 25px; }
  .dc-eyebrow { letter-spacing: .7px; font-size: 14px; }
  .dc-canvas { padding: 17px 14px; }
  .dc-document { padding: 20px 18px 16px; }
  .dc-fields { gap: 18px; grid-template-columns: 1fr; }
  .dc-field:first-child .dc-field-value { font-size: 22px; }
  .dc-field-value { font-size: 18px; }
  .dc-field:nth-child(2) { grid-column: 1 / -1; }
  .dc-footer { padding: 16px 18px 20px; }
  .dc-progress { grid-template-columns: 1fr; gap: 4px; }
  .dc-progress-track { margin-bottom: 8px; }
  .dc-skip { justify-self: start; }
  .dc-actions { display: grid; grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .dc-modal[open], .dc-document { animation: none; }
  .dc-modal *, .dc-modal *::before, .dc-modal *::after { transition: none; }
}
