:root{font-family:"Yu Gothic UI","Meiryo",system-ui,sans-serif;color:#252525;background:#fff;font-synthesis:none;line-height:1.7}
*{box-sizing:border-box}body{margin:0}button,input{font:inherit}button,a,input{touch-action:manipulation}[hidden]{display:none!important}
a{color:#235b99;text-underline-offset:3px}button{cursor:pointer;border:1px solid #bcbcbc;background:#fff;color:#333;border-radius:3px;padding:.45rem .9rem}button:hover{background:#f2f2f2}button:disabled{opacity:.5;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible{outline:2px solid #235b99;outline-offset:3px}
.masthead{max-width:1120px;margin:auto;padding:1.4rem 1.5rem;display:flex;align-items:center;justify-content:space-between;gap:1rem;border-bottom:1px solid #ddd}.brand{color:#222;text-decoration:none;font-size:1.15rem;font-weight:700}.brand span{font-weight:400;font-size:.875rem;color:#737373;margin-left:1rem}.channel{font-size:.875rem;color:#666}
main{max-width:1120px;margin:2.8rem auto;padding:0 1.5rem;min-height:52vh}.search-panel{max-width:900px}h1{font-size:1.35rem;font-weight:600;margin:0 0 1.6rem}label{display:block;font-size:.875rem;font-weight:500}input{border:1px solid #aaa;border-radius:3px;background:#fff;min-width:0;padding:.65rem .8rem;color:#222}.query-row{display:flex;gap:.6rem;margin-top:.45rem}.query-row input{flex:1;font-size:1rem}.primary{background:#303030;border-color:#303030;color:#fff;padding-inline:1.6rem}.primary:hover{background:#111}.hint{font-size:.875rem;color:#707070;margin:.5rem 0}
.filters{display:flex;align-items:end;gap:.85rem;flex-wrap:wrap;margin-top:1.4rem}.filters>span{padding-bottom:.45rem;font-size:.875rem;color:#555}.filters label{font-size:.875rem;color:#666}.filters input{display:block;padding:.35rem .5rem;margin-top:.2rem}.text-button{border:0;background:transparent;font-size:.875rem;color:#666;text-decoration:underline;text-underline-offset:3px}.error{color:#a5232e;font-size:.875rem;margin:0}.error:not(:empty){margin-top:1rem}
.sync-bar{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:1.25rem 0;margin-top:1.7rem;border-top:1px solid #e5e5e5}.sync-bar p{margin:0}#sync-status{font-size:.875rem;color:#555}.sync-bar .hint{font-size:.8rem;margin-top:.15rem}.sync-bar button{border:0;padding:.25rem 0;color:#666;text-decoration:underline;text-underline-offset:3px;font-size:.875rem}
.results-heading{display:flex;align-items:baseline;justify-content:space-between;border-bottom:2px solid #333;margin-top:1.8rem;padding-bottom:.7rem;gap:1rem}h2{font-size:1.1rem;margin:0;font-weight:600}#result-count{font-size:.875rem;color:#666}.video-card{padding:1.5rem 0;border-bottom:1px solid #aaa}.video-header{padding:0 0 1rem}.video-header h3{font-size:1.13rem;line-height:1.65;margin:.25rem 0 .5rem;font-weight:600}.video-header h3 a{color:#252525;text-decoration:none}.video-header h3 a:hover{color:#235b99;text-decoration:underline}.video-top{display:flex;justify-content:space-between;gap:.7rem;color:#6a6a6a;font-size:.875rem;font-variant-numeric:tabular-nums}.badge{color:#555}.metadata{font-size:.875rem;color:#6a6a6a}.metadata summary{cursor:pointer;width:fit-content}.metadata dl{display:grid;grid-template-columns:10rem 1fr;margin:.65rem 0;gap:.2rem}.metadata dt,.metadata dd{margin:0;overflow-wrap:anywhere}
.captions{width:100%;border-collapse:collapse;table-layout:fixed;font-size:1rem}.captions th{text-align:left;color:#666;font-size:.875rem;font-weight:500;border-bottom:1px solid #bbb}.captions th:first-child{width:7rem}.captions th,.captions td{padding:.65rem .8rem;vertical-align:top}.captions th:first-child,.captions td:first-child{padding-left:0}.captions td{border-bottom:1px solid #ededed;overflow-wrap:anywhere;white-space:pre-wrap}.captions td:first-child{font-variant-numeric:tabular-nums;white-space:nowrap}.captions a{font-size:.9rem}mark{background:#fff0b5;color:inherit;padding:.05rem 0}.card-actions{display:flex;gap:1rem;flex-wrap:wrap;padding:.7rem 0 0}.card-actions button{border:0;border-radius:0;padding:.2rem 0;color:#666;font-size:.875rem;text-decoration:underline;text-underline-offset:3px}.empty{padding:2rem 0;color:#666}.empty h3{font-size:1rem;font-weight:500;color:#333}.empty p{font-size:.875rem}#pagination{display:flex;align-items:center;justify-content:center;gap:1rem;padding:1.5rem 0}footer{max-width:1120px;margin:2rem auto;padding:1.2rem 1.5rem;border-top:1px solid #e5e5e5;color:#777;font-size:.8rem}
@media(max-width:620px){.masthead{padding:1rem;flex-wrap:wrap;gap:.35rem}.brand span{margin-left:.65rem}.channel{font-size:.8rem}main{margin:1.8rem auto;padding:0 1rem}h1{font-size:1.15rem}.query-row{flex-wrap:wrap}.query-row input{flex-basis:100%}.query-row .primary{flex:1}.filters{gap:.6rem}.filters>span:first-child{flex-basis:100%;padding:0}.filters input{max-width:145px}.sync-bar{align-items:start}.sync-bar button{flex-shrink:0}.captions th:first-child{width:5.5rem}.captions th,.captions td{padding:.55rem .45rem}.metadata dl{grid-template-columns:8rem 1fr}.video-top{flex-wrap:wrap}.results-heading{align-items:start}#result-count{text-align:right;font-size:.8rem}.video-header h3{font-size:1.05rem}footer{padding-inline:1rem}}
/* 動画一覧と字幕を別々にスクロールし、展開で一覧を押し出さない。 */
.result-layout{display:grid;grid-template-columns:minmax(240px,32%) minmax(0,1fr);height:clamp(340px,65vh,850px);border-bottom:1px solid #ccc}
#video-list-pane{overflow:auto;border-right:1px solid #ddd;min-width:0;scrollbar-gutter:stable}
#detail-pane{overflow:auto;min-width:0;padding:1.3rem 1.5rem;scrollbar-gutter:stable}
.video-choice{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid #e5e5e5;border-left:3px solid transparent;border-radius:0;padding:1rem .9rem;background:white;line-height:1.6}
.video-choice:hover{background:#f6f6f6}.video-choice.selected{border-left-color:#333;background:#f0f0f0}
.choice-title{display:block;font-size:.95rem;font-weight:500;overflow-wrap:anywhere}.choice-meta{display:block;font-size:.8rem;color:#666;margin-top:.4rem}
#video-detail .video-card{padding:0;border:0}#video-detail .video-header h3{font-size:1.05rem}#video-detail .captions th:first-child{width:6rem}
#back-to-list{display:none}#video-list-pane #pagination{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.3rem;font-size:.75rem;padding:1rem .25rem}#video-list-pane #pagination>span{grid-column:1/-1;text-align:center}#video-list-pane #pagination button{padding:.35rem .1rem;white-space:nowrap}
.filters{align-items:center}.filters>span{padding-bottom:0}.filters>input{font-size:.9rem;padding:.35rem .5rem}.query-row{margin-top:0}
@media(max-width:760px){
.result-layout{display:block;height:65vh;min-height:340px}#video-list-pane,#detail-pane{height:100%;border:0}#detail-pane{display:none;padding:1rem .25rem}
.result-layout.mobile-detail #video-list-pane{display:none}.result-layout.mobile-detail #detail-pane{display:block}#back-to-list{display:inline-block;margin-bottom:1rem;font-size:.875rem}
}
.filter-buttons{display:flex;gap:.65rem;margin-top:1rem}.filter-buttons button{font-size:.875rem;padding:.4rem .85rem}.result-tools{display:flex;align-items:center;justify-content:flex-end;gap:1rem;flex-wrap:wrap}.result-tools button{font-size:.8rem;padding:.3rem .6rem}
dialog{border:1px solid #bbb;border-radius:4px;padding:1.4rem;width:min(460px,calc(100vw - 2rem));max-height:85vh;overflow:auto;color:#252525;background:white;box-shadow:0 12px 40px #0002}dialog::backdrop{background:#0003}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1.4rem}.dialog-heading button{border:0;font-size:.875rem;padding:.2rem .4rem}.date-range{display:flex;align-items:center;gap:.6rem}.date-range input{flex:1;width:0;font-size:.9rem;padding:.5rem}.dialog-actions{display:flex;justify-content:flex-end;gap:.6rem;margin-top:1.4rem}.dialog-actions button{font-size:.875rem}.query-row .text-button{white-space:nowrap}#date-error:not(:empty){margin-top:.75rem}
@media(max-width:620px){.query-row .text-button{order:3;font-size:.8rem}.result-tools{gap:.5rem}.results-heading{align-items:center}.date-range{gap:.4rem}}
.channel-picker{display:flex;align-items:center;gap:.7rem;min-width:0}.channel-picker label{font-size:.8rem;color:#666;white-space:nowrap}.channel-picker select{font:inherit;font-size:.875rem;color:#333;background:#fff;border:1px solid #bbb;border-radius:3px;padding:.4rem .6rem;min-width:0;max-width:100%}.channel-picker select:focus-visible{outline:2px solid #235b99;outline-offset:3px}
@media(max-width:620px){.channel-picker{width:100%;margin-top:.65rem;flex-wrap:wrap;gap:.35rem .7rem}.channel-picker select{flex:1}}
.brand span{display:block;margin-left:0;margin-top:.2rem;font-size:.8rem}.masthead{flex-wrap:wrap}.channel-picker{margin-left:auto}
@media(max-width:620px){.brand span{margin-left:0}.channel-picker{margin-left:0}}

.primary.secondary{background:#fff;color:#333;border-color:#bcbcbc}.primary.secondary:hover{background:#f2f2f2}

.result-heading-main{display:flex;align-items:center;gap:.6rem;flex-shrink:0}.cancel-slot{display:flex;align-items:center;width:3.8rem;height:2.2rem}.cancel-slot button{font-size:.8rem;padding:.3rem .6rem}

.kofi-tag{display:inline-flex;align-items:center;white-space:nowrap;background:#2c6a7e;color:#fff;text-decoration:none;border-radius:4px;padding:.4rem .75rem;font-size:.8rem;font-weight:600}.kofi-tag:hover{background:#225362}@media(max-width:620px){.masthead .brand{flex-basis:100%}.masthead .channel-picker{width:100%;flex:0 0 100%}.kofi-tag{margin-top:.65rem}}
