.directory {padding:28px 0 46px;--wine:#982f27;--rule:#e4dfda;--quiet:#655e58}
.catalog-head {display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 15px}
.catalog-head p {color:var(--quiet);margin-top:5px;font-size:15px}.catalog-head img {object-fit:contain}
#catalog-filters {display:flex;align-items:center;gap:15px;padding:15px 19px;background:#fbf6f1;border-radius:10px;border:1px solid #ebded5}
.term-field {flex:1;display:flex;align-items:center;gap:14px;font-size:14px;font-weight:700}
#term,#family {font:inherit;font-size:16px;color:#252525;border:1px solid #b9b1ab;border-radius:6px;min-height:45px;background:#fff;padding:8px 12px;min-width:0}
#term {flex:1}#catalog-options {position:relative}#catalog-options summary,#alias-block summary {cursor:pointer;min-height:44px;padding:8px;font-weight:650}
.extra-options {position:absolute;right:0;z-index:2;width:min(300px,88vw);background:white;border:1px solid #d9d3cd;box-shadow:0 8px 25px #472b1a22;border-radius:8px;padding:12px}
.extra-options label {display:flex;align-items:center;gap:8px;min-height:46px;font-size:14px}
.extra-options select {width:80%}#stories {width:17px;height:17px;accent-color:var(--wine)}
.listing-head {display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:23px 0 12px}
.listing-head h2 {font-size:24px}#matches,.family-count {font-size:12px;color:var(--quiet);white-space:nowrap}
.clear,.retry,.more-jobs {font:inherit;font-weight:650;min-height:44px;padding:6px 13px;color:var(--wine);background:#fff;border:1px solid #d5c7bf;border-radius:6px;cursor:pointer}
.clear {margin-left:auto;font-size:13px}
.family-grid {display:grid;grid-template-columns:1fr 1fr;gap:24px;align-items:start}
.shelf {border-top:2px solid #a9382c;border-bottom:1px solid var(--rule);overflow:hidden}
.shelf-title {display:flex;align-items:center;gap:12px;background:#faf5f0;padding:6px 14px;font-size:19px;min-height:57px}
.shelf-title img {width:64px;height:42px;object-fit:contain;mix-blend-mode:multiply}
.family-card {display:grid;grid-template-columns:1fr auto 18px;align-items:center;gap:8px;padding:11px 14px;min-height:63px;border-top:1px solid var(--rule)}
.family-card strong,.family-card small {display:block}.family-card strong {font-size:17px;line-height:1.4}.family-card small {font-size:13px;color:var(--quiet);line-height:1.6;margin-top:2px}
.arrow {color:var(--wine)}.job-link:hover strong,.family-card:hover strong {color:var(--wine);text-decoration:underline;text-underline-offset:3px}
.job-grid {display:grid;grid-template-columns:1fr 1fr;gap:0 28px;border-top:1px solid var(--rule)}
.job-link {display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:74px;padding:12px 4px;border-bottom:1px solid var(--rule);font-size:17px;font-weight:700;scroll-margin:12px}
.result-summary {display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;color:var(--quiet);font-size:14px;font-weight:500;line-height:1.6;margin-top:3px}
.job-link small {display:inline-block;font-size:12px;color:#925142}.more-jobs {display:block;margin:15px auto 0}
.catalog-home a, .detail-back {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--wine); font-weight: 650;
}
.catalog-home { margin: 20px 0; }
.catalog-source { border-top: 1px solid var(--rule); margin-top: 26px; color: var(--quiet); }
.catalog-source summary, #alias-block summary { padding: 12px 0; cursor: pointer; min-height: 44px; font-size: 14px; }
.catalog-source p { max-width: 76ch; margin: 2px 0 12px; font-size: 13px; }
.detail-back { font-size: 14px; }
.occupation-hero {
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center;
  column-gap: 24px; row-gap: 12px; padding: 20px 0 22px; margin: 0;
  border-bottom: 2px solid var(--wine);
}
#occupation-family { color: var(--wine); font-size: 14px; font-weight: 700; }
#occupation-title { margin: 4px 0 0; font-size: clamp(28px, 4vw, 46px); line-height: 1.3; overflow-wrap: anywhere; }
.occupation-hero img { justify-self: end; width: 80px; height: 80px; object-fit: contain; }
#occupation-summary { grid-column: 1/-1; max-width: 52em; font-size: 17px; line-height: 1.8; }
.role-contents { display: flex; flex-wrap: wrap; align-items: center; gap: 0 18px; border-bottom: 1px solid var(--rule); }
.role-contents a { display: inline-flex; align-items: center; min-height: 46px; gap: 5px; color: var(--quiet); font-size: 14px; font-weight: 600; }
.role-contents a::after { content: "↓"; color: var(--wine); }
.role-contents .contents-story { color: var(--wine); }
.role-contents .contents-story::after { content: "→"; }
.role-contents a:hover, .detail-back:hover { color: var(--wine); text-decoration: underline; text-underline-offset: 3px; }
#detail-status:not(:empty) { margin: 16px 0; color: var(--quiet); font-size: 14px; }
#detail-status .retry { margin-top: 8px; }
.detail-columns { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(0,1fr); gap: clamp(24px, 5vw, 74px); }
.role-main, .role-side { min-width: 0; }
.role-section { margin: 30px 0 0; scroll-margin-top: 12px; }
.role-section h2 { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.5; }
.role-section h2::before { content: ""; display: inline-block; width: 5px; height: .82em; margin-right: .48em; background: #b83d30; border-radius: 2px; }
.task-list { list-style: none; border-bottom: 1px solid var(--rule); margin: 11px 0 0; padding: 0; }
.task-list li { position: relative; border-top: 1px solid var(--rule); padding: 11px 0 11px 20px; font-size: 16px; line-height: 1.75; }
.task-list li::before { content: ""; position: absolute; left: 1px; top: 1.45em; height: 6px; width: 6px; border-radius: 50%; background: var(--wine); }
.task-list li strong, .task-list li span { display: block; }
.task-list li span { margin-top: 3px; color: #403c39; font-size: 15px; }
#more-tasks { display: block; padding: 8px 13px; margin-top: 10px; min-height: 44px; border: 1px solid #d5c7bf; border-radius: 5px; background: white; color: var(--wine); cursor: pointer; font-size: 14px; font-weight: 650; }
.role-prose { margin-top: 12px; line-height: 1.9; font-size: 16px; }
.role-prose p+p { margin-top: .8em; }
.practice-section { padding: 15px 19px; background: #fbf5ef; border: 1px solid #e9dacf; border-radius: 3px 14px 3px 3px; }
.practice-section h2::before { display: none; }
.practice-section dl { margin: 10px 0 0; }
.practice-section dt { font-size: 13px; font-weight: 700; color: #874039; margin-top: 13px; }
.practice-section dd { margin: 3px 0 0; line-height: 1.8; }
#alias-block { margin-top: 22px; border-top: 1px solid var(--rule); }
#aliases { font-size: 14px; margin: 3px 0 10px; }
#story-block { margin-top: 30px; }
#sample { display: block; border: 1px solid var(--rule); border-radius: 3px 16px 3px 3px; overflow: hidden; background: #fff; }
#sample img { width: 100%; aspect-ratio: 2.35; height: auto; display: block; object-fit: cover; }
#sample div { padding: 12px 15px 14px; }
#sample small { font-size: 12px; color: var(--quiet); }
#sample strong { display: block; font-size: 17px; margin: 4px 0; }
#sample div > span { display: inline-block; color: var(--wine); font-size: 14px; font-weight: 650; }
#sample:hover div > span { text-decoration: underline; text-underline-offset: 3px; }
.catalog-empty {padding:22px;background:#faf7f4;border-radius:7px}.directory :is(a,button,select,input,summary):focus-visible {outline:2px solid #873529;outline-offset:2px}
@media(max-width:850px){.term-field{display:grid;gap:4px}.family-grid{gap:16px}.family-card{padding:9px 5px}.extra-options{width:280px}}
@media(max-width:650px){.directory{padding-top:14px}.catalog-head img{width:78px;height:53px}.catalog-head p{font-size:13px}.family-grid,.job-grid{grid-template-columns:1fr}.family-grid{gap:18px}#catalog-filters{padding:10px 12px;flex-wrap:wrap;gap:2px}#catalog-options{width:100%}#catalog-options summary{min-height:38px;padding:6px 0}.extra-options{position:static;border:0;background:transparent;box-shadow:none;padding:0;width:100%}.listing-head{margin:17px 0 9px}.listing-head h2,.detail-columns h2{font-size:21px}.shelf-title{font-size:18px;min-height:48px}.shelf-title img{height:36px;width:55px}.family-card strong,.job-link{font-size:16px}}
@media(min-width:651px){#catalog-filters:has(#catalog-options[open]){flex-wrap:wrap}.term-field{min-width:55%}#catalog-options[open]{width:100%;border-top:1px solid #e7dcd3}.extra-options{position:static;display:flex;gap:22px;width:100%;padding:2px 0;background:transparent;border:0;box-shadow:none}.extra-options select{width:auto}}

@media (max-width: 780px) {
  .detail-columns { display: block; }
  .occupation-hero { padding: 9px 0 16px; gap: 8px 12px; }
  .occupation-hero img { width: 58px; height: 58px; }
  #occupation-summary { font-size: 16px; line-height: 1.75; }
  .role-contents { gap: 0 13px; }
  .role-contents a { font-size: 13px; }
  .role-section, #story-block { margin-top: 23px; }
  .task-list li { padding-top: 9px; padding-bottom: 9px; }
  .role-prose { line-height: 1.8; }
  #sample { display: grid; grid-template-columns: clamp(92px,26vw,152px) 1fr; }
  #sample img { align-self: stretch; width: 100%; height: 100%; min-height: 92px; }
  #sample div { padding: 10px 12px; }
}
