/* Phytopardy question sets: board first, side panel editor. Desk palette with the game's board blue. */
.questions-page { margin: 0; min-height: 100svh; background: #f4f5fb; color: #0e1440; font: 400 15px/1.45 Archivo, Arial, sans-serif; }
.questions-page button, .questions-page input, .questions-page textarea, .questions-page select { font: inherit; color: inherit; }
.questions-page :focus-visible { outline: 3px solid #ff7a2b; outline-offset: 2px; }
.q-top { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; gap: 14px; padding: max(6px, env(safe-area-inset-top)) max(clamp(12px, 3vw, 28px), env(safe-area-inset-right)) 6px max(clamp(12px, 3vw, 28px), env(safe-area-inset-left)); background: #08135e; color: #fff; }
.q-brand { display: inline-flex; align-items: center; min-height: 44px; font: 400 24px/1 Anton, Impact, sans-serif; letter-spacing: .02em; color: #ffb365; text-decoration: none; text-transform: uppercase; }
.q-title { font-weight: 800; font-size: 15px; }
.q-back { display: inline-flex; align-items: center; min-height: 44px; margin-left: auto; color: #fff; font-weight: 650; font-size: 14px; }
#questions { max-width: 1600px; margin: 0 auto; padding: 12px clamp(12px, 3vw, 24px) 32px; }
.q-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.q-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border: 1px solid #1d3bc4; border-radius: 8px; background: #fff; color: #1d3bc4; font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.q-btn.primary { background: #1d3bc4; color: #fff; }
.q-btn.quiet { border-color: #d6dbec; color: #0e1440; font-weight: 650; }
.q-btn.danger { border-color: #e3b5b7; color: #a3262b; }
.q-btn.danger-solid { background: #a3262b; border-color: #a3262b; color: #fff; }
.q-btn:hover:not(:disabled) { filter: brightness(.96); }
.q-btn:disabled { opacity: .45; cursor: default; }
.q-status { font-size: 13px; color: #0f5c35; font-weight: 600; }
.q-status[data-state="saving"] { color: #4a5279; }
.q-status[data-state="error"] { color: #a3262b; }
.q-loading { margin: 12px 0 0; color: #4a5279; font-size: 14px; }
.q-skel { border-radius: 10px; background: linear-gradient(90deg, #e6e9f3 0%, #f1f3f9 50%, #e6e9f3 100%); background-size: 200% 100%; animation: q-shimmer 1.2s linear infinite; }
.q-skel-line { height: 56px; margin-bottom: 12px; }
.q-skel-sheet { height: 60svh; }
@keyframes q-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .q-skel { animation: none; } }
.q-menu { position: relative; }
.q-menu > summary { list-style: none; cursor: pointer; }
.q-menu > summary::-webkit-details-marker { display: none; }
.q-menu > summary::after { content: ""; width: 7px; height: 7px; margin-left: 10px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.q-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 9; display: grid; min-width: 250px; max-width: min(380px, calc(100vw - 24px)); padding: 6px; border: 1px solid #d6dbec; border-radius: 12px; background: #fff; box-shadow: 0 14px 36px #0e14402e; }
.q-menu-list > button, .q-menu-list > a, .qe-menu-actions > * { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: #0e1440; font-weight: 650; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.q-menu-list > button:hover, .q-menu-list > a:hover, .qe-menu-actions > *:hover { background: #eef1ff; }
.q-menu-list .danger { margin-top: 4px; border-top: 1px solid #eceef6; border-radius: 0 0 8px 8px; color: #a3262b; }
.qe-switch .q-menu-list { left: 0; right: auto; }
.qe-menu-title { margin: 6px 12px 4px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #4a5279; }
.qe-sets > button { padding: 6px 12px; }
.qe-sets > button span { display: grid; gap: 1px; }
.qe-sets > button small { color: #4a5279; font-size: 12.5px; font-weight: 600; }
.qe-sets > button[aria-current="true"] { background: #e3e9ff; }
.qe-menu-actions { display: grid; margin-top: 4px; padding-top: 4px; border-top: 1px solid #eceef6; }
.qe-menu-actions > * { color: #1d3bc4; }
.qe-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.qe-title { display: grid; flex: 1 1 320px; min-width: 0; }
.qe-title textarea { min-width: 0; min-height: 44px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; font-weight: 800; font-size: 20px; line-height: 1.25; padding-top: 8px; padding-bottom: 8px; resize: none; overflow: clip; }
.qe-title textarea:hover:not(:read-only) { border-color: #d6dbec; background: #fff; }
.qe-title textarea:focus { border-color: #1d3bc4; background: #fff; outline: none; box-shadow: 0 0 0 3px #1d3bc41f; }
.qe-title .q-status { padding-left: 11px; }
.qe-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: #e3e9ff; color: #1f2a66; font-size: 14px; }
.qe-note span { flex: 1 1 260px; }
.qe-summary { margin: 10px 0 8px; font-size: 13.5px; color: #4a5279; }
.qe-ok { color: #0f5c35; font-weight: 700; }
.qe-warn { color: #8a4b00; font-weight: 700; }
.qe-field { display: grid; gap: 4px; }
.qe-field > span { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #3a4270; }
.qe-field textarea { width: 100%; box-sizing: border-box; min-height: 64px; padding: 9px 11px; border: 1px solid #d6dbec; border-radius: 8px; background: #fff; font-size: 16px; line-height: 1.45; resize: none; overflow: clip; }
.qe-field textarea.short { min-height: 48px; overflow: auto; font-size: 14px; }
.qe-field textarea:focus { border-color: #1d3bc4; outline: none; box-shadow: 0 0 0 3px #1d3bc41f; }
.qe-field textarea:read-only { background: #f4f5fb; }
.qe-answer textarea { background: #f5f7ff; color: #0f2a8a; font-weight: 700; }
.qe-pics { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.q-pic { display: block; width: 84px; aspect-ratio: 4 / 3; padding: 0; border: 1px solid #d6dbec; border-radius: 6px; background: #fff; cursor: zoom-in; overflow: clip; }
.q-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.q-add { font-size: 13.5px; }
.q-add:hover { background: #eef1ff; }
.q-labels { color: #4a5279; font-size: 12.5px; }
.qe-more summary { display: flex; align-items: center; min-height: 44px; color: #3a4270; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.qe-more .qe-field + .qe-field { margin-top: 8px; }
.q-dialog { width: min(460px, calc(100vw - 32px)); padding: 0; border: 1px solid #d6dbec; border-radius: 14px; background: #fff; color: #0e1440; box-shadow: 0 18px 48px #0e14402e; }
.q-dialog::backdrop { background: #0e144059; }
.q-dialog form { display: grid; gap: 10px; padding: 18px 20px; }
.q-dialog h2 { margin: 0; font-size: 18px; }
.q-dialog p { margin: 0; color: #3a4270; }
.q-dialog ul { margin: 0; padding-left: 20px; max-height: 40svh; overflow: auto; color: #3a4270; font-size: 14px; }
.q-dialog-actions { justify-content: flex-end; margin-top: 6px; }
.q-viewer { width: min(760px, calc(100vw - 24px)); }
.q-viewer img { display: block; width: 100%; max-height: 66svh; object-fit: contain; border-radius: 8px; background: #f4f5fb; }
.qe-history { margin: 0; padding: 0; list-style: none; max-height: 50svh; overflow: auto; }
.qe-history li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; border-top: 1px solid #eceef6; font-size: 14px; font-variant-numeric: tabular-nums; }
.questions-page #toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; max-width: min(92vw, 560px); padding: 0; border-radius: 8px; background: #0e1440; color: #fff; font-size: 14px; }
.questions-page #toast:not(:empty) { padding: 9px 14px; }
@media (max-width: 1100px) {
}
@media (max-width: 760px) {
 #questions { padding: 8px 10px 28px; }
 .qe-head { gap: 8px; }
 .qe-title { order: 3; flex-basis: 100%; }
 .qe-title textarea { font-size: 18px; }
 .qe-head > .q-btn.primary { flex: 1; }
}
/* Closed menus take no layout space at all */
.q-menu:not([open]) > .q-menu-list { display: none; }

/* ---- One compact list: a row per clue, edited in place ---- */
.ql { border: 1px solid #d6dbec; border-radius: 12px; background: #fff; overflow: clip; }
.ql-colheads { position: sticky; top: 56px; z-index: 4; display: grid; grid-template-columns: 56px minmax(0, 1.15fr) minmax(0, 1fr) 96px; gap: 10px; padding: 6px 12px; border-bottom: 1px solid #e3e6f1; background: #f8f9fd; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #4a5279; }
.ql-cat-head { display: flex; align-items: center; gap: 10px; padding: 4px 12px; background: #0c1a6e; }
.ql .ql-cat-name { flex: 1; min-width: 0; min-height: 44px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #fff; font: 700 15px/1 'Archivo Narrow', Arial, sans-serif; letter-spacing: .05em; text-transform: uppercase; }
.ql .ql-cat-name:hover:not(:read-only) { border-color: #5566c4; }
.ql .ql-cat-name:focus { outline: none; border-color: #ffb365; background: #12347e; }
.ql-cat-head small { padding: 2px 9px; border-radius: 99px; background: #12347e; color: #e2e7ff; font-size: 12px; font-weight: 700; }
.ql-row { display: grid; grid-template-columns: 56px minmax(0, 1.15fr) minmax(0, 1fr) 96px; gap: 10px; align-items: start; padding: 4px 12px; border-top: 1px solid #eef0f6; }
.ql-cat-head + .ql-row { border-top: 0; }
.ql-row[data-state="missing"] { background: #fff7e6; }
.ql-row:focus-within { background: #f3f6ff; }
.ql-val { display: grid; place-items: center; height: 36px; margin-top: 4px; border-radius: 6px; background: #1d3bc4; color: #ffb365; font: 400 18px/1 Anton, Impact, sans-serif; }
.ql-row[data-state="missing"] .ql-val { background: #e6e9f3; color: #6b7299; }
.ql-cell { display: block; width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; font-size: 15px; line-height: 1.4; resize: none; overflow: clip; }
.ql-cell:hover:not(:read-only) { border-color: #dfe3f1; background: #fff; }
.ql-cell:focus { border-color: #1d3bc4; background: #fff; outline: none; box-shadow: 0 0 0 3px #1d3bc41f; }
.ql-cell::placeholder { color: #a0461a; font-weight: 700; }
.ql-answer { color: #1d3bc4; font-weight: 700; background: #f5f7ff; }
.ql-extras { justify-self: end; min-height: 44px; padding: 0 10px; white-space: nowrap; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #4a5279; font-size: 13px; font-weight: 700; text-align: right; cursor: pointer; }
.ql-row:hover .ql-extras, .ql-row:focus-within .ql-extras, .ql-extras:focus-visible { color: #1d3bc4; border-color: #dfe3f1; background: #fff; }
.ql-extras-body { display: grid; gap: 8px; }
.ql-extras-body h3 { margin: 6px 0 0; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #3a4270; }
.ql-extras-q { margin: 0; color: #3a4270; }
@media (max-width: 760px) {
 .ql-colheads { display: none; }
 .ql-row { grid-template-columns: 48px minmax(0, 1fr); gap: 2px 8px; padding: 6px 8px; }
 .ql-val { height: 32px; font-size: 16px; grid-row: span 2; }
 .ql-answer { grid-column: 2; }
 .ql-extras { grid-column: 2; justify-self: start; text-align: left; padding: 0 8px; }
}
.ql-extras[data-empty="true"] { color: #8a91b4; font-weight: 600; }
