/* upload.css — the notes-to-quiz overlay shown from the title picker. */

#upload-overlay { position: fixed; inset: 0; z-index: 12; display: grid; place-items: center; padding: 16px; box-sizing: border-box;
  background: rgba(22, 18, 14, .55); font-family: var(--ui); color: var(--ink); overflow: auto; }
.uo-card { position: relative; box-sizing: border-box; width: min(100%, 440px); max-height: calc(100dvh - 32px); overflow: auto; padding: 22px 18px 18px 50px;
  background: linear-gradient(90deg, transparent 36px, rgba(215, 38, 30, .55) 36px 38px, transparent 38px), var(--paper);
  border: 2.5px solid var(--ink); border-radius: 8px; box-shadow: 0 6px 0 var(--ink), 0 20px 44px rgba(22, 18, 14, .38); }
.uo-card h2 { margin: 0 0 4px; font: 800 26px/1.05 var(--display); }
.uo-sub { margin: 0 0 14px; font: 700 14px/1.4 var(--ui); color: rgba(22, 18, 14, .66); }
.uo-hint { margin: 6px 0 0; font-size: 12.5px; }
.uo-quota { margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; background: rgba(244, 197, 66, .25); font: 800 13px/1.35 var(--ui); }
.uo-paywall-actions { display: grid; gap: 10px; margin-top: 18px; }
/* A pinned-note heads-up: pencil yellow, so it reads before they pick a big file. */
.uo-note { margin: 8px 0 0; padding: 8px 10px; background: #fff3c4; border: 2px solid rgba(22, 18, 14, .25); border-left: 4px solid var(--pencil);
  border-radius: 8px; font: 700 13px/1.4 var(--ui); color: rgba(22, 18, 14, .78); }
.uo-note b { color: var(--ink); }
.uo-label { display: block; margin: 12px 0 5px; font: 800 11px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--red-ink); }
.uo-input, .uo-textarea, .uo-file { box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px 12px; background: #fffdf6; color: var(--ink);
  border: 2px solid rgba(22, 18, 14, .35); border-radius: 10px; font: 700 16px/1.3 var(--ui); }
