/* The parents' dashboard. Built on the design system's tokens in ../assets/base.css; the layout
   follows the canvas board "Panel para madres y padres". One filled primary button per view
   (UI_CONTROLS.md): sign in, accept, add. Everything else is outlined or a link. */

.p-body { background: #f7f8fa; }

/* Header */
.p-top { background: #ffffff; border-bottom: 2px solid var(--line); } /* not .p-bar: that is a chart bar (below) */
.p-bar-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; max-width: 1120px; min-height: 64px; margin: 0 auto; padding: 8px 32px; }
.p-brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.p-logo { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: 0.04em; }
.p-logo a { color: inherit; text-decoration: none; } /* the name leads home */
.p-bar-sub { margin: 0; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.p-bar-end { display: flex; align-items: center; gap: 12px; }
/* The language link: the same quiet pill as the site's header links (base.css .top-link). */
.p-lang { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 12px; border: 2px solid var(--line-2); border-radius: 999px; background: #ffffff; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1; text-decoration: none; }
.p-lang:hover { border-color: var(--ink); }
.p-account { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; }

/* Page */
.p-main { display: flex; flex-direction: column; gap: 24px; max-width: 1120px; margin: 0 auto; padding: 28px 32px 48px; }
.p-main p { margin: 0; }
.p-loading { color: var(--ink-2); }
.p-h1 { margin: 0; font-size: 30px; line-height: 1.2; font-weight: 700; text-wrap: balance; }
.p-h1:focus { outline: none; }
.p-h2 { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 700; }
.p-lead { font-size: 18px; line-height: 1.55; }
.p-sub, .p-sub2 { font-size: 15px; color: var(--ink-2); }
.p-sub2 { margin-top: 4px !important; }
.p-small { font-size: 14px; color: var(--ink-2); }
.p-empty { color: var(--ink-2); font-size: 15px; }
.p-sample { display: inline-block; margin: 0 0 6px !important; padding: 2px 10px; border: 2px dashed var(--line-2); border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); }

/* Narrow views: signed out, consent, the first child */
.p-narrow { display: flex; flex-direction: column; gap: 18px; max-width: 620px; }
.p-points { margin: 0; padding-left: 22px; }
.p-points li { margin-bottom: 6px; }
.p-cta { width: auto; align-self: flex-start; padding: 0 28px; }
.p-cta[aria-disabled="true"] { background: var(--off); color: var(--off-ink); box-shadow: 0 4px 0 var(--off-edge); cursor: not-allowed; }
.p-cta-inline { width: auto; padding: 0 24px; }
.p-terms { margin: 0; padding: 18px 20px; border: 2px solid var(--line); border-radius: 20px; background: #ffffff; }
.p-terms dt { font-weight: 700; }
.p-terms dd { margin: 2px 0 14px; color: var(--ink); }
.p-terms dd:last-child { margin-bottom: 0; }
.p-check { display: flex; align-items: flex-start; gap: 12px; font-size: 16px; cursor: pointer; }
.p-check input { flex-shrink: 0; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--lead); }

/* Forms */
.p-form { display: flex; flex-direction: column; gap: 18px; }
.p-field { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; }
.p-field label, .p-field legend { font-weight: 600; }
.p-field input[type="text"], .p-field input:not([type]) { min-height: 52px; padding: 0 14px; border: 2px solid var(--line-2); border-radius: 14px; font: inherit; }
.p-hint { font-size: 14px; color: var(--ink-2); }
.p-chips { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.p-chips legend { width: 100%; margin-bottom: 6px; }
.p-chips label { position: relative; }
.p-chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.p-chips span { display: flex; align-items: center; min-height: 44px; padding: 0 16px; border: 2px solid var(--line-2); border-radius: 22px; background: #ffffff; font-weight: 500; }
.p-chips input:checked + span { border-color: var(--ink); background: var(--ink); color: #ffffff; font-weight: 600; }
.p-chips input:focus-visible + span { outline: 3px solid var(--lead); outline-offset: 3px; }
.p-error { color: var(--warn); font-weight: 600; }
.p-code-input { max-width: 260px; min-height: 64px !important; font-family: var(--font-display); font-size: 30px !important; letter-spacing: 0.2em; text-transform: uppercase; }

/* Title row: name, children tabs, add */
.p-titlebar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.p-kids { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.p-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--off); }
.p-tabs button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; background: transparent; font-size: 15px; font-weight: 500; transition: background-color var(--t-fast) var(--ease); }
.p-tabs button[aria-selected="true"] { background: #ffffff; box-shadow: 0 2px 0 var(--off-edge); font-weight: 700; }
.p-outline { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 2px solid var(--line-2); border-radius: 14px; background: #ffffff; font-size: 15px; font-weight: 600; }
.p-outline:hover { border-color: var(--ink); }

/* Tiles */
.p-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 16px; }
.p-tile { padding: 18px 20px; border: 2px solid var(--line); border-radius: 20px; background: #ffffff; }
.p-tile-label { margin-bottom: 8px !important; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.p-tile-value { display: flex; align-items: baseline; gap: 8px; }
.p-num { font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.p-unit { font-size: 15px; color: var(--ink-2); }
.p-tile-note { margin-top: 8px !important; font-size: 14px; color: var(--ink-2); }

/* Panels */
.p-row { display: flex; flex-wrap: wrap; gap: 16px; }
.p-panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 20px 24px 22px; border: 2px solid var(--line); border-radius: 20px; background: #ffffff; }
.p-wide { flex: 999 1 560px; }
.p-narrowcol { flex: 1 1 300px; }
.p-half { flex: 1 1 400px; }
.p-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.p-seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--off); }
.p-seg-btn { min-height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; font-size: 14px; font-weight: 500; }
.p-seg-btn[aria-pressed="true"] { background: #ffffff; box-shadow: 0 2px 0 var(--off-edge); font-weight: 700; }

/* Minutes per week: one series, cobalt bars with 4px rounded tops on the baseline */
.p-chart { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 200px auto; column-gap: 10px; row-gap: 8px; }
.p-yaxis { display: flex; flex-direction: column; justify-content: space-between; height: 200px; font-size: 12px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.p-yaxis span { line-height: 0; }
.p-plot { position: relative; height: 200px; }
.p-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; }
.p-grid i { display: block; height: 1px; background: var(--line); }
.p-grid i:last-child { height: 2px; background: var(--line-2); }
.p-bars { position: absolute; inset: 0 0 2px 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; }
.p-bar { display: flex; align-items: flex-end; justify-content: center; height: 100%; padding: 0; border: 0; background: transparent; cursor: default; }
.p-bar span { display: block; width: min(60%, 44px); border-radius: 4px 4px 0 0; background: var(--lead); transition: background-color var(--t-fast) var(--ease); }
.p-bar:hover span, .p-bar:focus-visible span { background: var(--lead-edge); }
.p-bar:focus-visible { outline-offset: -3px; }
.p-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 10px; background: var(--ink); color: #ffffff; font-size: 13px; font-weight: 600; white-space: nowrap; pointer-events: none; }
.p-xaxis { grid-column: 2; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); font-size: 12px; color: var(--ink-2); text-align: center; }
.p-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.p-table th, .p-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.p-table th { font-size: 13px; font-weight: 600; color: var(--ink-2); }

/* Missions by science: one hue for magnitude; the science's colour only as a swatch */
.p-sci { display: flex; flex-direction: column; gap: 10px; }
.p-sci-row { display: grid; grid-template-columns: 112px 1fr 28px; align-items: center; gap: 10px; }
.p-sci-name { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.p-sci-name i { width: 12px; height: 12px; flex-shrink: 0; border-radius: 50%; background: var(--sci); box-shadow: inset 0 0 0 1px rgba(18, 23, 43, 0.25); }
.p-sci-track { height: 14px; border-radius: 7px; background: var(--off); overflow: hidden; }
.p-sci-track span { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--lead); }
.p-sci-v { font-size: 14px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* What they found */
.p-found { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); }
.p-found-m { font-weight: 700; }
.p-found-meta { font-size: 14px; color: var(--ink-2); }
.p-k { font-weight: 600; color: var(--ink-2); }
@media (min-width: 900px) {
  .p-found { grid-template-columns: 260px minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
}

/* To do together, devices */
.p-todo, .p-dev { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.p-todo-name { font-weight: 600; }
.p-todo-meta { font-size: 14px; color: var(--ink-2); }
.p-toggle { flex-shrink: 0; min-height: 44px; padding: 0 14px; border: 2px solid var(--line-2); border-radius: 14px; background: #ffffff; font-size: 14px; font-weight: 600; }
.p-toggle[aria-pressed="true"] { border-color: var(--ink); background: var(--yellow); }
.p-link-btn { min-height: 44px; padding: 0; border: 0; background: none; color: var(--lead); font-size: 15px; font-weight: 600; text-decoration: underline; }
.p-danger { color: var(--warn); }
.p-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.p-pair { padding: 16px 18px; border: 2px solid var(--ink); border-radius: 16px; background: var(--yellow-soft); }
.p-pair-code { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: 0.12em; }
.p-notice { padding: 10px 14px; border-radius: 14px; background: var(--quiet); font-weight: 500; }

/* Privacy line */
.p-privacy { display: flex; flex-direction: column; gap: 6px; padding: 4px 4px 0; font-size: 15px; color: var(--ink-2); }

/* Dialogs */
.p-dialog { width: min(480px, calc(100% - 32px)); padding: 24px; border: 2px solid var(--ink); border-radius: 20px; color: var(--ink); }
.p-dialog::backdrop { background: rgba(18, 23, 43, 0.45); }
.p-dialog form { display: flex; flex-direction: column; gap: 16px; }
.p-dialog p { margin: 0; }
.p-danger-btn { min-height: 48px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--warn); color: #ffffff; font-size: 15px; font-weight: 700; }

@media (max-width: 640px) {
  .p-bar-in, .p-main { padding-left: 16px; padding-right: 16px; }
  .p-num { font-size: 34px; }
  .p-sci-row { grid-template-columns: 96px 1fr 24px; }
}
