:root{color-scheme:light;--ink:#182b46;--muted:#526781;--blue:#1765cf;--blue-dark:#0d4fae;--pale:#edf4fc;--line:#dce5f0;--page:#f4f7fb;--white:#fff;--danger:#a33b38;--radius:15px;font-family:"Pretendard","Noto Sans KR","Malgun Gothic",system-ui,sans-serif;font-size:16px;line-height:1.55}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--page);color:var(--ink)}button,input,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.5;cursor:not-allowed}a{color:var(--blue);text-underline-offset:3px}::selection{background:#cce0fb;color:#102b4f}:focus-visible{outline:3px solid #76a8ed;outline-offset:2px}input::placeholder{color:#6c8098}svg{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.site-header{background:var(--white);border-bottom:1px solid var(--line)}.header-inner{max-width:1340px;margin:auto;padding:0 28px;min-height:76px;display:flex;align-items:center;justify-content:space-between;gap:20px}.brand{display:inline-flex;align-items:center;gap:12px;color:var(--ink);font-size:22px;font-weight:800;letter-spacing:-.03em;text-decoration:none;white-space:nowrap}.brand svg{width:32px;height:32px;color:var(--blue)}.header-actions{display:flex;align-items:center;gap:8px}.header-button{border:1px solid var(--line);background:var(--white);border-radius:10px;color:var(--ink);font-weight:700;padding:9px 14px}.header-button:hover,.clear-button:hover{background:var(--pale)}.header-button.subtle{border-color:transparent;color:var(--muted)}.count-dot{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 4px;margin-left:4px;background:var(--pale);border-radius:20px;color:var(--blue);font-size:13px}
.page-shell{max-width:1340px;margin:0 auto;padding:24px 28px 90px}.preview-notice{display:flex;align-items:center;gap:14px;border:1px solid #c8ddfa;background:#eaf3ff;color:#21446f;border-radius:11px;padding:11px 16px;font-size:14px}.preview-notice strong{color:#15519d;white-space:nowrap}.search-intro{padding:42px 0 26px}.search-intro h1{font-size:clamp(28px,3vw,42px);line-height:1.24;letter-spacing:-.035em;margin:0 0 10px;font-weight:800}.search-intro p{margin:0;color:var(--muted);font-size:17px}
.search-workspace{position:relative;background:var(--white);padding:20px;border:1px solid var(--line);border-radius:var(--radius)}.search-line{display:flex;gap:10px}.search-box{position:relative;flex:1}.search-box>svg{position:absolute;left:16px;top:50%;width:22px;height:22px;transform:translateY(-50%);color:#59738f}.search-box input{width:100%;height:54px;padding:0 16px 0 49px;border:1px solid #bfd0e4;border-radius:10px;color:var(--ink);background:#fbfdff;font-size:17px}.search-box input:focus{border-color:var(--blue);outline:2px solid #c7ddf8}.clear-button{padding:0 18px;border:1px solid var(--line);background:var(--white);color:var(--ink);border-radius:10px;font-weight:700}.suggestions{position:absolute;top:60px;left:0;right:0;z-index:20;background:var(--white);border:1px solid #bfd0e4;border-radius:10px;box-shadow:0 14px 30px #182b461c;max-height:260px;overflow:auto;padding:5px}.suggestions button{display:block;width:100%;border:0;background:transparent;color:var(--ink);text-align:left;padding:10px 12px;border-radius:7px}.suggestions button:hover,.suggestions button:focus{background:var(--pale)}.concept-chips{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px;min-height:2px}.concept-chips:empty{display:none}.concept-chips button{border:0;border-radius:100px;background:#dcecff;color:#15519d;padding:5px 10px;font-weight:700;font-size:13px}.filter-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin-top:16px}.filter-grid label{display:flex;flex-direction:column;gap:5px;font-size:13px;font-weight:700;color:var(--muted)}.filter-grid select,.section-head select{width:100%;min-height:42px;border:1px solid var(--line);border-radius:9px;background:var(--white);color:var(--ink);padding:0 10px}
.results-section{margin-top:33px}.section-head{display:flex;justify-content:space-between;align-items:end;gap:14px;margin-bottom:18px}.section-head h2{font-size:23px;letter-spacing:-.025em;margin:0 0 2px}.section-head p{margin:0;color:var(--muted);font-size:14px}.section-head select{width:auto;min-width:205px}.results-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.load-more{display:block;margin:24px auto 0;padding:10px 25px;border:1px solid #bdd1ea;background:white;color:var(--blue);border-radius:9px;font-weight:700}.load-more[hidden]{display:none}.question-card{display:flex;flex-direction:column;min-width:0;background:var(--white);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;transition:transform .18s ease,box-shadow .18s ease}.question-card:hover{transform:translateY(-3px);box-shadow:0 10px 28px #17395b17}.card-open{border:0;background:transparent;color:inherit;text-align:left;display:flex;flex-direction:column;padding:0;height:100%}.card-top{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:14px 16px 0;font-size:12px;font-weight:700;color:var(--muted)}.source-badge{color:var(--blue);background:#e7f1ff;border-radius:6px;padding:3px 7px}.relation-badge{color:#47617b;background:#eef2f7;border-radius:6px;padding:3px 7px}.card-preview{height:208px;display:grid;place-items:start center;overflow:hidden;background:#fbfcfe;margin:12px 16px 0;border:1px solid #e8eef5;border-radius:8px}.card-preview img{width:100%;height:auto;max-height:none;object-fit:contain;object-position:top}.card-body{padding:14px 16px 17px;display:flex;flex-direction:column;gap:8px;flex:1}.card-body h3{font-size:17px;line-height:1.4;margin:0;letter-spacing:-.02em}.card-meta{margin:0;color:var(--muted);font-size:13px}.card-tags{display:flex;gap:6px;flex-wrap:wrap;margin-top:auto;padding-top:3px}.card-tags span,.tag{font-size:12px;background:#edf4fc;color:#315b8c;border-radius:6px;padding:4px 7px}.card-foot{display:flex;align-items:center;justify-content:space-between;padding:0 16px 15px;color:var(--muted);font-size:13px}.card-foot strong{color:var(--blue)}.empty-state{text-align:center;background:var(--white);border:1px dashed #b9cadb;border-radius:var(--radius);padding:55px 20px}.empty-state h3{margin:0 0 7px}.empty-state p{margin:0;color:var(--muted)}
dialog{border:0;border-radius:18px;box-shadow:0 25px 70px #14263d3b;color:var(--ink);padding:0;max-height:calc(100vh - 30px)}dialog::backdrop{background:#10233e99}.detail-dialog{width:min(1160px,calc(100vw - 32px))}.sheets-dialog{width:min(1060px,calc(100vw - 32px))}.admin-dialog{width:min(650px,calc(100vw - 32px))}.dialog-top{display:flex;justify-content:space-between;align-items:start;gap:15px;padding:24px 28px;border-bottom:1px solid var(--line)}.dialog-top h2{margin:3px 0 0;font-size:23px;letter-spacing:-.025em}.dialog-top p{margin:6px 0 0;font-size:14px;color:var(--muted)}.source-line{font-size:13px;font-weight:700;color:var(--blue)}.icon-button{border:0;background:#edf2f8;border-radius:9px;color:var(--ink);width:38px;height:38px;font-size:26px;line-height:1}.detail-layout{display:grid;grid-template-columns:minmax(0,1fr) 290px;min-height:0;max-height:calc(100vh - 135px);overflow:auto}.detail-main{padding:26px 28px}.detail-main>img{display:block;width:100%;height:auto;border:1px solid var(--line);background:white}.detail-side{border-left:1px solid var(--line);padding:26px 22px;position:sticky;top:0;align-self:start;background:#fbfdff}.detail-side h3,.answer-panel h3{font-size:16px;margin:0 0 12px}.detail-side h4{font-size:13px;color:var(--muted);margin:19px 0 7px}.tag-list{display:flex;flex-wrap:wrap;gap:6px}.detail-actions{display:grid;gap:9px;margin-top:27px}.primary-button{border:0;background:var(--blue);color:white;border-radius:9px;padding:10px 15px;font-weight:700}.primary-button:hover{background:var(--blue-dark)}.text-button{border:0;background:transparent;color:var(--blue);font-weight:700;text-align:left;padding:8px 0}.choice-row{display:flex;gap:9px;flex-wrap:wrap}.choice-row label{cursor:pointer;border:1px solid var(--line);border-radius:8px;background:var(--white);min-width:43px;height:40px;display:grid;place-items:center;font-weight:700}.choice-row label:has(input:checked){border-color:var(--blue);background:#e8f2ff;color:var(--blue)}.choice-row input{position:absolute;opacity:0;width:1px;height:1px}.answer-panel{margin-top:22px;border-top:1px solid var(--line);padding-top:20px}.answer-panel .primary-button{margin-top:12px}.grade-result{min-height:24px;margin:10px 0;color:var(--blue);font-weight:700}.grade-result.wrong{color:var(--danger)}.explanation{border-top:1px solid var(--line);padding-top:13px;color:var(--ink);font-size:14px;white-space:pre-wrap}.export-menu{border:1px solid var(--line);border-radius:9px;background:white}.export-menu summary{padding:10px 14px;cursor:pointer;font-weight:700}.export-menu button{display:block;width:100%;border:0;border-top:1px solid var(--line);background:white;text-align:left;padding:10px 14px;color:var(--ink)}.export-menu button:hover{background:var(--pale)}
.sheet-toolbar{display:flex;gap:8px;flex-wrap:wrap;padding:19px 24px;border-bottom:1px solid var(--line)}.sheet-toolbar input{min-width:160px;flex:1;border:1px solid var(--line);border-radius:8px;padding:8px 10px}.sheet-toolbar>button:not(.primary-button),.file-button,.sheet-content button:not(.primary-button){border:1px solid var(--line);background:white;color:var(--ink);border-radius:8px;padding:8px 11px}.file-button{cursor:pointer}.sheet-layout{display:grid;grid-template-columns:210px minmax(0,1fr);min-height:320px;max-height:calc(100vh - 255px);overflow:auto}.sheet-list{background:#f7fafe;border-right:1px solid var(--line);padding:15px}.sheet-list button{display:block;width:100%;text-align:left;border:0;border-radius:8px;background:transparent;padding:10px;color:var(--ink);margin-bottom:3px}.sheet-list button.active{background:#e0edfd;color:var(--blue);font-weight:700}.sheet-content{padding:20px 24px}.sheet-content h3{margin:0 0 6px}.sheet-content p{color:var(--muted)}.sheet-item{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:10px;align-items:center;border-bottom:1px solid var(--line);padding:11px 0}.sheet-item-title{font-weight:700}.sheet-item-meta{font-size:12px;color:var(--muted)}.sheet-item-actions{display:flex;gap:4px}.sheet-item-actions button{padding:5px 8px!important;font-size:13px}.sheet-answer{display:flex;align-items:center;gap:8px;margin-top:6px}.sheet-answer select{border:1px solid var(--line);border-radius:7px;padding:4px}.sheet-controls{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}.sheet-score{background:var(--pale);border-radius:9px;padding:12px 15px;font-weight:700}.form-message{padding:0 24px 18px;margin:0;color:var(--blue)}.admin-status{padding:24px 28px 30px}.admin-status p{color:var(--muted)}
.print-stage{display:none}@media(max-width:1080px){.results-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.filter-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:690px){.header-inner{padding:0 16px;min-height:66px}.brand{font-size:18px;gap:7px}.brand svg{width:27px;height:27px}.header-button{padding:7px 9px;font-size:13px}.page-shell{padding:16px 14px 60px}.preview-notice{align-items:start;flex-direction:column;gap:3px}.search-intro{padding:31px 3px 22px}.search-intro p{font-size:15px}.search-workspace{padding:13px}.search-box input{font-size:15px}.clear-button{padding:0 10px}.filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.results-grid{grid-template-columns:1fr;gap:13px}.card-preview{height:190px}.section-head{align-items:start;flex-direction:column}.section-head select{width:100%}.detail-dialog,.sheets-dialog,.admin-dialog{width:100vw;max-width:none;max-height:100vh;height:100vh;margin:0;border-radius:0}.dialog-top{padding:17px}.detail-layout{display:block;max-height:calc(100vh - 93px)}.detail-main{padding:16px}.detail-side{position:static;border-left:0;border-top:1px solid var(--line);padding:20px 16px}.sheet-toolbar{padding:13px}.sheet-layout{grid-template-columns:1fr;max-height:calc(100vh - 230px)}.sheet-list{display:flex;overflow-x:auto;border-right:0;border-bottom:1px solid var(--line);padding:8px}.sheet-list button{min-width:120px;margin:0}.sheet-content{padding:17px}.sheet-item{grid-template-columns:24px minmax(0,1fr)}.sheet-item-actions{grid-column:2}.admin-status{padding:19px}}
.sheet-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.sheet-heading h3{margin:0}.sheet-heading button{font-size:12px;color:#667c97!important}
.detail-actions a.text-button{text-decoration:none}
@page{size:A4;margin:12mm}@media print{body{background:white}.site-header,.page-shell,dialog,.preview-notice{display:none!important}.print-stage{display:block!important}.print-stage h1{font-size:20pt;margin:0 0 12mm}.print-question{break-inside:avoid;page-break-inside:avoid;margin:0 0 7mm}.print-question img{display:block;width:100%;max-height:250mm;object-fit:contain;object-position:left top}.print-answer-table{border-collapse:collapse;width:100%;font-size:12pt}.print-answer-table th,.print-answer-table td{border:1px solid #555;padding:5mm;text-align:center}}

/* Search and reading surface */
:root{--ink:#282b2b;--muted:#5c625f;--blue:#1765bf;--blue-dark:#124f96;--pale:#e9f2fc;--line:#d5d8d4;--page:#f6f2ec;--white:#fff;--radius:14px}
body{background:var(--page)}
.site-header{background:#f6f2ec;border-bottom:1px solid #d8d2c9}
.header-inner{max-width:1240px}
.brand{font-size:20px;letter-spacing:-.025em}
.brand svg{color:#f2a22c}
.admin-icon{display:grid;place-items:center;width:42px;height:42px;padding:8px;border-color:transparent;background:transparent;color:#545b59}
.admin-icon svg{width:20px;height:20px}
.admin-icon:hover{background:#e7e1d8}
.page-shell{max-width:1240px;padding-top:38px}
.search-workspace{border-radius:3px;padding:25px;background:#fff;box-shadow:0 8px 28px #3333330c}
.search-line{gap:12px}
.search-box input{background:#fff;border-color:#bfc8c8;border-radius:3px}
.clear-button,.filter-grid select,.sort-row select{border-radius:3px}
.sort-row{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin:16px 0 0;font-size:13px;color:var(--muted);font-weight:700}
.sort-row select{min-height:39px;width:min(270px,100%);border:1px solid var(--line);background:#fff;color:var(--ink);padding:0 10px}
.filter-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 16px;margin-top:15px}
.filter-grid label{font-size:13px;color:#3e4c50}
.filter-grid label[hidden]{display:none}
.filter-grid select{min-height:46px}
.search-actions{display:flex;justify-content:flex-end;margin-top:20px}
.search-actions .primary-button{min-width:145px;border-radius:3px}
.results-section{margin-top:33px}
.section-head{align-items:center}
.section-head h2{font-size:25px}
.carousel-controls{display:flex;gap:7px}
.carousel-controls button{width:42px;height:42px;border:1px solid #aeb7b5;background:#fff;border-radius:50%;color:var(--ink);font-size:22px;line-height:1}
.carousel-controls button:hover:not(:disabled){background:#f7ca65}
.results-grid{display:flex;gap:16px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding-inline:3px;scrollbar-color:#aab7b8 transparent;scrollbar-width:thin;padding:4px 3px 20px;overscroll-behavior-inline:contain}
.question-card{flex:0 0 clamp(290px,31vw,365px);scroll-snap-align:start;border:0;border-radius:3px;box-shadow:0 4px 14px #33333310;transition:transform .25s ease,box-shadow .25s ease}
.question-card:nth-child(4n+1) .card-top{background:#ffd6a6}.question-card:nth-child(4n+2) .card-top{background:#d9dcff}.question-card:nth-child(4n+3) .card-top{background:#ccf0e6}.question-card:nth-child(4n) .card-top{background:#ffd7df}
.question-card:hover{transform:translateY(-5px);box-shadow:0 13px 28px #33333319}
.card-top{min-height:49px;padding:10px 14px;font-size:11px}
.source-badge,.relation-badge{background:#ffffffb8;color:#2e3e42}
.card-preview{height:218px;margin:0;border:0;border-bottom:1px solid #e2e5e4;border-radius:0;background:white}
.card-preview img{width:100%;height:auto}
.card-body{min-height:126px}
.card-body h3{font-size:16px}
.card-tags span{background:#f0f0ef;color:#4d5962}
.card-foot strong{color:var(--blue)}
.load-more{margin-top:10px;border-radius:3px}

/* The selected paper rises from the bottom; its controls stay easy to find. */
.detail-dialog{width:min(1120px,calc(100vw - 30px));height:min(91vh,980px);max-height:91vh;margin:auto auto 0;border-radius:18px 18px 0 0;animation:detail-rise .48s cubic-bezier(.16,1,.3,1) both}
.detail-dialog::backdrop{animation:backdrop-in .35s ease-out both}
@keyframes detail-rise{from{transform:translateY(58px);opacity:.6}to{transform:translateY(0);opacity:1}}
@keyframes backdrop-in{from{opacity:0}to{opacity:1}}
.detail-dialog .dialog-top{background:#f8f6f1;padding:18px 25px}
.detail-layout{height:calc(100% - 88px);max-height:none;grid-template-columns:minmax(0,1fr) 260px}
.detail-main{padding:20px 24px}
.detail-side{background:#fffdf9;padding:20px 18px}
.detail-actions{margin-top:0}
.keyword-details{margin-top:22px;border-top:1px solid var(--line);padding-top:16px}
.keyword-details summary{cursor:pointer;list-style:none;font-size:16px;font-weight:750;display:flex;align-items:center;justify-content:space-between}
.keyword-details summary::-webkit-details-marker{display:none}
.keyword-details summary span{transition:transform .2s ease}
.keyword-details[open] summary span{transform:rotate(180deg)}
.keyword-details #detailTags{padding-top:2px}
.detail-side h4{margin:16px 0 6px}

/* A small A4 preview mirrors the two-column print layout. */
.sheet-preview-label{margin:26px 0 8px!important;font-weight:700;font-size:13px;color:#536069!important}
.sheet-paper{width:min(100%,520px);aspect-ratio:210/297;margin:0 auto;background:#fff;border:1px solid #cbd0d0;box-shadow:0 7px 20px #20202012;padding:5%;overflow:hidden}
.sheet-paper-head{text-align:center;border-bottom:2px solid #202020;margin-bottom:4%;padding-bottom:2%;font-family:"Batang","Nanum Myeongjo",serif;font-weight:700;font-size:12px}
.sheet-paper-columns{height:92%;column-count:2;column-gap:5%;column-rule:1px solid #333;overflow:hidden}
.sheet-paper-item{break-inside:avoid;margin:0 0 5%;font-family:"Batang","Nanum Myeongjo",serif;font-size:7px;line-height:1.3}
.sheet-paper-item strong{display:block;margin-bottom:3px}
.sheet-paper-item img{width:100%;height:auto;display:block}

@media(max-width:690px){.header-inner{min-height:62px}.brand{font-size:15px;white-space:normal;line-height:1.2}.brand svg{flex:none}.admin-icon{width:34px;height:34px;padding:6px}.page-shell{padding:16px 12px 60px}.search-workspace{padding:15px}.sort-row{justify-content:space-between}.sort-row select{width:72%}.filter-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.search-actions .primary-button{width:100%}.section-head{flex-direction:row;align-items:center}.section-head h2{font-size:21px}.question-card{flex-basis:min(82vw,340px)}.detail-dialog{width:100vw;height:94vh;max-height:94vh;border-radius:17px 17px 0 0}.detail-layout{height:calc(100% - 75px);overflow:auto}.detail-main{padding:15px}.detail-side{padding:18px 15px}.sheet-paper{width:min(100%,450px)}}
@media(prefers-reduced-motion:reduce){.detail-dialog,.detail-dialog::backdrop{animation:none}.question-card,.keyword-details summary span{transition:none}.results-grid{scroll-behavior:auto}}
@media print{.print-stage h1{font-family:"Batang","Nanum Myeongjo",serif;font-size:14pt;text-align:center;margin:0 0 4mm;border-bottom:1.5px solid #111;padding-bottom:3mm}.print-columns{column-count:2;column-gap:7mm;column-rule:1px solid #333;column-fill:auto}.print-question{break-inside:avoid;page-break-inside:avoid;margin:0 0 5mm;font-family:"Batang","Nanum Myeongjo",serif}.print-question h2{font-size:7pt;font-weight:600;margin:0 0 2mm}.print-question img{width:100%;height:auto;max-height:245mm;object-fit:contain;object-position:left top}}

/* The search controls and one-paper carousel share the desktop viewport. */
.results-grid{position:relative;scroll-behavior:smooth;scroll-snap-type:x mandatory;overflow-y:hidden}
.question-card{scroll-snap-align:start;transition:transform .28s cubic-bezier(.16,1,.3,1),opacity .28s ease,box-shadow .28s ease}
.question-card:not(.is-current){transform:scale(.96);transform-origin:left center;opacity:.78}
.question-card.is-current:hover{transform:translateY(-3px)}
@media(min-width:960px){
  .page-shell{max-width:1620px;height:calc(100dvh - 76px);padding:22px 28px 26px}
  .workspace-layout{display:grid;grid-template-columns:minmax(320px,360px) minmax(0,1fr);gap:24px;height:100%;min-height:0}
  .search-workspace{max-height:100%;min-height:0;overflow-y:auto;padding:20px;align-self:start;scrollbar-width:thin}
  .search-box input{font-size:15px}
  .filter-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px}
  .filter-grid select{min-height:42px}
  .search-actions{margin-top:16px}
  .results-section{min-width:0;min-height:0;margin-top:0;display:flex;flex-direction:column}
  .section-head{flex:none;margin-bottom:12px}
  .results-grid{flex:1;min-height:0;padding:2px 3px 12px;gap:18px}
  .question-card{flex:0 0 min(650px,calc(100% - 80px));height:100%}
  .card-preview{height:clamp(170px,28vh,260px);flex:none}
  .card-body{min-height:0;overflow:hidden;padding:12px 16px}
  .card-body h3{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
  .card-tags{max-height:55px;overflow:hidden}
  .card-foot{flex:none}
  .load-more{flex:none}
}
@media(max-width:959px){
  .workspace-layout{display:block}
  .question-card{flex-basis:calc(100% - 42px);max-width:440px}
}
@media(max-width:690px){
  .brand{font-size:12px;white-space:nowrap;gap:5px}
  .brand svg{width:21px;height:21px}
  .question-card{flex-basis:calc(100% - 42px)}
  .results-grid{gap:12px}
}
@media(prefers-reduced-motion:reduce){.results-grid{scroll-behavior:auto}.question-card{transition:none}}

/* The guide explains the actual sheet workflow without leaving the search. */
.guide-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap}
.guide-button svg{width:18px;height:18px}
.guide-dialog{width:min(760px,calc(100vw - 28px));max-height:min(92vh,850px);border-radius:15px;background:#fffdf9}
.guide-dialog .dialog-top{background:#f8f6f1;padding:22px 26px}
.guide-dialog .dialog-top h2{margin-top:3px}
.guide-eyebrow{font-size:12px;font-weight:800;letter-spacing:.08em;color:#1765bf}
.guide-content{max-height:calc(92vh - 124px);overflow:auto;padding:24px 26px 28px}
.guide-steps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;list-style:none;margin:0;padding:0}
.guide-steps li{display:flex;align-items:flex-start;gap:12px;border:1px solid #e0ddd6;background:#fff;padding:17px;min-width:0}
.guide-number{font-size:12px;font-weight:900;color:#1765bf;line-height:1.7}
.guide-steps h3,.guide-backup h3{margin:0 0 6px;font-size:16px;line-height:1.4}
.guide-steps p,.guide-backup p{margin:0;color:#4f5a5c;font-size:14px;line-height:1.65;word-break:keep-all}
.guide-backup{margin:16px 0 18px;padding:17px 18px;border:1px solid #cbdcf1;background:#eef5fc}
.guide-backup p+p{margin-top:8px}
.guide-backup code{font-family:ui-monospace,Consolas,monospace;color:#164c8a;font-weight:700}
.guide-content>.primary-button{min-width:170px}
@media(max-width:690px){
  .header-inner{gap:7px}
  .header-actions{gap:3px}
  .guide-button{width:34px;height:34px;padding:7px}
  .guide-button span{display:none}
  .guide-button svg{flex:none}
  .guide-dialog{width:100vw;height:100vh;max-height:100vh;margin:0;border-radius:0}
  .guide-dialog .dialog-top{padding:17px}
  .guide-content{max-height:calc(100vh - 115px);padding:17px}
  .guide-steps{grid-template-columns:1fr}
}
input::placeholder{color:#4c6078}

/* Guided search, a wider sliding card, and a compact reading desk. */
.guide-overlay[hidden]{display:none}
.guide-shade{position:fixed;inset:0;background:#172925aa;z-index:1000}
.tour-highlight{position:relative!important;z-index:1001!important;box-shadow:0 0 0 5px #ffc76e,0 0 0 11px #ffc76e44!important;border-radius:10px}
.guide-panel{position:fixed;z-index:1002;right:clamp(18px,4vw,58px);top:50%;transform:translateY(-50%);width:min(400px,calc(100vw - 36px));max-height:calc(100dvh - 32px);overflow:auto;background:#fffaf5;border:1px solid #e8d7c8;border-radius:18px;box-shadow:0 24px 70px #17292555;padding:26px;color:#302e2a}
.guide-panel-top,.guide-panel-actions{display:flex;align-items:center;gap:8px}
.guide-panel-top{justify-content:space-between;font-size:13px;font-weight:800;color:#a56555}
.guide-close{border:0;background:transparent;font-size:23px;line-height:1;color:#5c625f}
.guide-progress-track{height:4px;background:#e9dbd4;margin:16px 0 21px;border-radius:9px;overflow:hidden}
.guide-progress-track span{display:block;height:100%;background:#b8826f;transition:width .25s ease}
.guide-panel h2{font-size:23px;margin:0 0 10px;letter-spacing:-.03em}
.guide-panel p{font-size:14px;line-height:1.7;color:#514f4b;margin:0}
.guide-tip{background:#f3ece5;border-left:3px solid #b8826f;margin:18px 0;padding:11px 13px;font-size:13px;line-height:1.6}
.guide-panel-actions{margin-top:20px}
.guide-panel-actions button{border:1px solid #e7ddd5;border-radius:9px;background:#fffaf5;padding:8px 10px;color:#4b4744;font-size:13px}
.guide-panel-actions .primary-button{color:#fff;background:#a97965;border-color:#a97965}
.guide-panel-actions .primary-button:hover{background:#8b5f4f}
.guide-panel-actions #guideSkip{border:0;text-decoration:underline;padding-left:0}
.guide-spacer{flex:1}
.guide-footnote{margin-top:21px!important;border-top:1px solid #e7ddd5;padding-top:13px;font-size:12px!important}
.results-grid.is-dragging{scroll-snap-type:none;scroll-behavior:auto;cursor:grabbing;user-select:none}
.results-grid:not(.is-dragging){cursor:grab}
.question-card{position:relative;isolation:isolate}
.card-top{padding-right:180px}
.card-quick-actions{position:absolute;z-index:3;right:10px;top:8px;display:flex;gap:5px;align-items:flex-start}
.card-quick-button{display:inline-block;border:1px solid #d8d4cc;border-radius:6px;background:#fffdf9eb;color:#334141;padding:5px 8px;font-size:11px;font-weight:750;line-height:1.4;white-space:nowrap;box-shadow:0 2px 5px #00000012}
.card-quick-button:hover{background:#fff0d5}
.card-quick-export{position:relative}
.card-quick-export summary{list-style:none;cursor:pointer}
.card-quick-export summary::-webkit-details-marker{display:none}
.card-quick-export button{display:block;position:relative;width:100%;white-space:nowrap;border:0;border-top:1px solid #eee;background:#fff;color:#334141;padding:8px;font-size:11px;text-align:left}
.card-quick-export[open]{background:#fff;box-shadow:0 5px 14px #0002}
.card-quick-export[open] summary{border-radius:6px 6px 0 0}
.card-quick-export[open] button:hover{background:#fff0d5}
.detail-dialog[open]{display:flex;flex-direction:column}
.detail-dialog .detail-dialog-top{flex:none;align-items:center;min-height:82px;gap:14px}
.detail-heading{min-width:0;flex:1}
.detail-heading h2{font-size:21px;line-height:1.25;margin:2px 0 0}
.detail-head-actions{display:flex;align-items:center;gap:8px;flex:none}
.detail-head-actions .primary-button{white-space:nowrap}
.detail-head-actions .export-menu{position:relative;z-index:4;min-width:108px}
.detail-head-actions .export-menu[open]{box-shadow:0 8px 18px #0002}
.detail-head-actions .export-menu button{white-space:nowrap}
.detail-layout{flex:1;min-height:0;height:auto;max-height:none;overflow:hidden;grid-template-columns:minmax(0,1fr) 260px}
.detail-main{min-height:0;overflow-y:auto;scrollbar-width:thin}
.detail-side{min-height:0;overflow-y:auto;position:static;align-self:stretch;display:flex;flex-direction:column;gap:16px}
.answer-panel{margin:0;padding:0;border:0}
.answer-panel .choice-row{gap:4px;flex-wrap:nowrap}
.answer-panel .choice-row label{min-width:0;width:calc((100% - 16px)/5);height:40px}
.answer-panel .primary-button{width:100%}
.detail-side #suggestEdit{margin-top:auto;border-top:1px solid var(--line);padding-top:12px}
.keyword-details{margin:14px 0 0;padding:12px 0;border-top:1px solid var(--line)}
.keyword-details summary{font-size:14px}
.keyword-details #detailTags{padding:12px 0 2px}
.keyword-details .tag-list{display:flex;flex-wrap:wrap;gap:5px}
.keyword-details .tag{font-size:11px;padding:3px 6px}
.explanation{margin-top:10px;font-size:clamp(1rem,.88rem + .4vw,1.125rem);line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
.explanation p{max-width:72ch}
.explanation-source{font-size:clamp(.875rem,.82rem + .2vw,1rem);color:#886653;background:#fff5e8;padding:8px 10px}
@media(min-width:960px){
  .question-card{flex-basis:min(750px,calc(100% - 58px))}
  .card-preview{height:auto;min-height:0;flex:1;overflow:hidden}
  .card-preview img{width:100%;height:auto;max-height:none;object-fit:cover;object-position:top}
  .card-body{flex:none;min-height:108px;max-height:128px;padding:10px 16px}
  .card-tags{max-height:26px;white-space:nowrap;overflow:hidden;flex-wrap:nowrap}
  .card-foot{padding:0 16px 10px}
}
@media(max-width:959px){.question-card{max-width:620px}.card-preview{height:clamp(220px,38vh,350px)}}
@media(max-width:690px){
  .question-card{flex-basis:calc(100% - 42px)}
  .card-top{padding-right:148px;font-size:10px;min-height:48px}
  .card-quick-actions{right:6px;top:7px;gap:3px}
  .card-quick-button{font-size:10px;padding:5px 6px}
  .card-preview{height:250px}
  .guide-panel{left:12px;right:12px;top:auto;bottom:12px;transform:none;width:auto;padding:19px;max-height:min(65dvh,500px)}
  .guide-panel h2{font-size:20px}
  .detail-dialog .detail-dialog-top{padding:12px;flex-wrap:wrap;min-height:auto}
  .detail-heading{flex:1 1 calc(100% - 80px)}
  .detail-heading h2{font-size:18px}
  .detail-head-actions{order:3;width:100%}
  .detail-head-actions .primary-button{flex:1}
  .detail-dialog-top>.icon-button{order:2}
  .detail-layout{display:block;overflow-y:auto}
  .detail-main,.detail-side{overflow:visible}
  .detail-side{padding:15px;border-left:0;border-top:1px solid var(--line)}
}
@media(prefers-reduced-motion:reduce){.guide-progress-track span{transition:none}}

/* Center the reading window and align the two quick actions on each card. */
.header-inner{max-width:none;margin:0;padding-inline:clamp(12px,1.3vw,24px)}
.card-quick-actions{align-items:center}
.card-quick-button,.card-quick-export summary{box-sizing:border-box;min-height:29px;display:inline-flex;align-items:center;justify-content:center;line-height:1}
.card-quick-export{display:flex;align-items:center}
.detail-dialog{height:min(88dvh,900px);max-height:calc(100dvh - 32px);margin:auto;border-radius:18px;animation:detail-center .36s cubic-bezier(.16,1,.3,1) both}
@keyframes detail-center{from{transform:translateY(22px) scale(.985);opacity:.55}to{transform:translateY(0) scale(1);opacity:1}}
@media(max-width:690px){.header-inner{padding-inline:12px}.detail-dialog{width:calc(100vw - 16px);height:min(92dvh,850px);max-height:calc(100dvh - 16px);margin:auto;border-radius:16px}}
@media(prefers-reduced-motion:reduce){.detail-dialog{animation:none}}

/* Paper order follows the left column, then the right column, on every page. */
.sheet-paper-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-count:auto;column-rule:0;gap:5%;align-items:start}
.sheet-paper-column{min-width:0;height:100%}
.sheet-paper-column:first-child{border-right:1px solid #333;padding-right:4%}
.sheet-paper-item{margin-bottom:10%;break-inside:avoid}
.sheet-paper-item img{max-height:100%;object-fit:contain;object-position:top left}
@media print{
  .print-page{break-after:page;page-break-after:always;min-height:265mm}
  .print-page:last-child{break-after:auto;page-break-after:auto}
  .print-page-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7mm;height:252mm}
  .print-page-column{min-width:0}
  .print-page-column:first-child{border-right:1px solid #333;padding-right:3.5mm}
  .print-question{margin:0 0 10mm;break-inside:avoid;page-break-inside:avoid}
  .print-question img{max-height:236mm}
  .print-single-image{display:block;width:100%;height:auto;max-height:245mm;object-fit:contain;object-position:top left}
}

/* A compact glass card deck shows the prompt and figures on wide screens. */
.site-header{background:rgba(255,255,255,.76);backdrop-filter:blur(18px) saturate(1.45);-webkit-backdrop-filter:blur(18px) saturate(1.45)}
.header-button,.admin-icon,.icon-button,.carousel-controls button{background:rgba(255,255,255,.68);border:1px solid rgba(255,255,255,.8);box-shadow:inset 0 1px rgba(255,255,255,.9),0 3px 12px #20334c16;backdrop-filter:blur(14px) saturate(1.55);-webkit-backdrop-filter:blur(14px) saturate(1.55)}
.question-card{background:linear-gradient(140deg,rgba(255,255,255,.88),rgba(250,253,255,.7));border:1px solid rgba(255,255,255,.85);border-radius:18px;box-shadow:inset 0 1px rgba(255,255,255,.94),0 10px 32px #2d436520;backdrop-filter:blur(18px) saturate(1.35);-webkit-backdrop-filter:blur(18px) saturate(1.35)}
.question-card.is-current{box-shadow:inset 0 1px rgba(255,255,255,.95),0 16px 38px #2d436526}
.question-card .card-top{background-color:rgba(255,219,176,.62)}
.question-card:nth-child(4n+2) .card-top{background-color:rgba(218,222,255,.64)}
.question-card:nth-child(4n+3) .card-top{background-color:rgba(205,242,232,.64)}
.question-card:nth-child(4n) .card-top{background-color:rgba(255,218,226,.65)}
.card-quick-button,.card-quick-export summary{background:rgba(255,255,255,.78);border-color:rgba(255,255,255,.95);backdrop-filter:blur(12px) saturate(1.5);-webkit-backdrop-filter:blur(12px) saturate(1.5)}
.results-grid.is-sliding{scroll-behavior:auto;scroll-snap-type:none}
.results-grid::after{content:"";flex:0 0 max(0px,calc(100% - min(82vw,340px) - 8px))}
@media(min-width:960px){
  .question-card{flex-basis:clamp(380px,36vw,490px)}
  .results-grid::after{flex-basis:max(0px,calc(100% - clamp(380px,36vw,490px) - 8px))}
  .card-preview{height:auto;min-height:0;flex:1;position:relative;display:block;background:#fff;overflow:hidden}
  .card-preview img{position:absolute;inset:0;width:100%;height:100%;max-height:100%;object-fit:contain;object-position:center center}
}
.explanation,.explanation p{box-sizing:border-box;width:100%;max-width:none;white-space:normal;overflow-wrap:anywhere}
.explanation p{margin:10px 0 0}
.sheet-title-group{display:flex;align-items:center;gap:7px;min-width:0;flex-wrap:wrap}
.sheet-title-group h3{margin:0}
.sheet-content .sheet-rename-button{width:30px;height:30px;padding:5px!important;display:inline-grid;place-items:center;border:0!important;background:transparent!important;color:var(--blue)!important}
.sheet-rename-button svg{width:17px;height:17px;stroke-width:1.8}
.sheet-title-group .sheet-name-input{min-width:150px;max-width:min(280px,55vw);padding:5px 8px;border:1px solid var(--blue);border-radius:6px}
@media(max-width:690px){.sheet-item>button:last-child{grid-column:2;justify-self:start}}
@page{size:A4;margin:0}
@media print{
  html,body{margin:0!important;padding:0!important}
  .print-page{height:297mm;min-height:297mm;padding:12mm;box-sizing:border-box;overflow:hidden}
  .print-page-columns{height:251mm}
  .print-answer-table{font-size:10pt}
  .print-answer-table th,.print-answer-table td{padding:3mm}
}
@media(prefers-reduced-motion:reduce){.question-card{transition:none}.site-header,.header-button,.question-card,.card-quick-button{backdrop-filter:none;-webkit-backdrop-filter:none}}

/* The output choices appear in a focused dialog instead of an expanding menu. */
.sheet-controls>button{min-width:145px;min-height:44px;font-weight:750}
.sheet-controls .sheet-print-button{border:1px solid #cbd3d9!important;background:#fff!important}
.sheet-export-dialog{width:min(380px,calc(100vw - 32px));max-height:calc(100dvh - 32px);margin:auto;padding:22px;border-radius:18px;background:rgba(255,255,255,.96);box-shadow:0 24px 70px #14263d4d}
.sheet-export-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.sheet-export-head h2{font-size:21px;line-height:1.3;margin:0}
.sheet-export-dialog p{font-size:14px;color:var(--muted);margin:10px 0 18px}
.sheet-export-options{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.sheet-export-options button{min-height:56px;border:1px solid #cbd9e8;border-radius:11px;background:#f8fbff;color:var(--ink);font-weight:750}
.sheet-export-options button:hover{border-color:var(--blue);background:#eaf3ff;color:var(--blue)}
@media(min-width:960px){
  .detail-layout{grid-template-columns:minmax(0,.94fr) minmax(0,1.06fr)}
  .detail-side{padding:20px 24px}
  .card-preview img{object-fit:cover;object-position:center top}
}
@media(max-width:959px){
  .detail-layout{display:block;overflow-y:auto}
  .detail-main,.detail-side{overflow:visible}
  .detail-side{border-left:0;border-top:1px solid var(--line)}
}

/* Question export and source reading keep the detail header at a stable height. */
.detail-export-button,.source-paper-button{min-height:40px;border:1px solid #cbd9e8;border-radius:9px;background:#fff;color:var(--ink);font-weight:750}
.detail-export-button{padding:8px 14px}
.source-paper-button{width:42px;display:inline-grid;place-items:center;flex:none}
.source-paper-button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.detail-export-button:hover,.source-paper-button:hover{border-color:var(--blue);color:var(--blue);background:#eaf3ff}
.question-export-dialog{width:min(430px,calc(100vw - 32px));max-height:calc(100dvh - 32px);margin:auto;padding:22px;border-radius:18px;background:#fff;box-shadow:0 24px 70px #14263d4d}
.question-export-dialog p{font-size:14px;color:var(--muted);margin:10px 0 18px}
.question-export-options{display:grid;gap:9px}
.question-export-options button{min-height:48px;border:1px solid #cbd9e8;border-radius:10px;background:#f8fbff;color:var(--ink);font-weight:750;text-align:left;padding:10px 15px}
.question-export-options button:hover{border-color:var(--blue);background:#eaf3ff;color:var(--blue)}
.question-export-dialog .form-message{margin:12px 0 0}
.question-export-dialog .form-message:empty{display:none}
.source-paper-dialog{width:min(1100px,calc(100vw - 32px));height:min(90dvh,900px);max-height:calc(100dvh - 32px);margin:auto;padding:20px;box-sizing:border-box;display:none;flex-direction:column;gap:12px;border-radius:18px;background:#fff}
.source-paper-dialog[open]{display:flex}
.source-paper-dialog .sheet-export-head{flex:none}
.source-paper-dialog h2{margin:0;font-size:21px}
.source-paper-dialog p{margin:4px 0 0;font-size:14px;color:var(--muted)}
.source-paper-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:14px;color:var(--muted)}
.source-paper-toolbar a{color:var(--blue);font-weight:750;white-space:nowrap;text-underline-offset:3px}
.source-paper-viewer{display:flex;flex:1;min-height:0;flex-direction:column;gap:9px}
.source-paper-viewer[hidden]{display:none}
.source-page-controls{display:flex;align-items:center;justify-content:center;gap:14px;flex:none}
.source-page-controls button{width:36px;height:34px;border:1px solid #cbd9e8;border-radius:8px;background:#fff;color:var(--ink);font-size:19px}
.source-page-controls button:disabled{opacity:.42;cursor:default}
.source-page-controls span{min-width:85px;text-align:center;font-size:14px;font-weight:750}
.source-page-controls .source-zoom-button{width:auto;min-width:46px;padding:0 8px;font-size:13px;font-weight:750}
.source-page-image{flex:1;min-height:0;overflow:auto;display:grid;place-items:start center;border:1px solid #cbd9e8;border-radius:9px;background:#e9edf1}
.source-page-image img{display:block;width:min(100%,980px);height:auto;background:#fff;box-shadow:0 6px 22px #172b4426}
.source-page-image.is-zoomed{display:block}
.source-page-image.is-zoomed img{width:max(900px,100%);max-width:none;margin-inline:auto}
.source-paper-dialog .source-paper-notice{font-size:13px;margin:0}
.source-paper-dialog .source-paper-notice:empty{display:none}
@media(max-width:690px){
  .detail-head-actions{gap:6px}
  .detail-head-actions .detail-export-button{padding:8px 10px}
  .source-paper-dialog{width:calc(100vw - 16px);height:calc(100dvh - 16px);max-height:none;padding:13px;border-radius:15px}
  .source-paper-toolbar{align-items:flex-start;flex-direction:column;gap:5px}
}

/* Search stays compact on phones and opens as a rail drawer on wide screens. */
.desktop-search-toggle{display:none}
.advanced-search summary{cursor:pointer}
.advanced-search-content{min-width:0}
.action-toast[hidden]{display:none}
.action-toast{position:fixed;left:50%;bottom:max(22px,env(safe-area-inset-bottom));z-index:1000;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 32px);padding:11px 18px;border-radius:12px;background:#253952;color:white;box-shadow:0 12px 32px #132c4960;font-size:14px;font-weight:700;text-align:center;pointer-events:none;animation:toast-in .22s cubic-bezier(.16,1,.3,1) both}
@keyframes toast-in{from{opacity:0;transform:translate(-50%,12px)}to{opacity:1;transform:translate(-50%,0)}}
.results-grid{scroll-snap-type:x mandatory;scrollbar-width:thin;scrollbar-color:#8399aa #e4e9e8;scrollbar-gutter:stable}
.results-grid::-webkit-scrollbar{height:8px}
.results-grid::-webkit-scrollbar-track{background:#e4e9e8;border-radius:999px}
.results-grid::-webkit-scrollbar-thumb{background:#8399aa;border-radius:999px;border:2px solid #e4e9e8}
.results-grid::-webkit-scrollbar-thumb:hover{background:#53718a}
.question-card{scroll-snap-align:start;scroll-snap-stop:always}
.skeleton-card{padding:0 15px 16px;gap:15px;pointer-events:none;transform:none!important;opacity:1!important}
.skeleton-card>*{border-radius:7px;background:linear-gradient(100deg,#e7eaeb 30%,#f5f6f6 49%,#e7eaeb 68%);background-size:200% 100%;animation:skeleton-shimmer 1.3s ease-in-out infinite}
.skeleton-card .skeleton-top{height:48px;margin:0 -15px}
.skeleton-card .skeleton-preview{flex:1;min-height:190px}
.skeleton-card .skeleton-title{height:20px;width:83%}
.skeleton-card .skeleton-meta{height:14px;width:60%}
.skeleton-card .skeleton-tags{height:27px;width:45%}
@keyframes skeleton-shimmer{to{background-position-x:-200%}}
@media(min-width:960px){
  .workspace-layout{grid-template-columns:56px minmax(0,1fr);gap:18px;transition:grid-template-columns .32s cubic-bezier(.16,1,.3,1)}
  .workspace-layout.search-open{grid-template-columns:minmax(320px,360px) minmax(0,1fr)}
  .search-workspace{padding:0;overflow:visible;align-self:stretch;background:transparent;border:0;box-shadow:none;min-height:0}
  .desktop-search-toggle{display:flex;align-items:center;justify-content:center;gap:10px;width:56px;height:56px;padding:0;border:1px solid #d5d8d4;border-radius:13px;background:rgba(255,255,255,.83);color:var(--ink);box-shadow:0 5px 18px #20334c14;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);font-weight:700;white-space:nowrap}
  .desktop-search-toggle svg{width:23px;height:23px;flex:none}
  .desktop-search-toggle span{display:none}
  .workspace-layout.search-open .desktop-search-toggle{width:100%;justify-content:flex-start;padding:0 18px;background:#fff;border-radius:13px 13px 0 0;border-bottom:0}
  .workspace-layout.search-open .desktop-search-toggle span{display:inline}
  .workspace-layout.search-open .desktop-search-toggle::after{content:"×";margin-left:auto;font-size:24px;font-weight:400;line-height:1}
  .workspace-layout:not(.search-open) .search-controls{display:none}
  .search-controls{height:calc(100% - 56px);max-height:calc(100% - 56px);overflow-y:auto;padding:18px;background:#fff;border:1px solid #d5d8d4;border-radius:0 0 13px 13px;box-shadow:0 12px 30px #20334c16;scrollbar-width:thin}
  .advanced-search summary{display:none}
  .advanced-search-content{display:block}
  .results-grid{scroll-padding-inline:3px}
  .question-card{flex-basis:clamp(315px,28.5vw,430px)}
  .results-grid::after{flex-basis:max(0px,calc(100% - clamp(315px,28.5vw,430px) - 8px))}
}
@media(max-width:959px){
  .search-workspace{position:sticky;top:0;z-index:15;background:rgba(255,255,255,.97);box-shadow:0 7px 24px #20334c14;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
  .search-workspace:has(.advanced-search[open]){max-height:calc(100dvh - 12px);overflow-y:auto}
  .search-line{position:sticky;top:0;z-index:2;background:rgba(255,255,255,.98);padding-bottom:7px}
  #resultsTitle{scroll-margin-top:150px}
  .advanced-search{margin-top:9px;border-top:0}
  .advanced-search summary{display:flex;align-items:center;justify-content:space-between;min-height:44px;padding:8px 1px;list-style:none;color:var(--ink);font-size:14px;font-weight:750}
  .advanced-search summary::-webkit-details-marker{display:none}
  .advanced-search summary span{transition:transform .2s ease}
  .advanced-search[open] summary span{transform:rotate(180deg)}
  .advanced-search-content{padding-bottom:5px}
  .sort-row{margin-top:8px}
  .concept-chips:not(:empty){margin-bottom:8px}
}
@media(prefers-reduced-motion:reduce){
  .workspace-layout{transition:none}
  .skeleton-card>*{animation:none;background:#e7eaeb}
  .action-toast{animation:none}
  .advanced-search summary span{transition:none}
}

/* Give the question image the reading space; keep result count on the title line. */
.result-heading{display:flex;align-items:baseline;gap:9px;min-width:0;flex-wrap:wrap}
.result-heading h2{margin:0;font-size:22px;line-height:1.2}
.result-heading p{margin:0;font-size:13px;white-space:nowrap}
.section-head{margin-bottom:9px}
.carousel-controls button{width:36px;height:36px;font-size:19px}
.card-top{box-sizing:border-box;min-height:35px;height:35px;padding:5px 145px 5px 10px;gap:4px;flex-wrap:nowrap;overflow:hidden;align-items:center}
.source-badge{display:inline-block;max-width:100%;white-space:nowrap;font-size:10px;line-height:1.15;letter-spacing:-.055em;padding:4px 6px}
.card-quick-actions{right:7px;top:4px;gap:4px}
.card-quick-button{min-height:27px;font-size:10px;padding:4px 6px}
.card-body{gap:5px;padding:9px 12px}
.card-body h3{font-size:15px;line-height:1.32}
.card-meta{font-size:12px}
.card-tags{gap:4px}
.card-foot{padding:0 12px 9px;font-size:12px}
.detail-dialog[open]{overflow:clip}
.detail-layout{overscroll-behavior:contain}
#singleResult:empty{display:none}
html:has(#detailDialog[open]){overflow:hidden}
@media(min-width:960px){
  .page-shell{padding:12px 20px 14px}
  .desktop-search-toggle{height:44px;width:52px}
  .workspace-layout{grid-template-columns:52px minmax(0,1fr)}
  .workspace-layout.search-open{grid-template-columns:minmax(320px,360px) minmax(0,1fr)}
  .workspace-layout.search-open .desktop-search-toggle{height:44px}
  .search-controls{height:calc(100% - 44px);max-height:calc(100% - 44px)}
  .card-body{min-height:95px;max-height:112px;padding:8px 12px}
  .card-foot{padding:0 12px 8px}
}
@media(max-width:959px){
  .page-shell{padding-top:8px}
  .search-workspace{padding:8px 10px}
  .search-line{gap:6px;padding-bottom:0}
  .search-box input{height:43px;font-size:14px;padding-left:39px}
  .search-box>svg{left:12px;width:18px;height:18px}
  .clear-button{min-height:43px;padding:0 9px;font-size:13px}
  .suggestions{top:46px}
  .advanced-search{margin-top:4px}
  .advanced-search summary{min-height:33px;padding:3px 1px;font-size:13px}
  .results-section{margin-top:14px}
  .section-head{gap:7px;margin-bottom:8px}
  .result-heading h2{font-size:19px}
  .result-heading p{font-size:12px}
  .carousel-controls{gap:5px}
  .carousel-controls button{width:34px;height:34px;font-size:18px}
  #resultsTitle{scroll-margin-top:118px}
  .question-card{flex-basis:calc(100% - 28px)}
  .card-top{padding-right:115px}
  .source-badge{font-size:clamp(8px,2.4vw,10px)}
  .card-preview{height:clamp(260px,45dvh,335px)}
  .detail-layout{overflow-x:hidden;overflow-y:auto}
  .detail-main,.detail-side{overflow:visible}
}
@media(max-width:690px){
  .card-top{min-height:34px;height:34px;padding:5px 113px 5px 8px}
  .card-quick-actions{top:4px;right:5px;gap:3px}
  .card-quick-button{min-height:26px;font-size:9px;padding:3px 5px}
  .card-preview{height:clamp(260px,45dvh,335px)}
  .detail-dialog{overflow:clip}
  .detail-layout{flex:1;min-height:0;height:auto;max-height:none}
}
