/* Shared controls, quieter frames, readable rules and discipline worksheets. */
::selection{background:var(--accent);color:var(--accent-ink)}
html{scrollbar-color:var(--control) var(--bg)}
input,select,textarea{caret-color:var(--accent)}
.workspace{padding:0;border-color:var(--line);border-radius:14px;overflow:clip}
main.inner{border:0;border-radius:14px 14px 0 0}
.workspace footer{border:0;border-top:1px solid var(--line)}
.context-panel,.match-score,.entry-summary>section:last-child{outline:0;border-color:var(--line)}
.judge-nav{border-color:var(--line);gap:6px}
.judge-nav>a{padding:8px 12px;text-decoration:none;border-radius:6px}
.judge-nav>a:hover{background:var(--soft)}
.row-actions,td.actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
td.actions{display:table-cell}
td.actions>a,.row-actions>a,.card-actions>a,.secondary-button{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:7px 11px;border:1px solid var(--control);border-radius:6px;background:var(--surface);color:var(--accent);text-decoration:none;font-size:14px;font-weight:600;white-space:nowrap}
td.actions>a{margin:3px}
.row-actions>a:hover,.card-actions>a:hover,.secondary-button:hover{background:var(--soft);border-color:var(--accent);opacity:1}
.row-actions{min-width:190px}
.card-actions{gap:8px}
button:disabled{cursor:not-allowed}
input:disabled,select:disabled{opacity:.65;cursor:not-allowed}
.text-button:active,.icon-button:active{transform:none}
.judge-guide{background:var(--raised);margin:24px 0 32px}
.workflow-steps{padding-left:24px;max-width:85ch}
.workflow-steps li{padding:6px 0 12px 8px;line-height:1.65}
.workflow-steps li::marker{color:var(--accent);font-weight:700}
.advanced-tools{margin-top:36px}
.rulebook-layout{grid-template-columns:260px minmax(0,1fr);gap:40px;margin-top:32px}
.rulebook-toc{padding:8px 16px;border:0;max-height:80vh}
.rulebook-toc details{padding:0;border:0;margin:0}
.rulebook-toc ul{list-style:none;padding:0;margin:0}
.rulebook-toc li{margin:0;border-top:1px solid var(--line)}
.rulebook-toc a{padding:12px 0;text-decoration:none;line-height:1.55}
.rulebook-toc a:hover{text-decoration:underline}
.rule-text{max-width:78ch}
.rule-text h2{margin:48px 0 20px;padding-top:24px;border-top:1px solid var(--line);line-height:1.5;font-size:20px;overflow-wrap:anywhere}
.rule-text>h2:first-child{margin-top:0}
.rule-text .rule-clause{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;margin:0 0 20px;line-height:1.75;scroll-margin-top:24px}
.rule-text .rule-clause:has(.clause-number){grid-template-columns:64px minmax(0,1fr);gap:16px}
.rule-clause p{margin:0;overflow-wrap:anywhere}
.clause-number{align-self:start;font-weight:600;text-decoration:none;padding-top:1px}
.rule-clause ul{padding-left:22px;margin:0}
.rule-clause li{margin-bottom:8px}
.rule-text .table-scroll{margin:24px 0 32px;border:1px solid var(--line);border-radius:8px}
.rule-text th,.rule-text td{padding:14px 16px;border:1px solid var(--line);min-width:120px;font-size:14px;line-height:1.65;font-weight:400;overflow-wrap:anywhere}
.rule-text th{color:var(--ink);font-weight:600;background:var(--raised)}
.rule-text :target{outline:2px solid var(--control);outline-offset:4px;border-radius:4px}
.rule-text span:target{outline:0}
.anchor-link{font-size:14px;text-decoration:none;color:var(--muted)}
.publication{margin:0 0 24px;font-size:14px;color:var(--muted)}
.worksheet-scroll{max-height:72vh;border:1px solid var(--line);border-radius:8px;scrollbar-gutter:stable}
.worksheet{width:max-content;min-width:100%;font-size:14px}
.worksheet th,.worksheet td{padding:10px 12px;min-width:100px;max-width:320px;border:1px solid var(--line);overflow-wrap:anywhere}
.worksheet thead th{position:sticky;top:0;background:var(--raised);z-index:2;white-space:nowrap}
.worksheet tbody th{font-weight:400;color:var(--ink);background:var(--surface);min-width:190px}
.worksheet tbody th{position:sticky;left:0;z-index:1}
.worksheet thead th:first-child{left:0;z-index:3}
.worksheet tbody th small{margin-top:6px}
.worksheet input:not([type=checkbox]),.worksheet select{width:100%;min-width:130px;padding:8px;font-size:14px}
.worksheet input[type=number]{min-width:68px;width:68px}
.worksheet input[type=datetime-local]{min-width:224px}
.worksheet input[name$="-name"]{min-width:240px;margin-bottom:8px}
.worksheet select[name$="-winner"]{min-width:220px}
.worksheet .is-edited{background:var(--soft);box-shadow:inset 0 -2px var(--accent)}
.worksheet tr:focus-within{background:var(--raised)}
.sheet-save{padding:20px 0 0}
.sheet-save .field{max-width:740px}
.sheet-save textarea{width:100%}
.sheet-save .toolbar{margin-bottom:12px}
.sheet-save output{font-size:14px;color:var(--muted)}
.sheet-roster{margin:0;padding:0;border:0;min-width:220px}
.sheet-roster ul{padding-left:20px}
.sheet-roster li{margin-bottom:8px}
.cell-errors{min-width:230px;font-size:13px;color:var(--alert)}
.rule-list{padding-left:24px;margin:0 0 24px;line-height:1.7}
.rule-list li{padding:4px 0;scroll-margin-top:24px}
@media(max-width:900px){.rulebook-layout{grid-template-columns:minmax(0,1fr);gap:28px}.rulebook-toc{position:static;max-height:40vh}.rule-text{max-width:100%}}
@media(max-width:700px){.workspace{border-radius:10px}.rule-text .rule-clause:has(.clause-number){grid-template-columns:48px minmax(0,1fr);gap:10px}.rule-text h2{font-size:18px;margin-top:36px}.rulebook-layout{margin-top:24px}.worksheet-scroll{max-height:65vh}.judge-guide{padding:12px}.workflow-steps{padding-left:20px}.row-actions>a,.card-actions>a,td.actions>a{min-height:44px}.rule-text th,.rule-text td{padding:12px}.judge-nav>a{padding:8px}.worksheet th,.worksheet td{max-width:260px}}
@media print{.worksheet-scroll{max-height:none;overflow:visible}.worksheet thead th{position:static}.sheet-save{display:none}.rulebook-toc{display:none}.rulebook-layout{display:block}.rule-text{max-width:none}}
