.contract-app .content-header { display: none; }

.contract-page {
    color: #263240;
}

.contract-page-actions {
    min-height: 58px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.contract-page-actions h2 {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 650;
}

.contract-page-actions p {
    margin: 0.3rem 0 0;
    color: #74808d;
    font-size: 0.8rem;
}

.contract-page-actions .btn svg,
.contract-action-group .btn svg,
.citation-panel .btn svg,
.review-actions .btn svg {
    width: 1rem;
    height: 1rem;
}

.contract-action-group {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.contract-action-group .btn,
.citation-panel .btn,
.review-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.contract-panel {
    background: #fff;
    border: 1px solid #dfe5ea;
    border-radius: 0.4rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.contract-kpi-band {
    display: grid;
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    margin-bottom: 1rem;
    background: #fff;
    border: 1px solid #dfe5ea;
    border-radius: 0.4rem;
    overflow: hidden;
}

.contract-kpi {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    background: #fff;
    border: 0;
    border-right: 1px solid #edf0f2;
    color: #606d79;
    text-align: left;
}

.contract-kpi:last-child {
    border-right: 0;
}

.contract-kpi:hover,
.contract-kpi.active {
    background: #f3f8fc;
}

.contract-kpi span {
    font-size: 0.78rem;
}

.contract-kpi strong {
    color: #1769aa;
    font-size: 1.5rem;
}

.contract-kpi.danger strong {
    color: #b54747;
}

.contract-filter-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, 0.75fr)) minmax(240px, 1.5fr) auto;
    align-items: end;
    gap: 0.65rem;
    padding: 0.8rem 1rem;
    background: #f8fafb;
    border-bottom: 1px solid #e4e9ee;
}

.contract-filter-bar label > span {
    display: block;
    margin-bottom: 0.28rem;
    color: #5e6975;
    font-size: 0.72rem;
    font-weight: 600;
}

.contract-filter-bar .form-control,
.contract-filter-bar .form-select {
    height: 36px;
    font-size: 0.8rem;
}

.contract-filter-actions {
    display: flex;
    gap: 0.4rem;
}

