:root{font-family:system-ui,-apple-system,"Yu Gothic",Meiryo,sans-serif;color:#263249;background:#f4f6fc}*{box-sizing:border-box}body{margin:0}.top{background:linear-gradient(120deg,#385ca9,#6d73c4);color:#fff;display:flex;justify-content:space-between;align-items:center;padding:20px max(18px,calc((100vw - 1100px)/2))}.top h1{font-size:1.3rem;margin:0}.top p{font-size:.85rem;margin:6px 0 0;color:#e5eaff}.ver{background:#ffffff33;padding:5px 11px;border-radius:20px;font-size:.8rem}main{max-width:1100px;margin:22px auto;padding:0 15px}.panel{background:#fff;padding:22px;border-radius:15px;box-shadow:0 3px 18px #202e5b0c;margin-bottom:18px}.heading{display:flex;justify-content:space-between;align-items:center;gap:15px;flex-wrap:wrap}.heading h2{margin:0 0 14px;font-size:1.07rem}.muted{font-size:.85rem;color:#68768d;line-height:1.7}.drop{min-height:116px;border:2px dashed #9caeda;border-radius:11px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;cursor:pointer;background:#f9fbff}.drop:hover{background:#f0f4ff}.drop small{color:#697a96}.big{font-size:24px;color:#577dd0}.toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:15px 0}.toolbar label{font-size:.84rem}button,select,input{font:inherit}button,select{border:1px solid #c8d2e8;background:white;color:#283e63;padding:9px 12px;border-radius:8px}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}.primary{background:#4b70c8;border-color:#4b70c8;color:white;font-weight:bold}.switch{display:flex;align-items:center;gap:4px}.progress{height:8px;background:#e7eaf5;border-radius:9px;overflow:hidden}.progress>div{height:100%;width:0;background:#6796dc;transition:width .15s}.previewWrap{background:#f0f2f8;overflow:auto;border-radius:8px;min-height:70px;padding:8px}#preview{display:block;max-width:100%;height:auto;cursor:crosshair}.inputs{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:10px}.inputs label{font-size:.76rem;color:#53637b}.inputs input{width:100%;margin-top:4px;padding:8px;border:1px solid #c7d2e6;border-radius:6px}.results{display:grid;grid-template-columns:repeat(auto-fill,minmax(265px,1fr));gap:12px}.result{border:1px solid #dfe6f3;border-radius:10px;padding:11px;background:#fff;display:grid;grid-template-columns:65px 1fr;gap:9px}.result img{width:60px;height:60px;object-fit:cover;border-radius:6px}.result .info{min-width:0}.result label{display:block;font-size:.73rem;color:#657286}.result select,.result input{width:100%;padding:6px;margin:3px 0 6px;font-size:.86rem}.result .meta{font-size:.74rem;color:#697994}.result .flag{display:inline-block;background:#fff0d7;color:#92610e;font-size:.72rem;padding:3px 6px;border-radius:5px}.result .good{background:#e8f6ee;color:#176a45}.result .candidates{font-size:.72rem;color:#737e94}.result .source{font-size:.72rem;color:#70819a}footer{text-align:center;padding:22px;color:#72819c;font-size:.8rem}@media(max-width:600px){.panel{padding:13px}.top{padding:18px}.top h1{font-size:1.05rem}.results{grid-template-columns:1fr}.heading{align-items:flex-start}}

/* v0.1.1: reference initialization bug fix. */
.assetline{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:0 0 14px}.assetline button{padding:6px 10px;font-size:.84rem}.result img.reference{object-fit:cover;width:34px;height:34px;border:1px solid #dfe6f3;margin-top:8px}.result .method{font-size:.73rem;color:#415775}.result .source{overflow-wrap:anywhere}

/* v0.3.0: confidence is communicated by the card border, not checkboxes. */
.result{border:3px solid #dfe6f3;}
.result.confidence-high{border-color:#239e67;}
.result.confidence-medium{border-color:#e8a318;}
.result.confidence-low{border-color:#d95546;}
.confidence-legend{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;font-size:.84rem;margin:6px 0 12px;}
.confidence-legend span{display:inline-flex;align-items:center;gap:6px;}
.confidence-legend span::before{content:'';display:inline-block;width:16px;height:16px;border:3px solid transparent;border-radius:4px;flex-shrink:0;}
.confidence-legend .legend-high::before{border-color:#239e67;}
.confidence-legend .legend-medium::before{border-color:#e8a318;}
.confidence-legend .legend-low::before{border-color:#d95546;}
.result .issue{color:#ad392c;font-size:.76rem;font-weight:600;}

/* v0.4.0: advanced grid controls are optional, not the default mobile workflow. */
.layoutDetails{margin-top:12px;padding:10px 12px;border:1px solid #dde5f4;border-radius:9px;background:#fafbff}
.layoutDetails summary{font-weight:600;font-size:.86rem;cursor:pointer;color:#415a8a}
.layoutDetails .inputs{margin-top:10px}
@media(max-width:600px){.layoutDetails{padding:9px}.previewWrap{padding:4px}}

/* v0.5.0: CR confidence is visible independently from the overall card border. */
.rank-confidence{display:inline-block;padding:1px 7px;border-radius:5px;font-size:.75rem;}
.rank-high{background:#e1f5e9;color:#11633d;}
.rank-medium{background:#fff0ca;color:#875300;}
.rank-low{background:#ffe4df;color:#a22a21;}

/* v0.7.0: two columns on compact screens, four on wider containers. */
.results-area{container-type:inline-size;min-width:0}
.results{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.result{display:block;min-width:0;padding:0;overflow:hidden;border-width:3px}
.result-details{min-width:0}
.result-toggle{display:flex;align-items:center;gap:8px;padding:8px;cursor:pointer;list-style:none;min-width:0;min-height:72px;touch-action:manipulation}
.result-toggle::-webkit-details-marker{display:none}
.result-toggle::marker{content:''}
.result-toggle img{flex:0 0 52px;width:52px;height:52px;object-fit:cover;margin:0;border-radius:7px}
.result-heading{display:flex;flex:1;flex-direction:column;align-items:flex-start;min-width:0;gap:3px}
.result-name{font-size:.83rem;line-height:1.35;overflow-wrap:anywhere;font-weight:650}
.result-rank{font-size:.83rem;font-weight:700;color:#3c5b8b;white-space:nowrap}
.result-arrow{border-right:2px solid #7787a0;border-bottom:2px solid #7787a0;width:8px;height:8px;transform:rotate(45deg);flex-shrink:0;margin-right:2px;transition:transform .15s}
.result-details[open] .result-arrow{transform:rotate(225deg)}
.result-expanded{border-top:1px solid #e3e8f1;padding:9px 10px 11px;min-width:0;overflow-wrap:anywhere}
.result-expanded label{display:block;min-width:0;margin-top:7px}
.result-expanded input{display:block;width:100%;min-width:0;margin-top:3px;margin-bottom:6px;padding:7px}
.result-expanded .meta,.result-expanded .method,.result-expanded .source{overflow-wrap:anywhere;line-height:1.5}
.result-expanded .candidate-details{margin-top:7px}
.result-expanded .candidate-details summary{cursor:pointer}
.result-details summary:focus-visible{outline:2px solid #385ca9;outline-offset:-3px}
@container (min-width:760px){.results{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}}
@media(max-width:600px){.results{grid-template-columns:repeat(2,minmax(0,1fr))}.result-toggle{padding:6px;gap:6px;min-height:62px}.result-toggle img{width:42px;height:42px;flex-basis:42px}.result-name{font-size:.76rem}.result-rank{font-size:.77rem}.result-arrow{width:7px;height:7px}}
@media(max-width:370px){.results{gap:7px}.result-toggle img{width:38px;height:38px;flex-basis:38px}.result-toggle{gap:5px;padding:5px}.result-name{font-size:.73rem}.result-arrow{margin-right:0}}

/* Fallback for browsers without CSS container queries. */
@supports not (container-type: inline-size){
  @media(min-width:980px){.results{grid-template-columns:repeat(4,minmax(0,1fr))}}
}

/* v0.8.0: explicit confidence reasons, touch-friendly dropdown and CR buttons. */
.result-reason-short{font-size:.68rem;line-height:1.35;color:#92500b;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
.confidence-low .result-reason-short{color:#a3382b}
.result-expanded{font-size:.81rem}
.result-expanded .edit-label{display:block;color:#3d4f70;font-weight:600;margin-top:11px;font-size:.8rem}
.result-expanded select.character{display:block;width:100%;max-width:100%;min-width:0;min-height:42px;margin-top:5px;padding:6px 8px;color:#243850;background:#fff;cursor:pointer;white-space:nowrap;text-overflow:ellipsis}
.diagnosis{border:1px solid #dce7e0;background:#f1f8f4;border-radius:8px;padding:9px;color:#28533a;line-height:1.55}
.diagnosis-medium{border-color:#f3da8c;background:#fff9e9;color:#79510b}
.diagnosis-low{border-color:#f1b9b0;background:#fff4f1;color:#912f23}
.diagnosis h3{font-size:.81rem;margin:0 0 5px;display:flex;flex-wrap:wrap;align-items:center;gap:5px}
.diagnosis h3 span{font-size:.73rem;font-weight:650}
.diagnosis-list{padding-left:1.2em;margin:5px 0;overflow-wrap:anywhere}
.diagnosis-list li+li{margin-top:4px}
.diagnosis-grades{margin:7px 0 0;padding-top:7px;border-top:1px solid currentColor;font-size:.73rem;opacity:.86}
.cr-control{margin-top:5px;min-width:0}
.cr-value{display:flex;align-items:center;justify-content:center;min-height:41px;border:1px solid #c5d2e6;border-radius:7px;background:#f7f9fe;font-size:1.1rem;font-weight:700;color:#254277}
.cr-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:7px}
.cr-buttons .cr-down,.cr-buttons .cr-up{min-width:0;min-height:43px;border-color:#9bb0d5;font-size:1.35rem;font-weight:650;touch-action:manipulation;background:#eff4ff}
.cr-buttons .cr-down:active,.cr-buttons .cr-up:active{background:#dce7ff}
.cr-clear{width:100%;margin-top:6px;min-height:34px;padding:5px 6px;color:#6b7991;background:#fff;font-size:.73rem}
.diagnostics-secondary{margin-top:12px;border-top:1px solid #e1e7f0;padding-top:10px;display:grid;gap:5px;color:#60718c}
.diagnostics-secondary .meta,.diagnostics-secondary .source,.diagnostics-secondary .method{font-size:.74rem;line-height:1.5}
.result-details summary:focus-visible,.result-expanded select:focus-visible,.result-expanded button:focus-visible{outline:2px solid #345fc6;outline-offset:2px}
@media(max-width:600px){.result-expanded{padding:7px}.diagnosis{padding:7px}.result-reason-short{font-size:.64rem}.result-expanded select.character{font-size:16px;min-height:44px}.cr-buttons{gap:5px}}

/* Keep each card compact when a red card in the same row is expanded; preserve row-major order. */
.results{align-items:start}

/* v0.8.1: an open neighbor must not stretch closed card borders. Keep grid reading order. */
.results > .result{align-self:start;height:max-content}

/* v0.9.0: navigation from the bottom of long results lists; compact supporter link. */
#resultsTop{scroll-margin-top:14px}
.results-navigation:not([hidden]){display:flex;justify-content:center;padding:20px 0 0}
.results-navigation button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;max-width:100%;padding:10px 17px;border:1px solid #9fb3dd;border-radius:9px;background:#f0f4ff;color:#294b92;text-align:center;text-decoration:none;font-size:.88rem;font-weight:650;overflow-wrap:anywhere}
.results-navigation button:hover{background:#e3ebff}
.results-navigation button:focus-visible,.support-message a:focus-visible{outline:2px solid #345fc6;outline-offset:3px}
.support-message{text-align:center;line-height:1.7;margin:16px 0 24px;padding:0 8px;font-size:.92rem;color:#3a4b67;overflow-wrap:anywhere}
.support-message a{color:#2750a0;text-decoration:underline;text-underline-offset:2px}
@media(max-width:600px){.results-navigation button{width:100%}.support-message{font-size:.86rem}}

/* v0.9.1: in-page export confirmation, not the browser's alert()/confirm(). */
.export-dialog{width:min(460px,calc(100% - 28px));max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);overflow-y:auto;margin:auto;padding:22px;border:1px solid #cad5e9;border-radius:14px;background:#fff;color:#263249;box-shadow:0 18px 55px #14213b44}
.export-dialog::backdrop{background:#152b4fa8}
.export-dialog h2{margin:0 0 14px;font-size:1.14rem}
.export-dialog p{margin:0 0 10px;font-size:.92rem;line-height:1.6;white-space:pre-wrap}
.export-dialog-notes{margin:12px 0;padding:0 0 0 1.4em;color:#79521b;font-size:.83rem;line-height:1.6;overflow-wrap:anywhere}
.export-dialog-notes:empty{display:none}
.export-dialog-notes li+li{margin-top:4px}
.export-dialog-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:10px;margin-top:18px}
.export-dialog-actions button{min-height:44px;min-width:110px;touch-action:manipulation}
.export-dialog-actions button:focus-visible{outline:2px solid #345fc6;outline-offset:2px}
@media(max-width:460px){.export-dialog{padding:17px}.export-dialog-actions button{flex:1 1 130px}}


/* v0.10.0: group JSON/CSV actions without a decorative surrounding box. */
.output-group{display:inline-flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0}
.output-format{font-size:.86rem;font-weight:700;color:#3e567f;margin-right:2px}
.output-group button{min-height:40px;touch-action:manipulation}
.output-group button:focus-visible{outline:2px solid #345fc6;outline-offset:2px}
.export-status{margin:2px 0 10px;font-size:.83rem;line-height:1.5;color:#285687;overflow-wrap:anywhere}
.export-status:empty{display:none}
.export-dialog-status{font-size:.82rem;color:#a33229;font-weight:600;margin:10px 0}
.export-dialog-status[hidden],.export-manual-copy[hidden]{display:none}
.export-manual-copy{margin:12px 0;font-size:.82rem;color:#415775}
.export-manual-copy textarea{display:block;width:100%;min-height:100px;margin-top:7px;padding:8px;border:1px solid #c8d2e8;border-radius:8px;font:12px/1.5 monospace;resize:vertical}
@media(max-width:440px){.output-group{gap:4px}.output-format{font-size:.82rem}.output-group button{padding:8px 10px}}

/* v1.0.1: screenshot capture instruction directly above the file selector. */
/* v1.0.4: clear, sequential capture instructions above the screenshot picker. */
.capture-guide{margin:12px 0 13px;padding:13px 15px;border-left:3px solid #5478be;border-radius:7px;background:#f2f6ff;color:#344f81}
.capture-guide h3{margin:0 0 11px;font-size:.95rem;font-weight:750;line-height:1.4}
.capture-steps{list-style:none;counter-reset:capture-step;margin:0;padding:0;display:grid;gap:9px}
.capture-steps li{counter-increment:capture-step;position:relative;min-height:28px;padding:3px 0 3px 35px;font-size:.88rem;line-height:1.6;overflow-wrap:anywhere}
.capture-steps li::before{content:counter(capture-step);position:absolute;left:0;top:1px;display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:#4c70bc;color:white;font-weight:750;font-size:.83rem;line-height:1}
.capture-steps strong{font-weight:750;color:#203f7c}
@media(max-width:600px){.capture-guide{padding:11px 12px}.capture-guide h3{font-size:.9rem}.capture-steps{gap:7px}.capture-steps li{font-size:.84rem}}
