/* Internal case workflow */
.case-review-notice { margin-bottom: 18px; padding: 14px 18px; display: flex; align-items: center; gap: 14px; color: #50350d; background: #fff5da; border: 1px solid #e6ca82; border-radius: 6px; }
.case-review-notice span { color: #765c2c; }
.case-table td { vertical-align: middle; }
.row-actions-end { justify-content: flex-end; }
.case-quality { margin-bottom: 18px; padding: 16px 18px; color: #632722; background: #fff4f2; border-left: 4px solid #c53b32; }
.case-quality ul { margin: 8px 0 0; padding-left: 20px; }
.case-source-strip { margin-bottom: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: #263034; color: white; border-radius: 6px; overflow: hidden; }
.case-source-strip > div { min-width: 0; padding: 15px 18px; border-left: 1px solid rgba(255,255,255,.12); }
.case-source-strip > div:first-child { border-left: 0; }
.case-source-strip span, .case-source-strip strong { display: block; }
.case-source-strip span { color: #afbbbf; font-size: 11px; }
.case-source-strip strong { margin-top: 4px; overflow-wrap: anywhere; }
.case-editor-form .panel { margin-bottom: 18px; }
.case-checkbox-field #id_service_types { min-height: 42px; margin: 0; padding: 9px 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; border: 1px solid var(--line); border-radius: 5px; background: white; }
.case-checkbox-field #id_service_types label { min-height: 32px; display: flex; align-items: center; gap: 7px; line-height: 1.35; }
.case-checkbox-field #id_service_types input[type="checkbox"] { flex: 0 0 16px; width: 16px; min-height: 16px; height: 16px; margin: 0; padding: 0; }
.case-story-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.case-story-fields .form-field:last-child { grid-column: 1 / -1; }
.metric-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.metric-form { padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 110px; gap: 10px; background: #f7f8f8; border: 1px solid var(--line); border-radius: 6px; }
.metric-form .form-field:nth-of-type(3) { grid-column: 1 / 3; }
.delete-check { align-self: end; min-height: 38px; display: flex; align-items: center; gap: 7px; color: var(--danger); }
.case-sticky-actions { position: sticky; bottom: 12px; z-index: 8; margin: 0 0 20px; padding: 11px 13px 11px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: white; background: rgba(38,48,52,.97); border-radius: 6px; box-shadow: 0 8px 24px rgba(24,32,36,.2); }
.case-sticky-actions span { color: #cbd2d4; font-size: 12px; }
.case-image-upload { display: grid; grid-template-columns: 150px minmax(190px, .8fr) minmax(220px, 1fr) minmax(180px, 1fr) auto; align-items: end; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.case-assets { padding-top: 18px; display: grid; grid-template-columns: minmax(250px, .65fr) minmax(0, 1.35fr); gap: 22px; }
.case-assets h3 { margin-bottom: 10px; }
.case-gallery-admin { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.case-asset { min-width: 0; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 11px; padding: 9px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.case-asset img { width: 112px; aspect-ratio: 4 / 3; display: block; object-fit: cover; border-radius: 4px; background: #e8ebec; }
.case-asset strong, .case-asset span { display: block; overflow-wrap: anywhere; }
.case-asset span { margin: 3px 0 8px; color: var(--muted); font-size: 11px; }
.case-submit-band { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 22px; background: #e8f2f0; border: 1px solid #bed7d2; border-radius: 6px; }
.case-submit-band h2 { margin-bottom: 4px; }
.case-submit-band p { margin: 0; color: #536a66; }
.case-review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; align-items: start; gap: 18px; }
.case-review-sidebar { position: sticky; top: 76px; }
.case-review-cover { position: relative; min-height: 310px; display: flex; align-items: flex-end; overflow: hidden; background: #263034; }
.case-review-cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .48; }
.case-review-cover > div { position: relative; z-index: 1; padding: 30px; color: white; }
.case-review-cover span { font-size: 12px; }
.case-review-cover h2 { margin: 8px 0; font-size: 27px; }
.case-review-cover p { max-width: 720px; margin: 0; color: #e3e8e9; }
.case-review-story article { padding: 4px 0 18px; border-bottom: 1px solid var(--line); }
.case-review-story article + article { padding-top: 18px; }
.case-review-story article:last-child { padding-bottom: 0; border-bottom: 0; }
.case-review-story p { margin-bottom: 9px; }
.case-review-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; padding: 0 !important; background: var(--line); }
.case-review-metrics div { min-height: 120px; padding: 20px; display: flex; flex-direction: column; background: white; }
.case-review-metrics strong { font-size: 24px; color: var(--teal); }
.case-review-metrics span { margin-top: 4px; font-weight: 700; }
.case-review-metrics small { margin-top: auto; color: var(--muted); }
.review-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.review-gallery figure { margin: 0; }
.review-gallery img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; border-radius: 4px; }
.review-gallery figcaption { padding-top: 5px; color: var(--muted); font-size: 11px; }
.review-check { margin-bottom: 12px; display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 9px; }
.review-check[hidden] { display: none; }
.review-check input { margin-top: 4px; }
.full-button { width: 100%; }
.case-logo-preview img { width: 100%; max-height: 120px; margin-bottom: 10px; display: block; object-fit: contain; background: #f4f6f6; border: 1px solid var(--line); }

/* Case approval workflow */
.case-workflow-tabs { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: white; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.case-workflow-tabs a { min-width: 0; min-height: 62px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #5d676b; border-right: 1px solid var(--line); text-decoration: none; }
.case-workflow-tabs a:last-child { border-right: 0; }
.case-workflow-tabs a:hover { background: #f5f7f7; }
.case-workflow-tabs a.active { color: #172326; background: #e8f2f0; box-shadow: inset 0 -3px #147a72; }
.case-workflow-tabs a strong { min-width: 27px; height: 27px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; color: #596367; background: #eef1f2; border-radius: 4px; font-size: 12px; }
.case-workflow-tabs a.active strong { color: white; background: #147a72; }
.case-review-notice a { margin-left: auto; }
.case-queue-table td { vertical-align: middle; }
.case-queue-table td:first-child { min-width: 300px; }
.case-queue-empty strong, .case-queue-empty span { display: block; }
.case-queue-empty span { margin-top: 5px; color: var(--muted); }

.case-preflight { margin: 0 0 18px; padding: 20px 22px; background: #f4f7f7; border: 1px solid #d8dfe1; border-radius: 6px; }
.case-preflight-heading { margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.case-preflight-heading span { color: var(--teal); font-size: 11px; font-weight: 800; }
.case-preflight-heading h2 { margin: 3px 0 0; font-size: 20px; }
.case-preflight-heading > strong { color: #657074; font-size: 12px; }
.case-preflight-grid, .case-check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.case-preflight-grid > a, .case-auto-check { min-width: 0; padding: 13px; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 10px; color: inherit; background: white; border: 1px solid #dbe1e2; border-radius: 5px; text-decoration: none; }
.case-preflight-grid > a > span, .case-auto-check > span { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 800; }
.case-preflight-grid .passed > span, .case-auto-check.passed > span { color: #176c5f; background: #dff0eb; }
.case-preflight-grid .error > span, .case-auto-check.error > span { color: #a32922; background: #f9e2df; }
.case-preflight-grid strong, .case-preflight-grid small, .case-auto-check strong, .case-auto-check small { display: block; }
.case-preflight-grid small, .case-auto-check small { margin-top: 3px; color: var(--muted); line-height: 1.5; }
.case-preflight-grid .error, .case-auto-check.error { border-color: #e7b9b4; }

.case-review-eyebrow { color: #147a72; font-size: 11px; font-weight: 800; }
.case-review-heading h1 { margin-top: 4px; }
.case-review-summary { margin-bottom: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #293235; border-radius: 6px; overflow: hidden; }
.case-review-summary > div { min-width: 0; min-height: 84px; padding: 17px 19px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid rgba(255,255,255,.11); }
.case-review-summary > div:last-child { border-right: 0; }
.case-review-summary span { color: #aeb9bc; font-size: 11px; }
.case-review-summary strong { margin-top: 5px; color: white; overflow-wrap: anywhere; }
.case-change-summary { margin-bottom: 14px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #edf2f2; border-left: 3px solid #147a72; }
.case-change-summary > div:first-child strong, .case-change-summary > div:first-child span { display: block; }
.case-change-summary > div:first-child span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.case-change-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.case-change-tags span { padding: 4px 7px; color: #3d4a4e; background: white; border: 1px solid #d5dcde; border-radius: 3px; font-size: 11px; }
.case-review-steps { position: sticky; top: 61px; z-index: 9; margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: white; border: 1px solid var(--line); box-shadow: 0 8px 18px rgba(29,39,43,.06); }
.case-review-steps a { min-width: 0; min-height: 58px; padding: 10px 13px; display: grid; grid-template-columns: 24px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; color: inherit; border-right: 1px solid var(--line); text-decoration: none; }
.case-review-steps a:last-child { border-right: 0; }
.case-review-steps a > span { grid-row: 1 / 3; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; color: #677276; background: #edf0f1; border-radius: 3px; font-size: 10px; font-weight: 800; }
.case-review-steps a strong { font-size: 12px; }
.case-review-steps a small { color: var(--muted); font-size: 10px; }
.case-review-steps a.passed > span { color: #14695d; background: #dff0eb; }
.case-review-steps a.error > span { color: #a32922; background: #f9e2df; }
.case-review-steps a.pending > span { color: #8a5b0e; background: #fff0cf; }
.case-review-section { scroll-margin-top: 138px; }
.case-review-section .panel-header { align-items: center; }
.case-step-kicker { color: #147a72; font-size: 10px; font-weight: 800; }
.case-review-section .panel-header h2 { margin-top: 3px; }
.case-public-badge, .case-human-badge { padding: 5px 8px; border-radius: 3px; font-size: 10px; font-weight: 800; }
.case-public-badge { color: #11675b; background: #e1f0ec; }
.case-human-badge { color: #85580e; background: #fff0cf; }
.case-review-basics { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.case-review-basics > div { min-width: 0; padding: 15px 17px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.case-review-basics > div:nth-child(2n) { border-right: 0; }
.case-review-basics > div:nth-last-child(-n+2) { border-bottom: 0; }
.case-review-basics span, .case-review-basics strong, .case-review-basics p { display: block; }
.case-review-basics span { margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.case-review-basics p { margin: 0; }
.case-public-story { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.case-public-story article { min-width: 0; }
.case-public-story article > span { display: block; margin-bottom: 7px; color: #147a72; font-size: 12px; font-weight: 800; }
.case-public-story p { margin: 0 0 10px; line-height: 1.8; }
.case-internal-details { margin-top: 20px; border-top: 1px solid var(--line); }
.case-internal-details summary { padding: 16px 0; display: flex; align-items: baseline; justify-content: space-between; gap: 20px; cursor: pointer; }
.case-internal-details summary span { font-weight: 800; }
.case-internal-details summary small { color: var(--muted); }
.case-internal-details > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 17px; background: #f4f6f6; }
.case-internal-details article h3 { margin-top: 0; font-size: 14px; }
.case-internal-details article p { margin-bottom: 8px; }
.case-review-metric-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.case-review-metric-block > div:first-child { margin-bottom: 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.case-review-metric-block h3 { margin: 0; }
.case-review-metric-block > div:first-child span { color: var(--muted); font-size: 11px; }
.review-gallery-detailed { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.review-gallery-detailed figure { min-width: 0; border: 1px solid var(--line); }
.review-gallery-detailed button { position: relative; width: 100%; padding: 0; display: block; overflow: hidden; cursor: zoom-in; background: #e8ebec; border: 0; }
.review-gallery-detailed button img { width: 100%; aspect-ratio: 16 / 10; border-radius: 0; }
.review-gallery-detailed button > span { position: absolute; top: 9px; left: 9px; padding: 4px 7px; color: white; background: rgba(35,45,49,.88); border-radius: 3px; font-size: 10px; font-weight: 800; }
.review-gallery-detailed figcaption { padding: 11px 13px; }
.review-gallery-detailed figcaption strong, .review-gallery-detailed figcaption span { display: block; }
.review-gallery-detailed figcaption span { margin-top: 3px; color: var(--muted); }
.case-privacy-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.case-privacy-options article { padding: 17px; border: 1px solid #bdd8d2; border-left: 3px solid #147a72; }
.case-privacy-options article.disabled { opacity: .62; border-color: var(--line); border-left-color: #8b9598; }
.case-privacy-options p { margin: 5px 0 0; color: var(--muted); }
.case-logo-review { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.case-logo-review > div:first-child h3, .case-logo-review > div:first-child p { margin: 0; }
.case-logo-review > div:first-child p { margin-top: 3px; color: var(--muted); }
.case-logo-preview { margin-top: 14px; display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: center; gap: 16px; }
.case-logo-preview img { margin: 0; }
.case-logo-preview strong { display: block; margin-bottom: 8px; }
.case-logo-form { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr 1fr auto; align-items: end; gap: 10px; }
.case-review-sidebar { position: sticky; top: 137px; }
.case-decision-panel { margin-bottom: 0; }
.case-display-mode { margin: 0 0 16px; padding: 0; border: 0; }
.case-display-mode legend { margin-bottom: 7px; font-size: 11px; font-weight: 800; }
.case-display-mode ul { margin: 0; padding: 3px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; list-style: none; background: #edf0f1; border-radius: 5px; }
.case-display-mode li { margin: 0; }
.case-display-mode label { min-height: 38px; padding: 7px 9px; display: flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; background: white; border: 1px solid transparent; border-radius: 3px; font-size: 12px; font-weight: 700; }
.case-display-mode label:has(input:checked) { color: white; background: #147a72; }
.case-display-mode input { width: 14px; height: 14px; margin: 0; }
.case-display-mode > small { display: block; margin-top: 6px; color: var(--muted); }
.case-publish-impact { margin-bottom: 16px; padding: 12px 13px; background: #f2f5f5; border-left: 3px solid #147a72; }
.case-publish-impact strong, .case-publish-impact span { display: block; }
.case-publish-impact span { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.case-feature-check { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.case-feature-check strong, .case-feature-check small { display: block; }
.case-feature-check small { margin-top: 2px; color: var(--muted); }
.case-publish-blocked { margin: 14px 0; padding: 11px 12px; color: #8e2822; background: #fbeae8; border: 1px solid #edc3bf; }
.case-publish-blocked strong, .case-publish-blocked span { display: block; }
.case-publish-blocked span { margin-top: 3px; font-size: 11px; }
.case-approve-button { min-height: 44px; }
.case-decision-divider { height: 34px; display: flex; align-items: center; gap: 10px; color: #899397; font-size: 10px; }
.case-decision-divider::before, .case-decision-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.case-return-dialog, .case-review-image-dialog { padding: 0; border: 0; border-radius: 6px; box-shadow: 0 24px 70px rgba(13,19,21,.32); }
.case-return-dialog { width: min(620px, calc(100vw - 32px)); }
.case-return-dialog::backdrop, .case-review-image-dialog::backdrop { background: rgba(20,27,30,.68); }
.case-return-dialog form { margin: 0; }
.case-return-dialog header { padding: 20px 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.case-return-dialog h2, .case-return-dialog p { margin: 0; }
.case-return-dialog p { margin-top: 3px; color: var(--muted); }
.case-return-dialog header > button, .case-review-image-dialog button { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: white; border: 1px solid var(--line); border-radius: 4px; font-size: 22px; }
.case-return-body { padding: 20px 22px; }
.case-return-body fieldset { margin: 0 0 17px; padding: 0; border: 0; }
.case-return-body legend { margin-bottom: 7px; font-weight: 800; }
.case-return-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.case-return-options label { min-height: 42px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; cursor: pointer; background: #f5f7f7; border: 1px solid var(--line); border-radius: 4px; }
.case-return-options input[type="checkbox"] { flex: 0 0 16px; width: 16px; min-height: 16px; height: 16px; margin: 0; padding: 0; }
.case-return-dialog footer { padding: 14px 22px; display: flex; justify-content: flex-end; gap: 8px; background: #f5f7f7; border-top: 1px solid var(--line); }
.case-review-image-dialog { width: min(1400px, calc(100vw - 40px)); max-width: none; background: #111719; }
.case-review-image-dialog > div { position: relative; min-height: min(82vh, 850px); padding: 24px; display: flex; align-items: center; justify-content: center; }
.case-review-image-dialog button { position: absolute; top: 14px; right: 14px; z-index: 1; color: white; background: rgba(24,32,35,.86); border-color: rgba(255,255,255,.25); }
.case-review-image-dialog img { max-width: 100%; max-height: calc(82vh - 48px); display: block; object-fit: contain; }

/* Public case library */
.public-cases { margin: 0; min-width: 320px; color: #202529; background: #fff; font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; font-size: 15px; line-height: 1.65; letter-spacing: 0; }
.public-cases * { box-sizing: border-box; }
.public-cases a { color: inherit; text-decoration: none; }
.public-cases button, .public-cases input, .public-cases select { font: inherit; letter-spacing: 0; }
.case-preview-bar { min-height: 44px; padding: 8px max(20px, calc((100% - 1240px) / 2)); display: flex; align-items: center; gap: 14px; color: #4e350e; background: #fff0c5; border-bottom: 1px solid #e6ca82; }
.case-preview-bar span { flex: 1; }
.case-preview-bar button { padding: 4px 10px; border: 1px solid #c99b3f; border-radius: 4px; background: white; }
.case-site-header { height: 72px; padding: 0 max(24px, calc((100% - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: white; border-bottom: 1px solid #e4e7e8; }
.case-site-brand { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.case-site-brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
.case-site-brand span { color: #6b7478; font-size: 12px; }
.case-site-header nav { display: flex; gap: 24px; color: #596266; font-size: 13px; }
.case-site-header nav a:hover { color: #c53b32; }
.case-site-footer { min-height: 150px; padding: 38px max(24px, calc((100% - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; color: #c7ced0; background: #22292c; }
.case-site-footer strong, .case-site-footer span { display: block; }
.case-site-footer strong { color: white; font-size: 17px; }
.case-site-footer span { margin-top: 6px; font-size: 12px; }
.case-site-footer > a { padding-bottom: 3px; color: white; border-bottom: 1px solid #809095; }

.case-index-heading { min-height: 220px; padding: 38px max(24px, calc((100% - 1240px) / 2)); display: flex; align-items: flex-end; color: white; background: #293235; }
.case-index-heading > div { max-width: 700px; }
.case-index-heading span { color: #82c5bb; font-size: 12px; font-weight: 700; }
.case-index-heading h1 { margin: 10px 0 8px; font-size: 38px; line-height: 1.2; }
.case-index-heading p { margin: 0; color: #d5dcde; font-size: 17px; }
.case-index-tools { padding: 22px max(24px, calc((100% - 1240px) / 2)); background: #f2f4f4; border-bottom: 1px solid #dfe3e5; }
.case-index-tools form { display: grid; grid-template-columns: minmax(240px, 1fr) 190px 190px auto auto; align-items: end; gap: 10px; }
.case-index-tools label { display: block; margin-bottom: 5px; color: #697276; font-size: 11px; font-weight: 700; }
.case-index-tools input, .case-index-tools select { width: 100%; height: 42px; padding: 8px 11px; color: #202529; background: white; border: 1px solid #cfd5d7; border-radius: 4px; }
.case-index-tools button, .case-index-tools form > a { height: 42px; padding: 8px 16px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #293235; border-radius: 4px; white-space: nowrap; }
.case-index-tools button { color: white; background: #293235; }
.case-index-tools form > a { color: #5e686c; background: white; border-color: #cfd5d7; }
.case-index-results { max-width: 1240px; margin: 0 auto; padding: 32px 24px 70px; }
.case-result-meta { margin-bottom: 14px; display: flex; align-items: baseline; gap: 5px; color: #687176; }
.case-result-meta strong { color: #202529; font-size: 20px; }
.case-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 18px; }
.case-card { min-width: 0; border: 1px solid #dfe3e5; border-radius: 6px; overflow: hidden; background: white; }
.case-card-image { position: relative; aspect-ratio: 16 / 10; display: block; overflow: hidden; background: #dfe4e5; }
.case-card-image img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s ease; }
.case-card:hover .case-card-image img { transform: scale(1.025); }
.case-card-badges { position: absolute; top: 12px; left: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.case-card-badges > span { padding: 5px 8px; color: white; border-radius: 3px; font-size: 11px; font-weight: 700; }
.case-card-badges .featured { background: #c53b32; }
.case-card-badges .demo { background: #293235; }
.case-card-body { min-height: 248px; padding: 18px; display: flex; flex-direction: column; }
.case-card-taxonomy { color: #147a72; font-size: 11px; font-weight: 700; }
.case-card-services { min-height: 24px; margin-top: 8px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 5px; }
.case-card-services span { padding: 3px 6px; color: #687176; background: #f6f7f7; border: 1px solid #dfe3e5; border-radius: 3px; font-size: 10px; line-height: 1.35; }
.case-card h2 { margin: 10px 0 8px; font-size: 19px; line-height: 1.42; overflow-wrap: anywhere; }
.case-card h2 a:hover { color: #c53b32; }
.case-card p { margin: 0 0 18px; color: #606a6e; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.case-card-footer { margin-top: auto; padding-top: 13px; display: flex; justify-content: flex-end; gap: 10px; color: #687176; border-top: 1px solid #e7e9ea; font-size: 12px; }
.case-card-footer a { color: #202529; font-weight: 700; }
.case-empty { grid-column: 1 / -1; min-height: 240px; padding: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #6d767a; background: #f4f6f6; text-align: center; }
.case-empty strong { color: #202529; font-size: 18px; }
.case-empty p { margin: 5px 0 0; }
.case-pagination { margin-top: 32px; display: flex; align-items: center; justify-content: center; gap: 18px; color: #687176; }
.case-pagination a { padding: 7px 12px; border: 1px solid #ccd2d4; border-radius: 4px; color: #202529; }

.case-hero { position: relative; height: min(62vh, 600px); min-height: 440px; display: flex; align-items: flex-end; overflow: hidden; color: white; background: #263034; }
.case-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.case-hero-shade { position: absolute; inset: 0; background: rgba(20,27,30,.62); }
.case-hero-content { position: relative; z-index: 1; width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 56px 0; }
.case-hero-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.case-hero-tags span { padding: 5px 8px; color: #dff1ee; background: rgba(15,93,86,.76); border: 1px solid rgba(192,230,224,.42); border-radius: 3px; font-size: 11px; }
.case-hero-tags .case-demo-tag { color: white; background: rgba(197,59,50,.9); border-color: rgba(255,214,209,.55); }
.case-hero h1 { max-width: 900px; margin: 15px 0 12px; font-size: 46px; line-height: 1.2; overflow-wrap: anywhere; }
.case-hero-content > p { max-width: 760px; margin: 0; color: #e2e7e8; font-size: 18px; }
.case-hero-meta { margin-top: 24px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; color: #d2dadc; font-size: 12px; }
.case-hero-meta img { width: 74px; height: 38px; padding: 5px; object-fit: contain; background: white; border-radius: 3px; }
.case-demo-note { max-width: 1060px; margin: 20px auto 0; padding: 12px 16px; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; color: #394246; background: #f2f4f4; border-left: 3px solid #778287; }
.case-demo-note strong { font-size: 13px; }
.case-demo-note p { margin: 0; color: #687176; font-size: 13px; }
.case-metric-band { background: #147a72; color: white; }
.case-demo-note + .case-metric-band { margin-top: 20px; }
.case-metric-band > div { max-width: 1240px; min-height: 154px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.case-metric-band article { min-width: 0; padding: 28px 24px; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid rgba(255,255,255,.18); }
.case-metric-band article:last-child { border-right: 1px solid rgba(255,255,255,.18); }
.case-metric-band strong { font-size: 31px; overflow-wrap: anywhere; }
.case-metric-band span { font-weight: 700; }
.case-metric-band small { margin-top: 3px; color: #c7e2dd; }
.case-story-intro { max-width: 1060px; margin: 0 auto; padding: 64px 24px; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 54px; }
.case-story-band { background: #f2f4f4; }
.case-story-band > div { max-width: 1060px; margin: 0 auto; padding: 64px 24px; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 54px; }
.case-story-dark { color: white; background: #293235; }
.case-section-label { display: flex; align-items: baseline; gap: 12px; color: #147a72; }
.case-section-label span { font-size: 12px; font-weight: 800; }
.case-section-label strong { color: inherit; font-size: 14px; }
.case-story-dark .case-section-label { color: #82c5bb; }
.case-prose { color: #3f484c; font-size: 17px; line-height: 1.9; }
.case-prose p { margin: 0 0 18px; }
.case-prose p:last-child { margin-bottom: 0; }
.case-story-dark .case-prose { color: #dfe5e6; }
.case-gallery { max-width: 1240px; margin: 0 auto; padding: 64px 24px; }
.case-gallery-heading { margin-bottom: 24px; }
.case-gallery-heading span { color: #147a72; font-size: 12px; font-weight: 700; }
.case-gallery-heading h2 { margin: 5px 0 0; font-size: 31px; }
.case-gallery-heading p { margin: 7px 0 0; color: #697276; font-size: 13px; }
.case-gallery-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; }
.case-gallery-grid figure { margin: 0; }
.case-gallery-trigger { width: 100%; padding: 0; display: block; overflow: hidden; cursor: zoom-in; background: #e5e8e9; border: 1px solid #d7dcde; border-radius: 4px; box-shadow: 0 12px 28px rgba(27, 36, 39, .09); }
.case-gallery-trigger img { width: 100%; aspect-ratio: 16 / 10; display: block; object-fit: cover; transition: transform .2s ease; }
.case-gallery-trigger:hover img { transform: scale(1.008); }
.case-gallery-trigger:focus-visible { outline: 3px solid #147a72; outline-offset: 4px; }
.case-gallery-grid figcaption { padding-top: 10px; color: #596367; font-size: 13px; }
.case-lightbox-open { overflow: hidden; }
.case-lightbox { width: 100vw; max-width: none; height: 100vh; max-height: none; margin: 0; padding: 0; overflow: hidden; color: white; background: rgba(10, 14, 16, .96); border: 0; }
.case-lightbox::backdrop { background: rgba(10, 14, 16, .96); }
.case-lightbox-panel { width: 100%; height: 100%; display: grid; grid-template-rows: 64px minmax(0, 1fr) 66px; }
.case-lightbox header { padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.case-lightbox header > div { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.case-lightbox header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.case-lightbox header span { color: #abb5b8; font-size: 12px; }
.case-lightbox button { width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: white; cursor: pointer; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .2); border-radius: 4px; }
.case-lightbox button:hover { background: rgba(255, 255, 255, .16); }
.case-lightbox button:focus-visible { outline: 3px solid #83c8bd; outline-offset: 2px; }
.case-lightbox-close { flex: 0 0 44px; font-size: 28px; line-height: 1; }
.case-lightbox-stage { min-width: 0; min-height: 0; padding: 18px 24px; display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; align-items: center; gap: 18px; }
.case-lightbox-stage img { width: 100%; height: 100%; min-width: 0; min-height: 0; display: block; object-fit: contain; }
.case-lightbox-nav { font-size: 34px; line-height: 1; }
.case-lightbox footer { padding: 12px 24px; display: flex; align-items: center; justify-content: center; color: #d6dcde; border-top: 1px solid rgba(255, 255, 255, .14); font-size: 13px; text-align: center; }
.case-contact { max-width: 1240px; min-height: 220px; margin: 0 auto 74px; padding: 36px 42px; display: flex; align-items: center; justify-content: space-between; gap: 40px; color: white; background: #293235; }
.case-contact > div:first-child { max-width: 600px; }
.case-contact span { color: #82c5bb; font-size: 12px; font-weight: 700; }
.case-contact h2 { margin: 7px 0; font-size: 28px; }
.case-contact p { margin: 0; color: #cfd7d9; }
.case-contact-actions { min-width: 240px; display: grid; gap: 8px; }
.case-contact-actions a, .case-contact-actions > span { min-height: 42px; padding: 9px 14px; display: flex; align-items: center; justify-content: center; color: white; border: 1px solid #728085; border-radius: 4px; font-size: 13px; }
.case-contact-actions a.primary { color: white; background: #c53b32; border-color: #c53b32; font-weight: 700; }

@media (max-width: 1040px) {
  .case-image-upload { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-image-upload button { width: max-content; }
  .case-review-layout { grid-template-columns: minmax(0, 1fr); }
  .case-review-sidebar { position: static; display: block; }
  .case-review-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-review-summary > div:nth-child(2) { border-right: 0; }
  .case-review-summary > div:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.11); }
  .case-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-index-tools form { grid-template-columns: minmax(220px, 1fr) 170px 170px auto; }
  .case-index-tools form > a { grid-column: 4; }
}

@media (max-width: 760px) {
  .case-review-notice, .case-submit-band { align-items: flex-start; flex-direction: column; }
  .case-source-strip, .case-story-fields, .metric-form-grid, .case-assets { grid-template-columns: minmax(0, 1fr); }
  .case-source-strip > div { border-left: 0; border-top: 1px solid rgba(255,255,255,.12); }
  .case-source-strip > div:first-child { border-top: 0; }
  .metric-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .metric-form .form-field:nth-of-type(3) { grid-column: 1 / -1; }
  .case-gallery-admin { grid-template-columns: minmax(0, 1fr); }
  .case-review-sidebar { display: block; }
  .case-workflow-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-workflow-tabs a:nth-child(2) { border-right: 0; }
  .case-workflow-tabs a:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .case-review-notice a { margin-left: 0; }
  .case-preflight-heading, .case-change-summary { align-items: flex-start; flex-direction: column; }
  .case-preflight-grid, .case-check-grid { grid-template-columns: minmax(0, 1fr); }
  .case-change-tags { justify-content: flex-start; }
  .case-review-steps { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-review-steps a:nth-child(2) { border-right: 0; }
  .case-review-steps a:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .case-review-section { scroll-margin-top: 76px; }
  .case-review-basics, .case-public-story, .case-internal-details > div, .case-privacy-options { grid-template-columns: minmax(0, 1fr); }
  .case-review-basics > div { border-right: 0; }
  .case-review-basics > div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .case-internal-details summary { align-items: flex-start; flex-direction: column; gap: 3px; }
  .case-logo-form { grid-template-columns: minmax(0, 1fr); }
  .case-checkbox-field #id_service_types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-review-image-dialog { width: calc(100vw - 20px); }
  .case-review-image-dialog > div { min-height: 75vh; padding: 10px; }
  .case-review-image-dialog img { max-height: calc(75vh - 20px); }
  .case-review-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-site-header { height: 64px; padding-inline: 18px; }
  .case-site-header nav { gap: 13px; }
  .case-site-brand span { display: none; }
  .case-index-heading { min-height: 210px; padding: 34px 20px; }
  .case-index-heading h1 { font-size: 34px; }
  .case-index-tools { padding: 18px 20px; }
  .case-index-tools form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-search-field { grid-column: 1 / -1; }
  .case-index-tools button, .case-index-tools form > a { grid-column: auto; }
  .case-index-results { padding: 26px 20px 54px; }
  .case-grid { grid-template-columns: minmax(0, 1fr); }
  .case-card-body { min-height: 225px; }
  .case-hero { height: 58vh; min-height: 430px; }
  .case-hero-content { width: calc(100% - 40px); padding: 38px 0; }
  .case-hero h1 { font-size: 34px; }
  .case-hero-content > p { font-size: 16px; }
  .case-demo-note { margin: 20px 20px 0; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .case-metric-band > div { padding: 0 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-metric-band article { min-height: 130px; padding: 22px 14px; border-bottom: 1px solid rgba(255,255,255,.18); }
  .case-story-intro, .case-story-band > div { padding: 52px 20px; grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .case-prose { font-size: 16px; }
  .case-gallery { padding: 52px 20px; }
  .case-gallery-grid { gap: 26px; }
  .case-lightbox-panel { grid-template-rows: 58px minmax(0, 1fr) 72px; }
  .case-lightbox header { padding: 0 14px; }
  .case-lightbox-stage { padding: 12px; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 6px; }
  .case-lightbox footer { padding: 10px 16px; }
  .case-contact { margin: 0 20px 54px; padding: 34px 26px; align-items: flex-start; flex-direction: column; }
  .case-contact-actions { width: 100%; min-width: 0; }
  .case-site-footer { padding-inline: 20px; }
}

@media (max-width: 440px) {
  .case-image-upload, .metric-form { grid-template-columns: minmax(0, 1fr); }
  .metric-form .form-field:nth-of-type(3) { grid-column: auto; }
  .case-sticky-actions { position: static; align-items: stretch; flex-direction: column; }
  .case-asset { grid-template-columns: 90px minmax(0, 1fr); }
  .case-asset img { width: 90px; }
  .case-preview-bar { align-items: flex-start; flex-wrap: wrap; }
  .case-preview-bar span { flex-basis: calc(100% - 100px); }
  .case-site-header nav a:last-child { display: none; }
  .case-index-tools form { grid-template-columns: minmax(0, 1fr); }
  .case-search-field, .case-index-tools button, .case-index-tools form > a { grid-column: auto; }
  .case-index-heading h1, .case-hero h1 { font-size: 30px; }
  .case-hero { min-height: 410px; }
  .case-metric-band strong { font-size: 25px; }
  .case-gallery-heading h2, .case-contact h2 { font-size: 26px; }
  .case-lightbox-stage { position: relative; padding: 8px; display: flex; align-items: center; justify-content: center; }
  .case-lightbox-stage img { width: 100%; height: 100%; }
  .case-lightbox-nav { position: absolute; bottom: 10px; z-index: 1; background: rgba(20, 27, 30, .78) !important; }
  .case-lightbox-prev { left: 12px; }
  .case-lightbox-next { right: 12px; }
  .case-site-footer { align-items: flex-start; flex-direction: column; }
  .case-review-summary { grid-template-columns: minmax(0, 1fr); }
  .case-review-summary > div { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.11); }
  .case-review-summary > div:last-child { border-bottom: 0; }
  .review-gallery-detailed { grid-template-columns: minmax(0, 1fr); }
  .case-logo-preview { grid-template-columns: minmax(0, 1fr); }
  .case-checkbox-field #id_service_types { grid-template-columns: minmax(0, 1fr); }
  .case-return-options { grid-template-columns: minmax(0, 1fr); }
}
