/* Answer-key workspace: compact preparation, persistent navigation, clear marking. */
#t-key { --key-bubble:36px; --key-row:44px; }
#t-key #examWorkflow { border:0; border-radius:0; padding:14px 0; margin:0; background:none; }
#t-key .key-workflow-main { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
#t-key .key-workflow-state, #t-key .key-workflow-actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
#t-key .key-workflow-state > .mut { font-size:12px; }
#t-key .key-workflow-actions button { min-height:36px; font-size:12px; }
#t-key .exam-workflow-hint { margin:10px 0 0; font-size:12px; line-height:1.5; }
#t-key .exam-extra-actions { margin:10px 0 0; padding:0; border:0; }
#t-key .exam-extra-actions > summary { width:fit-content; padding:4px 0; font-size:12px; color:var(--muted); }
#t-key .exam-extra-actions .manage-actions { padding:10px 0 0; }
#t-key #examWorkflowExtra:empty { display:none; }
#t-key .key-settings { margin:0 0 24px; border-block:1px solid var(--border); }
#t-key .key-settings > summary { cursor:pointer; padding:11px 0; font-size:13px; font-weight:500; }
#t-key .key-settings > summary > span { display:inline; }
#t-key .key-settings small { margin-left:14px; font-size:12px; font-weight:400; color:var(--muted); }
#t-key .key-settings > summary > .icon { float:right; width:16px; height:16px; margin-top:2px; color:var(--muted); }
#t-key .exam-settings { grid-template-columns:minmax(0,1fr) minmax(150px,.55fr); gap:16px 24px; padding:10px 0 20px; margin:0; border:0; }
#t-key .exam-settings > .field { max-width:none; }
#t-key .exam-settings > .switch { grid-column:1 / -1; }
#t-key .exam-settings #exInfo { padding-top:4px; line-height:1.7; }
#t-key .key-heading { margin:0 0 12px; gap:16px; }
#t-key .key-heading-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
#t-key .key-heading-actions > .primary { min-height:36px; font-size:12px; }
#t-key .key-heading h2 { font-size:17px; margin:0; }
#t-key .key-heading p { margin:5px 0 0; font-size:13px; font-variant-numeric:tabular-nums; }
#t-key .key-import-actions { gap:8px; }
#t-key .key-import-actions :is(button,.btn) { min-height:36px; font-size:12px; }
#t-key .key-progress { height:4px; margin-bottom:12px; }
#t-key .key-navigation { position:sticky; top:0; z-index:5; background:var(--surface); border-bottom:1px solid var(--border); padding-top:4px; }
#t-key .subject-tabs { gap:22px; margin:0; border-bottom:1px solid var(--rule); scrollbar-width:thin; scrollbar-color:var(--control) transparent; }
#t-key .subject-tabs button { display:flex; gap:8px; align-items:center; padding:12px 0; min-height:44px; font-size:13px; }
#t-key .subject-tabs small { margin:0; font-size:12px; font-variant-numeric:tabular-nums; color:var(--muted); }
#t-key .subject-tabs button[aria-selected=true] { font-weight:600; }
#t-key .subject-tabs button[aria-selected=true] small { color:var(--ink); }
#t-key .key-tools { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:52px; padding:8px 0; }
#t-key .key-tools button { min-height:32px; padding:6px 10px; font-size:12px; }
#t-key #keyMissing[aria-pressed=true] { background:var(--active); border-color:var(--ink); color:var(--ink); }
#t-key #keyNextMissing { padding-inline:0; }
#t-key .key-hint { margin:14px 0 20px; font-size:12px; line-height:1.6; max-width:80ch; }
#t-key .key-keyboard-hint { display:block; }
#t-key .keygrid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:28px; align-items:start; }
#t-key .keygrid.four-subjects { grid-template-columns:repeat(4,minmax(0,1fr)); }
#t-key .subject-group > h3 { display:flex; justify-content:space-between; gap:8px; align-items:baseline; min-height:32px; margin:0; padding:0 0 10px; font-size:13px; border-bottom:1px solid var(--border); }
#t-key .subject-group > h3 > span { white-space:nowrap; font-size:12px; }
#t-key .key-questions { padding-top:4px; }
#t-key .kq { display:grid; grid-template-columns:26px repeat(4,var(--key-bubble)); justify-content:start; gap:6px; min-height:var(--key-row); padding:3px 0; border-bottom:1px solid var(--rule); }
#t-key .five-options .kq { grid-template-columns:26px repeat(5,var(--key-bubble)); }
#t-key .kq b { width:auto; margin:0 5px 0 0; text-align:right; color:var(--muted); font-size:12px; }
#t-key .kq.miss b { font-weight:600; color:var(--warn); }
#t-key .kq button { width:var(--key-bubble); height:var(--key-bubble); min-height:var(--key-bubble); font-size:13px; border-radius:50%; }
#t-key .kq button:disabled { opacity:1; color:var(--muted); background:var(--surface); border-color:var(--border); }
#t-key .kq button.on, #t-key .kq button.on:disabled { background:var(--ink); color:var(--surface); border-color:var(--ink); font-weight:500; }
#t-key .kq button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
#t-key .keygrid.single-subject { grid-template-columns:minmax(0,820px); }
#t-key .single-subject .key-questions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(var(--question-rows),auto); grid-auto-flow:column; column-gap:40px; }
#t-key .key-empty { display:flex; align-items:center; gap:14px; padding:24px 0; }
#t-key .key-empty > .icon { width:22px; height:22px; color:var(--ok); flex:none; }
#t-key .key-empty h3 { font-size:14px; margin:0 0 5px; }
#t-key .key-empty p { margin:0; font-size:12px; }
#t-key .key-empty button { margin-left:auto; font-size:12px; }
#t-key .key-footer { margin-top:24px; padding-top:16px; }
#t-key .key-footer > span { margin-right:auto; }
#t-key #keySaveState { font-size:12px; line-height:1.5; }
#t-key #keySaveState[data-state]::before { content:''; width:6px; height:6px; border-radius:50%; flex:none; background:var(--warn); }
#t-key #keySaveState[data-state=saved]::before { background:var(--ok); }
#t-key #keySaveState[data-state=error] { color:var(--bad); }
#t-key #keySaveState[data-state=error]::before { background:var(--bad); }
#t-key .text-key-panel { margin:16px 0; padding:18px; }
#t-key .text-key-panel label { font-size:13px; line-height:1.6; }
#t-key .text-key-panel textarea { letter-spacing:.12em; min-height:100px; font-size:16px; }
#t-key #keyTextCount { margin:8px 0 0; font-size:12px; line-height:1.6; font-variant-numeric:tabular-nums; }
@media(max-width:1190px) {
  #t-key .keygrid, #t-key .keygrid.four-subjects { grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
  #t-key .keygrid.single-subject { grid-template-columns:1fr; }
}
@media(max-width:760px) {
  .workspace-sheet:has(#t-key:not(.hide)) .page-heading { flex-wrap:nowrap; align-items:center; }
  .workspace-sheet:has(#t-key:not(.hide)) .page-heading > div { flex-basis:auto; }
  .workspace-sheet:has(#t-key:not(.hide)) #pageDescription { display:none; }
  #t-key { --key-bubble:38px; --key-row:44px; }
  #t-key .key-navigation { top:calc(48px + env(safe-area-inset-top)); }
  #t-key .key-workflow-main { gap:10px; }
  #t-key .key-workflow-actions { gap:8px; }
  #t-key .key-workflow-actions button { min-height:38px; padding:8px 10px; }
  #t-key .key-settings { margin-bottom:20px; }
  #t-key .key-settings small { display:block; margin:2px 0 0 16px; line-height:1.5; }
  #t-key .key-settings > summary > .icon { display:none; }
  #t-key .exam-settings { grid-template-columns:1fr; gap:14px; }
  #t-key .exam-settings :is(input,select) { font-size:16px; }
  #t-key .key-heading { flex-direction:column; align-items:stretch; gap:12px; }
  #t-key .key-heading-actions { justify-content:flex-start; }
  #t-key .key-heading-actions > .primary { min-height:40px; }
  #t-key .key-heading h2 { font-size:17px; }
  #t-key .key-heading p { font-size:12px; }
  #t-key .key-import-actions { display:grid; grid-template-columns:1fr 1fr; width:100%; }
  #t-key .key-import-actions :is(button,.btn) { padding:8px; min-height:40px; font-size:12px; }
  #t-key .subject-tabs { gap:18px; }
  #t-key .subject-tabs button { gap:6px; min-height:44px; font-size:12px; }
  #t-key .subject-tabs small { font-size:12px; }
  #t-key .key-tools { gap:6px; min-height:50px; }
  #t-key .key-tools button { min-height:38px; padding:6px 8px; }
  #t-key .key-hint { margin:12px 0 16px; }
  #t-key .key-keyboard-hint { display:none; }
  #t-key .keygrid, #t-key .keygrid.four-subjects, #t-key .keygrid.five-options, #t-key .keygrid.single-subject { grid-template-columns:1fr; gap:24px; }
  #t-key .subject-group > h3 { font-size:14px; }
  #t-key .subject-group > h3 > span { font-size:12px; }
  #t-key .kq, #t-key .five-options .kq { gap:6px; padding-block:2px; grid-template-columns:minmax(16px,1fr) repeat(4,var(--key-bubble)) minmax(16px,1fr); }
  #t-key .five-options .kq { grid-template-columns:minmax(16px,1fr) repeat(5,var(--key-bubble)) minmax(16px,1fr); }
  #t-key .kq b { font-size:12px; }
  #t-key .kq button { font-size:13px; }
  #t-key .single-subject .key-questions { display:block; }
  #t-key .key-empty { flex-wrap:wrap; align-items:flex-start; padding:20px 0; }
  #t-key .key-empty > div { flex:1; min-width:180px; }
  #t-key .key-empty button { margin-left:36px; }
  #t-key .key-footer { gap:12px; }
  #t-key #checkWithKey { min-height:40px; }
  #t-key .text-key-panel { padding:14px; }
}
@media(max-width:359px) {
  #t-key .kq, #t-key .five-options .kq { gap:4px; }
  #t-key .key-tools { flex-wrap:wrap; justify-content:flex-start; }
  #t-key .key-tools button { font-size:12px; }
}
@media(pointer:coarse) and (min-width:761px) {
  #t-key { --key-bubble:44px; --key-row:50px; }
  #t-key .keygrid.four-subjects { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(pointer:coarse) and (min-width:761px) and (max-width:1000px) and (max-height:500px) {
  #t-key { --key-bubble:38px; --key-row:44px; }
}
