.reference-shell { max-width: 980px; margin: auto; display: grid; gap: 24px; }
.reference-card { background: #fff; border: 1px solid #ddddea; border-radius: 20px; padding: 28px; }
.reference-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; color: #182444; }
.reference-card h3 { font-size: 18px; font-weight: 650; }
.reference-muted { color: #60667a; font-size: 14px; line-height: 1.7; }
.reference-input { display: block; width: 100%; height: 220px; padding: 16px; margin: 16px 0 8px; border: 1px solid #c4c5d7; border-radius: 12px; resize: none; overflow-y: auto; line-height: 1.7; background: #fafaff; }
.reference-input-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-right: 8px; }
.reference-input-footer > div { min-width: 0; }
.reference-input-footer > button { flex-shrink: 0; }
.reference-cost { display: flex; align-items: center; gap: 8px; color: #4f46e5; font-size: 14px; font-weight: 700; line-height: 1.7; margin-top: 4px; }
.reference-cost .material-symbols-outlined { font-size: 20px; flex-shrink: 0; }
.reference-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 16px; }
.reference-pagination[hidden] { display: none; }
.reference-pagination .reference-button { padding: 6px 12px; }
.image-history-thumbnail { display: block; margin: 12px 0 0 18px; padding: 6px; border: 1px solid #ddddea; border-radius: 8px; cursor: zoom-in; max-width: 240px; }
.image-history-thumbnail img { max-width: 100%; max-height: 120px; object-fit: contain; }
.image-history-zoom { width: min(1100px, 94vw); max-height: 94vh; padding: 16px; border: 0; border-radius: 16px; }
.image-history-zoom::backdrop { background: rgb(15 23 42 / 75%); }
.image-history-zoom > img { display: block; max-width: 100%; max-height: 78vh; object-fit: contain; margin: 12px auto 0; }
.reference-input:focus { outline: none; box-shadow: none; border-color: #5065bc; }
.reference-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
#reference-report > .reference-toolbar { margin-bottom: 16px; font-size: 14px; }
#reference-filter, #reference-download { height: 36px; font-size: 14px; line-height: 20px; border-radius: 8px; }
#reference-filter { padding: 6px 32px 6px 10px; }
#reference-download { padding: 6px 12px; }
.reference-button { background: #163b92; color: white; border: 1px solid #163b92; padding: 10px 18px; border-radius: 10px; cursor: pointer; }
.reference-button.secondary { background: white; color: #163b92; border-color: #c4c5d7; }
.reference-button:disabled { opacity: .5; cursor: not-allowed; }
.reference-status { margin-top: 14px; line-height: 1.7; white-space: pre-wrap; }
.reference-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.reference-badge { display: inline-block; border-radius: 8px; padding: 5px 10px; font-size: 13px; background: #eff1fa; color: #39466a; }
.reference-badge[data-status="matched"] { background: #e4f5eb; color: #21633d; }
.reference-badge[data-status="mismatch"], .reference-badge[data-status="error"] { background: #fff0e7; color: #984615; }
.reference-item { border-top: 1px solid #e2e3ee; padding: 16px 0; overflow-wrap: anywhere; }
.reference-item summary { cursor: pointer; line-height: 1.8; }
.reference-item p { margin: 10px 0; line-height: 1.7; white-space: pre-wrap; }
.reference-item a { color: #163b92; text-decoration: underline; }
.reference-verdict { margin-top: 16px; padding: 4px 16px; background: #f2f4fa; border-left: 4px solid #64749b; border-radius: 6px; font-weight: 600; }
.reference-verdict[data-status="mismatch"], .reference-verdict[data-status="error"] { background: #fff5ed; border-left-color: #b75b23; color: #803c18; }
.reference-verdict[data-status="matched"] { background: #edf8f1; border-left-color: #368357; }
.reference-difference { margin: 20px 0; }
.reference-difference h4 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.reference-difference-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.reference-difference-input, .reference-difference-source { padding: 14px 16px; border-radius: 10px; border: 1px solid #dde2ed; background: #f7f9fd; }
.reference-difference-input { border-color: #edc5ab; background: #fff8f3; }
.reference-difference-pair p { margin-bottom: 0; font-weight: 600; }
.reference-action { padding: 12px 16px; background: #f4f6fc; border-radius: 8px; font-size: 14px; }
.reference-full-comparison { margin: 18px 0; color: #46516d; }
.reference-full-comparison > summary { font-size: 14px; }
.reference-row-changed { background: #fff5ed; }
.reference-table-wrap { overflow-x: auto; }
.reference-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 12px 0; }
.reference-table th, .reference-table td { text-align: left; padding: 10px; border: 1px solid #ddddea; vertical-align: top; min-width: 90px; }
.reference-history { display: grid; gap: 8px; margin-top: 12px; }
.reference-history button { text-align: left; border-radius: 10px; padding: 12px; background: #f4f5fb; cursor: pointer; }
.reference-progress { width: 100%; height: 8px; margin-top: 12px; }
.reference-mobile-link { display: none; }
@media (max-width: 767px) { .reference-card { padding: 18px; } .reference-mobile-link { display: block; color: #163b92; } }
@media (max-width: 600px) { .reference-difference-pair { grid-template-columns: 1fr; } }
