/* ============================================================
   ESA EXOSKELETON — BENTO TOKENS (official Bento contract)
   One framework: Bento. Upgrade in place. No second card system.
   Docs: docs/BENTO-OFFICIAL-UI.md · platform/src/components/bento/
   Palette: official ESA Bento palette — Beige · Green · Black.
   Brown / warm clay accents REMOVED (esa-bento-theme.css).
   ============================================================ */

:root {
  /* Surfaces */
  --bk-card: #121212;            /* esa-black-2  */
  --bk-panel: #1a1a1a;           /* esa-black-3  */
  --bk-panel-2: #0a0a0a;         /* esa-black    */
  --bk-border: rgba(244, 244, 238, 0.12);       /* esa-line */
  --bk-border-soft: rgba(244, 244, 238, 0.07);
  --bk-line: rgba(244, 244, 238, 0.22);
  --bk-viewport-border: rgba(244, 244, 238, 0.12);

  /* Text */
  --bk-text: #f4f4ee;            /* esa-beige    */
  --bk-text-2: rgba(244, 244, 238, 0.8);
  --bk-text-3: rgba(244, 244, 238, 0.52);

  /* Accents — green only, no brown */
  --bk-accent: #7ec8a0;          /* esa-green    */
  --bk-accent-2: #5aaf84;        /* esa-green-2  */
  --bk-accent-3: #a9dfc3;
  --bk-on-accent: #0a0a0a;
  --bk-chip: #1a1a1a;

  /* Functional status tokens (domain color-coding, not decoration) */
  --bk-danger: #e5484d;
  --bk-warn: #e0a13e;
  --bk-info: #5b8def;

  /* Elevation */
  --bk-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --bk-inset-soft: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ------------------------------------------------------------
   Stage reset — the render-area containers must NOT paint the
   legacy warm-glass frame; the Bento card IS the card.
   (Beats index.html's [id^="esa-"] frame on specificity.)
   ------------------------------------------------------------ */
.esa-render-area > [id^="esa-"] {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.esa-render-area > [id^="esa-"]::before { display: none; }

/* ------------------------------------------------------------
   Official Bento card contract (core.tsx → classes)
   ------------------------------------------------------------ */
.bento-card {
  border-radius: 1.25rem;
  border: 1px solid var(--bk-border);
  background: var(--bk-card);
  box-shadow: var(--bk-shadow), var(--bk-inset-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bento-demo {
  position: relative;
  min-height: 12rem;
  background: var(--bk-panel);
}

.bento-text {
  padding: 1rem 1.1rem 1.15rem;
}

/* V6 typeface standard: DM Serif Display for card titles */
.bento-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.01rem;
  color: var(--bk-text);
}

.bento-title em {
  font-style: italic;
  color: var(--bk-accent);
}

.bento-desc {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--bk-text-3);
}

.bk-btn {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--bk-border);
  background: var(--bk-chip);
  color: var(--bk-text);
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s, color 0.2s;
}
.bk-btn:hover { background: #232323; }
.bk-btn:active { transform: scale(0.97); }

.bk-btn.primary {
  border: none;
  background: linear-gradient(135deg, var(--bk-accent), var(--bk-accent-2));
  color: var(--bk-on-accent);
  box-shadow: 0 4px 16px rgba(126, 200, 160, 0.3);
}
.bk-btn.primary:hover { filter: brightness(1.06); }

.bk-line {
  display: inline-block;
  border-radius: 999px;
  background: var(--bk-line);
}

.bk-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  border: 1px solid var(--bk-border);
  background: transparent;
  color: var(--bk-text-2);
  cursor: pointer;
}

/* ------------------------------------------------------------
   Shared Bento primitives used inside card demos
   ------------------------------------------------------------ */

/* Status pill (replaces std-pill warm/brown) */
.bk-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(126, 200, 160, 0.3);
  background: linear-gradient(135deg, rgba(126, 200, 160, 0.14), rgba(126, 200, 160, 0.06));
  border-radius: 3rem;
  padding: 0.18rem 0.6rem;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  color: var(--bk-accent);
  white-space: nowrap;
}
.bk-pill.warn {
  border-color: rgba(224, 161, 62, 0.35);
  background: linear-gradient(135deg, rgba(224, 161, 62, 0.14), rgba(224, 161, 62, 0.06));
  color: var(--bk-warn);
}
.bk-pill.danger {
  border-color: rgba(229, 72, 77, 0.35);
  background: linear-gradient(135deg, rgba(229, 72, 77, 0.14), rgba(229, 72, 77, 0.06));
  color: var(--bk-danger);
}
.bk-pill.info {
  border-color: rgba(91, 141, 239, 0.35);
  background: linear-gradient(135deg, rgba(91, 141, 239, 0.14), rgba(91, 141, 239, 0.06));
  color: var(--bk-info);
}

.bk-dot {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  flex-shrink: 0;
}
.bk-dot.pulse { animation: bk-pulse 1.4s ease infinite; }
@keyframes bk-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.4); }
}

.bk-spin { animation: bk-spin 0.9s linear infinite; }
@keyframes bk-spin { to { transform: rotate(360deg); } }

/* Rows / fields / inputs */
.bk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--bk-border-soft);
  background: var(--bk-panel-2);
  border-radius: 0.65rem;
}

.bk-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bk-panel-2);
  border: 1px solid var(--bk-border);
  color: var(--bk-text);
  padding: 0.55rem 0.7rem;
  border-radius: 0.6rem;
  font-size: 0.8rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.bk-input:focus { border-color: rgba(126, 200, 160, 0.45); }
.bk-input::placeholder { color: var(--bk-text-3); }

.bk-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.bk-field-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  color: var(--bk-text-3);
}

/* Section icon tile (checklist / workorder) */
.bk-tile {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  color: #0a0a0a;
}

/* Muted meta text */
.bk-meta {
  font-size: 0.6rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  color: var(--bk-text-3);
}
