/* Shared viewport shell. Each analysis owns its own internal layout below. */
dialog.notebook-fullscreen {
  --panel-accent: #376d9b;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #f3f6fa;
  box-shadow: none;
}
#player-retention-panel { --panel-accent: #7756a5; }
#achievement-rates-panel { --panel-accent: #916727; }
.notebook-fullscreen[open] { display: flex; flex-direction: column; }
.notebook-fullscreen > .notebook-fullscreen-header {
  flex: 0 0 auto;
  min-height: 60px;
  gap: 10px 20px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  border-top: 3px solid var(--panel-accent);
  border-bottom: 1px solid #dce5ee;
  background: #fff;
  color: #243b53;
}
.notebook-fullscreen-header h2 { margin: 0; font-size: 20px; font-weight: 750; }
.notebook-fullscreen-header button, .notebook-fullscreen-header select { min-height: 34px; border-radius: 6px; font-size: 12px; }
.notebook-fullscreen :is(#player-retention-refresh, #achievement-rates-refresh, [data-workshop-refresh]) { background: var(--panel-accent); border-color: var(--panel-accent); color: #fff; }
.notebook-fullscreen > .notebook-fullscreen-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left));
  overflow: hidden;
}
/* ID bodies override their component's earlier padding/min-height rules. */
.notebook-fullscreen :is(#player-retention-body, #achievement-rates-body) { min-height: 0; padding: 14px 16px; overflow: hidden; }
.notebook-fullscreen :is(.player-retention-table, .achievement-rates-table, .workshop-history-scroll) { background: #fff; border: 1px solid #dce5ee; border-radius: 8px; scrollbar-width: thin; }
.notebook-fullscreen :is(.player-retention-table, .achievement-rates-table) caption { display: none; }
.notebook-fullscreen :is(.player-retention-table, .achievement-rates-table, .workshop-history-scroll) thead th { position: sticky; top: 0; z-index: 2; background: #edf2f8; color: #526a84; }

/* Retention: total + four rates above an independently scrolling cohort table. */
.notebook-fullscreen .player-retention-content { height: 100%; min-height: 0; display: grid; grid-template-columns: 180px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
.notebook-fullscreen .player-retention-user-total { margin: 0; padding: 14px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 5px; border: 1px solid #ded6eb; border-radius: 10px; background: #f3eef9; color: #645578; }
.notebook-fullscreen .player-retention-user-total strong { font-size: 32px; color: #62468a; }
.notebook-fullscreen .player-retention-metrics { margin: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.notebook-fullscreen .player-retention-metric { padding: 14px; border-top: 3px solid #b4a1cf; background: #fff; }
.notebook-fullscreen .player-retention-metric h4 { font-size: 14px; }
.notebook-fullscreen .player-retention-metric p { font-size: 13px; }
.notebook-fullscreen .player-retention-reference { font-size: 12px; }
.notebook-fullscreen .player-retention-rate { font-size: 32px; color: #344f72; }
.notebook-fullscreen .player-retention-table { grid-column: 1 / -1; min-height: 0; overflow: auto; }
.notebook-fullscreen .player-retention-table table { border-collapse: separate; border-spacing: 0; font-size: 15px; }
.notebook-fullscreen .player-retention-table th, .notebook-fullscreen .player-retention-table td { padding: 12px 14px; }
.notebook-fullscreen .player-retention-table thead th { font-size: 13px; }
.notebook-fullscreen .player-retention-table small { font-size: 12px; }
.notebook-fullscreen .player-retention-forecast { cursor: help; }
.notebook-fullscreen .player-retention-forecast:focus-visible { outline: 2px solid #8b489a; outline-offset: -2px; }
#player-retention-panel .hover-info { font-size: 14px; }
.notebook-fullscreen .player-retention-table tfoot { position: sticky; bottom: 0; background: #edf2f8; z-index: 1; }

/* Match the game's reward collection; the cards themselves carry the rates. */
dialog#achievement-rates-panel { background: #101d28; }
.notebook-fullscreen #achievement-rates-body { overflow: auto; padding: 20px 18px; }
.notebook-fullscreen .achievement-rates-content { height: auto; min-height: 0; display: grid; gap: 28px; }

/* Workshop: four charts beside the history/editor, using the entire viewport. */
.notebook-fullscreen .workshop-growth-body { display: flex; flex-direction: column; gap: 12px; }
.workshop-overview-bar { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12px; color: #63788e; }
.notebook-fullscreen .workshop-registration { margin: 0; gap: 8px; }
.notebook-fullscreen .workshop-registration strong { color: #376d9b; font-size: 22px; }
.workshop-workspace { display: grid; flex: 1 1 auto; min-height: 0; grid-template-columns: minmax(0, 2fr) minmax(390px, 1fr); gap: 14px; }
.notebook-fullscreen .workshop-growth-plots { min-height: 0; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.notebook-fullscreen .workshop-growth-plots > section { min-height: 0; display: flex; flex-direction: column; padding: 12px; border: 1px solid #dce5ee; border-top: 3px solid var(--workshop-color); border-radius: 9px; background: #fff; }
.notebook-fullscreen .workshop-metric-heading strong { color: var(--workshop-color); font-size: 28px; font-variant-numeric: tabular-nums; }
.notebook-fullscreen .workshop-chart { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; }
.notebook-fullscreen .workshop-chart svg { max-height: 100%; height: auto; }
.workshop-history-panel { min-height: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid #dce5ee; border-radius: 9px; background: #fff; }
.workshop-history-panel > h3 { margin: 0; padding: 12px; font-size: 14px; color: #344f72; border-bottom: 1px solid #dce5ee; }
.notebook-fullscreen .workshop-history-scroll { flex: 1 1 auto; min-height: 0; border: 0; border-radius: 0; overflow: auto; }
.notebook-fullscreen .workshop-history-scroll table { min-width: 540px; font-size: 15px; }
.notebook-fullscreen .workshop-history-scroll thead th { font-size: 13px; }
.notebook-fullscreen .workshop-history-scroll th, .notebook-fullscreen .workshop-history-scroll td { padding: 12px; }
.notebook-fullscreen .workshop-edit { margin: 8px; padding: 10px; flex: 0 0 auto; max-height: 55dvh; overflow: auto; }
.notebook-fullscreen .workshop-edit-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.notebook-fullscreen .workshop-edit-fields label:first-child { grid-column: 1 / -1; }
@media (max-width: 1400px) {
  .notebook-fullscreen .player-retention-content { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
  .notebook-fullscreen .player-retention-user-total { flex-direction: row; align-items: baseline; justify-content: flex-start; padding: 8px 12px; }
  .notebook-fullscreen .workshop-growth-body { overflow: auto; }
  .workshop-workspace { display: flex; flex-direction: column; flex: none; }
  .notebook-fullscreen .workshop-growth-plots { grid-template-rows: none; }
  .workshop-history-panel { min-height: 300px; max-height: 65dvh; }
}
@media (max-width: 700px), (max-height: 560px) {
  .notebook-fullscreen > .notebook-fullscreen-header { padding: 8px 10px; min-height: 54px; }
  .notebook-fullscreen-header h2 { font-size: 17px; }
  .notebook-fullscreen-header button, .notebook-fullscreen-header select { min-height: 44px; }
  .notebook-fullscreen > .notebook-fullscreen-body,
  .notebook-fullscreen :is(#player-retention-body, #achievement-rates-body) { padding: 10px; overflow: auto; }
  .notebook-fullscreen .player-retention-content { height: auto; display: flex; flex-direction: column; }
  .notebook-fullscreen .player-retention-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .notebook-fullscreen .player-retention-metric { padding: 10px; }
  .notebook-fullscreen .player-retention-rate { font-size: 26px; }
  .notebook-fullscreen .achievement-rates-content { height: auto; }
  .notebook-fullscreen .workshop-growth-body { overflow: auto; }
  .workshop-workspace { display: flex; flex-direction: column; flex: none; }
  .notebook-fullscreen .workshop-growth-plots { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
}
