/* AlphaGuru Scholar's Desk — Lane 5 panel styles (Part of MAS-47 / PLAN-021).
 * Warm-cream paper (#FFFAF0), slate ink (#1E293B), teal #0F766E and blue #1D4ED8 accents.
 * Every text/background pair below meets WCAG AA (>= 4.5:1). Buttons and fields are at least
 * 44px tall. Mounts never widen the page: grids collapse to one column at 768px and below.
 */
.ag-dk-mount {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  background: #FFFAF0;
  color: #1E293B;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}
.ag-dk-mount *, .ag-dk-mount *::before, .ag-dk-mount *::after { box-sizing: border-box; }
.ag-dk-mount h4 { margin: 0 0 8px; font-size: 1rem; color: #1E293B; }
.ag-dk-mount h5 { margin: 0 0 6px; font-size: 0.92rem; color: #1E293B; }
.ag-dk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px;
  margin-top: 10px;
}
.ag-dk-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  background: #FFFFFF;
  color: #1E293B;
  overflow-wrap: anywhere;
}
.ag-dk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.ag-dk-label { font-weight: 600; font-size: 0.88rem; color: #1E293B; }
.ag-dk-muted { margin: 6px 0 0; font-size: 0.86rem; color: #475569; }
.ag-dk-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  background: #FFFAF0;
  color: #1E293B;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  max-width: 100%;
  white-space: normal;
}
.ag-dk-btn.primary { background: #0F766E; border-color: #0F766E; color: #FFFFFF; }
.ag-dk-btn[aria-pressed="true"] { background: #1D4ED8; border-color: #1D4ED8; color: #FFFFFF; }
.ag-dk-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.ag-dk-input {
  min-height: 44px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid #94A3B8;
  border-radius: 8px;
  background: #FFFFFF;
  color: #1E293B;
  font: inherit;
}
input[type="number"].ag-dk-input { width: 6.5em; }
textarea.ag-dk-input { width: 100%; min-height: 96px; resize: vertical; }
.ag-dk-btn:focus-visible, .ag-dk-input:focus-visible, #petCompanionBadge:focus-visible {
  outline: 3px solid #1D4ED8;
  outline-offset: 2px;
}
.ag-dk-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #CCFBF1;
  color: #134E4A;
  font-size: 0.8rem;
  font-weight: 700;
}
.ag-dk-badge.warn { background: #FEF3C7; color: #78350F; }
.ag-dk-quadrant { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ag-dk-quadrant > * {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  background: #FFFAF0;
  color: #1E293B;
  font-size: 0.82rem;
  text-align: center;
}
.ag-dk-quadrant > [data-active="true"] { background: #0F766E; border-color: #0F766E; color: #FFFFFF; font-weight: 700; }
.ag-dk-svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #FFFDF7;
}
.ag-dk-table-wrap { max-width: 100%; overflow-x: auto; margin-top: 10px; }
.ag-dk-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.ag-dk-table caption { text-align: left; font-weight: 700; padding-bottom: 6px; }
.ag-dk-table th, .ag-dk-table td { padding: 6px 8px; border-bottom: 1px solid #E2E8F0; text-align: left; }
.ag-dk-table th { background: #F1F5F9; color: #1E293B; }
.ag-dk-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ag-dk-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #FFFFFF;
}
.ag-dk-turn.active { background: #DBEAFE; border-color: #1D4ED8; }
.ag-dk-flashcard { width: 100%; min-height: 88px; text-align: left; }
.ag-dk-flashcard[aria-pressed="true"] { background: #1D4ED8; color: #FFFFFF; }
.ag-dk-media-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; margin-top: 8px; }
.ag-dk-media-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }
.ag-dk-drawer > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
}
.ag-dk-steps { margin: 8px 0 0; padding-left: 20px; }
.ag-dk-paper {
  margin-top: 10px;
  padding: 16px;
  border: 1px solid #94A3B8;
  border-radius: 8px;
  background: #FFFFFF;
  color: #111827;
}
.ag-dk-paper-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.1rem; font-weight: 700; }
.ag-dk-qr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border: 2px dashed #475569;
  color: #475569;
  font-size: 0.72rem;
  text-align: center;
}
.ag-dk-qr svg { width: 96px; height: 96px; }
.ag-dk-status { min-height: 1.4em; margin: 6px 0 0; font-size: 0.86rem; color: #1E293B; }
#petCompanionBadge[role="button"] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
}
#agMockPaperPrintRoot { display: none; }

@media (max-width: 768px) {
  .ag-dk-grid { grid-template-columns: 1fr; }
  .ag-dk-row > .ag-dk-input, .ag-dk-row > .ag-dk-btn { flex: 1 1 100%; }
  input[type="number"].ag-dk-input { width: 100%; }
  .ag-dk-mount { padding: 10px; }
}

@media print {
  body.ag-dk-printing > :not(#agMockPaperPrintRoot) { display: none !important; }
  body.ag-dk-printing #agMockPaperPrintRoot { display: block; }
  body.ag-dk-printing .ag-dk-paper { border: 0; }
}
