/* Jugami School /account/ pages. Own look: warm paper, navy ink, coral accent. */
:root {
  --paper: #fffaf0; --card: #ffffff; --ink: #1d2a44; --muted: #5a6478; --line: #e6dccb;
  --accent: #c2412b; --accent-dark: #a33522;   /* white text: 5.14:1 / 6.80:1 */ --sky: #2b6cb0; --sun: #f2c618; --good: #2f7d4f; --bad: #b42318;
  --radius: 16px; --shadow: 0 2px 0 rgba(29,42,68,.06), 0 8px 24px rgba(29,42,68,.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ja-accent: var(--accent); --ja-accent-hover: var(--accent-dark); --ja-ink: var(--ink);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 var(--font); }
a { color: var(--sky); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6em 1em; z-index: 99; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 560px; }

.site-head { background: var(--ink); color: #fff; }
/* 44px touch targets for header/footer links (the pages use .site-head/.site-foot) */
.site-header a, .site-head a, .site-foot a, footer a { display: inline-flex; align-items: center; min-height: 44px; }
.site-head .bar { display: flex; align-items: center; gap: 1rem; min-height: 64px; flex-wrap: wrap; padding-block: 8px; }
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.2rem; display: inline-flex; align-items: center; gap: .5rem; }
.brand .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--sun); box-shadow: 10px 0 0 var(--accent); margin-right: 12px; }
.head-nav { display: flex; gap: .25rem; }
.head-nav a { color: #fff; text-decoration: none; padding: .35em .7em; border-radius: 999px; }
.head-nav a:hover, .head-nav a[aria-current] { background: rgba(255,255,255,.12); }
.site-head .ja-widget a, .site-head .ja-widget button { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.site-head .ja-widget .ja-primary { background: var(--accent); border-color: transparent; }
.site-head .ja-widget .ja-primary:hover { background: var(--accent-dark); filter: none; }

main { padding: 32px 0 56px; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.15; margin: 0 0 .4em; }
h2 { font-size: 1.3rem; margin: 0 0 .6em; }
h3 { font-size: 1.08rem; margin: 0 0 .3em; }
.lede { color: var(--muted); margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
[hidden] { display: none !important; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin: 0 0 20px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.notice { border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; background: #fff4d6; border: 1px solid #f0d58a; }
.notice.bad { background: #fdecea; border-color: #f4b8b0; color: var(--bad); }
.notice.good { background: #e7f5ec; border-color: #a9d8b9; color: var(--good); }
.draft-banner { background: var(--sun); color: #2b2100; font-weight: 700; text-align: center; padding: 10px 16px; }

/* Forms */
form { margin: 0; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .9rem; margin-top: 2px; }
input[type=text], input[type=email], input[type=password], input[type=number], select {
  width: 100%; font: inherit; padding: .65em .8em; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
/* Solid focus ring (no faint shadow): 2px border + 2px outline in the same colour. */
input:focus, select:focus, input:focus-visible, select:focus-visible { border-color: var(--sky); outline: 2px solid var(--sky); outline-offset: 0; box-shadow: none; }
/* Show/hide toggle next to password and PIN fields */
.pw-wrap { display: flex; gap: 8px; align-items: stretch; }
.pw-wrap input { flex: 1 1 auto; min-width: 0; }
.pw-toggle { flex: none; min-width: 44px; min-height: 44px; padding: 0 .9em; font: inherit; font-weight: 700; font-size: .95rem;
  border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer; }
.pw-toggle:hover { background: #f6efe2; }
.pw-toggle[aria-pressed=true] { background: #fff4d6; border-color: #f0d58a; }
.kid-panel .pin-wrap { max-width: 340px; margin: 0 auto; }
.kid-panel .pin-wrap .pin-input { margin: 0; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 14px 0 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.radios { display: flex; gap: 1rem; flex-wrap: wrap; }
.radios label { display: flex; gap: .4rem; align-items: center; font-weight: 400; margin: 0; }
.btn, button.btn { font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 46px; padding: .6em 1.3em; border-radius: 999px; border: 2px solid transparent; cursor: pointer;
  background: var(--accent); color: #fff; text-decoration: none; }
.btn:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: #f6efe2; }
.btn.danger { background: var(--bad); }
.btn.small { min-height: 36px; padding: .3em .9em; font-size: .92rem; font-weight: 600; }
.btn[disabled] { opacity: .6; cursor: progress; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.err { color: var(--bad); font-weight: 600; margin: 10px 0 0; min-height: 1.2em; }

/* Tabs */
.tabs { display: flex; gap: 6px; background: #f3ead9; padding: 6px; border-radius: 999px; margin: 0 0 18px; }
.tabs [role=tab] { flex: 1; font: inherit; font-weight: 700; border: 0; background: transparent; color: var(--ink);
  padding: .6em 1em; border-radius: 999px; cursor: pointer; min-height: 46px; }
.tabs [role=tab][aria-selected=true] { background: #fff; box-shadow: var(--shadow); }

/* Kid login */
.kid-panel { text-align: center; }
.kid-panel input#kid-username { font-size: 1.5rem; text-align: center; letter-spacing: .02em; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 16px 0 8px; }
.pin-dots span { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--ink); }
.pin-dots span.on { background: var(--ink); }
.pin-dots span.digit { background: #fff; color: var(--ink); font-weight: 800; font-size: 1rem; line-height: 16px; text-align: center; width: auto; min-width: 22px; border-radius: 8px; padding: 0 2px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 10px auto 0; }
.keypad button { font: 700 1.7rem/1 var(--font); min-height: 68px; border-radius: 18px; border: 2px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; }
.keypad button:active { transform: scale(.96); background: #fff4d6; }
.keypad .go { background: var(--good); color: #fff; border-color: transparent; font-size: 1.3rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kid-panel .pin-input { max-width: 220px; margin: 0 auto; font-size: 1.4rem; text-align: center; letter-spacing: .4em; }

/* Choice cards (signup) */
.choices { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.choice { text-align: left; font: inherit; color: inherit; background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 20px; cursor: pointer; box-shadow: var(--shadow); }
.choice:hover { border-color: var(--accent); }
.choice .big { font-size: 2rem; display: block; margin-bottom: 6px; }

/* Dashboard */
.kid-switch { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.kid-switch [role=tab] { font: inherit; font-weight: 700; border: 2px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: .45em 1.1em; cursor: pointer; min-height: 44px; }
.kid-switch [role=tab][aria-selected=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.resume { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: linear-gradient(135deg, #fff4d6, #ffe3dc); border-color: #f3cdb8; }
.resume .grow { flex: 1 1 260px; }
.course { padding: 18px; }
.course header { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .15em .6em;
  border-radius: 999px; background: #eef3fb; color: var(--sky); }
.tag.elementary { background: #fff4d6; color: #8a6500; } .tag.middle { background: #e7f5ec; color: var(--good); } .tag.high { background: #eef3fb; color: var(--sky); }
.bar-outer { height: 14px; border-radius: 999px; background: #f0e8da; overflow: hidden; margin: 10px 0 6px; }
.bar-inner { height: 100%; background: linear-gradient(90deg, var(--good), #48a56e); border-radius: 999px; min-width: 0; transition: width .4s; }
.units { list-style: none; padding: 0; margin: 10px 0 0; }
.units li { display: flex; gap: .55rem; align-items: baseline; padding: 4px 0; }
.units .mark { width: 1.3em; text-align: center; flex: none; }
.kid-admin { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-scroll { overflow-x: auto; }
dialog { border: 0; border-radius: var(--radius); padding: 24px; max-width: 460px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--ink); }
dialog::backdrop { background: rgba(29,42,68,.45); }

/* Prose (privacy) */
.prose h2 { margin-top: 1.6em; } .prose li { margin: .3em 0; }

.site-foot { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: .92rem; }
.jugami-more { display: flex; gap: 1rem; flex-wrap: wrap; }
.jugami-more a { color: var(--ink); }
@media (max-width: 560px) { .card { padding: 18px; } .head-nav { display: none; } }
@media (prefers-reduced-motion: reduce) { .bar-inner { transition: none; } }

/* 005: parent child cards, quiz tables, attempt drill-down */
.kid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0 0 16px; }
.kid-card { text-align: left; font: inherit; color: inherit; cursor: pointer; min-height: 44px; border: 1px solid #8a93a6; }
.kid-card:hover { border-color: #c2412b; }
.kid-card:focus-visible { outline: 3px solid #c2412b; outline-offset: 2px; }
.kid-card-name { display: block; font-size: 1.1em; }
.kid-stats { display: grid; grid-template-columns: auto auto; gap: 2px 12px; margin: 8px 0 0; font-size: 15px; }
.kid-stats dt { color: #3d4760; } .kid-stats dd { margin: 0; font-weight: 600; text-align: right; }
.quiz-table { width: 100%; border-collapse: collapse; }
.quiz-table th, .quiz-table td { padding: 8px; border-bottom: 1px solid #d5d9e2; text-align: left; vertical-align: middle; }
.quiz-table .btn.small { min-height: 44px; }
.quiz-table select { min-height: 44px; font: inherit; }
.attempt-detail { padding-left: 1.4em; overflow-wrap: anywhere; }
.attempt-detail li { margin: 0 0 10px; padding-left: 8px; border-left: 4px solid #8a93a6; }
.attempt-detail li[data-correct="yes"] { border-color: #1f6b3f; }
.attempt-detail li[data-correct="no"] { border-color: #a33522; }
.q-prompt { margin: 0; font-weight: 600; }

/* Mandy r2: phones get stacked quiz cards (label: value) and a wrapping attempt
   panel, so nothing scrolls sideways or starts off-screen. */
.quiz-table select { max-width: 100%; }
@media (max-width: 600px) {
  .quiz-course .table-scroll { overflow-x: visible; }
  .quiz-table, .quiz-table tbody, .quiz-table tr, .quiz-table th, .quiz-table td { display: block; width: 100%; box-sizing: border-box; min-width: 0; }
  .quiz-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .quiz-table tbody > tr:not(.qt-detail) { padding: 8px 0; border-bottom: 1px solid #d5d9e2; }
  .quiz-table th, .quiz-table td { border: 0; padding: 4px 0; overflow-wrap: anywhere; }
  .quiz-table th[data-label] { font-size: 1.05em; }
  .quiz-table td[data-label] { display: flex; gap: 12px; justify-content: space-between; }
  .quiz-table td[data-label]::before { content: attr(data-label) ":"; font-weight: 600; color: #3d4760; flex: none; }
  .quiz-table td.qt-act { padding-top: 8px; }
  .quiz-table tr.qt-detail[hidden] { display: none; }
  .quiz-table tr.qt-detail > td { padding: 8px 0 12px; }
  .quiz-table select { width: 100%; }
  .attempt-detail { padding-left: 1.2em; margin: 8px 0 0; }
  .attempt-detail p { overflow-wrap: anywhere; }
}

/* 006 answer keys */
#keys-section .keys-course { font-size: 1rem; margin: 16px 0 6px; }
.keys-rows { list-style: none; margin: 0; padding: 0; }
.keys-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid #e3e6ec; }
.keys-row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.keys-row .btn { min-height: 44px; flex: none; }

/* v6: parent dashboard side menu (only shown for parents; .has-nav set by pages.js) */
.dash-sec h2:focus { outline: none; } .dash-sec h2:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dash.has-nav { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
.dash.has-nav .dash-off { display: none; }
.dash-nav { position: sticky; top: 16px; }
.dash-nav ul { list-style: none; margin: 0; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.dash-nav a { display: flex; align-items: center; min-height: 44px; padding: .4em .9em; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.dash-nav a:hover { background: #f6efe2; }
.dash-nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.kid-admin .btn.small { min-height: 44px; }
.kid-admin .grow { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .dash.has-nav { display: block; }
  .dash-nav { position: sticky; top: 0; z-index: 5; margin: 0 -20px 16px; background: var(--paper); padding: 6px 0; }
  .dash-nav ul { display: flex; gap: 6px; overflow-x: auto; padding: 4px 20px; border: 0; border-radius: 0; box-shadow: none; background: transparent; scrollbar-width: thin; }
  .dash-nav li { flex: none; }
  .dash-nav a { white-space: nowrap; border: 2px solid var(--line); background: #fff; border-radius: 999px; }
}
.dash.has-nav .btn.small { min-height: 44px; }
