/* ── Core Panel — ARKAN UI core (design_handoff_arkan_ui/COMPONENTS.md #7) ──
   One markup, three responsive presentations (breakpoints match TOKENS.md's
   proposed --bp-md/--bp-sm = 1024/768; kept local to this file rather than
   registered in the shared variables.css for this pass — additive only). */

.core-panel-backdrop {
  display: flex;
}

.core-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface-primary);
  overflow: hidden;
}

.core-panel__handle { display: none; }

/* ── Header ── */
.core-panel__header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: 52px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
}
.core-panel__header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.core-panel__number {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}
.core-panel__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.core-panel__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Body ── */
.core-panel__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px;
}

/* ── Footer ── */
.core-panel__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-default);
  flex-shrink: 0;
}

/* ══ Docked — >=1024px: in-flow column, no backdrop, no dimming ══ */
@media (min-width: 1024px) {
  .core-panel-backdrop {
    position: static;
    background: none;
    backdrop-filter: none;
    height: 100%;
  }
  .core-panel {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
  }
}

/* ══ Overlay — 768-1023px: dimmed + blurred backdrop, right-side column ══ */
@media (min-width: 768px) and (max-width: 1023px) {
  .core-panel-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    align-items: stretch;
    justify-content: flex-end;
    background: var(--surface-overlay);
    backdrop-filter: blur(2px);
  }
  .core-panel {
    width: min(480px, 92vw);
    height: 100%;
    box-shadow: var(--shadow-lg);
  }
}

/* ══ Sheet — <768px: bottom sheet, 76% height, drag handle ══ */
@media (max-width: 767px) {
  .core-panel-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    align-items: flex-end;
    justify-content: stretch;
    background: var(--surface-overlay);
    backdrop-filter: blur(2px);
  }
  .core-panel {
    width: 100%;
    height: 76%;
    border-radius: 16px 16px 0 0;
    box-shadow: var(--shadow-lg);
  }
  .core-panel__handle {
    display: block;
    width: 40px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: var(--radius-full);
    background: var(--border-default);
    flex-shrink: 0;
  }
}
