/* Digital Licenças - Estilos do Design Aprovado */

:root {
  --ink: #182136;
  --muted: #6c7f9b;
  --line: #dce6f1;
  --blue: #05ace5;
  --pale: #f6f8fb;
  --green-bg: #d5f7e8;
  --green: #087451;
  --cyan-bg: #d3f2ff;
  --cyan: #0876a0;
  --gray-bg: #eef2f6;
  --gray: #526176;
  --amber-bg: #fff2c9;
  --amber: #985017;
  --red-bg: #ffe0e2;
  --red: #b52d31;
}

.dl-order-chat {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: 20px;
  width: min(380px, calc(100vw - 40px));
  height: min(580px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(24, 32, 43, .2);
  animation: dl-chat-open .22s ease-out both;
}
.dl-order-chat.is-dragging { outline: 3px dashed #0877a7; outline-offset: -6px; }
@keyframes dl-chat-open { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes dl-chat-close { to { opacity: 0; transform: translateY(12px) scale(.98); } }
.dl-order-chat.is-closing { pointer-events: none; animation: dl-chat-close .18s ease-in both; }
@keyframes dl-chat-message-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dl-order-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  color: #18202b;
  background: #eaf8fe;
  border-bottom: 1px solid var(--line);
}
.dl-order-chat-header strong,
.dl-order-chat-header span { display: block; }
.dl-order-chat-header span { color: var(--muted); font-size: 12px; }
.dl-order-chat-close { border: 0; background: transparent; color: #18202b; font-size: 25px; }
.dl-order-chat-older { border: 0; background: #fff; color: #0877a7; padding: 9px; }
.dl-order-chat-older[hidden] { display: none; }
.dl-order-chat-messages { flex: 1; overflow-y: auto; padding: 16px; }
.dl-order-chat-empty { color: var(--muted); }
.dl-order-chat-empty.is-loading::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border: 2px solid #dce6f1; border-top-color: #0877a7; border-radius: 50%; animation: dl-chat-spin .8s linear infinite; }
@keyframes dl-chat-spin { to { transform: rotate(360deg); } }
.dl-order-chat-message { max-width: 88%; margin: 0 0 12px; padding: 9px 12px; border-radius: 12px; background: #eef2f6; overflow-wrap: anywhere; }
.dl-order-chat-message.is-customer { margin-left: auto; background: #eaf8fe; }
.dl-order-chat-message span { display: block; font-size: 11px; color: var(--muted); }
.dl-order-chat-message p { margin: 4px 0 0; white-space: pre-wrap; }
.dl-order-chat-message.is-new { animation: dl-chat-message-in .2s ease-out both; }
.dl-order-chat-send-status { display: block; margin-top: 5px; color: #526176; }
.dl-order-chat-attachment { display: block; margin-top: 8px; color: #0877a7; }
.dl-order-chat-attachment img { display: block; max-width: 100%; max-height: 220px; border-radius: 8px; object-fit: contain; }
.dl-order-chat-retry { margin-top: 6px; border: 1px solid #0877a7; background: #fff; color: #0877a7; border-radius: 6px; padding: 5px 8px; }
.dl-order-chat-new { align-self: center; margin: -32px 0 4px; z-index: 1; border: 0; border-radius: 16px; background: #0877a7; color: #fff; padding: 6px 10px; box-shadow: 0 2px 8px #0002; }
.dl-order-chat-new[hidden], .dl-order-chat-selected[hidden], .dl-order-chat-emojis[hidden] { display: none; }
.dl-order-chat-status { min-height: 0; padding: 0 16px; color: #b52d31; font-size: 12px; }
.dl-order-chat-status:empty { display: none; }
.dl-order-chat-form { display: grid; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.dl-order-chat-form label { font-weight: 600; }
.dl-order-chat-form textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: inherit; }
.dl-order-chat-form button { justify-self: end; padding: 9px 14px; border: 0; border-radius: 8px; color: #fff; background: #0877a7; }
.dl-order-chat-form button:disabled { opacity: .6; }
.dl-order-chat-form small { color: var(--muted); }
.dl-order-chat-actions { display: flex; align-items: center; gap: 8px; }
.dl-order-chat-actions button[type="submit"] { margin-left: auto; }
.dl-order-chat-clip { cursor: pointer; padding: 6px; color: #0877a7; }
.dl-order-chat-emoji { border: 0 !important; background: transparent !important; color: #0877a7 !important; font-size: 22px; padding: 2px !important; }
.dl-order-chat-emojis { position: absolute; bottom: 75px; left: 12px; display: flex; gap: 4px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 4px 16px #0002; }
.dl-order-chat-emojis button { background: transparent; color: #18202b; padding: 4px; }
.dl-order-chat-selected { font-size: 12px; color: #526176; overflow-wrap: anywhere; }
.dl-order-chat-selected button { margin-left: 6px; padding: 3px 6px; background: #eef2f6; color: #18202b; }
.dl-order-chat-viewer { position: fixed; inset: 0; z-index: 100; background: #000d; display: grid; place-items: center; padding: 25px; }
.dl-order-chat-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.dl-order-chat-viewer button { position: absolute; top: 12px; right: 18px; border: 0; background: transparent; color: #fff; font-size: 32px; }
.dl-order-chat-viewer a { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; background: #0877a7; border-radius: 7px; padding: 7px 12px; }
@media (max-width: 600px) {
  .dl-order-chat { inset: auto 0 0; width: 100%; height: min(72vh, 640px); border-radius: 16px 16px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dl-order-chat, .dl-order-chat.is-closing, .dl-order-chat-message.is-new, .dl-order-chat-empty.is-loading::before { animation: none; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 14px/1.4 Arial, Helvetica, sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #078bc4;
  outline-offset: 3px;
}

a {
  color: #0877a7;
}

#app {
  min-height: 100vh;
}

/* Login */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 400px;
  width: 100%;
  padding: 40px;
  text-align: center;
}

.login-logo {
  font-size: 32px;
  margin-bottom: 12px;
}

.login-title {
  font-size: 24px;
  margin-bottom: 12px;
}

.login-subtitle {
  color: var(--muted);
  margin-bottom: 32px;
  font-size: 14px;
}

.btn-login {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-login:hover {
  background: #0499cc;
}

/* Loading & Error */
.loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.error {
  background: var(--red-bg);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 12px 16px;
  border-radius: 8px;
  margin: 20px auto;
  max-width: 780px;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

/* Lista de Pedidos */
.list-page {
  max-width: 780px;
  margin: 46px auto 0;
  padding: 0 20px;
}

.list-head {
  margin-bottom: 8px;
}

.page-title {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.7px;
  margin: 0 0 4px;
  font-weight: 750;
}

.order-new-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  margin-left: 9px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--blue);
  color: #08283a;
  font-size: 12px;
  vertical-align: middle;
}

.subhead {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
}

/* Filtros */
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  margin: 23px 0 20px;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filters .filter {
  display: inline-grid;
  border: 1px solid transparent;
  border-radius: 24px;
  padding: 6px 14px;
  background: var(--gray-bg);
  color: var(--gray);
  font-size: 14px;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.filters .filter > span,
.filters .filter::before {
  grid-area: 1 / 1;
}

.filters .filter::before {
  content: attr(data-label);
  visibility: hidden;
  font-weight: 600;
}

.filters .filter.active {
  background-color: #EAF8FE;
  border-color: #00AEEF;
  color: #00AEEF;
  font-weight: 600;
}

.filters .filter:hover:not(.active) {
  background: #dee4ea;
}

/* Grid de Pedidos - Desktop */
.order-row {
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr) 122px 126px;
  align-items: center;
  column-gap: 18px;
  border-top: 1px solid var(--line);
  min-height: 94px;
  padding: 22px 0;
}

.order-row:last-child {
  border-bottom: 1px solid var(--line);
}

.order-name {
  font-size: 17px;
  font-weight: 700;
}

.order-view-status {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.order-view-status.is-new { color: var(--blue); font-weight: 700; }

.secondary {
  color: var(--muted);
}

.order-meta {
  margin-top: 2px;
  white-space: nowrap;
  font-size: 13px;
}

/* Badges */
.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 14px;
  padding: 3px 11px;
  font-weight: 650;
  font-size: 12px;
  white-space: nowrap;
}

.badge.paid {
  background: var(--green-bg);
  color: var(--green);
}

.badge.sent {
  background: var(--cyan-bg);
  color: var(--cyan);
}

.badge.waiting {
  background: var(--amber-bg);
  color: var(--amber);
}

.badge.unpaid {
  background: var(--amber-bg);
  color: var(--amber);
}

.badge.expired {
  background: var(--red-bg);
  color: var(--red);
}

.badge.neutral {
  background: var(--gray-bg);
  color: var(--gray);
}

.order-message {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.2;
}

/* Precio */
.price {
  text-align: right;
}

.price strong {
  font-size: 17px;
  white-space: nowrap;
}

.price .secondary {
  font-size: 13px;
}

/* Botones de Acción */
.action-wrap {
  text-align: right;
}

.action {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  transition: all 0.2s;
}

.action:hover {
  background: var(--pale);
  border-color: #c5d3e3;
}

.action.primary {
  background: var(--blue);
  color: #08283a;
  border-color: var(--blue);
}

.action.primary:hover {
  background: #0499cc;
}

.action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Empty State */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 15px;
}

/* Detalle de Pedido */
.detail-page {
  max-width: 780px;
  margin: 46px auto 0;
  padding: 0 20px;
}

.back {
  border: 0;
  background: none;
  color: var(--blue);
  font-size: 15px;
  padding: 0;
  margin-bottom: 20px;
}

.back:hover {
  text-decoration: underline;
}

.desktop-back {
  display: block;
}

.detail-mobile-top {
  display: none;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.detail-header h1 {
  font-size: 32px;
  font-weight: 750;
  letter-spacing: -0.7px;
  margin: 0;
}

.dl-detail-order-meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.dl-detail-order-pill {
  border-radius: 20px;
  background: var(--gray-bg);
  color: var(--gray);
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  white-space: nowrap;
}

.dl-detail-order-pill-available {
  background: var(--green-bg);
  color: var(--green);
}

.dl-detail-order-pill-waiting,
.dl-detail-order-pill-late,
.dl-detail-order-pill-off {
  background: var(--amber-bg);
  color: var(--amber);
}

.support {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.support:hover:not(:disabled) {
  background: var(--pale);
  border-color: #c5d3e3;
}

.support:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.support svg {
  width: 18px;
  height: 18px;
}

.detail-mobile-support {
  display: none;
}

/* Estado del Pedido */
.detail-status {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  margin-bottom: 24px;
  font-size: 15px;
}

.desktop-status {
  display: block;
}

.mobile-status {
  display: none;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  margin-right: 6px;
}

.status-separator {
  margin: 0 8px;
  color: var(--line);
}

/* Secciones de Productos */
.product-section {
  border-top: 1px solid var(--line);
  padding: 24px 0;
}

.product-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.product-top strong {
  font-size: 17px;
  font-weight: 700;
}

.product-top .secondary {
  font-size: 13px;
  margin-top: 2px;
}

.product-price {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
}

/* Footer */
.summary {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 17px;
}

.summary strong {
  font-size: 20px;
}

/* Responsive - Mobile */
@media (max-width: 820px) {
  .list-page,
  .detail-page {
    margin-top: 24px;
    padding: 0 16px;
  }

  .page-title {
    font-size: 26px;
  }

  .subhead {
    font-size: 14px;
  }

  .filters {
    margin: 16px 0;
  }

  /* Mobile: Cards con CSS Grid */
  .order-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 12px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    min-height: auto;
  }

  .order-row:last-child {
    border-bottom: 1px solid var(--line);
  }

  /* Primera columna, primera fila: número/fecha */
  .order-row > div:first-child {
    grid-column: 1;
    grid-row: 1;
  }

  .order-name {
    font-size: 16px;
  }

  .order-meta {
    font-size: 13px;
    margin-bottom: 0;
  }

  /* Segunda columna, primera fila: precio */
  .price {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
    margin-bottom: 0;
    align-self: start;
  }

  /* Primera fila completa (span 2): badges */
  .badges-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 0;
    margin-bottom: 0;
  }

  /* Primera fila completa (span 2): botón */
  .action-wrap {
    grid-column: 1 / -1;
    grid-row: 3;
    text-align: left;
  }

  .action {
    width: 100%;
    padding: 10px 16px;
  }

  /* Detalle mobile */
  .desktop-back {
    display: none;
  }

  .detail-mobile-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
  }

  .detail-mobile-top .back {
    font-size: 28px;
    margin: 0;
    padding: 0;
  }

  .detail-mobile-top strong {
    font-size: 17px;
    font-weight: 700;
  }

  .detail-header {
    flex-direction: column;
    gap: 16px;
  }

  .detail-header h1 {
    font-size: 26px;
  }

  .detail-header .support {
    display: none;
  }

  .detail-mobile-support {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    margin-bottom: 20px;
  }

  .desktop-status {
    display: none;
  }

  .mobile-status {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
  }

  .detail-mobile-date {
    display: block;
    font-size: 13px;
    color: var(--muted);
  }

  .product-top {
    flex-direction: column;
    gap: 8px;
  }

  .product-price {
    align-self: flex-start;
  }
}

/* Paginación */
.pagination {
  text-align: center;
  margin: 32px 0;
}

.pagination button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.pagination button:hover {
  background: var(--pale);
  border-color: #c5d3e3;
}

/* Detalle digital: Design B, foco no estado. */
.detail-page {
  --detail-product-title-size: 17px;
}

.detail-page :is(
  .detail-header h1,
  .detail-mobile-top strong,
  .dl-detail-product strong,
  .dl-detail-product .product-price,
  .dl-detail-status-heading h2,
  .dl-detail-estimates b,
  .dl-detail-credentials h3,
  code.dl-detail-credential-value,
  .dl-detail-instructions summary,
  .dl-detail-instructions h3,
  .dl-detail-unit-instructions :is(h2, h3),
  .summary strong
) {
  color: #18202B;
}

.dl-detail-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dl-detail-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  overflow: hidden;
}

.dl-detail-product {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.dl-detail-product strong {
  font-size: var(--detail-product-title-size);
  font-weight: 700;
}

.dl-detail-product .secondary {
  font-size: 13px;
  margin-top: 2px;
}

.dl-detail-product-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.dl-detail-status-card {
  margin-top: 20px;
  margin-bottom: 22px;
  padding: 24px;
  border-radius: 10px;
  background: #eef1fe;
}

.dl-detail-status-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
}

.dl-detail-status-heading h2 {
  margin: 0;
  font-size: var(--detail-product-title-size);
  line-height: 1.3;
  letter-spacing: -0.2px;
}

.dl-detail-status-heading .dl-detail-live {
  margin: 0 0 0 auto;
}

.dl-detail-status-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.dl-detail-estimates {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 16px 0 0;
}

.dl-detail-estimates span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.dl-detail-estimates b {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dl-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.dl-detail-support {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dl-detail-support svg {
  width: 18px;
  height: 18px;
}

.dl-detail-notify {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  column-gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.dl-detail-notify input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--blue);
}

.dl-detail-notify small {
  grid-column: 2;
  font-size: 12px;
}

.dl-detail-live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.dl-detail-live i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #9aa5b1;
}

.dl-detail-live.is-live i {
  background: var(--green);
  animation: dl-detail-pulse 1.8s ease-in-out infinite;
}

@keyframes dl-detail-pulse {
  50% { opacity: .25; }
}

.dl-detail-status-neutral {
  background: #f6f8fb;
}

.dl-detail-status-available {
  background: #eef1fe;
}

.dl-detail-status-late,
.dl-detail-status-off {
  background: var(--amber-bg);
}

.dl-detail-timeline {
  --dl-timeline-done: #14804A;
  display: grid;
  grid-template-columns: 1fr;
  list-style: none;
  margin: 0;
  padding: 0;
  padding-inline-start: 40px;
  text-align: left;
}

.dl-detail-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 40px;
  padding: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 22px;
}

.dl-detail-step:last-child {
  min-height: 22px;
  padding-bottom: 0;
}

.dl-detail-step:not(:last-child)::after {
  position: absolute;
  top: 22px;
  left: 10px;
  width: 2px;
  height: calc(100% - 22px);
  background: var(--line);
  content: '';
}

.dl-detail-step.is-done,
.dl-detail-step.is-active {
  color: var(--ink);
  font-weight: 600;
}

.dl-detail-step.is-done::after {
  background: var(--dl-timeline-done);
}

.dl-detail-step-marker {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.dl-detail-step.is-done .dl-detail-step-marker {
  border-color: var(--dl-timeline-done);
  background: var(--dl-timeline-done);
}

.dl-detail-step.is-active .dl-detail-step-marker {
  border-color: #d97706;
  background: #d97706;
  box-shadow: 0 0 0 4px var(--amber-bg);
}
.dl-detail-step-marker svg { display: block; }
.dl-detail-live.is-interrupted i { background: #d97706; animation: none; }

.dl-detail-credentials,
.dl-detail-instructions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.dl-detail-instructions {
  margin-top: 18px;
  padding-top: 14px;
}

.dl-detail-instructions summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.dl-detail-instruction-group {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.dl-detail-instruction-group > .dl-detail-instructions {
  margin: 0;
  padding: 0;
  border: 0;
}

.dl-detail-instruction-group > :not(:first-child) { margin-top: 12px; }
.dl-detail-instruction-group > .dl-detail-muted { margin-bottom: 0; }

.dl-detail-unit-instructions,
.dl-detail-instruction-body,
.dl-detail-instruction-group,
.dl-detail-unmatched-unit { min-width: 0; }
.dl-detail-unit-instructions h2 { margin: 0 0 8px; font-size: 18px; }
.dl-detail-unmatched-unit + .dl-detail-unmatched-unit { border-top: 1px dashed var(--line); margin-top: 16px; padding-top: 16px; }
.dl-detail-unmatched-unit .dl-detail-muted { overflow-wrap: anywhere; }
.dl-detail-instruction-body { padding-top: 12px; overflow-wrap: anywhere; }
.dl-detail-instruction-body code,
.dl-detail-instruction-body a { overflow-wrap: anywhere; word-break: break-word; }
.dl-detail-instruction-body code { white-space: pre-wrap; }
.dl-detail-instruction-body li .dl-detail-button { margin: 6px 0 0 10px; }

.dl-detail-instructions ol {
  margin-top: 8px;
}

.dl-detail-credentials h3,
.dl-detail-instructions h3,
.dl-detail-unit-instructions h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.dl-detail-muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.dl-detail-credential {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(20, 42, 74, .04);
}

.dl-detail-credentials { max-width: 100%; }
.dl-detail-credential-value { font-size: clamp(14px, 2vw, 18px); }
.dl-detail-status-card > .dl-detail-credentials { margin-top: 16px; }
.dl-detail-status-card .dl-detail-credential {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  align-items: stretch;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.dl-detail-status-card .dl-detail-credential > div:first-child {
  display: grid;
  align-content: center;
  min-block-size: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.dl-detail-status-card .dl-detail-credential-unlabeled::before { display: none; }
.dl-detail-status-card .dl-detail-credential-unlabeled > code { position: static; }

.dl-detail-copy-label { display: none; }
.dl-detail-status-card .dl-detail-copy-label { display: inline; }

.dl-detail-status-card .dl-detail-credential-actions .dl-detail-reveal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-inline-size: 0;
  inline-size: 100%;
}

.dl-detail-credential-unlabeled {
  --credential-label-line: 16.8px;
  max-inline-size: 100%;
}

.dl-detail-credential-unlabeled::before {
  display: block;
  block-size: var(--credential-label-line);
  content: '';
}

.dl-detail-credential-unlabeled > code {
  position: relative;
  inset-block-start: calc(var(--credential-label-line) / -2);
}
.dl-detail-reveal {
  display: inline-grid;
  min-width: 68px;
  min-height: 38px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: #2f4bd8;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.dl-detail-reveal:disabled { cursor: wait; opacity: .7; }
.dl-detail-reveal svg { display: block; }
.dl-detail-support.is-loading { cursor: wait; opacity: .75; }
.dl-detail-support.is-loading::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: dl-support-spin .7s linear infinite;
}
@keyframes dl-support-spin { to { transform: rotate(360deg); } }

.dl-detail-credential > span {
  color: var(--muted);
  font-size: 13px;
}

.dl-detail-credential > div:first-child {
  min-width: 0;
}

.dl-detail-credential > div:first-child > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.dl-detail-credential-actions {
  display: flex;
  flex: none;
  gap: 6px;
}

.dl-detail-button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 6px 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.dl-detail-button-primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #08283a;
}

.dl-detail-credential code,
.dl-detail-credential a {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  font: 600 15px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.dl-detail-credential a {
  color: #0877a7;
  text-align: right;
}

.dl-detail-instructions ol {
  margin: 0;
  padding-left: 20px;
}

.dl-detail-instruction-link { margin: 4px 0; padding-left: 20px; overflow-wrap: anywhere; }

.dl-detail-instructions li {
  margin: 4px 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.dl-detail-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  max-width: 90vw;
  transform: translate(-50%, 24px);
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  opacity: 0;
  padding: 10px 16px;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}

.dl-detail-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .dl-detail-live.is-live i {
    animation: none;
  }
  .dl-detail-support.is-loading::before { animation: none; }
}

@media (max-width: 820px) {
  .dl-detail-card {
    padding: 16px;
  }

  .dl-detail-product {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .dl-detail-product .product-price {
    align-self: flex-start;
  }

  .dl-detail-product-side {
    align-items: flex-start;
  }

  .dl-detail-order-pill {
    align-self: flex-start;
  }

  .dl-detail-status-card {
    padding: 16px;
  }

  .dl-detail-timeline {
    padding-inline-start: clamp(6px, 2.5vw, 20px);
  }

  .dl-detail-credential {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .dl-detail-status-card .dl-detail-credential {
    grid-template-columns: minmax(0, 1fr) clamp(84px, 24vw, 110px);
  }

  .dl-detail-status-card .dl-detail-credential > div:first-child {
    padding-inline: 10px;
  }

  .dl-detail-credential a {
    text-align: left;
  }

  .dl-detail-credential-actions {
    width: 100%;
  }

  .dl-detail-button {
    flex: 1;
  }

}