.uo-textarea { min-height: 120px; resize: vertical; }
.uo-input:focus, .uo-textarea:focus, .uo-file:focus { outline: 3px solid var(--uniform-blue); outline-offset: 2px; border-color: var(--ink); }
.uo-file::-webkit-file-upload-button { margin-right: 10px; padding: 6px 12px; background: var(--paper); border: 2px solid var(--ink); border-radius: 8px; font: 800 14px var(--ui); }
.uo-source-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.uo-source-tab { min-height: 40px; background: #fffdf6; border: 2px solid rgba(22, 18, 14, .3); border-radius: 10px; font: 800 14px var(--ui); color: var(--ink); cursor: pointer; }
.uo-source-tab.uo-source-active { border-color: var(--ink); background: #fff3c4; box-shadow: 0 0 0 3px var(--pencil); }
.uo-status { min-height: 1.4em; margin-top: 10px; font: 800 14px/1.4 var(--ui); }
.uo-err { color: var(--red-ink); }
.uo-info { color: rgba(22, 18, 14, .7); }
.uo-ok { color: #11804a; }
.uo-buttons { display: flex; gap: 10px; margin-top: 16px; }
.uo-btn { flex: 1; min-height: 52px; border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: 0 3px 0 var(--ink); font: 800 17px/1 var(--ui); color: var(--ink); cursor: pointer; }
.uo-btn:active { translate: 0 2px; box-shadow: 0 1px 0 var(--ink); }
.uo-btn:focus-visible { outline: 3px solid var(--uniform-blue); outline-offset: 3px; }
.uo-cancel { background: var(--paper); }
.uo-go, .uo-play { background: var(--pencil); }
.uo-go:disabled { opacity: .5; cursor: progress; }
.uo-loading { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 0 6px; text-align: center; }
.uo-percent { font: 800 40px/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
/* The wooden ruler, like Play on the title: it fills as the quiz is built. */
.uo-bar { position: relative; height: 22px; overflow: hidden; background: #fffdf6; border: 2.5px solid var(--ink); border-radius: 8px; }
.uo-bar span { position: absolute; inset: 0 auto 0 0; width: 0; transition: width .25s ease;
  background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(22, 18, 14, .4) 9px 10.5px) bottom / 100% 7px no-repeat, linear-gradient(180deg, var(--wood-a), var(--wood-b)); }
@media (prefers-reduced-motion: reduce) { .uo-bar span { transition: none; } }

/* Account and saved-note panel, styled like the same paper UI as uploads. */
.account-overlay { position: fixed; inset: 0; z-index: 14; display: grid; place-items: center; padding: 16px; box-sizing: border-box; font-family: var(--ui); color: var(--ink); }
.account-backdrop { position: absolute; inset: 0; background: rgba(22, 18, 14, .62); }
.account-card { position: relative; box-sizing: border-box; width: min(100%, 560px); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px; box-shadow: 0 6px 0 var(--ink), 0 20px 44px rgba(22, 18, 14, .38); }
.account-card h2 { margin: 0 38px 14px 0; font: 800 26px/1.1 var(--display); }
.account-close { position: absolute; top: 10px; right: 12px; width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 50%; background: #fffdf6; font: 800 24px/1 var(--ui); cursor: pointer; }
.account-content { display: grid; gap: 12px; }
.account-message, .account-email, .account-balance { margin: 0; font: 700 14px/1.45 var(--ui); }
.account-balance { padding: 9px 12px; border-radius: 8px; background: rgba(244, 197, 66, .25); }
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.account-button, .account-small-button { min-height: 38px; padding: 7px 12px; border: 2px solid var(--ink); border-radius: 9px; background: var(--pencil); color: var(--ink); font: 800 13px var(--ui); cursor: pointer; }
.account-secondary { background: #fffdf6; }
.account-danger { background: #ffe4dc; }
.account-notes h3 { margin: 8px 0; font: 800 18px/1.1 var(--display); }
.account-note-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 6px; align-items: center; padding: 9px 0; border-top: 1px solid rgba(22, 18, 14, .25); }
.account-note-detail { min-width: 0; display: grid; gap: 3px; }
.account-note-detail b { overflow-wrap: anywhere; font: 800 14px/1.25 var(--ui); }
.account-note-detail small { color: rgba(22, 18, 14, .65); font: 700 11px/1.25 var(--ui); }
.account-small-button { min-height: 34px; padding: 5px 9px; }
.account-auth { min-height: 180px; }
.account-card.is-auth { width: min(100%, 420px); }
.account-hint { display: grid; gap: 10px; padding: 12px; border: 2px solid var(--ink); border-radius: 10px; background: rgba(244, 197, 66, .28); }
.account-hint[hidden] { display: none; }
.account-hint-text { margin: 0; font: 800 15px/1.3 var(--ui); }
.account-hint .account-button { width: 100%; min-height: 44px; font-size: 15px; }
/* Clerk's card is a fixed ~400px frame with its own header. Inside our paper card that read as a
   card in a card, left-aligned, repeating the title. Let it fill and drop its frame and header. */
:is(.account-content, .mode-signup) .cl-rootBox { width: 100% !important; }
:is(.account-content, .mode-signup) .cl-cardBox { width: 100% !important; max-width: none !important; border: 0 !important; background: transparent !important; box-shadow: none !important; overflow: visible !important; }
:is(.account-content, .mode-signup) .cl-card { gap: 20px !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; overflow: visible !important; }
:is(.account-content, .mode-signup) .cl-header { display: none !important; }
:is(.account-content, .mode-signup) .cl-main { gap: 18px !important; overflow: visible !important; }
:is(.account-content, .mode-signup) .cl-socialButtons { padding: 3px 0 !important; }
:is(.account-content, .mode-signup) .cl-footer { background: transparent !important; }
/* The form is one job: type your email, get a code. Bold label, one big field, one button in the game's own style. */
:is(.account-content, .mode-signup) .cl-formFieldLabel { color: var(--ink) !important; font: 900 18px/1.2 var(--ui) !important; }
:is(.account-content, .mode-signup) .cl-formFieldInput { min-height: 52px !important; border: 2px solid var(--ink) !important; border-radius: 10px !important; background: #fffdf6 !important; box-shadow: none !important; color: var(--ink) !important; font: 700 17px var(--ui) !important; }
:is(.account-content, .mode-signup) .cl-formFieldInput:focus { outline: 3px solid rgba(244, 197, 66, .8) !important; outline-offset: 1px !important; }
:is(.account-content, .mode-signup) .cl-formButtonPrimary { min-height: 52px !important; border: 2px solid var(--ink) !important; border-radius: 10px !important; background: var(--pencil) !important; box-shadow: 0 3px 0 var(--ink) !important; color: var(--ink) !important; font: 900 17px var(--ui) !important; text-transform: none !important; }
:is(.account-content, .mode-signup) .cl-formButtonPrimary:hover { background: var(--pencil) !important; filter: brightness(1.05); }
@media (max-width: 460px) { .account-card { padding: 20px 14px; } .account-note-row { grid-template-columns: minmax(0, 1fr) auto auto; } .account-note-row .account-danger { grid-column: 2 / 4; } }
