/* Court Bundles: page-specific styles. Shared look comes from brand.css and app-shell.css. */
.app-title { font-size: var(--step-3); margin-bottom: 0.3em; }
.intro { color: var(--muted); max-width: 72ch; margin-bottom: 20px; }
#drop { min-height: 240px; }
#drop .progress { width: min(360px, 100%); }
.note { margin-top: 4px; }
.results-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.results-head h2 { font-size: var(--step-2); margin: 0 0 4px; }
.results-head h2:focus { outline: none; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.small { font-size: var(--step--1); margin: 6px 0; }
.how { margin-top: 24px; font-size: var(--step--1); max-width: 80ch; }
.link-btn { font: inherit; border: 0; background: none; color: var(--primary); cursor: pointer; text-decoration: underline; padding: 0; text-underline-offset: 0.18em; }

.bundle-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.side { display: grid; gap: 20px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px; min-width: 0; }
.panel h3 { font-size: var(--step-1); margin: 0 0 6px; }
.panel h4 { font-family: var(--font-display); font-weight: 600; font-size: var(--step-0); margin: 0 0 6px; }
#organise[data-drag="over"] { outline: 3px dashed var(--primary); outline-offset: 2px; }

/* Sections and documents */
.sections, .docs { list-style: none; margin: 0; padding: 0; }
.sections { display: grid; gap: 14px; margin-top: 12px; }
.section { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--bg); padding: 10px 12px 12px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sec-letter { flex: none; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 8px; background: var(--hero); color: var(--on-hero);
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.sec-letter.empty { background: var(--line); color: var(--muted); }
.sec-title { flex: 1 1 12rem; min-width: 0; font: inherit; font-weight: 700; padding: 0.35em 0.6em; border: 2px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--fg); }
.sec-title:focus { border-color: var(--primary); outline: none; }
.sec-tools, .doc-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sec-pages { margin: 6px 0 8px 2.6rem; font-size: var(--step--1); color: var(--muted); }
.docs { display: grid; gap: 8px; }
.doc { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); padding: 8px 10px; }
.doc-fields { display: grid; grid-template-columns: minmax(0, 1fr) 11.5rem; gap: 8px; }
.doc-fields .field { gap: 2px; }
.doc-fields label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.doc-fields input { padding: 0.35em 0.55em; }
.doc-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; margin-top: 6px; }
.doc-meta { margin: 0; font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; min-width: 0; flex: 1 1 14rem; }
.doc-meta .file { color: var(--fg); }
.mini { font: inherit; font-size: 0.85rem; font-weight: 600; min-width: 2.25rem; min-height: 2.25rem; padding: 0.2em 0.55em; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--fg); cursor: pointer; line-height: 1; }
.mini:hover:not([disabled]) { border-color: var(--primary); }
.mini[disabled] { opacity: 0.4; cursor: not-allowed; }
.mini.text { padding: 0.2em 0.7em; }
.mini-select { font: inherit; font-size: 0.85rem; min-height: 2.25rem; max-width: 11rem; padding: 0.2em 0.4em; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); }

.problems { border: 2px solid var(--danger); border-radius: var(--radius-s); padding: 8px 12px; margin: 10px 0; }
.problems h4 { color: var(--danger); }
.problems ul { margin: 0; padding-left: 1.1em; font-size: var(--step--1); display: grid; gap: 4px; }

/* Details and options */
.side .field { margin-bottom: 10px; }
.mode { border: 0; padding: 0; margin: 14px 0 12px; display: grid; gap: 8px; }
.mode legend { font-weight: 700; font-size: var(--step--1); padding: 0; margin-bottom: 4px; }
.mode .check, .more .check { align-items: flex-start; font-size: var(--step--1); line-height: 1.4; }
.mode .check input, .more .check input { margin-top: 2px; flex: none; }
.limit-field input { width: 8em; }
.more { border-top: 1px solid var(--line); padding-top: 10px; }
.more summary { cursor: pointer; font-weight: 600; color: var(--primary); padding: 4px 0; }
.more[open] summary { margin-bottom: 8px; }
.more .check { display: flex; margin: 6px 0; }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.more-grid select { width: 100%; }

/* Check and build */
#summary { margin: 0 0 6px; }
.limit-check { margin: 0 0 8px; font-size: var(--step--1); padding: 6px 10px; border-radius: var(--radius-s); border-left: 4px solid var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.limit-check[data-kind="warn"] { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.done { border: 2px solid var(--ok); border-radius: var(--radius-m); background: var(--surface); padding: 12px 16px; margin: 14px 0 0; }
.done:focus { outline: none; }
.done:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.done h4 { margin: 0 0 6px; overflow-wrap: anywhere; }
.done p { margin: 0 0 8px; }
.index-title { margin-top: 18px !important; }
.index-wrap { max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-s); }
#index-preview { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
#index-preview th, #index-preview td { text-align: left; padding: 5px 10px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
#index-preview thead th { position: sticky; top: 0; background: var(--hero); color: var(--on-hero); z-index: 1; }
#index-preview .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
#index-preview .date { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
#index-preview tr.sec th, #index-preview tr.sec td { font-weight: 700; padding-top: 10px; background: var(--bg); }

@media (max-width: 960px) {
  .bundle-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .panel { padding: 12px; }
  .section { padding: 8px; }
  .doc-fields { grid-template-columns: minmax(0, 1fr); }
  .sec-pages { margin-left: 0; }
  .more-grid { grid-template-columns: 1fr; }
  .doc { padding: 8px; }
  .doc-tools, .sec-tools { gap: 4px; }
  .mini { min-width: 2rem; min-height: 2rem; }
  .mini.text { padding: 0.2em 0.5em; }
  .mini-select { max-width: 6.5rem; min-height: 2rem; }
}
.check:has(input:disabled) { color: var(--muted); cursor: not-allowed; }
