* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }

.complaint-app h2,.complaint-app h3,.complaint-app h4,.complaint-app p { margin-top: 0; }
.complaint-app h2 { font-size: 22px; letter-spacing: 0; margin-bottom: 10px; }
.complaint-app h3 { font-size: 18px; margin-bottom: 0; }
.complaint-app h4 { font-size: 15px; margin-bottom: 8px; }
.workspace-bar { display: flex; align-items: center; gap: 36px; border-bottom: 1px solid var(--tool-color-border); padding: 19px 0; }
.workspace-title { display: flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; background: var(--tool-color-primary); color: white; border-radius: 7px; font-size: 18px; }
.main-nav { display: flex; gap: 10px; }
.main-nav [aria-current="page"] { font-weight: 750; text-decoration: underline; text-underline-offset: 10px; }
.intro-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 30px 0 22px; }
.intro-row h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.intro-row p { margin-bottom: 0; }
.muted { color: var(--tool-color-muted); font-size: 13px; }
.case-layout { display: grid; grid-template-columns: minmax(310px,.85fr) minmax(450px,1.45fr); gap: 26px; align-items: start; }
.input-column,.result-column { min-width: 0; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.section-heading h3 { display: flex; align-items: center; gap: 10px; }
.section-number { font-size: 13px; font-weight: 600; color: #7586a6; font-variant-numeric: tabular-nums; }
.micro-label { color: var(--tool-color-muted); font-size: 13px; white-space: nowrap; }
#sample-select { margin: 9px 0 20px; background-color: #f8faff; }
.field-pair { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; margin-bottom: 22px; }
.field-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.field-title .muted { font-size: 13px; }
#description { min-height: 190px; resize: vertical; font-size: 15px; line-height: 1.85; }
.input-hint { font-size: 13px; color: var(--tool-color-muted); line-height: 1.7; margin: 8px 0 17px; }
.upload-zone { position: relative; display: flex; flex-direction: column; align-items: center; border: 1px dashed #b7c8e1; background: #fafcff; padding: 17px 12px; border-radius: 8px; cursor: pointer; gap: 3px; text-align: center; }
.upload-zone:hover,.upload-zone.dragging { background: #eef4ff; border-color: var(--tool-color-primary); }
.upload-zone:focus-within { outline: 2px solid var(--tool-color-primary); }
.upload-glyph { font-size: 22px; color: #5778b2; line-height: 1; margin-bottom: 4px; }
.upload-zone strong { font-size: 15px; }
.upload-zone span:not(.upload-glyph),.upload-zone small { font-size: 13px; color: var(--tool-color-muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.attachment-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.attachment { min-width: 0; position: relative; }
.attachment img { width: 100%; height: 75px; object-fit: cover; border-radius: 6px; border: 1px solid #dbe3f0; }
.attachment small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.form-message { font-size: 15px; color: #b53838; margin-bottom: 10px; }
.result-column { background: #fff; border: 1px solid var(--tool-color-border); border-radius: 12px; overflow: hidden; }
.result-top { padding: 23px 28px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e7ecf5; }
.result-top h3 { margin-top: 3px; }
.status-pill { display: inline-block; padding: 4px 10px; border-radius: 5px; background: #edf3ff; color: #3462ab; font-size: 13px; white-space: nowrap; }
.status-pill.neutral { color: #67738f; background: #f1f4f9; }
.empty-result { min-height: 370px; padding: 80px 30px; text-align: center; }
.empty-result h3 { font-size: 22px; margin: 26px 0 12px; }
.empty-result p { font-size: 13px; color: var(--tool-color-muted); line-height: 1.9; }
.document-illustration { width: 150px; margin: auto; padding: 15px; background: #fff; border: 1px solid #d0ddef; border-radius: 8px; transform: rotate(-5deg); box-shadow: 12px 10px 0 #f0f4fb; text-align: left; }
.illustration-label { font-size: 13px; color: #6f83a4; }
.document-illustration i { display: block; height: 4px; background: #e4ebf7; margin-top: 9px; border-radius: 2px; }
.document-illustration i:nth-of-type(2) { width: 75%; }
.document-illustration i:nth-of-type(3) { width: 85%; }
.illustration-tags { display: flex; gap: 5px; margin-top: 15px; }
.illustration-tags b { font-size: 13px; font-weight: 500; padding: 3px 5px; color: #537eb9; background: #eff5ff; border-radius: 3px; }
.risk-banner { margin: 24px 28px 0; padding: 16px 18px; border-radius: 8px; background: #fff8ea; border-left: 3px solid #dca135; }
.risk-banner.urgent { background: #fff1f1; border-color: #c43838; }
.risk-banner.routine { background: #edf4ff; border-color: #6a94d7; }
.risk-banner strong { font-size: 15px; }
.risk-banner p { font-size: 15px; color: #6d6557; margin: 6px 0 0; line-height: 1.8; }
.result-section { margin: 0 28px; padding: 20px 0; }
.result-section .section-heading { margin-bottom: 16px; }
.category-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.category-chip { font-size: 13px; color: #466da7; border: 1px solid #d9e5f7; padding: 3px 9px; border-radius: 4px; background: #f6f9ff; }
.issue-row { display: grid; grid-template-columns: 122px minmax(0,1fr); gap: 16px; padding: 14px 0; border-bottom: 1px dashed #e3eaf5; }
.issue-row:last-child { border-bottom: 0; padding-bottom: 0; }
.issue-row blockquote { margin: 3px 0 6px; font-size: 15px; line-height: 1.8; color: #485872; overflow-wrap: anywhere; }
.issue-row small { font-size: 13px; color: #8a96aa; }
.assignment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.assignment-box { padding: 14px; background: #f7f9fc; border-radius: 7px; }
.assignment-box span { display: block; font-size: 13px; color: #77859c; margin-bottom: 5px; }
.assignment-box strong { font-size: 15px; font-weight: 650; }
.assignment-note { font-size: 13px; color: #79879d; margin: 10px 0 0; }
.anomaly-note { padding: 14px 16px; background: #f7f9fc; border-radius: 7px; font-size: 15px; line-height: 1.8; color: #5e6b81; }
.anomaly-note p { margin-bottom: 0; }
.action-list { margin: 0; padding-left: 22px; color: #4b5d79; font-size: 15px; line-height: 1.9; }
.action-list li { padding-left: 5px; margin: 9px 0; }
.reply-panel { margin: 24px 28px; padding: 20px; background: #f6f9fe; border-radius: 8px; }
.reply-panel .section-heading { margin-bottom: 12px; }
.reply-text { font-size: 15px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; margin-bottom: 0; }
.reply-panel .input-hint { margin-bottom: 0; }
.report-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 28px 24px; }
.report-footer p { font-size: 13px; color: #8190a8; margin-bottom: 0; }
.library-toolbar { display: grid; grid-template-columns: minmax(200px,500px) 180px; gap: 12px; margin: 8px 0 18px; }
.library-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.tag-card { border: 1px solid var(--tool-color-border); border-radius: 10px; padding: 22px; background: #fff; }
.tag-card .section-heading { margin-bottom: 15px; }
.tag-card h3 { font-size: 18px; margin-bottom: 12px; }
.tag-card p { font-size: 15px; line-height: 1.8; color: #647590; margin-bottom: 15px; }
.tag-card code { font-size: 13px; color: #8491a6; }
#tag-dialog { max-width: min(580px,calc(100vw - 32px)); width: 580px; border: 1px solid #dbe3f0; border-radius: 14px; color: #17233c; padding: 0; max-height: 85dvh; overflow: auto; box-shadow: 0 24px 70px #142c5b2b; }
#tag-dialog::backdrop { background: #172d514d; }
.dialog-content { padding: 26px; }
#tag-detail h2 { margin: 12px 0 8px; }
#tag-detail dl { margin-bottom: 0; }
#tag-detail dt { font-size: 15px; font-weight: 700; margin-top: 18px; }
#tag-detail dd { margin: 5px 0 0; color: #63738b; font-size: 15px; line-height: 1.8; }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); background: #213e70; color: #fff; padding: 12px 22px; border-radius: 8px; z-index: 1000; font-size: 15px; max-width: calc(100vw - 32px); }
@media(max-width:1100px) { .complaint-app { padding: 0 22px; } .case-layout { gap: 18px; grid-template-columns: minmax(280px,.9fr) minmax(360px,1.2fr); }  .library-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .issue-row { grid-template-columns: 1fr; gap: 0; } }
@media(max-width:760px) {  .workspace-bar { gap: 10px; flex-wrap: wrap; padding: 15px 0; } .workspace-title { font-size: 15px; } .main-nav { margin-left: auto; gap: 0; } .intro-row { align-items: flex-start; padding-top: 24px; } .complaint-app h2 { font-size: 22px; } .case-layout { grid-template-columns: 1fr; } .empty-result { min-height: auto; padding: 35px 20px; } .result-top { padding: 20px; } .result-section { margin: 0 20px; } .risk-banner,.reply-panel { margin-left: 20px; margin-right: 20px; } .section-heading { flex-wrap: wrap; } .report-footer { margin: 0 20px 20px; flex-wrap: wrap; } .library-toolbar,.library-grid { grid-template-columns: 1fr; } .library-toolbar { gap: 8px; } }


.extracted-tags > summary { cursor: pointer; color: var(--tool-color-text); font-size: 15px; font-weight: 650; }
.extracted-tags > summary::marker { color: var(--tool-color-muted); }
.extracted-tags .section-number { margin-right: 10px; }
.extracted-tags[open] > summary { margin-bottom: 18px; }
.analysis-heading { margin: 25px 28px 0; }
@media(max-width:760px) { .analysis-heading { margin-inline: 20px; } }

.result-block + .result-block { border-top: 1px solid var(--tool-color-border); margin-top: 20px; }
.analysis-facts { display: grid; grid-template-columns: 80px minmax(0,1fr); gap: 13px 18px; font-size: 15px; line-height: 1.8; }
.analysis-facts dt { font-weight: 650; color: #52617a; }
.analysis-facts dd { margin: 0; overflow-wrap: anywhere; }
.responsibility-row { font-size: 15px; line-height: 1.8; margin-bottom: 14px; }
.result-block .extracted-tags > summary { font-size: 15px; font-weight: 500; color: #67738f; }
.result-block .extracted-tags[open] .category-list { margin-top: 16px; }
.action-list.result-section { padding-left: 22px; }
.action-list p { margin: 4px 0; }
.action-list small { color: #77859c; }
#image-findings { font-size: 15px; line-height: 1.8; padding-top: 18px; }
@media(max-width:760px) { .analysis-facts { grid-template-columns: 1fr; gap: 4px; } .analysis-facts dd { margin-bottom: 10px; } }

.record-metadata { margin: 14px 0 20px; font-size: 13px; }
.record-metadata summary,.handling-history summary { cursor: pointer; color: #61728b; }
.record-metadata .field-pair { margin-top: 12px; }
#handling-panel { margin: 0 0 0 auto; width: min(480px,100vw); height: 100dvh; max-height: 100dvh; max-width: 100vw; border: 1px solid var(--tool-color-border); border-radius: 0; overflow-y: auto; }
#handling-panel .section-heading { gap: 16px; }
#handling-panel::backdrop { background: #172d514d; }
#handling-panel { overflow: hidden; padding: 0; }
#record-controls { height: 100%; display: flex; flex-direction: column; }
.panel-header,.panel-footer { padding: 20px 24px; flex: none; background: var(--tool-color-surface); }
.panel-header { border-bottom: 1px solid var(--tool-color-border); }
.panel-footer { border-top: 1px solid var(--tool-color-border); }
.panel-body { overflow-y: auto; padding: 0 24px 24px; flex: 1; min-height: 0; }
#history-panel { width: min(580px,95vw); border: 1px solid var(--tool-color-border); }
#history-panel::backdrop { background: #172d514d; }
#current-summary { font-weight: 600; overflow-wrap: anywhere; }
.result-column details > summary { cursor: pointer; }
#record-controls .tool-label { margin-top: 12px; display: block; }
#save-materials { margin: 0 0 10px; }
.handling-history { margin-top: 18px; font-size: 13px; line-height: 1.8; }
.records-toolbar { display: grid; grid-template-columns: 1fr 160px auto; gap: 12px; }
.record-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.record-card { border: 1px solid #e0e6ef; border-radius: 9px; padding: 20px; background: white; font-size: 15px; line-height: 1.8; }
.record-card p { margin-top: 12px; }
.records-pagination { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 24px 0; }
#related-history { font-size: 15px; line-height: 1.8; }
@media(max-width:760px) { .record-list { grid-template-columns: 1fr; } .records-toolbar { grid-template-columns: 1fr; } }

/* Report rhythm: shared controls, consistent body and secondary text. */
#current-status { background: var(--tool-color-surface-alt, #f7f9fc); margin: 20px 24px 0; padding: 16px; border-radius: var(--tool-radius-sm); }
#current-summary { margin-bottom: 12px; font-weight: 500; }
.record-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.result-column details.result-section { padding: 16px 0; border-top: 1px solid var(--tool-color-border); }
.result-column details > summary { font-size: 15px; font-weight: 500; color: var(--tool-color-text); }
.result-column details[open] > summary { margin-bottom: 16px; }
#analysis-snapshot { font-size: 13px; padding: 16px 0 0; margin-bottom: 0; }
.action-list small,.record-card small,#rule-history small { font-size: 13px; }
.analysis-facts dt { color: var(--tool-color-text); }
@media(max-width:760px) { .intro-row { flex-wrap: wrap; gap: 8px; } .intro-row h2 { flex-basis: 100%; } #current-status { margin-inline: 20px; } }
