/* An extension of the existing Bloco library, with no decorative motion. */
.table-builder { font-size:16px; }
.builder-wrap { width:min(1184px, calc(100% - 64px)); margin-inline:auto; }
.builder-header { display:flex; align-items:center; justify-content:space-between; gap:20px; min-height:84px; border-bottom:1px solid var(--line); }
.builder-header > a:last-child { font-size:.875rem; padding-block:12px; }
.builder-heading { margin-block:24px; }
.builder-heading h1 { font:400 2.5rem/1.15 var(--serif); letter-spacing:-.025em; overflow-wrap:anywhere; }
.builder-heading p { margin-top:10px; color:var(--muted); max-width:65ch; }
.table-builder button, .table-builder select, .table-builder input { font:inherit; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:5px; min-height:44px; }
.table-builder button { padding:8px 14px; cursor:pointer; }
.table-builder button:hover, .table-builder select:hover { border-color:var(--accent); }
.table-builder button:disabled { color:var(--muted); cursor:not-allowed; }
.table-builder .builder-primary { background:var(--accent); color:var(--on-accent); border-color:var(--accent); font-weight:600; }
.table-builder .builder-primary:disabled { background:var(--soft); color:var(--muted); border-color:var(--line); }
.table-builder input { width:100%; padding:8px 10px; caret-color:var(--accent); }
.table-builder input::placeholder { color:var(--muted); opacity:1; }
.table-builder input[type=checkbox] { width:19px; height:19px; min-height:0; accent-color:var(--accent); flex:none; margin:0; }
.table-builder a { text-underline-offset:4px; }
.table-builder a:hover { text-decoration:underline; }
.table-builder :focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.builder-sticky { position:sticky; top:0; z-index:10; background:var(--paper); padding-top:env(safe-area-inset-top, 0px); border-bottom:1px solid var(--line); }
.saved-switcher { display:flex; align-items:center; gap:10px; padding-block:10px; }
.saved-switcher label { font-size:.875rem; color:var(--muted); }
.saved-switcher select { flex:1; min-width:0; max-width:360px; padding:8px; }
.saved-switcher .edit-choices { margin-left:auto; padding:10px 0 10px 10px; white-space:nowrap; color:var(--accent); font-size:.875rem; }
#tense-jumps { display:flex; gap:22px; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:thin; }
#tense-jumps button { flex:none; min-height:44px; padding:10px 0; border:0; background:none; color:var(--accent); font-size:.875rem; }
/* The finder shares the view toolbar; Go stays available after each jump. */
.table-view-toolbar { display:grid; grid-template-columns:auto minmax(0,1fr); gap:8px 20px; align-items:end; padding-block:12px; }
.table-view-toolbar .table-view-choices { margin:0; }
.table-find-panel { display:flex; gap:8px; justify-content:flex-end; align-items:center; min-width:0; position:relative; }
.table-find-fields { display:grid; grid-template-columns:minmax(0,140px) minmax(0,210px); gap:8px; min-width:0; }
.table-find-fields[hidden] { display:none; }
.table-find-fields label { min-width:0; }
.table-find-fields input { display:block; min-width:0; font-size:1rem; }
.table-builder .table-find-toggle { flex:none; min-width:52px; }
.table-find-toggle[aria-expanded=true] { border-color:var(--accent); }
.table-find-message { position:absolute; right:0; top:100%; z-index:1; max-width:360px; padding:8px; border:1px solid var(--line); border-radius:5px; background:var(--paper); color:var(--muted); font-size:.8125rem; }
.table-find-message:empty { display:none; }
@media (max-width:900px) {
  .table-view-toolbar { grid-template-columns:minmax(0,1fr) auto; gap:8px; }
  .table-find-panel { display:contents; }
  .table-find-fields { grid-column:1/-1; grid-row:2; grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .table-find-toggle { grid-column:2; grid-row:1; }
  .table-find-message { position:static; grid-column:1/-1; grid-row:3; max-width:none; }
}
@media (max-width:480px) {
  .table-view-toolbar .table-view-choices > div { gap:4px; flex-wrap:nowrap; }
  .table-view-toolbar button { font-size:.8125rem; padding-inline:8px; }
  .table-builder .table-find-toggle { min-width:44px; }
}
.custom-matrix td.table-find-match { background:var(--soft); box-shadow:inset 0 0 0 1px var(--accent); }
#choices, .custom-tense { scroll-margin-top:140px; }
.table-name-row { display:flex; align-items:end; gap:10px; margin-block:20px 16px; }
.table-name-row label { flex:1; max-width:480px; font-size:.875rem; }
.table-name-row input { display:block; margin-top:5px; font-size:1rem; }
.builder-choices { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.builder-choices > details { border:1px solid var(--line); border-radius:5px; min-width:0; align-self:start; }
.table-builder summary { cursor:pointer; min-height:44px; padding:10px 12px; font-size:.9375rem; }
.table-builder summary { padding-right:30px; }
.table-builder summary::after { content:''; top:14px; right:10px; width:16px; height:16px; background:var(--accent); mask:url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"%3E%3Cpath d="m3 6 5 5 5-5" fill="none" stroke="black" stroke-width="1.5"/%3E%3C/svg%3E') center / contain no-repeat; }
.table-builder details[open] > summary::after { content:''; transform:rotate(180deg); }
.table-builder details p { padding:0; }
.builder-choices summary span { color:var(--muted); margin-left:8px; font-size:.875rem; }
.picker-content { padding:4px 12px 12px; border-top:1px solid var(--line); }
.picker-content > label { display:block; font-size:.875rem; margin-top:8px; }
.picker-content input[type=search] { display:block; margin-top:5px; font-size:1rem; }
.picker-actions { display:flex; flex-wrap:wrap; gap:4px 12px; padding-block:4px; }
.table-builder .picker-actions button { padding:8px 0; border:0; background:transparent; color:var(--accent); font-size:.875rem; text-decoration:underline; text-underline-offset:4px; }
.choice-list { max-height:288px; overflow-y:auto; overscroll-behavior:contain; scrollbar-color:var(--muted) var(--paper); }
.choice-list label { display:flex; align-items:center; gap:12px; min-height:44px; padding:8px 4px; border-top:1px solid var(--line); cursor:pointer; }
.choice-list label:has(input:checked) { background:var(--soft); }
.choice-list small { color:var(--muted); margin-left:6px; }
.table-utilities { display:flex; justify-content:space-between; align-items:start; gap:12px; margin-top:6px; }
.table-utilities details { max-width:70ch; min-width:0; }
.table-utilities summary { padding-inline:0; color:var(--accent); font-size:.875rem; }
.table-utilities details > div { padding-block:8px 16px; }
.table-utilities label { display:block; margin-block:12px; font-size:.875rem; }
.table-utilities input { display:block; margin-top:4px; }
.table-builder #delete-table { border:0; background:none; color:var(--muted); font-size:.8125rem; margin-top:3px; }
#save-status, #storage-error, #no-results { font-size:.875rem; color:var(--muted); margin-top:8px; }
.table-builder .builder-error { color:var(--ink); padding:12px; border:1px solid var(--line); }
.table-reading-note { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 18px; border-top:1px solid var(--line); padding-top:18px; margin-top:20px; font-size:.8125rem; color:var(--muted); }
.table-reading-note strong, .custom-matrix strong { color:var(--accent); font-weight:700; }
.custom-tense { margin-top:26px; }
.custom-tense h2 { font:400 1.5rem/1.25 var(--serif); letter-spacing:-.02em; margin-bottom:12px; }
.custom-matrix-scroll { width:100%; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-color:var(--muted) var(--paper); border-block:1px solid var(--line); }
.custom-matrix { border-collapse:separate; border-spacing:0; width:100%; min-width:var(--table-min); table-layout:fixed; text-align:left; }
.custom-matrix th, .custom-matrix td { padding:10px 12px; border-bottom:1px solid var(--line); vertical-align:middle; }
.custom-matrix tr:last-child > * { border-bottom:0; }
.custom-matrix thead th { background:var(--surface); font-weight:500; }
.custom-matrix thead th:not(:first-child) { font:400 1.125rem/1.4 var(--serif); }
.custom-matrix thead small { display:block; font:400 .75rem/1.5 var(--sans); color:var(--muted); margin-top:3px; }
.custom-matrix th:first-child { position:sticky; left:0; width:126px; background:var(--paper); z-index:1; font:400 .8125rem/1.5 var(--sans); box-shadow:1px 0 0 var(--line); }
.custom-matrix thead th:first-child { background:var(--surface); }
.custom-matrix td { font:400 1.1875rem/1.55 var(--serif); }
.custom-matrix .form-word { white-space:nowrap; }
.custom-tense details { margin-top:4px; max-width:70ch; }
.custom-tense summary { color:var(--muted); padding-inline:0; font-size:.8125rem; }
.custom-tense details p { font-size:.875rem; margin-bottom:10px; }
.builder-empty { margin-block:32px; padding-block:24px; border-block:1px solid var(--line); }
.builder-empty h2 { font-size:1.5rem; margin-bottom:8px; }
.builder-empty a { display:inline-block; color:var(--accent); min-height:44px; padding-block:10px; text-decoration:underline; }
.builder-about { border-top:1px solid var(--line); margin-top:40px; padding-top:8px; }
.builder-about summary { padding-inline:0; color:var(--muted); }
.builder-about p { max-width:70ch; margin-block:12px; font-size:.875rem; }
.builder-about a { color:var(--accent); text-decoration:underline; }
.builder-footer { display:flex; flex-wrap:wrap; gap:10px 24px; margin-top:32px; border-top:1px solid var(--line); padding-block:20px 90px; font-size:.875rem; color:var(--muted); }
.builder-footer a { padding-block:10px; }
.table-builder .builder-footer button { border:0; background:none; color:inherit; font-size:inherit; padding-inline:0; }
.builder-sr-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.table-builder-entry { display:flex; align-items:center; justify-content:space-between; gap:16px; padding-block:22px; margin-top:20px; border-block:1px solid var(--line); }
.table-builder-entry h2 { font:400 1.375rem/1.3 var(--serif); }
.table-builder-entry p { margin-top:5px; color:var(--muted); font-size:.875rem; }
.table-builder-entry > a { flex:none; min-height:44px; padding:10px 16px; border:1px solid var(--accent); border-radius:5px; color:var(--accent); font-size:.9375rem; }
@media (max-width:700px) {
  .builder-wrap { width:calc(100% - 32px); }
  .builder-header { min-height:72px; }
  .builder-heading { margin-block:20px; }
  .builder-heading h1 { font-size:2rem; }
  .builder-heading p { font-size:.9375rem; }
  .saved-switcher { gap:8px; }
  .saved-switcher label { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
  .saved-switcher button { padding-inline:10px; }
  .saved-switcher .edit-choices { padding-left:0; }
  .table-name-row { flex-wrap:wrap; gap:8px; }
  .table-name-row label { min-width:160px; }
  .table-name-row button { flex:none; }
  .table-name-row #save-copy { margin-left:auto; }
  .builder-choices { gap:8px; }
  .builder-choices summary { font-size:.875rem; padding-inline:10px; }
  .builder-choices summary span { margin-left:3px; }
  .builder-choices:has(details[open]) { grid-template-columns:1fr; }
  .table-utilities { flex-wrap:wrap; gap:0; }
  .custom-matrix th:first-child { width:92px; }
  .custom-matrix th, .custom-matrix td { padding:8px; }
  .custom-matrix td { font-size:1.0625rem; }
  .custom-matrix thead th:not(:first-child) { font-size:1rem; }
  .custom-matrix thead small { font-size:.6875rem; }
  .table-builder-entry { align-items:start; flex-direction:column; }
}
@media print {
  .builder-header, .builder-sticky, #choices, .builder-about, .builder-footer, .privacy-panel { display:none !important; }
  .builder-wrap { width:100%; }
  .custom-matrix-scroll { overflow:visible; }
  .custom-matrix { min-width:0; }
  .custom-tense { break-inside:avoid; }
}

/* Catalog scope and explicit gaps use the existing quiet reference styling. */
.builder-catalog-note, .custom-matrix .form-unavailable small { color:var(--muted); font:400 .8125rem/1.5 var(--sans); }
.custom-matrix .form-unavailable small { display:block; white-space:normal; max-width:15ch; margin-top:.25rem; }
.table-view-choices { border:0; padding:0; margin:24px 0 0; min-width:0; }
.table-view-choices legend { font-size:.875rem; margin-bottom:8px; }
.table-view-choices > div { display:flex; flex-wrap:wrap; gap:8px; }
.table-view-choices button[aria-pressed="true"] { background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
.custom-matrix-scroll { max-height:70svh; overflow:auto; }
.custom-matrix thead th { position:sticky; top:0; z-index:2; }
.custom-matrix thead th:first-child { z-index:3; }
.custom-matrix .matrix-tense-heading th { position:static; width:auto; background:var(--surface); font-weight:600; box-shadow:none; border-top:1px solid var(--line); }
.custom-matrix .matrix-tense-label { position:sticky; left:12px; display:inline-block; }
.custom-matrix tr:has(+ .matrix-tense-heading) > * { border-bottom:0; }
@media (max-width:700px) {
  .custom-matrix .matrix-tense-label { left:8px; }
}
@media print {
  .table-view-choices { display:none; }
  .custom-matrix-scroll { max-height:none; overflow:visible; }
  .custom-matrix thead th { position:static; }
  .custom-matrix .matrix-tense-label { position:static; }
}

#saved-picker {position:relative;flex:1;min-width:0;max-width:360px;border:1px solid var(--line);border-radius:5px;background:var(--surface);}
#saved-table-label {overflow-wrap:anywhere;}
#saved-picker .saved-search-panel {position:absolute;top:100%;left:0;z-index:20;width:min(360px,calc(100vw - 32px));padding:12px;border:1px solid var(--line);background:var(--paper);}
.saved-switcher #saved-picker label {position:static;width:auto;height:auto;overflow:visible;clip:auto;}
#saved-picker label {display:block;font-size:.875rem;}
#saved-results {max-height:200px;overflow-y:auto;scrollbar-color:var(--muted) var(--paper);}
#saved-results button {display:block;text-align:left;width:100%;margin-top:4px;}
#saved-picker[open] {border-color:var(--accent);}
#custom-editor {border-block:1px solid var(--line);padding-block:24px;margin-top:24px;scroll-margin-top:150px;}
#custom-editor h2 {font:400 1.7rem/1.3 var(--serif);}
#custom-editor p {max-width:65ch;color:var(--muted);margin:12px 0;}
#custom-editor > label {display:block;max-width:400px;margin-bottom:12px;}
#custom-editor label input {margin-top:4px;}
#custom-forms {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:20px;margin-block:24px;}
#custom-forms fieldset {min-width:0;border:1px solid var(--line);padding:12px;}
#custom-forms legend {padding-inline:6px;}
#custom-forms label {display:block;font-size:.875rem;margin-bottom:10px;}
#custom-error {font-weight:600;}
.choice-list label > button {margin-left:auto;flex:none;font-size:.8125rem;}
#add-custom-verb {margin-top:12px;}
#no-tense-results {font-size:.875rem;color:var(--muted);}