.contract-filter-actions .btn {
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.contract-filter-actions svg {
    width: 1rem;
    height: 1rem;
}

.contract-table {
    table-layout: fixed;
    width: 100%;
    font-size: 0.8rem;
}

.contract-table th,
.contract-table td {
    padding: 0.72rem 0.8rem;
    vertical-align: middle;
}

.contract-table th:first-child { width: 21%; }
.contract-table th:nth-child(2) { width: 9%; text-align: center; }
.contract-table th:nth-child(3) { width: 11%; }
.contract-table th:nth-child(4) { width: 12%; }
.contract-table th:nth-child(5) { width: 12%; }
.contract-table th:last-child { width: 35%; }

.contract-table td:first-child {
    min-width: 0;
}

.contract-table td small,
.contract-table td:first-child a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contract-table td small {
    margin-top: 0.15rem;
    color: #8a95a1;
}

.contract-primary-link {
    color: #253343;
    font-weight: 600;
    text-decoration: none;
}

.contract-primary-link:hover,
.text-button:hover {
    color: #1769aa;
}

.contract-meta {
    color: #718096;
    font-size: 0.7rem;
}

.document-type-tag {
    width: 64px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.35rem;
    color: #3e617d;
    background: #eef5fa;
    border: 1px solid #cfe0eb;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
}
.document-type-tag.contract { color: #1769aa; background: #eef7fc; border-color: #b9d7e9; }
.document-type-tag.regulation { color: #8a5a16; background: #fff7e8; border-color: #ead39e; }
.document-type-tag.reference { color: #5e6570; background: #f1f3f5; border-color: #d4d9df; }
.contract-table td:nth-child(2) { text-align: center; }
.document-group-row th { padding: 0.45rem 0.8rem; background: #f5f8fa; border-top: 1px solid #dce5eb; border-bottom: 1px solid #e8eef2; }
.document-group-toggle { display: inline-flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.15rem 0; color: #344054; background: transparent; border: 0; font-size: 0.78rem; font-weight: 700; text-align: left; cursor: pointer; }
.document-group-toggle svg { width: 0.9rem; height: 0.9rem; color: #1769aa; transition: transform 0.15s ease; }
.document-group-toggle.collapsed svg { transform: rotate(-90deg); }
.document-group-toggle small { margin-left: 0.2rem; color: #82909d; font-size: 0.7rem; font-weight: 500; }
.document-group-empty { padding: 0.85rem; color: #98a2b3; font-size: 0.75rem; text-align: center; }

.contract-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #52606d;
    font-size: 0.73rem;
    white-space: nowrap;
}

.contract-status i,
.task-progress i {
    width: 0.45rem;
    height: 0.45rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #8b98a5;
}

.contract-status.ready i,
.contract-status.pending i { background: #23856d; }
.contract-status.processing i,
.contract-status.uploaded i,
.contract-status.parsing i,
.contract-status.chunking i,
.contract-status.embedding i { background: #d28a16; }
.contract-status.needs_ocr i,
.contract-status.overdue i,
.contract-status.failed i { background: #c44545; }
.contract-status.waiting i { background: #7656a5; }
.contract-status.candidate i { background: #d28a16; }

.icon-button {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: #617080;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.35rem;
}

.icon-button:hover {
    color: #1769aa;
    background: #f1f6fa;
    border-color: #d9e4ed;
}

.icon-button svg,
.pagination-compact svg {
    width: 1rem;
    height: 1rem;
}

.contract-row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.contract-row-action {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.55rem;
    color: #1769aa;
    background: #f8fbfd;
    border: 1px solid #cfe0eb;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.contract-row-action svg { width: 0.85rem; height: 0.85rem; }
.contract-row-action:hover { color: #0f4f83; background: #eef7fc; border-color: #a9c9dc; }
.contract-row-action.danger { color: #b42318; background: #fffafa; border-color: #e8c8c5; }
.contract-row-action.danger:hover { color: #8f1b13; background: #fff1f0; border-color: #dca5a0; }
.contract-row-action.disabled { color: #98a2b3; background: #fafbfc; border-color: #e4e7eb; cursor: default; }
.contract-row-action.disabled:hover { color: #98a2b3; background: #fafbfc; border-color: #e4e7eb; }
.document-operation-button { color: #3e617d; }
.document-operation-button:hover { color: #174c70; }
.source-file-state { display: block; margin-top: 0.15rem; font-size: 0.66rem; }
.source-file-state.available { color: #527463; }
.source-file-state.missing { color: #a15c28; }
.delete-document-copy { margin: 0; color: #475467; font-size: 0.86rem; line-height: 1.65; }
.delete-document-copy strong { color: #1f2937; }
.delete-document-modal .btn-danger { min-width: 92px; }
.delete-document-modal .contract-inline-alert { margin-top: 1rem; }

.contract-table-footer {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 1rem;
    color: #7b8794;
    font-size: 0.75rem;
    border-top: 1px solid #edf0f2;
}

.pagination-compact {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.pagination-compact button {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0;
    background: #fff;
    border: 1px solid #d9e0e6;
    border-radius: 0.3rem;
}

.contract-modal {
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 0.45rem;
}

.contract-modal .modal-header {
    align-items: flex-start;
}

.contract-modal .modal-title {
    font-size: 1.05rem;
}

.contract-modal .modal-header p {
    margin: 0.25rem 0 0;
    color: #7a8793;
    font-size: 0.75rem;
}

.document-operation-modal { min-height: 290px; }
.document-operation-modal .modal-body { min-height: 190px; }
.document-operation-modal .form-label { color: #475467; font-size: 0.8rem; font-weight: 600; }
.document-operation-result { padding: 1rem; border: 1px solid #d7e7dc; border-left: 3px solid #4c8c62; background: #f4faf5; color: #344054; }
.document-operation-result h3 { margin: 0 0 0.7rem; color: #255b39; font-size: 0.95rem; }
.document-operation-result p { margin: 0 0 0.7rem; font-size: 0.82rem; line-height: 1.6; }
.document-operation-result dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; margin: 0 0 0.8rem; }
.document-operation-result dl div { padding: 0.6rem; background: #fff; border: 1px solid #e0eee3; }
.document-operation-result dt { color: #7a8793; font-size: 0.68rem; }
.document-operation-result dd { margin: 0.15rem 0 0; color: #255b39; font-size: 1rem; font-weight: 700; }
.document-operation-result a { color: #1769aa; font-size: 0.78rem; font-weight: 600; }
.review-operation-summary { margin-bottom: 0.85rem; }
.review-operation-findings { display: grid; gap: 0.65rem; max-height: 390px; overflow: auto; padding-right: 0.2rem; }
.review-operation-finding { padding: 0.75rem; background: #fff; border: 1px solid #e0e6eb; border-left: 3px solid #b8cbd8; }
.review-operation-finding.critical { border-left-color: #b54747; }
.review-operation-finding.high { border-left-color: #c47a2c; }
.review-operation-finding.medium { border-left-color: #d0a33d; }
.review-operation-finding header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.review-operation-finding h4 { margin: 0.35rem 0 0; color: #253343; font-size: 0.82rem; line-height: 1.45; }
.review-operation-finding p { margin: 0.55rem 0 0; color: #667085; font-size: 0.75rem; line-height: 1.55; }
.review-operation-finding blockquote { margin: 0.55rem 0 0; padding: 0.55rem 0.7rem; color: #475467; background: #f8fafb; border-left: 2px solid #d7e1e7; font-size: 0.73rem; line-height: 1.5; }
.review-operation-finding small { display: block; margin-top: 0.35rem; color: #82909d; font-size: 0.67rem; }
.translation-operation-segments { display: grid; gap: 0.65rem; max-height: 390px; overflow: auto; padding-right: 0.2rem; }
.translation-operation-segment { padding: 0.75rem; background: #fff; border: 1px solid #e0e6eb; }
.translation-operation-segment header { display: flex; justify-content: space-between; color: #475467; font-size: 0.75rem; }
.translation-operation-segment header small { color: #82909d; }
.translation-operation-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.55rem; }
.translation-operation-columns section { min-width: 0; padding: 0.6rem; background: #f8fafb; }
.translation-operation-columns h4 { margin: 0 0 0.35rem; color: #667085; font-size: 0.7rem; }
.translation-operation-columns p { margin: 0; color: #344054; font-size: 0.75rem; line-height: 1.55; white-space: pre-wrap; }
.translation-operation-flags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.55rem; }
.todo-operation-list { display: grid; gap: 0.65rem; max-height: 390px; overflow: auto; padding-right: 0.2rem; }
.todo-operation-item { padding: 0.75rem; background: #fff; border: 1px solid #e0e6eb; border-left: 3px solid #d0a33d; }
.todo-operation-item header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.todo-operation-item h4 { margin: 0.35rem 0 0; color: #253343; font-size: 0.82rem; line-height: 1.45; }
.todo-operation-item header > strong { color: #1769aa; font-size: 0.82rem; white-space: nowrap; }
.todo-operation-item p { margin: 0.55rem 0 0; color: #475467; font-size: 0.75rem; line-height: 1.55; }
.todo-operation-item small { display: block; margin-top: 0.45rem; color: #82909d; font-size: 0.68rem; }
@media (max-width: 640px) { .translation-operation-columns { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .document-operation-result dl { grid-template-columns: 1fr; } }

.upload-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 1rem;
    color: #84909c;
    font-size: 0.75rem;
}

.upload-steps span {
    padding-bottom: 0.55rem;
    border-bottom: 2px solid #e5e9ed;
}

.upload-steps span.active {
    color: #1769aa;
    border-color: #1769aa;
}

.upload-dropzone {
    position: relative;
    overflow: hidden;
    min-height: 135px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 0.35rem;
    color: #64717d;
    background: #f8fafb;
    border: 1px dashed #aeb9c3;
    border-radius: 0.4rem;
    cursor: pointer;
}

.upload-dropzone svg { width: 1.8rem; height: 1.8rem; color: #1769aa; }
.upload-dropzone span { font-size: 0.75rem; }
.upload-dropzone .upload-file-name { color: #1769aa; font-weight: 600; }
.upload-dropzone .upload-file-name.selected { color: #287653; }
.upload-dropzone input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-wait-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 2rem;
    color: #253343;
    text-align: center;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(2px);
}

.upload-wait-overlay strong { font-size: 1rem; }
.upload-wait-overlay > span:last-child { max-width: 360px; color: #667585; font-size: 0.78rem; line-height: 1.6; }

.upload-wait-spinner {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #1769aa;
    border: 1px solid #d7e6f1;
    border-radius: 50%;
    background: #f4f9fc;
}

.upload-wait-spinner span {
    width: 5px;
    height: 18px;
    border-radius: 2px;
    background: currentColor;
    animation: upload-wait-pulse 0.9s ease-in-out infinite;
}

.upload-wait-spinner span:nth-child(2) { animation-delay: 0.12s; }
.upload-wait-spinner span:nth-child(3) { animation-delay: 0.24s; }

@keyframes upload-wait-pulse {
    0%, 100% { height: 12px; opacity: 0.45; }
    50% { height: 26px; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .upload-wait-spinner span { animation: none; height: 18px; opacity: 0.75; }
}

.task-progress {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #5c6875;
    font-size: 0.78rem;
}

.task-progress i { background: #23856d; }

.translation-shell {
    min-height: 610px;
    display: grid;
    grid-template-columns: 215px minmax(0, 1fr);
    overflow: hidden;
}

.translation-nav,
.review-list,
.milestone-list,
.query-scope,
.citation-panel {
    background: #f8fafb;
    border-right: 1px solid #e2e7ec;
}

.translation-nav-title {
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid #e2e7ec;
}

.translation-nav-title span,
.translation-nav-title small {
    display: block;
}

.translation-nav-title span { font-weight: 650; font-size: 0.85rem; }
.translation-nav-title small { margin-top: 0.2rem; color: #84909c; font-size: 0.7rem; }

.translation-segment-link {
    width: 100%;
    min-height: 68px;
    position: relative;
    display: grid;
    gap: 0.18rem;
    padding: 0.7rem 2rem 0.7rem 0.9rem;
    color: #53606d;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #e8ecef;
}

.translation-segment-link:hover,
.translation-segment-link.active {
    background: #eaf3fa;
    color: #1f3549;
}

.translation-segment-link span { font-size: 0.7rem; }
.translation-segment-link strong { font-size: 0.8rem; }

.segment-state {
    width: 0.5rem;
    height: 0.5rem;
    position: absolute;
    top: 1rem;
    right: 0.9rem;
    border-radius: 50%;
    background: #8b98a5;
}

.segment-state.accepted { background: #23856d; }
.segment-state.edited { background: #1769aa; }
.segment-state.flagged { background: #d28a16; }

.translation-editor,
.translation-segment-panel {
    min-width: 0;
}

.translation-segment-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 610px;
}

.translation-column {
    min-width: 0;
    padding: 1rem;
}

.source-column { border-right: 1px solid #e2e7ec; }

.workspace-column-title {
    min-height: 40px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.workspace-column-title span { font-size: 0.85rem; font-weight: 650; }
.workspace-column-title small { color: #82909d; font-size: 0.7rem; }

.contract-text-block,
.translation-textarea {
    width: 100%;
    min-height: 380px;
    padding: 1rem;
    color: #303d49;
    background: #fbfcfd;
    border: 1px solid #dfe5ea;
    border-radius: 0.35rem;
    font-family: inherit;
    font-size: 0.88rem;
    line-height: 1.8;
}

.translation-textarea {
    resize: none;
    background: #fff;
}

.translation-textarea:focus {
    outline: 2px solid rgba(23, 105, 170, 0.14);
    border-color: #68a2cf;
}

.translation-validation {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    background: #f8fafb;
    border-top: 1px solid #e2e7ec;
    font-size: 0.75rem;
}

.validation-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #287a67;
}

.validation-item.warning { color: #a66b0c; }
.validation-item svg { width: 0.9rem; height: 0.9rem; }

.query-workspace {
    min-height: 650px;
    display: grid;
    grid-template-columns: 220px minmax(380px, 1fr) 330px;
    overflow: hidden;
}

.query-scope {
    padding: 1rem;
}

.query-scope h3,
.citation-panel h3 {
    margin: 0 0 1rem;
    font-size: 0.9rem;
}

.query-scope > label {
    display: block;
    margin-bottom: 1rem;
}

.query-scope > label > span {
    display: block;
    margin-bottom: 0.35rem;
    color: #5f6b77;
    font-size: 0.72rem;
    font-weight: 600;
}

.query-scope .form-select,
.query-scope .form-control { font-size: 0.78rem; }

.check-list {
    display: grid;
    gap: 0.45rem;
    font-size: 0.78rem;
}

.check-list label { display: flex; align-items: center; gap: 0.4rem; }

.scope-summary {
    display: grid;
    gap: 0.3rem;
    padding: 0.75rem;
    color: #6b7783;
    background: #eef4f8;
    border-radius: 0.35rem;
    font-size: 0.72rem;
}

.scope-summary strong { color: #354453; }

.query-main {
    min-width: 0;
    padding: 1rem 1.15rem;
}

.query-form {
    display: flex;
    align-items: stretch;
    gap: 0.55rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e9ed;
}

.query-form textarea {
    min-height: 70px;
    flex: 1;
    padding: 0.7rem;
    border: 1px solid #cfd8df;
    border-radius: 0.35rem;
    resize: vertical;
    font-size: 0.85rem;
}

.query-form .btn {
    min-width: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.query-form svg { width: 1rem; height: 1rem; }

.query-answer {
    padding: 1rem 0;
    font-size: 0.88rem;
    line-height: 1.75;
}

.query-answer.loading { opacity: 0.45; }

.answer-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.answer-confidence {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #287a67;
    font-size: 0.75rem;
}

.answer-confidence svg { width: 1rem; height: 1rem; }
.query-answer h3 { margin: 1rem 0 0.35rem; font-size: 0.88rem; font-weight: 650; }
.query-answer p { margin: 0; }

.citation-chip {
    padding: 0 0.2rem;
    color: #1769aa;
    background: transparent;
    border: 0;
    font-weight: 700;
}

.answer-note {
    display: flex;
    gap: 0.55rem;
    margin-top: 1rem;
    padding: 0.7rem;
    color: #5b6773;
    background: #f3f6f8;
    border-left: 3px solid #1769aa;
    font-size: 0.76rem;
}

.answer-note svg { width: 1rem; height: 1rem; flex: 0 0 auto; }

.citation-panel {
    padding: 1rem;
    border-right: 0;
    border-left: 1px solid #e2e7ec;
}

.citation-panel-title {
    display: flex;
    justify-content: space-between;
}

.citation-panel-title span { color: #84909c; font-size: 0.72rem; }

.citation-item {
    width: 100%;
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
    padding: 0.7rem;
    color: #4f5e6c;
    text-align: left;
    background: #fff;
    border: 1px solid #dfe5ea;
    border-radius: 0.35rem;
}

.citation-item:hover,
.citation-item.active { border-color: #6ca2ca; background: #f4f9fc; }
.citation-item .citation-number {
    width: 22px;
    height: 22px;
    display: grid;
    flex: 0 0 22px;
    place-items: center;
    padding: 0;
    color: #fff;
    background: #1769aa;
    border-radius: 50%;
    font-size: 0.7rem;
    line-height: 1;
    text-align: center;
}
.citation-item strong,
.citation-item span,
.citation-item small { display: block; }
.citation-item strong { color: #314151; font-size: 0.75rem; }
.citation-item div > span { margin-top: 0.2rem; font-size: 0.72rem; }
.citation-item small { margin-top: 0.15rem; color: #84909c; font-size: 0.68rem; }
.citation-item p { margin: 0.45rem 0 0; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; font-size: 0.72rem; line-height: 1.5; }

.review-summary-band {
    min-height: 72px;
    display: grid;
    grid-template-columns: repeat(5, minmax(90px, 0.6fr)) minmax(190px, 1.3fr);
    margin-bottom: 1rem;
    background: #fff;
    border: 1px solid #dfe5ea;
    border-radius: 0.4rem;
    overflow: hidden;
}

.review-summary-band > div,
.review-summary-band > button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    color: #63707c;
    background: #fff;
    border: 0;
    border-right: 1px solid #edf0f2;
    font-size: 0.75rem;
}

.review-summary-band strong { font-size: 1.25rem; color: #334252; }
.review-summary-band .risk-high { color: #b54747; }

.review-progress {
    display: grid !important;
    align-content: center;
    gap: 0.4rem !important;
    border-right: 0 !important;
}

.review-progress div { height: 5px; background: #e8ecef; border-radius: 4px; overflow: hidden; }
.review-progress i { display: block; height: 100%; background: #1769aa; }

.review-workspace {
    min-height: 620px;
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    overflow: hidden;
}

.review-list-toolbar {
    display: flex;
    gap: 0.4rem;
    padding: 0.65rem;
    border-bottom: 1px solid #e2e7ec;
}

.review-list-toolbar .form-select { font-size: 0.75rem; }

.review-finding-link {
    width: 100%;
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 0.65rem;
    padding: 0.8rem;
    color: #52606d;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #e6eaee;
}

.review-finding-link:hover,
.review-finding-link.active { background: #eaf3fa; }
.review-finding-link strong,
.review-finding-link span { display: block; }
.review-finding-link strong { color: #2d3c4b; font-size: 0.78rem; line-height: 1.45; }
.review-finding-link div span { margin-top: 0.25rem; color: #82909d; font-size: 0.68rem; }

.risk-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 24px;
    padding: 0 0.4rem;
    color: #fff;
    border-radius: 0.25rem;
    font-size: 0.68rem;
    font-weight: 700;
}

.risk-label.critical { background: #8f2d2d; }
.risk-label.high { background: #c44545; }
.risk-label.medium { background: #c77b12; }

.review-detail,
.milestone-detail {
    min-width: 0;
    padding: 1.1rem;
}

.review-detail-heading,
.milestone-detail-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e9ed;
}

.review-detail-heading h3,
.milestone-detail-heading h3 { margin: 0.55rem 0 0.25rem; font-size: 1rem; }
.review-detail-heading p,
.milestone-detail-heading p { margin: 0; color: #80909d; font-size: 0.72rem; }
.human-status { color: #a66b0c; font-size: 0.75rem; white-space: nowrap; }

.review-finding-panel section,
.milestone-detail-panel section { margin-top: 1rem; }
.review-finding-panel h4,
.milestone-detail-panel h4 { margin: 0 0 0.45rem; color: #52606d; font-size: 0.76rem; font-weight: 650; }
.review-finding-panel p,
.milestone-detail-panel p { margin: 0; font-size: 0.85rem; line-height: 1.65; }

.evidence-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.evidence-grid section {
    padding: 0.85rem;
    background: #f8fafb;
    border: 1px solid #e2e7ec;
    border-radius: 0.35rem;
}

blockquote {
    margin: 0;
    color: #475563;
    font-size: 0.8rem;
    line-height: 1.65;
}

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.55rem;
    padding: 0;
    color: #1769aa;
    background: transparent;
    border: 0;
    font-size: 0.72rem;
}

.text-button svg { width: 0.8rem; height: 0.8rem; }
.recommendation { padding: 0.8rem; background: #eef5fa; border-left: 3px solid #1769aa; }

.review-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e9ed;
}

.segmented-control {
    display: flex;
    padding: 2px;
    background: #e7ecf0;
    border-radius: 0.35rem;
}

.segmented-control button {
    width: 34px;
    height: 32px;
    display: grid;
    place-items: center;
    color: #687582;
    background: transparent;
    border: 0;
    border-radius: 0.25rem;
}

.segmented-control button.active { color: #1769aa; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.segmented-control svg { width: 1rem; height: 1rem; }

.milestone-filter {
    grid-template-columns: repeat(3, minmax(140px, 0.7fr)) minmax(220px, 1.3fr) auto;
}

.milestone-workspace {
    min-height: 590px;
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
}

.milestone-list { border-right: 1px solid #e2e7ec; }

.milestone-link {
    width: 100%;
    display: grid;
    gap: 0.28rem;
    padding: 0.8rem;
    color: #52606d;
    text-align: left;
    background: #f8fafb;
    border: 0;
    border-bottom: 1px solid #e6eaee;
}

.milestone-link:hover,
.milestone-link.active { background: #eaf3fa; }
.milestone-link strong { color: #2d3c4b; font-size: 0.8rem; }
.milestone-link > span:not(.contract-status) { font-size: 0.72rem; }
.milestone-link small { overflow: hidden; color: #87939f; font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }
.milestone-detail-heading > strong { color: #1769aa; font-size: 1rem; white-space: nowrap; }

.milestone-fields {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 1rem 0 0;
    border: 1px solid #e2e7ec;
    border-radius: 0.35rem;
    overflow: hidden;
}

.milestone-fields div { padding: 0.7rem; border-right: 1px solid #e2e7ec; }
.milestone-fields div:last-child { border-right: 0; }
.milestone-fields dt { color: #82909d; font-size: 0.68rem; font-weight: 500; }
.milestone-fields dd { margin: 0.22rem 0 0; font-size: 0.78rem; font-weight: 600; }

.reminder-schedule {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.reminder-schedule span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.38rem 0.55rem;
    color: #536170;
    background: #f3f6f8;
    border: 1px solid #e0e5e9;
    border-radius: 0.3rem;
    font-size: 0.7rem;
}

.reminder-schedule svg { width: 0.8rem; height: 0.8rem; }

.milestone-calendar { padding: 1rem; }
.calendar-header { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 0.8rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(80px, 1fr)); border-top: 1px solid #dfe5ea; border-left: 1px solid #dfe5ea; }
.weekday { padding: 0.55rem; color: #6c7884; background: #f3f6f8; border-right: 1px solid #dfe5ea; border-bottom: 1px solid #dfe5ea; text-align: center; font-size: 0.7rem; }
.calendar-day { min-height: 86px; display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem; padding: 0.55rem; color: #4d5965; background: #fff; border: 0; border-right: 1px solid #dfe5ea; border-bottom: 1px solid #dfe5ea; }
.calendar-day:hover { background: #f6f9fb; }
.calendar-day small { padding: 0.22rem 0.35rem; color: #1769aa; background: #eaf3fa; border-radius: 0.2rem; font-size: 0.63rem; }
.calendar-day.has-overdue small { color: #a63b3b; background: #fbecec; }

.prototype-toast {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    max-width: 360px;
    padding: 0.7rem 0.85rem;
    color: #fff;
    background: #263544;
    border-radius: 0.35rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    font-size: 0.78rem;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: .18s ease;
}

.prototype-toast.show { opacity: 1; transform: translateY(0); }
.prototype-toast svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
.prototype-toast.error { background: #8f2727; }

.contract-kpi { text-decoration: none; color: inherit; }
.contract-primary-link { border: 0; background: transparent; padding: 0; text-align: left; }
.contract-empty { min-height: 180px; display: grid; place-items: center; align-content: center; gap: .55rem; padding: 2rem; color: #667085; text-align: center; }
.contract-empty.large { min-height: 420px; }
.contract-empty.compact { min-height: 90px; padding: 1rem; }
.contract-empty > svg { width: 2rem; height: 2rem; color: #1769aa; }
.contract-inline-alert { margin-top: 1rem; padding: .75rem 1rem; border: 1px solid #b7d4e8; background: #edf7fd; color: #15577f; border-radius: 4px; }
.contract-inline-alert.error { border-color: #e1b2b2; background: #fff1f1; color: #8f2727; }
.contract-drawer { position: fixed; inset: 0; z-index: 1080; pointer-events: none; visibility: hidden; }
.contract-drawer.open { pointer-events: auto; visibility: visible; }
.contract-drawer-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .38); opacity: 0; transition: opacity .18s ease; }
.contract-drawer.open .contract-drawer-backdrop { opacity: 1; }
.contract-drawer aside { position: absolute; right: 0; top: 0; bottom: 0; width: min(520px, 92vw); background: #fff; transform: translateX(100%); transition: transform .18s ease; box-shadow: -12px 0 30px rgba(17, 24, 39, .16); }
.contract-drawer.open aside { transform: translateX(0); }
.contract-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid #e2e7ec; }
.contract-drawer-header h2 { font-size: 1rem; margin: 0; }
.contract-drawer-body { padding: 1.25rem; overflow: auto; height: calc(100% - 64px); }
.detail-list { display: grid; gap: .75rem; }
.detail-list div { display: grid; grid-template-columns: 90px 1fr; gap: 1rem; }
.detail-list dt { color: #667085; }
.version-list { list-style: none; padding: 0; display: grid; gap: .6rem; }
.version-list li { display: flex; justify-content: space-between; padding: .75rem; border: 1px solid #e2e7ec; }
.reminder-list { display: grid; gap: .65rem; }
.reminder-list article { display: grid; grid-template-columns: auto minmax(160px,1fr) auto auto auto; gap: .75rem; align-items: center; padding: .8rem; border-bottom: 1px solid #e2e7ec; }

@media (max-width: 1180px) {
    .contract-filter-bar,
    .milestone-filter { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
    .query-workspace { grid-template-columns: 200px minmax(360px, 1fr); }
    .citation-panel { grid-column: 1 / -1; border-left: 0; border-top: 1px solid #e2e7ec; }
}

@media (max-width: 950px) {
    .contract-kpi-band,
    .review-summary-band { grid-template-columns: repeat(2, 1fr); }
    .contract-kpi { border-bottom: 1px solid #edf0f2; }
    .translation-shell,
    .review-workspace,
    .milestone-workspace,
    .query-workspace { grid-template-columns: 1fr; }
    .translation-nav,
    .review-list,
    .milestone-list,
    .query-scope { border-right: 0; border-bottom: 1px solid #e2e7ec; }
    .translation-segment-panel { grid-template-columns: 1fr; }
    .source-column { border-right: 0; border-bottom: 1px solid #e2e7ec; }
    .translation-validation { grid-column: 1; flex-wrap: wrap; }
    .evidence-grid { grid-template-columns: 1fr; }
    .milestone-fields { grid-template-columns: repeat(2, 1fr); }
    .contract-table { min-width: 0; }
}

@media (max-width: 680px) {
    .contract-page-actions { align-items: stretch; flex-direction: column; }
    .contract-action-group { align-items: stretch; flex-wrap: wrap; }
    .contract-filter-bar,
    .milestone-filter { grid-template-columns: 1fr; }
    .contract-kpi-band,
    .review-summary-band { grid-template-columns: 1fr; }
    .contract-kpi { border-right: 0; }
    .review-actions { flex-wrap: wrap; }
    .review-actions .btn { flex: 1; }
    .milestone-fields { grid-template-columns: 1fr; }
    .milestone-fields div { border-right: 0; border-bottom: 1px solid #e2e7ec; }
    .calendar-grid { min-width: 720px; }
    .milestone-calendar { overflow-x: auto; }
}

/* ─── 待办事项：按合同分组 ─────────────────────────── */

.milestone-groups {
    display: grid;
    gap: 1rem;
}

.milestone-group {
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e7ec;
    border-radius: 0.55rem;
}

.milestone-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    color: inherit;
    text-align: left;
    background: #f8fafb;
    border: 0;
    border-bottom: 1px solid #e2e7ec;
    cursor: pointer;
}

.milestone-group-header:hover { background: #f0f4f7; }

.milestone-group-title { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.milestone-group-title h3 { margin: 0; color: #253343; font-size: 0.92rem; }
.milestone-group-title span { color: #82909d; font-size: 0.7rem; white-space: nowrap; }

.milestone-group-chevron {
    width: 0.95rem;
    height: 0.95rem;
    color: #98a3ad;
    transition: transform 0.18s ease;
    flex: 0 0 auto;
}

.milestone-group.collapsed .milestone-group-chevron { transform: rotate(-90deg); }
.milestone-group.collapsed .milestone-group-list { display: none; }
.milestone-group.collapsed .milestone-group-header { border-bottom: 0; }

.milestone-group-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.milestone-group-stats span {
    padding: 0.28rem 0.5rem;
    color: #536170;
    background: #eef2f5;
    border-radius: 0.3rem;
    font-size: 0.68rem;
}

.milestone-group-list { display: grid; }

.milestone-entry { border-bottom: 1px solid #e6eaee; }
.milestone-entry:last-child { border-bottom: 0; }

.milestone-entry-head {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    color: #52606d;
    text-align: left;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.milestone-entry-head:hover { background: #f4f8fb; }
.milestone-entry-head strong { color: #2d3c4b; font-size: 0.82rem; }
.milestone-entry-meta { color: #87939f; font-size: 0.72rem; white-space: nowrap; }

.milestone-entry-chevron {
    width: 0.9rem;
    height: 0.9rem;
    color: #98a3ad;
    transition: transform 0.18s ease;
}

.milestone-entry.open .milestone-entry-chevron { transform: rotate(180deg); }

.milestone-entry-detail {
    padding: 1rem 1.1rem 1.1rem;
    background: #fbfcfd;
    border-top: 1px solid #e9edf0;
}

.milestone-entry-detail .milestone-detail-heading { padding-top: 0; }
.milestone-entry-detail section { margin-top: 1rem; }
.milestone-entry-detail h5 { margin: 0 0 0.45rem; color: #52606d; font-size: 0.76rem; font-weight: 650; }
.milestone-entry-detail p { margin: 0; font-size: 0.85rem; line-height: 1.65; }

/* ─── 待办事项抽取弹窗 ─────────────────────────────── */

.milestone-result-title {
    margin: 0 0 0.7rem;
    color: #253343;
    font-size: 0.95rem;
}

#milestone-modal-status.error { color: #a63b3b; background: #fbecec; }

/* ─── 抽取弹窗内嵌确认列表 ─────────────────────────── */

#milestone-modal .modal-dialog { max-width: 1080px; }

.milestone-modal-result-wrap {
    max-height: 62vh;
    overflow: auto;
    padding-right: 0.3rem;
}

.milestone-modal-list {
    display: grid;
    gap: 0.6rem;
}

.milestone-modal-list .milestone-entry {
    border: 1px solid #e2e7ec;
    border-radius: 0.45rem;
    overflow: hidden;
}

.milestone-modal-list .milestone-entry-head {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    background: #fff;
}

.milestone-modal-list .milestone-entry-detail {
    border-top: 1px solid #e9edf0;
    background: #fbfcfd;
    padding: 0.75rem 0.9rem 0.85rem;
}

.milestone-modal-list .milestone-entry-detail .milestone-detail-heading { padding-bottom: 0.6rem; }
.milestone-modal-list .milestone-entry-detail .milestone-detail-heading h4 { margin-top: 0.3rem; font-size: 0.9rem; }

.milestone-modal-list .milestone-entry-detail .milestone-fields {
    grid-template-columns: repeat(4, 1fr);
    margin-top: 0.65rem;
}

.milestone-modal-list .milestone-entry-detail .milestone-fields div { padding: 0.5rem 0.6rem; }

.milestone-modal-list .milestone-entry-detail .milestone-sections-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-top: 0.7rem;
}

.milestone-modal-list .milestone-entry-detail .milestone-sections-grid section {
    margin-top: 0;
    padding: 0.6rem 0.7rem;
    background: #f3f6f8;
    border-radius: 0.3rem;
}

.milestone-modal-list .milestone-entry-detail .milestone-sections-grid h5 { margin-bottom: 0.3rem; }
.milestone-modal-list .milestone-entry-detail .milestone-sections-grid p,
.milestone-modal-list .milestone-entry-detail .milestone-sections-grid blockquote {
    font-size: 0.76rem;
    line-height: 1.5;
}

.milestone-modal-list .milestone-entry-detail .milestone-comment { font-size: 0.78rem; }

@media (max-width: 900px) {
    #milestone-modal .modal-dialog { max-width: 640px; }
    .milestone-modal-list .milestone-entry-detail .milestone-fields { grid-template-columns: repeat(2, 1fr); }
    .milestone-modal-list .milestone-entry-detail .milestone-sections-grid { grid-template-columns: 1fr; }
}


.milestone-operation-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eef1f4;
}
.milestone-operation-actions .btn { display: inline-flex; align-items: center; gap: 0.45rem; text-decoration: none; }
.milestone-operation-actions .btn svg { width: 1rem; height: 1rem; }


.todo-group {
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e7ec;
    border-radius: 0.55rem;
}
.todo-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.9rem;
    color: #2d3c4b;
    background: #f7fafc;
    border: 0;
    border-bottom: 1px solid #e2e7ec;
    cursor: pointer;
    text-align: left;
}
.todo-group-header:hover { background: #f0f4f7; }
.todo-group-chevron { flex: 0 0 auto; transition: transform .18s ease; color: #6c7884; }
.todo-group.collapsed .todo-group-chevron { transform: rotate(-90deg); }
.todo-group-header strong { font-size: 0.88rem; }
.todo-group-version { color: #82909d; font-size: 0.72rem; white-space: nowrap; }
.todo-group-stats { margin-left: auto; display: flex; gap: 0.55rem; }
.todo-group-stats span { color: #667085; font-size: 0.72rem; white-space: nowrap; }
.todo-group-stats span.danger { color: #a63b3b; }
.todo-group.collapsed .todo-group-list { display: none; }
.todo-group-list { display: grid; }
.todo-group-list .todo-entry:first-child { margin-top: 0; }

/* ─── 待办事项 ToDo 风格 ─────────────────────────────────── */
.milestone-todo-panel {
    padding: 1rem;
    background: #fff;
    border: 1px solid #e2e7ec;
    border-radius: 0.55rem;
}
.milestone-todo-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.85rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #eef1f4;
}
.milestone-todo-progress {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 260px;
}
.milestone-todo-progress > span { color: #667085; font-size: 0.75rem; white-space: nowrap; }
.milestone-todo-progress .progress { flex: 1; height: 6px; margin: 0; background: #e9edf1; }
.milestone-todo-progress .progress-bar { background: #1769aa; border-radius: 3px; }
.milestone-todo-group-filter { display: flex; align-items: center; gap: 0.5rem; color: #667085; font-size: 0.75rem; }
.milestone-todo-group-filter select { width: auto; min-width: 220px; font-size: 0.78rem; }
.milestone-todo-list { display: grid; }
.todo-entry {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid #eef1f4;
    transition: background .15s ease;
}
.todo-entry:last-child { border-bottom: 0; }
.todo-entry:hover { background: #f7fafc; }
.todo-check {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    cursor: pointer;
}
.todo-check input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.todo-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #c3cdd6;
    border-radius: 6px;
    background: #fff;
    transition: .15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.todo-check input:checked + .todo-checkbox {
    background: #1769aa;
    border-color: #1769aa;
}
.todo-check input:checked + .todo-checkbox::after {
    content: "";
    width: 10px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px);
}
.todo-check input:focus-visible + .todo-checkbox { outline: 2px solid rgba(23,105,170,.4); }
.todo-main {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    padding: 0;
    text-align: left;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.todo-main strong { color: #2d3c4b; font-size: 0.84rem; line-height: 1.4; }
.todo-main:hover strong { color: #1769aa; }
.todo-meta { overflow: hidden; color: #87939f; font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.todo-entry.completed .todo-main strong { color: #98a4ae; text-decoration: line-through; }
.todo-entry.completed .todo-meta { color: #b3bdc5; }
.todo-entry.completed .contract-status { opacity: 0.55; }
.todo-actions { display: flex; gap: 0.3rem; }
.todo-actions .icon-button { padding: 0.3rem; }
.todo-actions .icon-button.danger:hover { color: #a63b3b; background: #fbecec; }

.milestone-kpis .contract-kpi.active { border-color: #1769aa; background: #eaf3fa; }

.milestone-summary-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: center;
    padding: 0.65rem 0.2rem;
    border-bottom: 1px solid #eef1f4;
}
.milestone-summary-row:last-child { border-bottom: 0; }
.milestone-summary-row strong { color: #2d3c4b; font-size: 0.82rem; }
.milestone-summary-row > span:last-child { color: #87939f; font-size: 0.72rem; white-space: nowrap; }

/* 属性面板 */
#milestone-props-modal .modal-dialog { max-width: 860px; }
#milestone-props-modal .modal-content { border-radius: 0.6rem; }
#milestone-props-modal .modal-header { padding: 0.75rem 1.1rem; }
#milestone-props-modal .modal-header h2 { font-size: 1rem; margin: 0; }
#milestone-props-modal .modal-header p { margin: 0.15rem 0 0; color: #80909d; font-size: 0.72rem; }
#milestone-props-modal .modal-body { padding: 0.9rem 1.1rem; }
#milestone-props-modal .modal-footer { padding: 0.7rem 1.1rem; }
#milestone-props-modal .form-label { margin-bottom: 0.3rem; font-size: 0.74rem; }
#milestone-props-modal .form-control { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
#milestone-props-modal .form-control[type="date"] { padding-right: 0.4rem; }
#milestone-props-modal textarea.form-control { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
.milestone-props-completed { display: flex; align-items: center; gap: 0.4rem; min-height: 34px; }
.milestone-props-completed .todo-check { width: auto; gap: 0.5rem; }
.milestone-props-completed .todo-check span:last-child { color: #52606d; font-size: 0.8rem; }
.milestone-props-readonly {
    display: grid;
    grid-template-columns: 1.1fr 1.4fr 1.2fr;
    gap: 0.8rem 1.2rem;
    margin-top: 0.9rem;
    padding: 0.75rem 0.9rem;
    background: #f7fafc;
    border: 1px solid #e7ebef;
    border-radius: 0.4rem;
}
.milestone-props-readonly div { display: grid; gap: 0.2rem; min-width: 0; }
.milestone-props-readonly dt { color: #82909d; font-size: 0.68rem; font-weight: 600; }
.milestone-props-readonly dd {
    margin: 0;
    color: #52606d;
    font-size: 0.76rem;
    line-height: 1.55;
    overflow-wrap: break-word;
}
.milestone-props-readonly dd#milestone-props-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (max-width: 680px) {
    #milestone-props-modal .modal-dialog { max-width: 100%; margin: 0.5rem; }
    .milestone-props-readonly { grid-template-columns: 1fr; }
}

/* 月度日历 */
.milestone-calendar { padding: 1rem; background: #fff; border: 1px solid #e2e7ec; border-radius: 0.55rem; }
.calendar-header { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-bottom: 0.8rem; }
.calendar-header strong { min-width: 140px; text-align: center; color: #2d3c4b; font-size: 1rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(80px, 1fr)); border-top: 1px solid #dfe5ea; border-left: 1px solid #dfe5ea; }
.weekday { padding: 0.55rem; color: #6c7884; background: #f3f6f8; border-right: 1px solid #dfe5ea; border-bottom: 1px solid #dfe5ea; text-align: center; font-size: 0.7rem; }
.calendar-day {
    position: relative;
    min-height: 108px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem;
    color: #4d5965;
    background: #fff;
    border-right: 1px solid #dfe5ea;
    border-bottom: 1px solid #dfe5ea;
}
.calendar-day:hover { background: #f6f9fb; }
.calendar-day.empty { background: #fafbfc; }
.calendar-day.today { background: #f0f7fc; box-shadow: inset 0 0 0 1px #b7d4e8; }
.calendar-day > small {
    align-self: flex-start;
    min-width: 22px;
    padding: 0.15rem 0.3rem;
    color: #1769aa;
    background: #eaf3fa;
    border-radius: 0.25rem;
    font-size: 0.68rem;
    text-align: center;
}
.calendar-day.today > small { color: #fff; background: #1769aa; }
.calendar-day.has-overdue > small { color: #a63b3b; background: #fbecec; }
.calendar-day.today.has-overdue > small { color: #fff; background: #a63b3b; }
.calendar-day-count { display: flex; gap: 0.25rem; }
.calendar-day-count .count-open { padding: 0 0.35rem; color: #1769aa; background: #eaf3fa; border-radius: 0.25rem; font-size: 0.66rem; font-weight: 600; }
.calendar-day-count .count-done { padding: 0 0.35rem; color: #4c7a58; background: #e9f4ec; border-radius: 0.25rem; font-size: 0.66rem; }
.calendar-day-items { display: grid; gap: 0.25rem; min-width: 0; }
.calendar-day-item {
    overflow: hidden;
    max-width: 100%;
    padding: 0.2rem 0.4rem;
    color: #3d4b57;
    background: #f0f4f7;
    border: 0;
    border-radius: 0.3rem;
    font-size: 0.68rem;
    line-height: 1.3;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.calendar-day-item:hover { background: #e3ecf4; color: #1769aa; }
.calendar-day-item.done { color: #9aa6b0; text-decoration: line-through; background: #f3f5f7; }
.calendar-day-more { color: #87939f; font-size: 0.66rem; }

@media (max-width: 1180px) {
    .milestone-todo-toolbar { flex-direction: column; align-items: stretch; }
    .milestone-todo-progress { min-width: 0; }
    .milestone-todo-group-filter select { width: 100%; }
}
@media (max-width: 680px) {
    .todo-entry { grid-template-columns: auto minmax(0, 1fr) auto; }
    .todo-entry .contract-status { display: none; }
    .calendar-grid { min-width: 720px; }
    .milestone-calendar { overflow-x: auto; }
}

