:root{--color-state-active:#16a34a;--color-state-active-bg:#dcfce7;--color-state-active-fg:#14532d;--color-state-archived:#6b7280;--color-state-archived-bg:#f3f4f6;--color-state-archived-fg:#1f2937;--color-state-trashcan:#ea580c;--color-state-trashcan-bg:#ffedd5;--color-state-trashcan-fg:#7c2d12;--color-state-deleted:#dc2626;--color-state-deleted-bg:#fee2e2;--color-state-deleted-fg:#7f1d1d;--color-primary-50:#e8eef7;--color-primary-100:#c9d6ec;--color-primary-200:#93b0d8;--color-primary-300:#6791c5;--color-primary-400:#4574b8;--color-primary-500:#2a5aad;--color-primary-600:#0e429b;--color-primary-700:#0a347c;--color-primary-800:#072666;--color-primary-900:#051a4d;--color-chrome-border:#0a347c;--color-chrome-bg:#0e429b;--color-chrome-fg:#fff;--color-chrome-muted:#c9d6ec;--color-surface-elevated:#fff}.state-badge{display:inline-flex;align-items:center;padding:.125rem .5rem;border-radius:9999px;font-size:.75rem;font-weight:500;line-height:1rem}.state-badge-active{background-color:var(--color-state-active-bg);color:var(--color-state-active-fg)}.state-badge-archived{background-color:var(--color-state-archived-bg);color:var(--color-state-archived-fg)}.state-badge-trashcan{background-color:var(--color-state-trashcan-bg);color:var(--color-state-trashcan-fg)}.state-badge-deleted{background-color:var(--color-state-deleted-bg);color:var(--color-state-deleted-fg)}.page-header{background-color:var(--color-chrome-bg);border-bottom:1px solid var(--color-chrome-border)}.page-header,.page-header a{color:var(--color-chrome-fg)}.page-header a:hover{color:var(--color-chrome-muted)}.page-header-inner{max-width:72rem;margin-left:auto;margin-right:auto;padding:.75rem 1.5rem;display:flex;align-items:center;justify-content:space-between}.page-header-actions{display:flex;align-items:center;gap:.5rem}@media (min-width:768px){.items-browser-row-header>.items-browser-cell{width:var(--items-browser-col-width,auto);flex:var(--items-browser-col-flex,1 1 0)}}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }

/*! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\!container{width:100%!important}.container{width:100%}@media (min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.\!visible{visibility:visible!important}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.bottom-4{bottom:1rem}.left-1\/2{left:50%}.right-0{right:0}.right-4{right:1rem}.top-1{top:.25rem}.top-4{top:1rem}.top-full{top:100%}.isolate{isolation:isolate}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[160\]{z-index:160}.col-span-2{grid-column:span 2/span 2}.m-auto{margin:auto}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-5{margin-left:1.25rem}.ml-6{margin-left:1.5rem}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.table-cell{display:table-cell}.table-row{display:table-row}.grid{display:grid}.contents{display:contents}.list-item{display:list-item}.hidden{display:none}.h-11{height:2.75rem}.h-12{height:3rem}.h-2{height:.5rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-full{height:100%}.max-h-48{max-height:12rem}.max-h-\[50vh\]{max-height:50vh}.max-h-full{max-height:100%}.min-h-\[2\.25rem\]{min-height:2.25rem}.min-h-\[300px\]{min-height:300px}.min-h-\[44px\]{min-height:44px}.min-h-screen{min-height:100vh}.w-11{width:2.75rem}.w-12{width:3rem}.w-2{width:.5rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\[12rem\]{min-width:12rem}.min-w-\[200px\]{min-width:200px}.min-w-\[2rem\]{min-width:2rem}.min-w-\[44px\]{min-width:44px}.min-w-\[6rem\]{min-width:6rem}.max-w-48{max-width:12rem}.max-w-4xl{max-width:56rem}.max-w-full{max-width:100%}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-x-1\/2{--tw-translate-x:-50%}.-translate-x-1\/2,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-grab{cursor:grab}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-pan-x{--tw-pan-x:pan-x}.touch-pan-x,.touch-pan-y{touch-action:var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)}.touch-pan-y{--tw-pan-y:pan-y}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-y-0\.5{row-gap:.125rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem*var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem*var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem*var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem*var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px*var(--tw-divide-y-reverse))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(229 231 235/var(--tw-divide-opacity,1))}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-amber-200{--tw-border-opacity:1;border-color:rgb(253 230 138/var(--tw-border-opacity,1))}.border-amber-600{--tw-border-opacity:1;border-color:rgb(217 119 6/var(--tw-border-opacity,1))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.border-green-600{--tw-border-opacity:1;border-color:rgb(22 163 74/var(--tw-border-opacity,1))}.border-primary-300{--tw-border-opacity:1;border-color:rgb(122 157 210/var(--tw-border-opacity,1))}.border-primary-600{--tw-border-opacity:1;border-color:rgb(14 66 155/var(--tw-border-opacity,1))}.border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.border-red-300{--tw-border-opacity:1;border-color:rgb(252 165 165/var(--tw-border-opacity,1))}.border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.bg-amber-100{--tw-bg-opacity:1;background-color:rgb(254 243 199/var(--tw-bg-opacity,1))}.bg-amber-50{--tw-bg-opacity:1;background-color:rgb(255 251 235/var(--tw-bg-opacity,1))}.bg-black\/50{background-color:rgba(0,0,0,.5)}.bg-black\/70{background-color:rgba(0,0,0,.7)}.bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.bg-primary-600{--tw-bg-opacity:1;background-color:rgb(14 66 155/var(--tw-bg-opacity,1))}.bg-purple-100{--tw-bg-opacity:1;background-color:rgb(243 232 255/var(--tw-bg-opacity,1))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.bg-red-600{--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity,1))}.bg-rose-100{--tw-bg-opacity:1;background-color:rgb(255 228 230/var(--tw-bg-opacity,1))}.bg-slate-100{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.object-contain{-o-object-fit:contain;object-fit:contain}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-12{padding:3rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pl-3{padding-left:.75rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.ordinal{--tw-ordinal:ordinal}.ordinal,.tabular-nums{font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.tabular-nums{--tw-numeric-spacing:tabular-nums}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-amber-600{--tw-text-opacity:1;color:rgb(217 119 6/var(--tw-text-opacity,1))}.text-amber-700{--tw-text-opacity:1;color:rgb(180 83 9/var(--tw-text-opacity,1))}.text-amber-800{--tw-text-opacity:1;color:rgb(146 64 14/var(--tw-text-opacity,1))}.text-blue-400{--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity,1))}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.text-gray-400\/80{color:rgba(156,163,175,.8)}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.text-primary-200{--tw-text-opacity:1;color:rgb(159 184 223/var(--tw-text-opacity,1))}.text-primary-500{--tw-text-opacity:1;color:rgb(42 90 173/var(--tw-text-opacity,1))}.text-primary-600{--tw-text-opacity:1;color:rgb(14 66 155/var(--tw-text-opacity,1))}.text-primary-700{--tw-text-opacity:1;color:rgb(10 52 124/var(--tw-text-opacity,1))}.text-purple-800{--tw-text-opacity:1;color:rgb(107 33 168/var(--tw-text-opacity,1))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.text-rose-800{--tw-text-opacity:1;color:rgb(159 18 57/var(--tw-text-opacity,1))}.text-slate-800{--tw-text-opacity:1;color:rgb(30 41 59/var(--tw-text-opacity,1))}.text-transparent{color:transparent}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.text-yellow-800{--tw-text-opacity:1;color:rgb(133 77 14/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.accent-primary-600{accent-color:#0e429b}.opacity-20{opacity:.2}.opacity-25{opacity:.25}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-75{opacity:.75}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-2xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-lg,.shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring,.ring-2{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-red-300{--tw-ring-opacity:1;--tw-ring-color:rgb(252 165 165/var(--tw-ring-opacity,1))}.blur{--tw-blur:blur(8px)}.blur,.invert{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert:invert(100%)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.\[id\:fr\]{id:fr}.\[id\:lang\]{id:lang}body{min-height:100vh;--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1));--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.container{margin-left:auto;margin-right:auto;max-width:56rem;padding:2rem 1rem}h1{margin-bottom:1rem;font-size:1.875rem;line-height:2.25rem;font-weight:700;color:rgb(10 52 124/var(--tw-text-opacity,1))}h1,p{--tw-text-opacity:1}p{color:rgb(75 85 99/var(--tw-text-opacity,1))}:root{--color-swiss-badge-bg:#dbeafe;--color-swiss-badge-fg:#1e40af;--color-confidentiality-degraded-bg:#fef3c7;--color-confidentiality-degraded-fg:#92400e;--color-tests-internes-badge-bg:#ede9fe;--color-tests-internes-badge-fg:#5b21b6;--color-performance-badge-bg:#e5e7eb;--color-performance-badge-fg:#374151;--color-radio-group-border:#e5e7eb;--color-radio-legend:#111827;--color-radio-option-hover-bg:#f9fafb;--color-radio-option-label:#111827;--color-radio-option-desc:#4b5563}.swiss-badge{background:var(--color-swiss-badge-bg);color:var(--color-swiss-badge-fg);border-radius:9999px;padding:2px 8px;font-size:.75rem;font-weight:600;line-height:1.25;display:inline-flex;align-items:center;gap:4px;cursor:help}.confidentiality-degraded-banner{background:var(--color-confidentiality-degraded-bg);color:var(--color-confidentiality-degraded-fg);border-left:4px solid var(--color-confidentiality-degraded-fg);padding:8px 12px;border-radius:0 4px 4px 0;font-size:.875rem;display:flex;align-items:center;gap:8px}.tests-internes-badge{background:var(--color-tests-internes-badge-bg);color:var(--color-tests-internes-badge-fg);border-radius:9999px;padding:2px 8px;font-size:.75rem;font-weight:600;display:inline-flex;align-items:center;gap:4px}.confidentiality-radio-group{border:1px solid var(--color-radio-group-border);border-radius:8px;padding:16px;margin-top:16px}.confidentiality-radio-group legend{font-weight:600;font-size:.875rem;color:var(--color-radio-legend);padding:0 8px}.confidentiality-radio-option{display:flex;align-items:flex-start;gap:12px;padding:10px 12px;border-radius:6px;cursor:pointer}.confidentiality-radio-option:hover{background:var(--color-radio-option-hover-bg)}.confidentiality-radio-option input[type=radio]{margin-top:4px;cursor:pointer}.confidentiality-radio-option .option-label{font-weight:500;color:var(--color-radio-option-label);display:flex;align-items:center;gap:6px}.confidentiality-radio-option .option-desc{font-size:.8125rem;color:var(--color-radio-option-desc);margin-top:2px}.hover\:border-primary-400:hover{--tw-border-opacity:1;border-color:rgb(74 115 185/var(--tw-border-opacity,1))}.hover\:bg-amber-50:hover{--tw-bg-opacity:1;background-color:rgb(255 251 235/var(--tw-bg-opacity,1))}.hover\:bg-emerald-50:hover{--tw-bg-opacity:1;background-color:rgb(236 253 245/var(--tw-bg-opacity,1))}.hover\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.hover\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.hover\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.hover\:bg-primary-50:hover{--tw-bg-opacity:1;background-color:rgb(232 238 247/var(--tw-bg-opacity,1))}.hover\:bg-primary-700:hover{--tw-bg-opacity:1;background-color:rgb(10 52 124/var(--tw-bg-opacity,1))}.hover\:bg-red-100:hover{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.hover\:bg-red-200:hover{--tw-bg-opacity:1;background-color:rgb(254 202 202/var(--tw-bg-opacity,1))}.hover\:bg-red-50:hover{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.hover\:bg-red-700:hover{--tw-bg-opacity:1;background-color:rgb(185 28 28/var(--tw-bg-opacity,1))}.hover\:text-amber-600:hover{--tw-text-opacity:1;color:rgb(217 119 6/var(--tw-text-opacity,1))}.hover\:text-emerald-600:hover{--tw-text-opacity:1;color:rgb(5 150 105/var(--tw-text-opacity,1))}.hover\:text-gray-600:hover{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.hover\:text-gray-700:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.hover\:text-primary-100:hover{--tw-text-opacity:1;color:rgb(197 212 236/var(--tw-text-opacity,1))}.hover\:text-primary-600:hover{--tw-text-opacity:1;color:rgb(14 66 155/var(--tw-text-opacity,1))}.hover\:text-primary-700:hover{--tw-text-opacity:1;color:rgb(10 52 124/var(--tw-text-opacity,1))}.hover\:text-primary-800:hover{--tw-text-opacity:1;color:rgb(6 39 96/var(--tw-text-opacity,1))}.hover\:text-red-600:hover{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.hover\:text-red-700:hover{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.hover\:text-red-800:hover{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.hover\:text-red-900:hover{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.hover\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.focus\:not-sr-only:focus{position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal}.focus\:absolute:focus{position:absolute}.focus\:left-2:focus{left:.5rem}.focus\:top-2:focus{top:.5rem}.focus\:z-50:focus{z-index:50}.focus\:rounded:focus{border-radius:.25rem}.focus\:border-blue-500:focus{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.focus\:border-primary-500:focus{--tw-border-opacity:1;border-color:rgb(42 90 173/var(--tw-border-opacity,1))}.focus\:bg-primary-600:focus{--tw-bg-opacity:1;background-color:rgb(14 66 155/var(--tw-bg-opacity,1))}.focus\:px-4:focus{padding-left:1rem;padding-right:1rem}.focus\:py-2:focus{padding-top:.5rem;padding-bottom:.5rem}.focus\:text-white:focus{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.focus\:ring-primary-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(42 90 173/var(--tw-ring-opacity,1))}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (min-width:640px){.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:gap-3{gap:.75rem}.sm\:p-6{padding:1.5rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}.sm\:py-3{padding-top:.75rem;padding-bottom:.75rem}}@media (min-width:768px){.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-\[95vh\]{height:95vh}.md\:max-h-\[95vh\]{max-height:95vh}.md\:w-\[95vw\]{width:95vw}.md\:max-w-\[95vw\]{max-width:95vw}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-center{justify-content:center}.md\:gap-2{gap:.5rem}.md\:self-center{align-self:center}.md\:rounded{border-radius:.25rem}.md\:rounded-lg{border-radius:.5rem}.md\:border{border-width:1px}.md\:border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.md\:border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.md\:bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.md\:bg-transparent{background-color:transparent}.md\:p-4{padding:1rem}.md\:p-8{padding:2rem}.md\:px-3{padding-left:.75rem;padding-right:.75rem}.md\:py-2{padding-top:.5rem;padding-bottom:.5rem}}@media (min-width:1024px){.lg\:inline{display:inline}}/* apps/api/src/styles/components.css — Story 13.2: the hand-written component
   CSS that commit 334f9bda (no-CDN + Tailwind purge) clobbered out of
   public/styles.css. Recovered from 06d0a5cf. APPENDED to the tailwind output
   by build:css (so it cascades AFTER utilities — the demo's [tailwind,
   components] order that fixed the blue page-header). chat.css is inlined
   below (it is pure CSS; was a runtime @import in the old styles.css). */

/* ===== inlined: apps/api/public/lib/chat/chat.css ===== */
/*
 * Chat module styles — Story 10.5 Phase C origin, generalised in Story 10.6
 * manual-test ripple to a neutral `.chat-modal-*` prefix shared by every
 * chat adapter (Story 10.5 expert-findings-chat + Story 10.6 modify-with-AI
 * + future kb-chat). One set of class names, one set of rules — adding a
 * new chat consumer requires zero new CSS.
 *
 * Imported into styles.css via `@import url('./lib/chat/chat.css');`.
 * Replaces the Phase B `.expert-finding-modal-*` + `.expert-finding-preview-*`
 * blocks (deleted alongside `expert-finding-modal.js` in Task 20.2). The
 * brouillon-pill + `.btn-add-expert-finding` styles stay in styles.css
 * because they belong to the results-page toolbar, not the modal.
 */

/* === Modal shell ========================================================= */

.chat-modal-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.chat-modal-root[hidden] { display: none; }

.chat-modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--color-overlay-backdrop, rgba(0, 0, 0, 0.5));
}

.chat-modal-dialog {
  position: relative;
  background: var(--color-surface-elevated, white);
  /* Iter-12 (Beat 2026-05-07 Bug 27 round-3): keep the 4vh top position
   * Beat asked for, but reduce the BOTTOM margin so the dialog uses the
   * available bottom space instead of leaving a ~44px gap at the
   * viewport bottom on phone. `margin: 4vh auto 1vh auto` = 4vh top,
   * 1vh bottom. */
  margin: 4vh auto 1vh auto;
  max-width: 800px;
  width: 95%;
  /* Iter-4 (Bug 14): on mobile Safari `vh` uses the LARGE viewport (no
   * address bar) — the dialog overflows below the visible area when the
   * address bar shows. `dvh` (dynamic viewport height) tracks the actual
   * visible region. iOS 15.4+ / Chrome 108+; graceful fallback to `vh`
   * for older browsers.
   *
   * Iter-12 (Bug 27 round-3): max-height bumped 90→95 to match the new
   * margin allocation (4vh top + 95dvh content + 1vh bottom = 100vh
   * exactly — no wasted bottom space). */
  max-height: 95vh;
  max-height: 95dvh;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-modal, 0 25px 50px -12px rgba(0, 0, 0, 0.25));
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* Story 10.11c iter-10 (Beat 2026-05-07 Bug 27): clip overflow that
   * spills past the dialog's max-height. Pre-fix the dialog had `overflow:
   * visible` (default), so when the chat thread + composer + actions
   * exceeded 90dvh — frequent right after Envoyer or after Restaurer/trash
   * cycles re-flowed bubbles — the actions row literally rendered BELOW
   * the dialog box. With `overflow: hidden` the dialog clips at its
   * edge; the thread-host's `flex: 1; min-height: 0` (below) absorbs the
   * squeeze and stays scrollable. */
  overflow: hidden;
}

.chat-modal-dialog h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

/* Story 10.11c iter-11 (Beat 2026-05-07 Bug 27 follow-up): on phone the
 * dialog max-height (90dvh) leaves the conversation thread cramped after
 * iter-10's `overflow: hidden` + `min-height: 0` fix. Beat: "don't move
 * the dialog up; the title can be smaller when there's less reasonable
 * space for the conversation." Targeted polish at ≤639px:
 *   - Title font 1.25rem → 1rem (saves ~6px vertical).
 *   - Dialog padding 1.5rem → 1rem (saves 16px top + 16px bottom = 32px).
 *   - Inter-child gap 1rem → 0.5rem (saves ~8px × 5 gaps = 40px).
 *   - Composer textarea min-height 6rem → 4rem (saves ~32px).
 * Total ~110px of additional space recovered for the chat thread without
 * changing the dialog's top position. */
@media (max-width: 639px) {
  .chat-modal-dialog {
    padding: 1rem;
    gap: 0.5rem;
  }
  .chat-modal-dialog h2 {
    font-size: 1rem;
  }
  .chat-composer-textarea {
    min-height: 4rem;
  }
}

.chat-modal-error,
.chat-modal-error-slot {
  color: var(--color-action-negative);
  font-size: 0.875rem;
}
.chat-modal-error[hidden],
.chat-modal-error-slot[hidden] { display: none; }

.chat-modal-thread-host {
  flex: 1;
  /* Iter-10 (Beat 2026-05-07 Bug 27): drop the hard 200px `min-height`
   * floor → `min-height: 0` lets the thread-host shrink to whatever
   * vertical space is left after summary + composer + actions take
   * their natural sizes. Without `min-height: 0` the flex algorithm
   * can't shrink below the floor, dialog overflows max-height, and the
   * actions row spills out the bottom. The thread's own
   * `overflow-y: auto` keeps it scrollable even when squeezed small. */
  min-height: 0;
  overflow-y: auto;
  /* Story 10.11c iter-4 (Beat 2026-05-07 Bug 14): legacy iOS Safari needs
   * `-webkit-overflow-scrolling: touch` to enable momentum scrolling; in
   * its absence, touch-drag inside the thread can be silently captured
   * by the outer modal-root, making the user think the dialog isn't
   * scrollable at all (Beat: "the only way to add comment is to fold its
   * accordion"). Modern WebKit ignores this property; Safari ≤15 honors it. */
  -webkit-overflow-scrolling: touch;
  /* Anchor the scroll viewport so a tall expanded finding-card doesn't
   * push the composer below the visible viewport. `overscroll-behavior:
   * contain` prevents the outer modal-root from chaining the scroll. */
  overscroll-behavior: contain;
  border: 1px solid var(--color-border-subtle, #e5e7eb);
  border-radius: 0.375rem;
  padding: 0.5rem;
  background: var(--color-surface-neutral, #f9fafb);
}

.chat-modal-composer-host {
  flex-shrink: 0;
}

.chat-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  /* Story 10.11c iter-9 (Beat 2026-05-07 Bug 27): pin actions row at the
   * bottom of the dialog. Pre-fix the actions were the LAST flex child of
   * `.chat-modal-dialog` without flex-shrink: 0 — when the chat thread
   * grew tall enough to crowd the dialog (after streaming reply or after
   * Restaurer-then-trash cycles re-flowed bubbles), the actions row was
   * the first thing the flex algorithm shrank → buttons clipped /
   * partially overlapped the dialog border / fell below it. With
   * flex-shrink: 0 the actions row keeps its natural height; the
   * thread-host (flex: 1) absorbs the squeeze instead. */
  flex-shrink: 0;
}
.chat-modal-actions-host {
  flex-shrink: 0;
}
.chat-modal-actions button {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: 1px solid var(--color-border-subtle, #d1d5db);
  background: var(--color-surface-elevated, white);
  cursor: pointer;
}
/* Code review iter-4 F4-3: scope the generic neutral-hover to non-primary
   buttons so the primary action button (Ajouter N observations) keeps its
   blue background on hover instead of degrading to gray (white-on-gray
   loses the primary-action visual signal). */
.chat-modal-actions button:not(.btn-primary):hover { background: var(--color-surface-neutral, #f3f4f6); }
.chat-modal-actions button:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-modal-actions .btn-primary {
  background: var(--color-action-primary, #2563eb);
  color: var(--color-on-action-primary, white);
  border-color: var(--color-action-primary, #2563eb);
}
.chat-modal-actions .btn-primary:hover:not(:disabled) {
  /* Match the project's global .btn-primary:hover convention (styles.css).
     Task 23.5 (T3-5): exclude `:disabled` so the commit button doesn't
     show a darker-blue hover state when count===0 (the existing
     `button:disabled { opacity: 0.5 }` rule was being layered with the
     hover-darken, producing a half-faded dark-blue 'almost-active'
     look). Local fix only — global `.btn-primary:hover` in styles.css
     intentionally untouched per Beat's scope-limit on this iter. */
  background: var(--color-btn-primary-hover, var(--color-action-primary, #2563eb));
  border-color: var(--color-btn-primary-hover, var(--color-action-primary, #2563eb));
}
.chat-modal-actions .btn-destructive {
  background: var(--color-surface-elevated, white);
  color: var(--color-action-negative);
  border-color: var(--color-action-negative);
}

/* Optional title row + close button + summary card — Story 10.6 modify-with-AI
   uses these; Story 10.5 doesn't. Naming kept neutral so future adapters can
   reuse if they need an in-modal close button or a header summary card. */
.chat-modal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.chat-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-secondary, #6b7280);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.chat-modal-close:hover {
  color: var(--color-text-primary, #111827);
}
.chat-modal-summary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  /* Iter-5 (Beat 2026-05-07 Bug 14): cap the summary's height when
   * expanded so the composer stays visible below it. The current-finding
   * card with all sections rendered (title, description, why, how, sources,
   * references) can be 500-1000px tall on phone — without this cap it pushes
   * the composer below the dialog's max-height fold, forcing the user to
   * fold the accordion (header button) to type a comment. 35dvh shows
   * title + first ~3 sections at a glance; user scrolls within the summary
   * for more. `overflow-y: auto` confines the scroll to the summary itself,
   * leaving the chat thread + composer untouched as siblings. */
  max-height: 35vh;
  max-height: 35dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Iter-13 (Beat 2026-05-07 Bug 27 round-4): on phone widths the 35dvh
 * summary cap was still letting the current-finding card eat too much
 * vertical space — the chat thread had less than 50% of the dialog
 * to "start the conversation". Beat: "as soon as the conversation box
 * opens, the conversation should take more space and the current
 * finding box should shrink a bit (like up to 50% for each)." Tighten
 * the summary to 28dvh on phone (~30% of a 95dvh dialog); the thread
 * gets the larger remainder so the empty prompt area reads as the
 * primary affordance from the start. The summary stays scrollable
 * within its cap; users who want to re-read the finding can scroll
 * inside it OR tap the accordion header to collapse it entirely.
 *
 * Iter-14 (Beat 2026-05-07 Bug 27 round-5): replicate the streaming-time
 * layout immediately at Envoyer. Beat observed: "when reply starts
 * streaming in, the conversation autogrows fine, making current finding
 * smaller and smaller. Same should be done when hitting Envoyer."
 * Match via `:has(.chat-bubble[data-role="user"])` — once any user
 * bubble exists in the thread (Envoyer appended it), tighten the
 * summary cap further (28dvh → 15dvh). The flex algorithm hands the
 * freed vertical space to the thread (flex: 1) — same effective layout
 * as the post-streaming state, just achieved at Envoyer time. */
@media (max-width: 639px) {
  .chat-modal-summary {
    max-height: 28vh;
    max-height: 28dvh;
  }
  .chat-modal-dialog:has(.chat-bubble[data-role="user"]) .chat-modal-summary {
    max-height: 15vh;
    max-height: 15dvh;
  }
  /* Iter-16 (Beat 2026-05-07 Bug 27 round-7): when the user explicitly
   * re-expands the accordion AFTER the auto-collapse-at-end-of-reply,
   * lift the 15dvh cap to 50dvh so the finding card is actually
   * readable. The class is set / cleared by `render_summary_card` based
   * on whether the call came from a user click or auto-code path. */
  .chat-modal-dialog.summary-explicitly-expanded .chat-modal-summary {
    max-height: 50vh;
    max-height: 50dvh;
  }
}
.chat-modal-summary:empty { display: none; }
.chat-modal-summary-header {
  background: transparent;
  border: none;
  padding: 0.25rem 0;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary, #4b5563);
  cursor: pointer;
  align-self: flex-start;
}
.chat-modal-summary-header:hover {
  color: var(--color-text-primary, #111827);
}
/* The summary reuses `findings_list_renderer` for DRY parity with the AI
   proposal cards. Two card-level affordances aren't meaningful in a single
   read-only "current state" display — hide them in this scope only:
     - checkbox: there's nothing to commit / un-commit
     - visual numbering chip (#1, #2, …): only one card here */
.chat-modal-summary .chat-finding-card-checkbox,
.chat-modal-summary .chat-finding-card-number {
  display: none;
}

/* F15 (manual-test ripple): hide the per-card checkbox + numbering chip in
   the Modify-with-AI scope too. Modify-with-AI is single-finding — the
   commit affordance is the per-card `[✓ Enregistrer]` button below the
   card, not a checkbox-driven multi-commit flow. Same shape as the
   summary-card scope above. */
.chat-modal-finding-modify .chat-finding-card-checkbox,
.chat-modal-finding-modify .chat-finding-card-number {
  display: none;
}

/* F12 (manual-test ripple): per-card AI-proposal action row + inline diff
   panel. The action row sits inside the finding-card wrapper (after the
   card body); the diff panel renders below the actions when [👁 Différences]
   is toggled. Buttons inherit `.btn-primary` / `.btn-destructive` styling
   from the `.chat-modal-actions` palette via the parent class group. */
.chat-modal-finding-modify-actions {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border-subtle, #e5e7eb);
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
}
.chat-modal-finding-modify-diff {
  /* Neutral inspect button — same metrics as the other action buttons but
     no fill (it's a toggle, not a commit). */
  background: transparent;
  border: 1px solid var(--color-border-subtle, #d1d5db);
  color: var(--color-text-primary, #111827);
}
.chat-modal-finding-modify-diff:hover:not(:disabled) {
  background: var(--color-surface-neutral, #f3f4f6);
}
.chat-modal-finding-modify-diff-panel {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--color-surface-neutral, #f9fafb);
  border: 1px solid var(--color-border-subtle, #e5e7eb);
  border-radius: 0.375rem;
  font-size: 0.875rem;
}
.chat-modal-finding-modify-diff-panel[hidden] { display: none; }
.chat-modal-actions-host:empty { display: none; }
.chat-modal-composer-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* === Chat thread + bubbles =============================================== */

.chat-host { position: relative; }

/* Bug 2 + 3 (Beat smoke 2026-04-26): hide the empty thread box at modal
   open — show only the composer + actions until the first message lands.
   The chat-renderer toggles this class on the host based on visible thread
   length. Also collapse the host so the surrounding layout reclaims its
   space (the parent thread-host has `min-height: 200px` set further up;
   we override that here to zero when empty). */
.chat-host-empty .chat-thread { display: none; }
.chat-host-empty.chat-modal-thread-host,
.chat-modal-thread-host:has(.chat-host-empty) {
  min-height: 0;
  border: none;
  padding: 0;
  background: transparent;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Bug 4 (Beat smoke 2026-04-26): the first bubble after the compose→chat
   transition slides+fades in from the bottom (where the composer sits) so
   the user perceives their typed message migrating into the conversation
   surface. */
@keyframes chat-bubble-arrive {
  from {
    opacity: 0;
    transform: translateY(1.5rem) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.chat-bubble-fresh {
  animation: chat-bubble-arrive 0.32s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .chat-bubble-fresh { animation: none; }
}

.chat-bubble {
  position: relative;
  max-width: 80%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  word-wrap: break-word;
}

.chat-bubble-user {
  align-self: flex-end;
  background: var(--color-surface-elevated, white);
  border: 1px solid var(--color-border-subtle);
}

.chat-bubble-assistant {
  align-self: flex-start;
  background: var(--color-surface-neutral, #f3f4f6);
  border: 1px solid var(--color-border-subtle, #e5e7eb);
}

.chat-bubble-trashed {
  opacity: 0.5;
  font-style: italic;
}

.chat-bubble-content {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Bug 44 + 45 (Beat smoke 2026-04-26): empty assistant placeholder shows
   an animated three-dot "thinking" indicator. Visible immediately when
   the placeholder bubble lands (Send → user bubble + assistant
   placeholder appear together), so the user has unmistakable feedback
   that work is in progress — independent of whether Gemini's streaming
   is per-token or buffered. Replaced by rendered partial content via
   update_streaming_partial as tokens arrive. */
.chat-bubble-thinking {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  padding: 0.25rem 0;
}
.chat-bubble-thinking-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-text-muted, #6b7280);
  animation: chat-bubble-thinking-pulse 1.2s ease-in-out infinite;
}
.chat-bubble-thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-bubble-thinking-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes chat-bubble-thinking-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .chat-bubble-thinking-dot { animation: none; opacity: 0.6; }
}

.chat-bubble-affordances {
  display: flex;
  gap: 0.125rem;
  align-items: center;
  position: absolute;
  /* Bug 6 (Beat smoke 2026-04-26): pre-fix `top: -0.5rem` made the affordance
     buttons stick out 8px above the bubble; with the 0.75rem thread `gap`
     the buttons physically overlapped the bottom of the previous (assistant)
     bubble. Now positioned INSIDE the bubble's top-right corner — no
     overflow into prior bubbles. */
  top: 0.25rem;
  right: 0.5rem;
  visibility: hidden;
  /* Bug 53 follow-up (Beat smoke 2026-04-27): give the affordance group
     an opaque background so the bubble text underneath doesn't bleed
     through the gaps between buttons. The background only renders when
     the container is visible (i.e. on hover), so the always-visible
     `.chat-version-nav` (Bug 48) provides its own background to cover
     itself when the rest of the group is hidden. */
  background: var(--color-surface-elevated, white);
  border-radius: 0.25rem;
  padding: 0.125rem;
}
.chat-bubble:hover .chat-bubble-affordances { visibility: visible; }

/* Iter-5 (Beat 2026-05-07 Bug 20): on touch devices `:hover` doesn't
 * fire reliably (and for some browsers it sticks-on after a tap). Beat
 * report: the pencil/trash overlay is visible during AI processing
 * (sticky :hover after tap) AND covers the message text, then disappears
 * after processing. Fix: at coarse-pointer, ALWAYS show the affordances
 * AND move them ABOVE the bubble so they don't overlap the content.
 * `top: -1.25rem` positions just above the bubble's top edge; the user-
 * bubble's right-aligned column means the affordance group sits at the
 * top-right of the chat thread, clearly distinct from the message.
 *
 * Iter-7 (Beat 2026-05-07 Bug 20 follow-up — playwright-confirmed):
 * the `top: -1.5rem` placement was being clipped at the TOP of the
 * thread-host scroll viewport — the user couldn't scroll up past the
 * first bubble to see the overlay. Two fixes pair together:
 *   - Reduce the overhang to `top: -1rem` (still clearly above the
 *     bubble + visually distinct, but less aggressive on the clip).
 *   - Add `padding-top: 1.25rem` to `.chat-modal-thread-host` so the
 *     first bubble starts ~20px down from the scroll viewport's top
 *     edge. The overlay's -1rem offset now lands within the padding —
 *     visible without scroll required.
 *
 * Iter-8 (Beat 2026-05-07 Bug 20 round-3): the -1rem placement still
 * had the affordance icons overlapping the message text by ~half a
 * character height. Lift them another 0.75rem (`top: -1.75rem`) and
 * pad the thread-host top by an extra 0.25rem (1.5rem total) so the
 * scroll viewport accommodates the higher overhang.
 */
@media (pointer: coarse) {
  .chat-bubble-affordances {
    visibility: visible;
    top: -1.75rem;
    right: 0.25rem;
    /* No background needed — the affordances sit OUTSIDE the bubble's
     * paint area, so there's no bleed-through to mask. */
    background: transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }
  .chat-modal-thread-host {
    padding-top: 1.5rem;
  }
}

/* Bug 43 (Beat smoke 2026-04-26): in edit mode the hover-revealed
   pencil/trash/version-nav buttons would otherwise overlap the
   in-bubble textarea and obscure editing. Hide unconditionally while
   `.chat-bubble-editing` is set; the JS removes the class on cancel/
   resend. */
.chat-bubble-editing .chat-bubble-affordances { display: none; }

/* Bug 44 #2 (Beat smoke 2026-04-26): the bubble's width is intrinsic-
   content-driven (max-width: 80%, but default width = whatever the
   content needs). When edit mode swaps the read-mode text for an
   empty `<textarea>`, the textarea's natural min-width (cols default
   ~20 chars) collapses the bubble to a narrow column — visually much
   smaller than the original message. Force the editing bubble to its
   max-width track so the in-bubble textarea has room to breathe. The
   textarea's `width: 100%; box-sizing: border-box` then fills the
   bubble's content slot exactly (no overflow, no shrink). */
.chat-bubble-editing {
  width: 80%;
}

.chat-affordance {
  background: var(--color-surface-elevated, white);
  border: 1px solid var(--color-border-subtle, #e5e7eb);
  border-radius: 0.25rem;
  /* Bug 53 follow-up (Beat smoke 2026-04-27): "make those trash etc
     buttons at least 25% bigger (as big as one-line responses)."
     Bumped from 0.95rem → 1.2rem font-size (≈26%) and padding to
     0.375rem 0.55rem so the hit target matches the bubble line-height
     (~1.3rem). The parent `.chat-bubble-affordances` now has its own
     opaque white background, so individual affordances can shed their
     borders without dropping back through to bubble text underneath. */
  padding: 0.375rem 0.55rem;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}
.chat-affordance:hover { background: var(--color-surface-neutral, #f3f4f6); }
/* Bug 36 (Beat smoke 2026-04-26): the U+270F PENCIL glyph (✏) renders
   horizontal in many sans-serif fallback fonts, making it visually
   indistinguishable as an "edit" icon. The standard edit-pencil
   convention is diagonal, eraser at top-right and tip at bottom-left.
   The renderer puts the SVG inside the pencil-affordance button instead
   of relying on the unicode character (see make_pencil_button in
   version-tree-edit.js). The SVG itself is laid out diagonally, no
   rotation needed. */
.chat-affordance-edit svg {
  /* Bug 53 follow-up: SVG bumped to match the new font-size. */
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  pointer-events: none; /* clicks land on the button, not the SVG */
}

.chat-version-nav {
  /* Sized + revealed-on-hover to match `.chat-affordance` (pencil/trash).
     Beat 2026-04-27 follow-up: "indicator size not bumped with trash/edit
     icons — and it should show only on hover, like pen and trash". The
     earlier Bug-48 visibility override (persistent display so a `<` click
     auto-swap doesn't strand the new active bubble's nav off-hover) is
     dropped here; user prefers the cleaner hover-only behaviour and will
     hover the new bubble after a swap. */
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  background: var(--color-surface-elevated, white);
  border: 1px solid var(--color-border-subtle, #e5e7eb);
  border-radius: 0.25rem;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
}
.chat-version-nav-prev,
.chat-version-nav-next {
  background: transparent;
  border: none;
  cursor: pointer;
  /* Match `.chat-affordance` padding so the chevron buttons land at the
     same height as the trash/pencil siblings. */
  padding: 0.375rem 0.55rem;
  font-size: 1.2rem;
  line-height: 1;
}
.chat-version-nav-prev:disabled,
.chat-version-nav-next:disabled { opacity: 0.3; cursor: not-allowed; }
.chat-version-nav-indicator {
  font-variant-numeric: tabular-nums;
  padding: 0 0.25rem;
  font-size: 1.2rem;
  line-height: 1;
}

/* === Clarifications payload ============================================== */

/* Bugs 21+22 (Beat smoke 2026-04-26): the LLM responds with `clarifications`
   when it can't confidently produce findings. Each question is a numbered
   list item; styled like the assistant bubble's text content so the visual
   hierarchy stays consistent. */
.chat-clarifications-list {
  margin: 0;
  padding-left: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
}
.chat-clarification-item {
  margin-bottom: 0.375rem;
}
.chat-clarification-item:last-child {
  margin-bottom: 0;
}

/* === Inline edit (pencil swap) =========================================== */

.chat-bubble-edit-textarea {
  /* Bug 44 (Beat smoke 2026-04-26): without `box-sizing: border-box`,
     `width: 100%` puts the content area at 100% of the parent and ADDS
     padding + border outside, so the textarea visually overflows OR the
     parent shrinks it depending on the layout — Beat saw it render
     "much less wide than the message displayed" inside the chat bubble.
     With border-box, `width: 100%` is the OUTER box, so the textarea
     fills the bubble's content slot exactly and editing is seamless
     with the surrounding bubble's padding. font-size/line-height
     inherit so the edit UI matches the read-mode bubble text. */
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 4rem;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  padding: 0.375rem;
  border: 1px solid var(--color-border-subtle, #e5e7eb);
  border-radius: 0.25rem;
  resize: vertical;
}
.chat-bubble-edit-actions {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.375rem;
}
.chat-bubble-edit-cancel,
.chat-bubble-edit-resend {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--color-border-subtle, #e5e7eb);
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.75rem;
  background: var(--color-surface-elevated, white);
}
.chat-bubble-edit-resend {
  background: var(--color-action-primary, #2563eb);
  color: var(--color-on-action-primary, white);
  border-color: var(--color-action-primary, #2563eb);
}

/* === Composer ============================================================ */

.chat-composer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.chat-composer-textarea {
  width: 100%;
  min-height: 6rem; /* Bug 5: ~4 rows of 1rem with 0.5rem padding. */
  /* Bug 5 (Beat smoke 2026-04-26): cap auto-grow so the textarea + thread
     can both expand within the dialog (capped at 90vh) without the textarea
     monopolising the viewport on long pastes. 50vh keeps room for at least
     a few message bubbles. The dialog itself caps at 90vh; if both hit
     their caps the inner overflow scrolls. */
  max-height: 50vh;
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.5rem;
  border: 1px solid var(--color-border-subtle, #e5e7eb);
  border-radius: 0.375rem;
  resize: vertical;
  /* JS auto-grow toggles `style.height` per scrollHeight on input. Without
     this, the user-toggled `resize` handle would conflict with JS-driven
     height changes. Box-sizing: border-box so padding doesn't add to the
     scrollHeight comparison. */
  box-sizing: border-box;
}
.chat-composer-textarea:focus {
  outline: none;
  border-color: var(--color-action-primary, #2563eb);
  box-shadow: var(--shadow-focus-ring, 0 0 0 3px rgba(37, 99, 235, 0.1));
}

.chat-composer-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted, #6b7280);
}
.chat-composer-status[hidden] { display: none; }

.chat-composer-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--color-border-subtle, #e5e7eb);
  border-top-color: var(--color-action-primary, #2563eb);
  border-radius: 50%;
  animation: chat-spinner-spin 0.8s linear infinite;
}

@keyframes chat-spinner-spin {
  to { transform: rotate(360deg); }
}

.chat-composer-send {
  align-self: flex-end;
  padding: 0.5rem 1rem;
  background: var(--color-action-primary, #2563eb);
  color: var(--color-on-action-primary, white);
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
}
.chat-composer-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === Findings card payload =============================================== */

.chat-finding-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-finding-list-historical .chat-finding-card {
  opacity: 0.75;
}

.chat-finding-card {
  border: 1px solid var(--color-border-subtle, #e5e7eb);
  border-radius: 0.375rem;
  padding: 0.5rem;
  background: var(--color-surface-elevated, white);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chat-finding-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chat-finding-card-checkbox {
  flex-shrink: 0;
  cursor: pointer;
}

.chat-finding-card-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.75rem;
}

.chat-finding-card-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.875rem;
}

.chat-finding-card-badges {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.chat-finding-card-severity {
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}
/* Code review iter-2 F2-4: use the project-wide severity tokens
   (`--color-severity-{high,medium,low}-{bg,text}`) instead of inventing
   non-existent unsuffixed names with hardcoded text colors. The pre-fix
   fallbacks (#fee2e2 etc.) also diverged from the project's defined
   palette — `--color-severity-high-bg` is `#fecaca`, not `#fee2e2`. */
.chat-finding-card-severity.severity-high { background: var(--color-severity-high-bg); color: var(--color-severity-high-text); }
.chat-finding-card-severity.severity-medium { background: var(--color-severity-medium-bg); color: var(--color-severity-medium-text); }
.chat-finding-card-severity.severity-low { background: var(--color-severity-low-bg); color: var(--color-severity-low-text); }

.chat-finding-card-category {
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  background: var(--color-surface-neutral, #f3f4f6);
  font-size: 0.75rem;
  color: var(--color-text-muted, #6b7280);
}

.chat-finding-card-supersedes,
.chat-finding-card-replaced-by {
  font-size: 0.75rem;
  color: var(--color-text-muted, #6b7280);
  font-style: italic;
}

.chat-finding-card-description { font-size: 0.875rem; }

.chat-finding-card-section {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px dashed var(--color-border-subtle, #e5e7eb);
}

.chat-finding-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted, #6b7280);
  margin-bottom: 0.125rem;
}

.chat-finding-card-value { font-size: 0.875rem; }
.chat-finding-card-value-prewrap { white-space: pre-wrap; }

.chat-finding-card-references {
  margin: 0;
  padding-left: 1rem;
  list-style: disc;
}

.chat-finding-card-references li { margin-bottom: 0.25rem; }

.chat-finding-card-ref-label {
  background: transparent;
  border: none;
  color: var(--color-action-primary, #2563eb);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
  font-size: 0.75rem;
}
.chat-finding-card-ref-label:hover { text-decoration: none; }
.chat-finding-card-ref-label:focus-visible {
  outline: 2px solid var(--color-action-primary, #2563eb);
  outline-offset: 2px;
}

.chat-finding-card-ref-text {
  font-size: 0.75rem;
  color: var(--color-text-muted, #6b7280);
  margin-top: 0.125rem;
}

/* === Supersede group chain icon ========================================= */

.chat-supersede-chain-icon {
  font-size: 0.875rem;
  margin-left: 0.25rem;
  /* Bug 15 (Beat smoke 2026-04-26): the icon is now clickable (toggles
     the broken state of the group). `pointer` cursor signals affordance. */
  cursor: pointer;
  user-select: none;
}

/* === Trash toggle button ================================================ */

/* Bug 35 (Beat smoke 2026-04-26): pre-fix `position: absolute` anchored the
   toggle to the bottom of the SCROLLABLE CONTENT (the chat-host's
   relatively-positioned padding-box), which scrolled with the conversation
   — invisible until the user manually scrolled to the bottom. With many
   trashed turns, the user had no discoverable way to re-enable the
   show-trashed view to find the Restaurer buttons.
   Switch to `position: sticky` so the button stays glued to the visible
   viewport bottom regardless of scroll position. The chat-thread is a
   flex-column inside the scroll container; sticky on a flex item still
   pins to the scroll viewport (browsers treat the scroll container as the
   sticky containing block). align-self ensures it stays on the right
   regardless of the flex direction. */
.chat-trash-toggle {
  position: sticky;
  /* Beat 2026-04-27 follow-up: was `bottom: 0.5rem`. Bumped down by ~40%
     of the button's own height (≈0.7rem on a 1.75rem-tall control) so it
     no longer overlaps the bottom of the last AI bubble while reading. */
  bottom: -0.2rem;
  /* host_element (the scroll container) is `display: block`, so
     `align-self` would no-op. `display: block; margin-left: auto;
     width: fit-content` pushes the button to the right edge of the
     container content area. `margin-right: 0.5rem` matches the prior
     visual offset from the scrollbar. */
  display: block;
  margin-left: auto;
  margin-right: 0.5rem;
  width: fit-content;
  background: var(--color-surface-elevated, white);
  border: 1px solid var(--color-border-subtle, #e5e7eb);
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 0.75rem;
  z-index: 1;
}
.chat-trash-toggle[hidden] { display: none; }

.chat-bubble-restore {
  display: block;
  margin-top: 0.25rem;
  background: transparent;
  border: 1px solid var(--color-border-subtle, #e5e7eb);
  border-radius: 0.25rem;
  padding: 0.125rem 0.375rem;
  cursor: pointer;
  font-size: 0.75rem;
}

/* ---------------------------------------------------------------------------
 * In-chat notice block (Story 11.20c, Beat 2026-05-29) — rendered INSIDE the
 * modal by render_chat_notice_block (rate-limit + generic stream errors),
 * replacing the global show_error toast that landed behind the backdrop. The
 * base block was previously unstyled; the `-notice-error` variant is red.
 * Class name kept as `*-rate-limit-block` (the original) so existing markup +
 * tests keep matching; it now serves all in-chat notices.
 * ------------------------------------------------------------------------- */
.finding-modify-chat-rate-limit-block {
  margin: 0.5rem 0;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border-subtle, #e5e7eb);
  border-radius: 0.375rem;
  background: var(--color-surface-elevated, #ffffff);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.finding-modify-chat-rate-limit-message {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.35;
}
.finding-modify-chat-rate-limit-cta {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--color-border-subtle, #e5e7eb);
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 0.8125rem;
}
/* Error variant — clearly red (Beat: "with the red background"). */
.finding-modify-chat-notice-error {
  background: var(--color-severity-high-bg);
  border-color: var(--color-severity-high-accent);
  color: var(--color-severity-high-text);
}
.finding-modify-chat-notice-error .finding-modify-chat-rate-limit-cta {
  border-color: var(--color-severity-high-accent);
  color: var(--color-severity-high-text);
}

/* ===== recovered component CSS (06d0a5cf:apps/api/public/styles.css) ===== */

/* ============================================================================
   Story 3.7: CSS Custom Properties for Severity Colors
   ============================================================================ */
:root {
  /* Severity accent colors - for dots, borders, traffic lights (bright & distinct)
     Synced with PDF constants in export-service.ts (Story 4.7 code review) */
  --color-severity-high-accent: #DC2626;    /* red-600 - clearly red */
  --color-severity-medium-accent: #E67E22;  /* orange - stronger orange, distinct from yellow */
  --color-severity-low-accent: #EAB308;     /* yellow-500 - warm yellow, distinct from orange */

  /* Severity badge backgrounds - muted for text readability */
  --color-severity-high-bg: #fecaca;   /* red-200 - stronger red, less pink */
  --color-severity-high-text: #991b1b; /* red-800 */
  --color-severity-high-selected: #fef2f2; /* red-50 */

  --color-severity-medium-bg: #fed7aa;   /* orange-200 - distinctly orange vs yellow */
  --color-severity-medium-text: #9a3412; /* orange-800 */
  --color-severity-medium-selected: #fff7ed; /* orange-50 */

  --color-severity-low-bg: #fef9c3;    /* yellow-100 */
  --color-severity-low-text: #854d0e;  /* yellow-800 */
  --color-severity-low-selected: #fefce8; /* yellow-50 */

  /* Story 10.1 review state — distinct from severity (severity-low is yellow,
     approved needs to read as a green confirmation). */
  --color-state-approved: #16a34a;       /* green-600 — clearly green confirmation */
  --color-state-approved-bg: #dcfce7;    /* green-100 — soft tint for the whole item */
  --color-state-approved-border: #86efac; /* green-300 — visible left-border */
  --color-state-rejected: #DC2626;       /* red-600 — reused from severity-high */
  --color-state-rejected-bg: #fee2e2;    /* red-100 — soft tint for the whole item */
  --color-state-rejected-border: #fca5a5; /* red-300 — visible left-border */

  /* Story 10.11b Decision 18: rejected-finding screen styling. The label
     badge greys via opacity rather than a red tint, because labels reflect
     export-walk order (active before rejected) but on screen they appear
     interleaved by canonical sort. The greying is the cue: "these labels
     are valid; you're just in the screen view, not the export view."
     Single shared token so a future tweak (e.g. 0.6) propagates everywhere. */
  --opacity-rejected: 0.55;

  /* Story 10.9 Decision 8: feedback colors alias the existing state-* semantic
     vars per CLAUDE.md DRY-colors rule. Override here ONLY if smoke-testing
     surfaces a real visual reason to deviate from the state palette. */
  --color-feedback-positive: var(--color-state-approved);
  --color-feedback-negative: var(--color-state-rejected);
  /* Story 10.10 — 5-emoji selector palette + post_project neutral fill.
     Selected state is the project yellow (per AC 10.10.1); default/hover
     reuse the gray scale. Cancellation chip uses gray-200/700 for the
     visible-but-disabled treatment per AC 10.10.14. */
  --color-feedback-emoji-default: var(--color-gray-400);
  --color-feedback-emoji-hover: var(--color-gray-700);
  --color-feedback-emoji-selected: #ca8a04;  /* yellow-600 — primary CTA tint; no project gray var matches */
  --color-feedback-neutral: var(--color-feedback-emoji-selected);

  /* Amber utility scale (Tailwind amber palette).
     Use these for all amber-colored UI: confidence medium, divergence banner, notices. */
  --color-amber-50:  #fffbeb;
  --color-amber-100: #fef3c7;
  --color-amber-200: #fde68a;
  --color-amber-300: #fcd34d;
  --color-amber-500: #f59e0b;
  --color-amber-800: #92400e;
  --color-amber-900: #78350f;

  /* Story 4.1: Confidence colors (parallel naming to severity-*)
     Thresholds: high ≥80% (neutral - no emphasis), medium 50-79%, low <50% */
  --color-status-muted: #9ca3af;          /* gray-400 — pending and cancelled agent icons */
  --color-confidence-high: #6B7280;      /* gray-500 - neutral, no green! (kept for consistency with severity-* pattern) */
  --color-confidence-high-bg: #F3F4F6;   /* gray-100 */
  --color-confidence-high-text: #374151; /* gray-700 */

  --color-confidence-medium: var(--color-amber-500);
  --color-confidence-medium-bg: var(--color-amber-100);
  --color-confidence-medium-text: var(--color-amber-800);

  --color-confidence-low: #EF4444;       /* red-500 */
  --color-confidence-low-bg: #fee2e2;    /* red-100 */
  --color-confidence-low-text: #991b1b;  /* red-800 */

  /* Primary colors - Story 4.2: CSS custom properties for new code.
     F-ripple-iter3-2 (post-Story-10.6 ripple): the -50 lightest-tint slot
     was missing; .undo-entry:focus referenced it with a hex fallback
     (the documented retro F10.5-5 / F10.6-iter3-1 class). Defined here
     so the primary-N scale is complete; theming :root redefines now
     propagate to the focus highlight. */
  --color-primary-50: #E8EEF7;
  --color-primary-500: #2A5AAD;
  --color-primary-600: #0E429B;
  --color-primary-700: #0A347C;

  /* Button blue — matches Tailwind blue-600/700 for primary action buttons */
  --color-btn-primary: #2563EB;
  --color-btn-primary-hover: #1D4ED8;

  /* Action card — corrective measures (Story 5.20) */
  --color-action-bg: #EFF6FF;        /* blue-50 */
  --color-action-border: #BFDBFE;    /* blue-200 */
  --color-action-accent: #2563EB;    /* blue-600 */
  --color-action-title: #1E40AF;     /* blue-800 */
  --color-action-sub-accent: #93C5FD; /* blue-300 */

  /* Gray utility scale (Tailwind gray palette).
     Use these for all new code. Existing 100+ hardcoded uses are a backlog item. */
  --color-gray-50:  #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  /* Story 10.5 semantic aliases (iter 3 — previously referenced with
     var(..., fallback) but not defined, so the fallback always won. Define
     here so the link is real and a future :root redefinition actually
     propagates.) */
  --color-border-subtle: var(--color-gray-300);
  --color-action-negative: #dc2626; /* red-600 — matches severity-high-accent */
  --color-surface-elevated: #ffffff;
  --color-surface-neutral: var(--color-gray-100);
  --color-text-primary: var(--color-gray-800);
  --color-text-muted: var(--color-gray-500);

  /* Story 10.5 Phase C — chat module semantic tokens (code review iter-2 F2-4).
     iter-1's F10.5-5 added `var(--token, fallback)` references but never
     defined the tokens here — fallbacks always won. Define so future
     :root redefinitions (theming, dark mode) actually propagate. */
  --color-overlay-backdrop: rgba(0, 0, 0, 0.5);
  --color-on-action-primary: #ffffff;
  /* Story 12.35b — the border of the header's round user badge and organisation chip, on the
   * primary band and when open (white face). One value each for both controls. */
  --color-header-chip-border: rgba(255, 255, 255, 0.4);
  --color-header-chip-border-open: rgba(17, 24, 39, 0.12);
  /* Code review iter-3 F3-3: `--color-action-primary` is the semantic pair
     of `--color-on-action-primary` (above) — used 9× in chat.css for primary
     button bg, focus ring, spinner, ref-link colors. F2-4 added the "on"
     half but missed the bg half. Alias to `--color-btn-primary` (the
     project's existing canonical button-blue token) so a future redefine
     of either propagates everywhere. */
  --color-action-primary: var(--color-btn-primary);
  --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.1);

  /* Story 10.11 smoke-test follow-up #11 — single source of truth for the
   * project's button corner radius. CLAUDE.md DRY rule: every button class
   * MUST reference `var(--radius-button)` rather than hardcoding a literal,
   * so changing the project palette touches one place. Pre-existing
   * inconsistency (`.btn-primary` 0.25rem vs `.btn-secondary` 0.5rem vs
   * `.btn-add-expert-finding` 4px vs `.finding-edit-recovery-banner-button`
   * 4px) collapses to this single value. 0.5rem matches the Tailwind
   * `rounded-lg` utility used elsewhere (e.g. upload.html confirm dialog),
   * so visual consistency holds across both CSS-class and utility-class
   * surfaces. */
  --radius-button: 0.5rem;

  /* Story 10.11c (AC 10.11c.HINT.1) — Shift-held mnemonic-hint badge tokens.
     Holding Shift sets `body.shift-held`; the
     `[data-shortcut-action]::after` pseudo-element pulls the chord-display
     token from the per-element `--shortcut-hint` custom property and
     renders it in the bottom-right corner of every registered shortcut
     button. Default bg is the page neutral; chord-button consumers with a
     non-default background must override `--shortcut-hint-bg` on their own
     selector so the badge masks visibly. */
  --shortcut-hint-opacity: 0.85;
  --shortcut-hint-bg: #ffffff;

  /* Background tokens */
  --color-bg-secondary: #f9fafb;     /* gray-50 — text preview, code blocks */

  /* Layout dimensions - Story 3.3 (moved here for consolidation)
   * Column widths: Story 3.3 AC #1 specifies 380px/fluid/200px
   * Header height: UX spec line 1610 originally defined nav 44px + results
   * header 40px = 84px. Story 10.1 iter 3 added the stacked review-progress
   * bar (label + 6.4px bar + 2px gap) to the results header, pushing its
   * actual height to ~48px. Bumped to 92px so `calc(100vh - var(--header-
   * height))` matches the rendered header — without this, the results page
   * was ~8px taller than the viewport (bug #28, 2026-04-18) and the body
   * showed a vertical scrollbar that drifted on every scroll.
   * Touch target: UX spec field conditions requirement */
  --findings-panel-width: 380px;
  --documents-panel-width: 200px;
  --header-height: 92px;
  --touch-target-min: 48px;

  /* Story 5.15: Debug mode accent color */
  --color-debug: #6b7280;

  /* Story 7.5c: Affirmation tree state colors */
  --color-state-yes: #16a34a;        /* green-600 — affirmative checkmark */
}

/* Basic styles - will be replaced by Tailwind build */
body {
  font-family: system-ui, -apple-system, sans-serif;
  background-color: #f9fafb;
  color: #111827;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 1rem;
}

p {
  color: #4b5563;
}

/* ============================================================================
   Analysis Progress Styles (Story 2.10)
   ============================================================================ */

.analysis-progress {
  max-width: 100%;
  padding: 1rem 0;
}

/* Agent Status Icons */
.status-pending {
  color: var(--color-status-muted);
}

.status-running {
  color: #3b82f6; /* blue-500 */
}

.status-complete {
  color: #22c55e; /* green-500 */
}

.status-failed {
  color: #ef4444; /* red-500 */
}

.status-cancelled {
  color: var(--color-status-muted);
}

/* Pulse animation for running state
   Story 5.8 Task 0: GPU-composited (opacity-only), slowed to 3s to reduce repaints,
   stepped to minimize intermediate frames. will-change applied only during animation. */
@keyframes pulse-blue {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse-blue {
  animation: pulse-blue 4s steps(2) infinite;
  will-change: opacity;
}

/* Elapsed time pulse animation during analysis — same 4s/steps(2) as pulse-blue
   so blink transitions align with the 2s elapsed timer tick */
.animate-pulse-timer {
  animation: pulse-blue 4s steps(2) infinite;
  will-change: opacity;
}

/* Story 5.8 Task 0: Override Tailwind animate-spin to reduce CPU —
   use steps(12) for a "clock tick" effect instead of smooth 60fps rotation.
   12 steps at 1s = one tick every ~83ms, drastically fewer compositor frames. */
.analysis-spinner.animate-spin {
  animation: spin 1s steps(12) infinite;
  will-change: transform;
}

/* Story 5.8 Task 0: Respect reduced motion for all analysis progress animations */
@media (prefers-reduced-motion: reduce) {
  .animate-pulse-blue,
  .animate-pulse-timer {
    animation: none !important;
    will-change: auto !important;
  }
  .animate-spin {
    animation: none !important;
    will-change: auto !important;
  }
  .finding-skeleton,
  .document-skeleton {
    animation: none !important;
    will-change: auto !important;
  }
  .findings-partial-notice .spinner-icon {
    animation: none !important;
  }
  .accordion-header::after,
  .finding-item::after {
    transition: none !important;
  }
  .accordion-chevron,
  .category-toggle-icon,
  .accordion-expand-icon {
    transition: none !important;
  }
}

/* Findings count badge */
.findings-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.25rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  margin-left: 0.75rem; /* ~3 whitespace gap */
  background-color: #e5e7eb; /* gray-200 default */
  color: #374151; /* gray-700 default */
}

/* Severity-colored badges */
.findings-badge.badge-high {
  background-color: #fee2e2; /* red-100 */
  color: #991b1b; /* red-800 */
}

.findings-badge.badge-medium {
  background-color: var(--color-amber-100);
  color: var(--color-amber-800);
}

.findings-badge.badge-low {
  background-color: #dcfce7; /* green-100 */
  color: #166534; /* green-800 */
}

.findings-badge.badge-none {
  background-color: var(--color-amber-100);
  color: var(--color-amber-800);
}

/* Error tooltip */
.error-tooltip {
  position: absolute;
  z-index: 50;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: white;
  background-color: #dc2626; /* red-600 */
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  max-width: 20rem;
  word-wrap: break-word;
}

.error-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 1rem;
  border-width: 0 6px 6px 6px;
  border-style: solid;
  border-color: transparent transparent #dc2626 transparent;
}

/* Accordion styles for findings */
.accordion-item {
  border: 1px solid #e5e7eb; /* gray-200 */
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: #f9fafb; /* gray-50 */
  border: none;
  cursor: pointer;
  text-align: left;
  position: relative;
}

/* Story 5.8 Task 0: hover overlay via opacity (GPU-composited) instead of background-color transition */
.accordion-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: #f3f4f6; /* gray-100 */
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
  z-index: 0;
}

.accordion-header:hover::after {
  opacity: 1;
}

/* Ensure accordion-header children sit above the pseudo-element */
.accordion-header > * {
  position: relative;
  z-index: 1;
}

.accordion-header:focus {
  outline: 2px solid #3b82f6; /* blue-500 */
  outline-offset: -2px;
}

.accordion-header[aria-expanded="true"] {
  border-bottom: 1px solid #e5e7eb;
}

.accordion-chevron {
  width: 1.25rem;
  height: 1.25rem;
  color: #6b7280; /* gray-500 */
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.accordion-header[aria-expanded="true"] .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-content {
  overflow: hidden;
  max-height: 1000px; /* Large enough for most content */
  transition: max-height 0.3s ease-out;
}

.accordion-content.collapsed {
  max-height: 0 !important;
}

/* Agent origin badge */
.agent-origin-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background-color: #e0e7ff; /* indigo-100 */
  color: #4338ca; /* indigo-700 */
  margin-right: 0.5rem;
}

/* Severity border colors for findings - Story 3.7 Task 4: Use CSS custom properties */
.finding-severity-high {
  border-left: 4px solid var(--color-severity-high-accent);
}

.finding-severity-medium {
  border-left: 4px solid var(--color-severity-medium-accent);
}

.finding-severity-low {
  border-left: 4px solid var(--color-severity-low-accent);
}

/* Agent status list item */
.agent-status-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.agent-status-icon {
  font-size: 1.125rem;
  line-height: 1;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.agent-status-name {
  font-size: 0.875rem;
  color: #374151; /* gray-700 */
}

.agent-status-text {
  font-size: 0.75rem;
  color: #6b7280; /* gray-500 */
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

/* Child finding in accordion */
.child-finding {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  background-color: #ffffff;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
}

.child-finding:last-child {
  margin-bottom: 0;
}

/* Accordion expand icon */
.accordion-expand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.625rem;
  color: white;
  background-color: #f97316; /* orange-500 */
  border-radius: 0.25rem;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

/* ============================================================================
   Conversation Viewer — Debug Mode (Story 5.8 Task 7)
   ============================================================================ */

/* Scrollable viewer per agent row (~8 lines ≈ 12rem) */
.cv-viewer {
  position: relative;
  margin: 0.25rem 0 0.5rem 2.25rem; /* indented to align under agent name */
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  background-color: #1e1e2e; /* dark terminal-like bg */
  overflow: hidden;
}

.cv-content-area {
  max-height: 12rem; /* ~8 lines */
  overflow-y: auto;
  padding: 0.5rem;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #cdd6f4; /* light text on dark bg */
}

/* Expand button (top-right corner) */
.cv-expand-btn {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  z-index: 2;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(49, 50, 68, 0.8);
  border: 1px solid #585b70;
  border-radius: 0.25rem;
  color: #cdd6f4;
  font-size: 0.875rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.cv-viewer:hover .cv-expand-btn {
  opacity: 1;
}

.cv-expand-btn:hover {
  background: rgba(69, 71, 90, 0.9);
}

.cv-expand-btn:focus-visible {
  opacity: 1;
  outline: 2px solid #89b4fa;
  outline-offset: 1px;
}

/* Item blocks */
.cv-item-block {
  margin-bottom: 0.5rem;
  border-radius: 0.25rem;
  overflow: hidden;
}

.cv-item-block:last-child {
  margin-bottom: 0;
}

.cv-item-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.125rem 0.375rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cv-item-content {
  padding: 0.375rem;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.75rem;
  line-height: 1.4;
  max-height: 20rem;
  overflow-y: auto;
}

/* Core type color coding */
.cv-item-prompt .cv-item-label { color: #a6e3a1; background: rgba(166, 227, 161, 0.1); }
.cv-item-prompt .cv-item-content { color: #a6e3a1; }

.cv-item-response .cv-item-label { color: #89b4fa; background: rgba(137, 180, 250, 0.1); }
.cv-item-response .cv-item-content { color: #cdd6f4; }

.cv-item-tool-call .cv-item-label { color: #f9e2af; background: rgba(249, 226, 175, 0.1); }
.cv-item-tool-call .cv-item-content { color: #f9e2af; }

.cv-item-tool-result .cv-item-label { color: #94e2d5; background: rgba(148, 226, 213, 0.1); }
.cv-item-tool-result .cv-item-content { color: #94e2d5; }

.cv-item-error .cv-item-label { color: #f38ba8; background: rgba(243, 139, 168, 0.1); }
.cv-item-error .cv-item-content { color: #f38ba8; }

.cv-item-sub-agent .cv-item-label { color: #cba6f7; background: rgba(203, 166, 247, 0.1); }
.cv-item-sub-agent .cv-item-content { color: #cba6f7; }

/* Retry badge */
.cv-retry-badge {
  margin-left: 0.5rem;
  padding: 0 0.375rem;
  font-size: 0.625rem;
  font-weight: 600;
  border-radius: 9999px;
  background: rgba(243, 139, 168, 0.2);
  color: #f38ba8;
}

/* Live streaming item */
.cv-item-live {
  margin-bottom: 0.375rem;
}

.cv-type-indicator {
  display: inline-block;
  padding: 0 0.25rem;
  font-size: 0.625rem;
  font-weight: 600;
  border-radius: 0.125rem;
  margin-right: 0.25rem;
}

.cv-type-prompt { color: #a6e3a1; background: rgba(166, 227, 161, 0.15); }
.cv-type-response { color: #89b4fa; background: rgba(137, 180, 250, 0.15); }
.cv-type-tool_call { color: #f9e2af; background: rgba(249, 226, 175, 0.15); }
.cv-type-tool_result { color: #94e2d5; background: rgba(148, 226, 213, 0.15); }
.cv-type-error { color: #f38ba8; background: rgba(243, 139, 168, 0.15); }
.cv-type-sub_agent { color: #cba6f7; background: rgba(203, 166, 247, 0.15); }

.cv-live-content {
  margin: 0.125rem 0 0;
  padding: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  color: #cdd6f4;
}

/* Collapsible tool results */
.cv-collapsible.cv-collapsed {
  max-height: 4rem;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.cv-collapsible.cv-collapsed::after {
  content: '▼ click to expand';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.25rem 0.375rem;
  font-size: 0.625rem;
  text-align: center;
  background: linear-gradient(transparent, rgba(30, 30, 46, 0.95));
  color: #6c7086;
}

/* ============================================================================
   Conversation Viewer Modal (Story 5.8 Task 7)
   ============================================================================ */

.cv-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.cv-modal-overlay.cv-modal-visible {
  display: flex;
}

body.cv-modal-open {
  overflow: hidden;
}

.cv-modal-dialog {
  display: flex;
  flex-direction: column;
  width: 90vw;
  max-width: 56rem;
  max-height: 85vh;
  background: #1e1e2e;
  border: 1px solid #585b70;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.cv-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #313244;
  flex-shrink: 0;
}

.cv-modal-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #cdd6f4;
  margin: 0;
}

.cv-modal-close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #585b70;
  border-radius: 0.25rem;
  color: #cdd6f4;
  font-size: 0.875rem;
  cursor: pointer;
}

.cv-modal-close:hover {
  background: #313244;
}

.cv-modal-close:focus-visible {
  outline: 2px solid #89b4fa;
  outline-offset: 1px;
}

.cv-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #cdd6f4;
}

.cv-modal-body .cv-item-content {
  max-height: none; /* no height limit in modal */
}

.cv-item-live-modal {
  border: 1px dashed #585b70;
  border-radius: 0.25rem;
  padding: 0.25rem;
  margin-bottom: 0.5rem;
}

/* Reduced motion: disable transitions on viewer */
@media (prefers-reduced-motion: reduce) {
  .cv-expand-btn {
    opacity: 1;
    transition: none !important;
  }
}

/* ============================================================================
   Results Page Split Panel Layout (Story 3.3)
   ============================================================================ */

/* Layout dimension vars moved to main :root block at top of file (X9 consolidation) */

/* Documents toggle button width matches panel (M2 fix for consistency) */
.documents-toggle {
    width: var(--documents-panel-width);
}

/* Story 10.1 iter 4 bug #28 follow-up (2026-04-18): the previous approach
 * used a hardcoded `--header-height` magic value and `calc(100vh - var(...))`
 * for the layout height. Story 10.1 iter 3 added the stacked progress bar
 * to the results header — its actual rendered height drifted past the
 * hardcoded value, leaving the body ~8-15px taller than the viewport
 * (vertical scrollbar drifting on every scroll).
 *
 * New approach (results page only): make the body a flex-column with
 * `height: 100vh; overflow: hidden`, then let the layout `flex: 1` to fill
 * whatever the header doesn't. The header takes its own natural height.
 * Robust to any future header changes — no magic value to keep in sync. */
body.results-page-body {
    height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Grid-based layout - AC #3 requires CSS Grid (Task 1.1) */
.results-layout {
    display: grid;
    grid-template-columns: var(--findings-panel-width) minmax(300px, 1fr) var(--documents-panel-width);
    /* Default for legacy contexts (kept for tests / non-flex bodies). The
     * flex body above takes precedence when present. */
    height: calc(100vh - var(--header-height));
    flex: 1;
    min-height: 0;
}
body.results-page-body .results-layout {
    height: auto;
}

/* Panel scroll and paint optimization (Task 1.2-1.3) */
/* Note: scroll-behavior: smooth is progressive enhancement - older browsers (Safari <15.4) use instant scrolling, which is acceptable */
#findings_panel, #detail_panel {
    contain: content;
    scroll-behavior: smooth;
}

/* When documents panel is collapsed (Task 5.3) */
.results-layout.documents-collapsed {
    grid-template-columns: var(--findings-panel-width) minmax(300px, 1fr) 0;
}

/* Panel toggle animation - slide + accordion effect (Task 6.6, UX spec lines 1447-1459) */
#documents_panel {
    transition: width 200ms ease, opacity 200ms ease;
    will-change: width, opacity; /* GPU acceleration hint */
    overflow: hidden;
}
#documents_panel.collapsed {
    width: 0;
    opacity: 0;
}

/* Content accordion reveal (top-to-bottom open, bottom-to-top close) */
#documents_panel > * {
    transition: transform 200ms ease, opacity 200ms ease;
    transform-origin: top;
}
#documents_panel.collapsed > * {
    transform: scaleY(0);
    opacity: 0;
}

/* Accessibility: respect reduced motion preference (Task 6.7) */
@media (prefers-reduced-motion: reduce) {
    #documents_panel, #documents_panel > * {
        transition: none !important;
    }
}

/* Selected finding background by severity (Task 6.8) - use CSS custom properties */
.finding-item.selected.severity-issue { background-color: var(--color-severity-high-selected); }
.finding-item.selected.severity-review { background-color: var(--color-severity-medium-selected); }
.finding-item.selected.severity-compliant { background-color: var(--color-severity-low-selected); }

/* Story 10.1 iter 2: the list-view per-card affordance is ONLY the checkmark
 * glyph ✓/✗ inside the `.finding-state-checkmark` button. No full-item
 * background tint or border-left change — user direction 2026-04-18: "green
 * background color in the side-view on confirmed is not wanted, we already
 * have the checkmark". The detail-panel state badge covers per-finding
 * deep-view feedback (see `.detail-state-badge` below). */

/* Story 10.1 iter 3 item #11 (2026-04-18): transient HALO animation on the
 * card whose state just changed via undo/redo. Using box-shadow instead of
 * background-color so the `.selected.severity-*` background rule paints
 * immediately on selection (a background-color animation would mask it for
 * the whole 1.5s duration, making the selection look slow). The halo is
 * per-state (green for approved, red for rejected, neutral for
 * unreviewed). Same class + keyframes apply to the detail-panel checkmark
 * (user-idea 2026-04-18) so the eye tracks from list card to detail. */
@keyframes finding-state-halo-neutral {
  0%   { box-shadow: 0 0 0 3px var(--color-gray-400), 0 0 16px 2px var(--color-gray-400); }
  100% { box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent; }
}
@keyframes finding-state-halo-approved {
  0%   { box-shadow: 0 0 0 3px var(--color-state-approved), 0 0 16px 2px var(--color-state-approved); }
  100% { box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent; }
}
@keyframes finding-state-halo-rejected {
  0%   { box-shadow: 0 0 0 3px var(--color-state-rejected), 0 0 16px 2px var(--color-state-rejected); }
  100% { box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent; }
}
.finding-item.finding-state-just-changed,
.finding-state-checkmark.finding-state-just-changed {
  animation: finding-state-halo-neutral 1.2s ease-out;
  /* position:relative so the halo renders outside the rounded corners */
  position: relative;
  z-index: 1;
}
.finding-item.finding-state-just-changed[data-state="approved"],
.finding-state-checkmark.finding-state-just-changed[data-state="approved"] {
  animation-name: finding-state-halo-approved;
}
.finding-item.finding-state-just-changed[data-state="rejected"],
.finding-state-checkmark.finding-state-just-changed[data-state="rejected"] {
  animation-name: finding-state-halo-rejected;
}

/* Bug 20 (Beat smoke 2026-04-26): expert-added findings get a highlight
   after the chat commits them. The class is applied by results.js on the
   `user-action-pushed` listener (`finding.expert_added`).
   Bug 37 (Beat smoke 2026-04-26): pre-fix the animation faded to
   transparent over 3s — Beat reported "the highlight vanishes, instead
   of staying". The just-added findings are session-significant; the
   highlight is the only visual signal that distinguishes them from the
   AI-generated ones in the list. Now: a brief entrance pulse settles at
   a stable amber tint that PERSISTS for the rest of the session. Reload
   removes the class (it's a session-scoped DOM state, not persisted).
   `animation-fill-mode: forwards` holds the 100% keyframe state after
   the entrance pulse ends. */
@keyframes finding-item-just-added-pulse {
  0%   { background-color: rgba(252, 211, 77, 0.65); box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.8); }
  20%  { background-color: rgba(252, 211, 77, 0.55); box-shadow: 0 0 0 2px rgba(252, 211, 77, 0.65); }
  100% { background-color: rgba(252, 211, 77, 0.35); box-shadow: 0 0 0 2px rgba(252, 211, 77, 0.5); }
}
.finding-item.finding-item-just-added {
  animation: finding-item-just-added-pulse 0.8s ease-out forwards;
  position: relative;
  z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
  /* No entrance pulse; jump straight to the persistent state. */
  .finding-item.finding-item-just-added {
    animation: none;
    background-color: rgba(252, 211, 77, 0.35);
    box-shadow: 0 0 0 2px rgba(252, 211, 77, 0.5);
  }
}

/* Finding hierarchy CSS prep for Story 3.4 accordion (C2 - per Story 2.10 patterns) */
.finding-item.nested { padding-left: 24px; }
.finding-indent { margin-left: 16px; border-left: 2px solid #e5e7eb; } /* gray-200 */
.finding-item.consolidated > .finding-expand-icon { display: inline-block; }
.finding-item:not(.consolidated) > .finding-expand-icon { display: none; }

/* Story 3.7 Task 2: Responsive Breakpoints (Desktop ≥1280px, Tablet 1024-1279px, Mobile <1024px) */

/* Desktop: Full three-column layout (≥1280px) - base layout is already 3-column above */
@media (min-width: 1280px) {
    .results-layout {
        grid-template-columns: var(--findings-panel-width) minmax(300px, 1fr) var(--documents-panel-width);
    }

    /* Desktop: When documents are hidden, collapse to two columns */
    .results-layout[data-documents-open="false"] {
        grid-template-columns: var(--findings-panel-width) 1fr;
    }
    .results-layout[data-documents-open="false"] #documents_panel {
        display: none;
    }
}

/* Tablet: Hide documents panel, show findings + detail (1024px-1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
    .results-layout {
        grid-template-columns: var(--findings-panel-width) 1fr;
        grid-template-rows: 1fr;
    }

    /* Tablet: Documents panel hidden by default, shown as overlay when data-documents-open */
    #documents_panel {
        display: none !important;
    }

    /* Tablet: When documents panel is open, show as overlay below header */
    .results-layout[data-documents-open="true"] #documents_panel {
        display: flex !important;
        position: fixed;
        right: 0;
        top: var(--header-height);
        bottom: 0;
        width: 280px;
        z-index: 50;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    }

    /* Keep documents toggle visible on tablet */
    .documents-toggle {
        display: flex !important;
    }
}

/* Mobile responsive (<1024px) - Task 4.1-4.4 */
@media (max-width: 1023px) {
    .results-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        position: relative;
        overflow: hidden;
    }

    /* Mobile: Findings panel is the base view */
    #findings_panel {
        position: absolute;
        inset: 0;
        transition: transform 200ms ease;
        z-index: 10;
    }

    /* Mobile: Detail panel slides in from right (H4 fix) */
    #detail_panel {
        position: absolute;
        inset: 0;
        transform: translateX(100%);
        transition: transform 200ms ease;
        z-index: 20;
        background: white;
    }

    /* When detail view is active, slide detail panel in */
    .results-layout.detail-view-active #detail_panel {
        transform: translateX(0);
    }

    /* Mobile documents panel: slides in from right (Task 4.4) */
    #documents_panel {
        position: fixed;
        right: 0;
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
        width: var(--documents-panel-width);
        transform: translateX(100%);
        transition: transform 200ms ease;
        z-index: 40;
    }
    /* Mobile: Show documents panel when open */
    .results-layout[data-documents-open="true"] #documents_panel {
        transform: translateX(0);
    }

    /* Story 3.7 Task 7: Documents toggle width responsive */
    .documents-toggle {
        width: auto;
        min-width: 120px;
    }
}

/* Large screens - scale documents panel proportionally (H3 fix)
 * At 1200px+ viewports, the documents panel scales from 200px up to 280px
 * This provides better balance when center panel becomes very large */
@media (min-width: 1200px) {
    :root {
        --documents-panel-width: clamp(200px, 14vw, 280px);
    }
}

/* Ultra-narrow viewports - phones (Task 4.5) */
@media (max-width: 639px) {
    .results-layout {
        grid-template-columns: 1fr;
    }
    /* Ensure touch targets meet UX spec field conditions (48px) */
    #documents_toggle,
    .finding-item,
    .help-link {
        min-height: var(--touch-target-min);
        min-width: var(--touch-target-min);
    }
}

/* ============================================================================
   Findings List Component (Story 3.4)
   ============================================================================ */

/* Category group styling */
.finding-category {
  margin-bottom: 4px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: white;
  border: none;
  border-bottom: 1px solid #e5e7eb; /* gray-200 */
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: #374151; /* gray-700 */
}

.category-header:hover {
  background: #f9fafb; /* gray-50 */
}

.category-toggle-icon {
  width: 12px;
  height: 12px;
  transition: transform 150ms ease;
}

.category-header[aria-expanded="false"] .category-toggle-icon {
  transform: rotate(-90deg);
}

.category-count {
  margin-left: auto;
  color: #374151; /* gray-700 - WCAG AAA (10:1 contrast) */
  font-weight: 400;
}

.category-content {
  display: block;
}

.category-content.collapsed {
  display: none;
}

/* Finding item styling */
.finding-item {
  display: flex;
  padding: 10px 12px;
  margin: 4px 8px;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  min-height: var(--touch-target-min, 48px);
  position: relative;
}

/* Story 5.8 Task 0: hover overlay via opacity (GPU-composited) instead of background-color transition */
.finding-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: #f9fafb; /* gray-50 */
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
  border-radius: 4px;
  z-index: 0;
}

.finding-item:hover::after {
  opacity: 1;
}

/* Story 10.1 iter 4 bug #18 (2026-04-18): a selected card isn't re-clickable
 * (clicking a selected card is a no-op), so the gray-50 hover paint must not
 * mask its severity-tinted background. */
.finding-item.selected:hover::after {
  opacity: 0;
}

.finding-item > * {
  position: relative;
  z-index: 1;
}

/* Story 10.11 smoke-test follow-up #17 — when an inline picker is mounted
 * inside a finding-item, lift the ENTIRE finding-item above its siblings
 * so the picker's listbox dropdown (which extends visually past the
 * finding-item's bottom edge into the next finding-item's territory)
 * paints above the next finding-item's title + checkmark. The picker
 * container is not a direct child of `.finding-item` (it's a grandchild
 * inside `.finding-content > .finding-header`), so a z-index bump on the
 * combobox itself would be locked inside `.finding-content`'s z-1
 * stacking context — the listbox would still stack at z-1 from the
 * sibling-comparison view (where DOM order makes the next finding-item
 * win). Bumping the whole `.finding-item` (already `position: relative`)
 * to z-100 puts its entire subtree above neighboring finding-items at
 * z-auto. The :has() selector scopes this to ONLY the finding-item that
 * currently hosts a picker — sibling finding-items keep their default
 * stacking. */
.finding-item:has(.inline-edit-combobox) {
  z-index: 100;
}

.finding-item:focus {
  outline: 2px solid #0E429B; /* primary-600 */
  outline-offset: 2px;
}

/* Severity borders - Story 3.7 Task 4: Use CSS custom properties */
.finding-border {
  width: 3px;
  margin-right: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.finding-border.severity-high {
  background-color: var(--color-severity-high-accent);
}

.finding-border.severity-medium {
  background-color: var(--color-severity-medium-accent);
}

.finding-border.severity-low {
  background-color: var(--color-severity-low-accent);
}

/* Finding content */
.finding-content {
  flex: 1;
  min-width: 0; /* Allow text truncation */
}

.finding-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.finding-title {
  font-size: 14px;
  font-weight: 500;
  color: #111827; /* gray-900 */
  line-height: 1.3;
}

.finding-description {
  font-size: 12px;
  color: #374151; /* gray-700 - WCAG AAA (10:1 contrast) */
  line-height: 1.4;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.finding-rule {
  display: inline-block;
  font-size: 10px;
  font-family: ui-monospace, monospace;
  color: #374151; /* gray-700 - WCAG AAA (10:1 contrast) */
  margin-top: 4px;
}

/* Story 10.1: clickable review-state checkmark. `data-state` on the parent
 * .finding-item (set by render_finding_item) drives the glyph + color via
 * attribute selectors. No hardcoded hex: reuses existing severity-color vars
 * (approved = severity-low green, rejected = severity-high red) since an
 * icon + position keep the two affordances visually distinct. */
.finding-state-checkmark {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  flex-shrink: 0;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-gray-400);
  cursor: pointer;
  font-size: 16px;
  line-height: 20px;
  text-align: center;
}
.finding-state-checkmark::before { content: ""; }
.finding-item[data-state="unreviewed"] .finding-state-checkmark::before { content: ""; }
.finding-item[data-state="approved"] .finding-state-checkmark {
  color: var(--color-state-approved);
  border-color: var(--color-state-approved);
  background: white;
}
.finding-item[data-state="approved"] .finding-state-checkmark::before { content: "✓"; }
.finding-item[data-state="rejected"] .finding-state-checkmark {
  color: var(--color-state-rejected);
  border-color: var(--color-state-rejected);
  background: white;
}
.finding-item[data-state="rejected"] .finding-state-checkmark::before { content: "✗"; }

.finding-modified-indicator {
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--color-btn-primary, #2563EB);
}
.finding-modified-indicator svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Selected/reviewed states - use existing from Story 3.3 */
/* .finding-item.selected.severity-issue, etc. already defined */

/* Empty state */
.findings-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: #374151; /* gray-700 - WCAG AAA (10:1 contrast) */
  font-size: 14px;
  text-align: center;
}

/* Partial analysis notice */
.findings-partial-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-amber-100);
  border-bottom: 1px solid var(--color-amber-300);
  font-size: 12px;
  color: var(--color-amber-800);
}

.findings-partial-notice .spinner-icon {
  width: 14px;
  height: 14px;
  animation: spin 1s steps(12) infinite;
  will-change: transform;
}

/* Story 11.44b AC 11.44b.1.3 — « Limites de cette analyse »: neutral, not an error
   banner (every line carries its remedy). Existing neutral tokens only. */
.completion-gaps-block {
  padding: 8px 12px;
  background: var(--color-surface-neutral);
  border-bottom: 1px solid var(--color-gray-300);
  font-size: 12px;
  color: var(--color-gray-700);
}

.completion-gaps-title {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-gray-800);
}

.completion-gaps-list {
  margin: 0;
  padding-left: 16px;
  list-style: disc;
}

.completion-gaps-list li + li {
  margin-top: 2px;
}

/* Loading skeleton */
.findings-loading-state {
  padding: 8px;
}

.finding-skeleton {
  display: flex;
  padding: 10px 12px;
  margin: 4px 0;
  background: white;
  border-radius: 4px;
  animation: skeleton-pulse 3s steps(2) infinite;
  will-change: opacity;
}

.skeleton-border {
  width: 3px;
  height: 48px;
  margin-right: 12px;
  background: #e5e7eb; /* gray-200 */
  border-radius: 2px;
}

.skeleton-content {
  flex: 1;
}

.skeleton-title {
  width: 60%;
  height: 14px;
  background: #e5e7eb;
  border-radius: 4px;
  margin-bottom: 6px;
}

.skeleton-description {
  width: 80%;
  height: 10px;
  background: #e5e7eb;
  border-radius: 4px;
  margin-bottom: 4px;
}

.skeleton-rule {
  width: 30%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============================================================================
   Detail Panel Component (Story 3.5)
   ============================================================================ */

/* Detail panel container */
#detail_panel {
  padding: 20px;
  overflow-y: auto;
  /* Story 10.11c iter-6 (Beat 2026-05-07 Bug 19): clip horizontal overflow
   * so a wide action-row at narrow viewports doesn't expose a horizontal
   * scroll trail when the user swipes right. The action row has 6 elements
   * (Retenir + Écarter + Modifier + divider + thumbs-up + thumbs-down)
   * that on a Galaxy S-21 (~360px) total ~370-400px — overflowing the
   * 320px-wide content area. Without overflow-x: hidden the panel exposes
   * the off-screen content as horizontal scroll on touch-drag → "white
   * zone" Beat reports. */
  overflow-x: hidden;
  height: 100%;
}

/* Story 10.1 iter 4 bugs #25+#26 (2026-04-18): the page-header back-arrow
 * (← link to project / dashboard on results.html and upload.html). Was a
 * bare `&larr;` glyph at default size with no padding — small hit area, no
 * focus indicator, and shift-tab from the next focusable element didn't
 * make its focus state visible.
 *
 * Fix: bigger glyph (1.4× scale via line-height 1 + larger font-size),
 * comfortable padding for the WCAG hit-area target, hover background, and
 * an explicit :focus-visible outline so keyboard users see where they are. */
/* Story 10.1 iter 4 bug #25 (2026-04-18, fourth try): user reported focus
 * still not visible. E2E debug confirmed `:focus` styles ARE applied, BUT
 * `transition: background 120ms, color 120ms` made the focus state animate
 * IN over 120ms — combined with browser CSS caching, users perceived "no
 * focus state". Removed the transition entirely so the focus state appears
 * INSTANTLY. Also switched the back-arrow tag from <a> to <button> per
 * user suggestion: <button> has stricter, more uniform focusability across
 * browsers and assistive tech, with no UA-specific quirks for anchors. */
.nav-back-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--color-gray-500);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  z-index: 1;
}
.nav-back-arrow:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-700);
}
.nav-back-arrow:focus,
.nav-back-arrow:focus-visible {
  outline: none;
  background-color: #0E429B;
  color: #fff;
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px #0E429B;
}

/* H4 fix: Mobile back button - hidden on desktop */
.detail-back-button {
  display: none;
}
/* Story 10.11c iter-9 (Beat 2026-05-07 Bug 1 round-4): clicks/taps on the
 * SVG arrow inside the back button used to NOT route through to the
 * `<button>` because SVG default `pointer-events: visiblePainted` makes
 * the painted stroke a hit-target. With `pointer-events: none` on the
 * SVG (and all children) the entire SVG area is click-through — taps
 * always land on the parent button, which the document-delegated handler
 * matches via `closest('.detail-back-button')`. */
.detail-back-button svg,
.detail-back-button svg * {
  pointer-events: none;
}

@media (max-width: 1023px) {
  .detail-back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin: -12px -12px 16px -12px;
    background: #f3f4f6; /* gray-100 */
    border: none;
    border-bottom: 1px solid #e5e7eb; /* gray-200 */
    width: calc(100% + 24px);
    font-size: 14px;
    font-weight: 500;
    color: #374151; /* gray-700 */
    cursor: pointer;
    min-height: var(--touch-target-min);
  }

  .detail-back-button:hover {
    background: #e5e7eb; /* gray-200 */
  }

  .detail-back-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
}

/* Status badge */
.detail-status-badge {
  display: inline-flex;
  align-items: center;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 4px;
  letter-spacing: 0.025em;
  /* margin-bottom removed - container .detail-header-badges handles spacing */
}

/* Story 3.7 Task 4: Use CSS custom properties for severity badges */
.detail-status-badge.severity-high {
  background-color: var(--color-severity-high-bg);
  color: var(--color-severity-high-text);
}

.detail-status-badge.severity-medium {
  background-color: var(--color-severity-medium-bg);
  color: var(--color-severity-medium-text);
}

.detail-status-badge.severity-low {
  background-color: var(--color-severity-low-bg);
  color: var(--color-severity-low-text);
}

/* Story 10.3: severity badge acts as the inline-edit anchor for the severity
   picker. Keep the button-like affordance minimal — the badge still LOOKS like
   a badge; the cursor + focus ring signal interactivity. */
.detail-status-badge[role="button"] {
  cursor: pointer;
}
.detail-status-badge[role="button"]:focus-visible {
  outline: 2px solid var(--color-primary-600, currentColor);
  outline-offset: 2px;
}

/* Story 10.3 smoke-test round 2 (2026-04-22): native <select> dropdown used
   as the severity picker. Inherits the badge's uppercase-typography shape so
   it reads as a "badge dropdown" rather than a generic form field. Browser-
   chromed decoration (border, chevron, focus ring) comes free from the native
   <select> element — this rule just tunes typography + spacing. */
.severity-picker-select {
  display: inline-flex;
  align-items: center;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 4px;
  letter-spacing: 0.025em;
  cursor: pointer;
}
.severity-picker-select:focus-visible {
  outline: 2px solid var(--color-primary-600, currentColor);
  outline-offset: 2px;
}

/* Story 10.3: embedded AI dot INSIDE the severity badge — signals "AI was
   overridden here" as a nested indicator rather than a sibling chip. The
   dot's color references the ORIGINAL (AI-assigned) severity, not the
   current one. Reuses --color-severity-*-accent tokens; zero new variables. */
.severity-ai-dot {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 0.4em;
  font-size: 0.85em;
  /* No opacity: a semi-transparent wrapper blended the circle's color with
     the badge background (yellow low-severity dot over a red high-severity
     badge rendered as orangy-pink). The `(IA:` text inherits the badge's
     text color for sufficient contrast without needing wrapper opacity. */
}
.severity-ai-dot-circle {
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  margin-left: 2px;
  /* Fallback if the [data-original-severity] selector below doesn't match
     (e.g. future enum extension). Graceful degradation: the dot picks up
     the badge's text color rather than rendering invisible. */
  background: currentColor;
  /* Thin outline separates the circle from the badge background so sub-
     pixel anti-aliasing doesn't smear the dot's color into the bg color. */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}
.severity-ai-dot[data-original-severity="high"] .severity-ai-dot-circle {
  background: var(--color-severity-high-accent);
}
.severity-ai-dot[data-original-severity="medium"] .severity-ai-dot-circle {
  background: var(--color-severity-medium-accent);
}
.severity-ai-dot[data-original-severity="low"] .severity-ai-dot-circle {
  background: var(--color-severity-low-accent);
}

/* Title and description */
.detail-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827; /* gray-900 */
  margin-bottom: 8px;
  line-height: 1.3;
}

.detail-description {
  font-size: 14px;
  color: #1f2937; /* gray-800 - WCAG AAA (12.6:1 contrast) */
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Why this matters box */
.detail-why-box {
  background-color: var(--color-amber-50);
  border: 1px solid var(--color-amber-200);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.detail-why-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-amber-900);
  margin-bottom: 8px;
}

.detail-why-text {
  font-size: 14px;
  color: var(--color-amber-800);
  line-height: 1.5;
  white-space: pre-line;
}

/* Action card — corrective measures (Story 5.20) */
.detail-action-card {
  background-color: var(--color-action-bg);
  border: 1px solid var(--color-action-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.detail-action-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.detail-action-card-icon {
  width: 18px;
  height: 18px;
  color: var(--color-action-accent);
  flex-shrink: 0;
}

.detail-action-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-action-title);
}

.detail-action-card-content {
  font-size: 14px;
  color: #1F2937; /* gray-800 */
  line-height: 1.6;
}

.detail-action-card-content p {
  margin: 0 0 8px 0;
}

.detail-action-card-content p:last-child {
  margin-bottom: 0;
}

.detail-action-card-content ul {
  margin: 4px 0 8px 0;
  padding-left: 20px;
}

.detail-action-card-content li {
  margin-bottom: 4px;
}

/* ============================================================================
   Story 5.21: Executive Summary Card
   ============================================================================ */
.executive-summary-card {
  margin: 8px;
  border-radius: 6px;
  border: 1px solid #D1D5DB; /* gray-300 */
  border-top: 3px solid #0E429B; /* primary-600 */
  background: white;
  padding: 12px 14px;
}

.executive-summary-clickable {
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s;
}
.executive-summary-clickable:hover {
  background: #F3F4F6; /* gray-100 */
}
.executive-summary-clickable.selected {
  background: #E8EEF7; /* primary-50 */
  box-shadow: 0 0 0 2px #0E429B; /* ring-2 primary */
}

.executive-summary-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.executive-summary-compact-title {
  font-weight: 600;
  font-size: 14px;
  color: #0E429B;
}
.executive-summary-compact-count {
  font-size: 12px;
  color: #6B7280;
}

.executive-summary-generate-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #0E429B;
  background: #E8EEF7; /* primary-50 */
  border: 1px dashed #9FB8DF; /* primary-200 */
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s;
}
.executive-summary-generate-btn:hover {
  background: #C5D4EC; /* primary-100 */
}

.executive-summary-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 14px;
  color: #4B5563; /* gray-600 */
}

.executive-summary-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 14px;
  color: #DC2626; /* red-600 */
}
.executive-summary-retry-btn {
  padding: 4px 10px;
  font-size: 13px;
  color: #DC2626;
  border: 1px solid #DC2626;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}
.executive-summary-retry-btn:hover {
  background: #FEE2E2; /* red-100 */
}

.executive-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.executive-summary-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827; /* gray-900 */
  margin: 0;
}

.executive-summary-regenerate-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 12px;
  color: #4B5563;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}
.executive-summary-regenerate-btn:hover {
  background: #F3F4F6; /* gray-100 */
}

.executive-summary-stale-warning {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--color-amber-800);
  background: var(--color-amber-100);
  border: 1px solid var(--color-amber-200);
  border-radius: 4px;
}

.executive-summary-section {
  margin-bottom: 12px;
}
.executive-summary-section:last-child {
  margin-bottom: 0;
}

.executive-summary-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #374151; /* gray-700 */
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 16px 0 10px 0;
}
.executive-summary-section:first-child .executive-summary-section-title {
  margin-top: 0;
}

.executive-summary-action-item {
  border-left: 3px solid #6B7280;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #F9FAFB; /* gray-50 */
  border-radius: 0 4px 4px 0;
}

.executive-summary-action-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.executive-summary-urgency-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border: 1px solid;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.executive-summary-action-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.executive-summary-action-desc {
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
}
.executive-summary-action-desc p { margin: 0 0 4px 0; }
.executive-summary-action-desc p:last-child { margin-bottom: 0; }
.executive-summary-action-desc ul { margin: 2px 0 4px 0; padding-left: 18px; }
.executive-summary-action-desc li { margin-bottom: 2px; }

.executive-summary-action-refs {
  font-size: 13px;
  color: #6B7280;
  margin-top: 6px;
}
.executive-summary-ref-list {
  list-style: none;
  padding: 0;
  margin: 2px 0 0 0;
}
.executive-summary-ref-list li {
  padding: 1px 0;
}
.executive-summary-ref-list li::before {
  content: "— ";
  color: #9CA3AF;
}
.executive-summary-finding-ref {
  color: #0E429B;
  text-decoration: underline;
  cursor: pointer;
}
.executive-summary-finding-ref:hover {
  color: #062760;
}

.executive-summary-doc-item {
  border-left: 3px solid #1E40AF;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #F9FAFB;
  border-radius: 0 4px 4px 0;
  font-size: 14px;
}
.executive-summary-doc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.executive-summary-doc-type {
  font-size: 11px;
  font-weight: 600;
  color: #1E40AF;
  border: 1px solid #1E40AF;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.executive-summary-doc-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.executive-summary-findings-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.executive-summary-finding-item {
  padding: 6px 0;
  border-bottom: 1px solid #F3F4F6;
}
.executive-summary-finding-item:last-child {
  border-bottom: none;
}

.executive-summary-finding-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.executive-summary-sev-badge {
  font-size: 10px;
  padding: 1px 4px;
  flex-shrink: 0;
}

.executive-summary-finding-title {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}

.executive-summary-finding-summary {
  color: #6B7280;
  font-size: 13px;
  margin-top: 2px;
  line-height: 1.5;
}

/* Sub-finding action card (compact) */
.sub-finding-action-card {
  border-left: 3px solid var(--color-action-sub-accent);
  padding: 8px 12px;
  margin: 8px 0;
  font-size: 14px;
  color: #374151; /* gray-700 */
  line-height: 1.5;
}

.sub-finding-action-card p {
  margin: 0 0 4px 0;
}

.sub-finding-action-card p:last-child {
  margin-bottom: 0;
}

.sub-finding-action-card ul {
  margin: 2px 0 4px 0;
  padding-left: 16px;
}

.sub-finding-action-header {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}

.sub-finding-action-icon {
  width: 14px;
  height: 14px;
  color: var(--color-action-accent);
  flex-shrink: 0;
}

.sub-finding-action-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-action-title);
}

/* Section title — shared heading for detail panel sections */
.detail-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #6B7280; /* gray-500 */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

/* Citation box */
.detail-citation-box {
  background-color: #F9FAFB; /* gray-50 */
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.citation-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.citation-type-badge {
  display: inline-block;
  background-color: #E5E7EB; /* gray-200 */
  color: #374151; /* gray-700 */
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
}

.citation-reference {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 14px;
  font-weight: 500;
  color: #0A347C; /* primary-700 */
}

/* Story 5.14: Grounding status — no visual indicator (looked too positive for issues).
   CSS classes kept for data attribute styling hooks if needed later. */

/* Story 5.10: Clickable citation reference opens regulation viewer */
button.citation-viewer-trigger {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

button.citation-viewer-trigger:hover {
  text-decoration-style: solid;
  color: #062760; /* primary-800 */
}

/* M2 fix: focus ring for keyboard navigation on citation badges */
button.citation-viewer-trigger:focus-visible {
  outline: 2px solid #0A347C; /* primary-700 */
  outline-offset: 2px;
  border-radius: 2px;
}

.citation-link {
  margin-left: auto;
  color: #6b7280; /* gray-500 */
  padding: 4px;
  border-radius: 4px;
  transition: color 150ms ease;
}

.citation-link:hover {
  color: #0E429B; /* primary-600 */
}

.citation-link svg {
  width: 16px;
  height: 16px;
}

.citation-text {
  font-size: 14px;
  color: #4b5563; /* gray-600 */
  line-height: 1.5;
  font-style: italic;
}

/* Secondary citations (collapsible) */
.detail-secondary-citations {
  margin-bottom: 20px;
}

.secondary-citations-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  font-size: 12px;
  color: #6b7280; /* gray-500 */
  cursor: pointer;
  padding: 8px 0;
}

.secondary-citations-toggle:hover {
  color: #0E429B; /* primary-600 */
}

.secondary-citations-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 150ms ease;
}

.secondary-citations-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.secondary-citations-list.collapsed {
  display: none;
}

/* Source reference */
.detail-source-reference {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background-color: #F3F4F6; /* gray-100 */
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: background-color 150ms ease;
  text-align: left;
}

.detail-source-reference:hover {
  background-color: #E5E7EB; /* gray-200 */
}

.source-icon {
  font-size: 16px;
}

.source-filename {
  font-size: 14px;
  font-weight: 500;
  color: #111827; /* gray-900 */
}

.source-arrow {
  color: #9ca3af; /* gray-400 */
  font-size: 12px;
}

.source-page {
  font-size: 14px;
  color: #4b5563; /* gray-600 */
}

.source-link-icon {
  margin-left: auto;
  width: 16px;
  height: 16px;
  color: #6b7280; /* gray-500 */
}

/* Multiple sources section */
.detail-sources-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #E5E7EB;
}

.detail-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #374151; /* gray-700 - WCAG AAA (10:1 contrast) */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.detail-sources-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Sub-findings section */
.detail-sub-findings-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #E5E7EB;
}

.sub-findings-accordion {
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  background: #F9FAFB;
}

.sub-findings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  list-style: none;
}

.sub-findings-toggle::-webkit-details-marker {
  display: none;
}

.sub-findings-chevron {
  width: 16px;
  height: 16px;
  color: #6b7280;
  transition: transform 150ms ease;
}

.sub-findings-accordion[open] .sub-findings-chevron {
  transform: rotate(90deg);
}

.sub-findings-list {
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sub-finding-item {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  padding: 10px;
}

.sub-finding-header {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 6px;
}

.sub-finding-number {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  flex-shrink: 0;
}

.sub-finding-title {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  margin-bottom: 4px;
}

.sub-finding-agent {
  font-size: 11px;
  color: #6B7280;
  background: #F3F4F6;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  font-family: monospace;
}

.sub-finding-source {
  font-size: 12px;
  color: #0E429B;
  background: #EFF6FF;
  padding: 2px 6px;
  border-radius: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.sub-finding-source-btn {
  border: none;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.sub-finding-source-btn:hover {
  background-color: #DBEAFE;
}

.sub-finding-description {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.5;
}

/* Story 5.11: Sub-finding compact citation badges */
.sub-finding-citations {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.sub-finding-citation-badge {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  padding: 2px 6px;
  gap: 3px;
}

/* M3 fix: non-clickable span badges — muted style */
span.sub-finding-citation-badge {
  color: #6b7280; /* gray-500 */
  cursor: default;
  text-decoration: none;
}

.citation-type-badge-compact {
  font-size: 11px;
  padding: 0 4px;
}

/* Action buttons */
.detail-action-buttons {
  display: flex;
  /* Without this, when the inline rejection picker mounts in place of
     the Écarter button, the combobox's wrapped Input/Save/Cancel rows
     make the picker ~2-3 line-heights tall — and the default
     `align-items: stretch` then stretches every sibling (Retenir,
     Modifier, thumbs) to match. Centering keeps siblings their natural
     height; the row simply grows around the picker for the duration of
     the interaction. Top-aligned (not centered) so the action buttons
     stay anchored to the row's baseline while the picker grows
     downward — visually less jarring than mid-row drift. */
  align-items: flex-start;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #E5E7EB; /* gray-200 */
}

.btn-action-primary {
  flex: 1;
  background-color: var(--color-btn-primary);
  color: white;
  border: none;
  border-radius: var(--radius-button);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.btn-action-primary:hover:not(:disabled) {
  background-color: var(--color-btn-primary-hover);
}

.btn-action-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-action-secondary {
  background-color: transparent;
  border: 1px solid #D1D5DB; /* gray-300 */
  border-radius: var(--radius-button);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #374151; /* gray-700 */
  cursor: pointer;
  transition: background-color 150ms ease;
}

.btn-action-secondary:hover:not(:disabled) {
  background-color: #F9FAFB; /* gray-50 */
}

.btn-action-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Empty state */
.detail-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 48px 24px;
  text-align: center;
}

.detail-empty-state p {
  font-size: 14px;
  color: #374151; /* gray-700 - WCAG AAA (10:1 contrast) */
}

/* Loading state */
.detail-loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 48px 24px;
}

.detail-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #E5E7EB;
  border-top-color: #0E429B;
  border-radius: 50%;
  animation: spin 1s steps(12) infinite;
  will-change: transform;
}

/* L2 fix: Focus indicator styles for keyboard navigation */
.secondary-citations-toggle:focus-visible,
.detail-source-reference:focus-visible,
.citation-link:focus-visible {
  outline: 2px solid #0E429B; /* primary-600 */
  outline-offset: 2px;
}

/* Accessibility: respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .detail-loading-spinner {
    animation: none !important;
  }
  .secondary-citations-toggle svg {
    transition: none !important;
  }
}

/* ============================================================================
   End of Detail Panel Component (Story 3.5)
   ============================================================================ */

/* ============================================================================
   Documents Panel Component (Story 3.6)
   ============================================================================ */

/* Documents panel content container */
#documents_panel {
  padding: 0;
}

.documents-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  /* Story 11.26 (AC 11.26.2 / FR-E11.77): the documents panel must scroll
   * independently when its content overflows. `#documents_panel` keeps
   * `overflow: hidden` for the collapse/accordion animation, which
   * (ID-specificity 1,0,0) overrides the `.overflow-y-auto` utility on the
   * panel element — so the panel itself can never scroll. Option B: make this
   * inner content the bounded scroll container instead. `flex:1 + min-height:0`
   * lets this sole child fill the column and `overflow-y:auto` scrolls it.
   * Story 12.23b code-review iter-1: this rule lived ONLY in the built
   * apps/api/public/styles.css and was dropped by a `build:css` rebuild —
   * back-ported into source here so future rebuilds keep it. */
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* Document file */
.document-file {
  border-bottom: 1px solid #E5E7EB; /* gray-200 */
}

.document-file:last-child {
  border-bottom: none;
}

/* L3 fix: Ensure minimum 48px touch target for file headers too */
.document-file-header {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  min-height: var(--touch-target-min);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.document-file-header:hover {
  background-color: #E5E7EB; /* gray-200 */
}

.document-file-header:focus-visible {
  outline: 2px solid #0E429B; /* primary-600 */
  outline-offset: -2px;
}

.document-toggle-chevron {
  width: 14px;
  height: 14px;
  color: #6b7280; /* gray-500 */
  flex-shrink: 0;
  transition: transform 150ms ease;
  /* Rotation controlled via JS: style.transform = 'rotate(90deg)' when expanded */
}

/* H10 fix: File type icon styles */
.document-type-icon {
  width: 14px;
  height: 14px;
  color: #6b7280; /* gray-500 */
  flex-shrink: 0;
}

.document-type-icon.document-type-pdf {
  color: #dc2626; /* red-600 */
}

.document-type-icon.document-type-image {
  color: #2563eb; /* blue-600 */
}

.document-filename {
  font-size: 13px;
  font-weight: 500;
  color: #111827; /* gray-900 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.document-aggregate-dots {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

/* Document pages container */
.document-pages {
  padding-left: 20px;
}

.document-pages.collapsed {
  display: none;
}

/* Page item - L3 fix: Ensure minimum 48px touch target (UX spec requirement) */
.document-page-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 12px;
  min-height: var(--touch-target-min);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.document-page-item:hover {
  background-color: #E5E7EB; /* gray-200 */
}

.document-page-item:focus-visible {
  outline: 2px solid #0E429B; /* primary-600 */
  outline-offset: -2px;
}

.document-page-item.highlighted {
  background-color: #DBEAFE; /* blue-100 */
}

.document-page-item.highlighted:hover {
  background-color: #BFDBFE; /* blue-200 */
}

/* Story 5.25: Chapter time label (documents panel) */
.chapter-time {
  font-size: 0.7rem;
  color: #6B7280; /* gray-500 */
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Story 5.26: Three-pane evidence viewer */
.evidence-viewer {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 35vh;
  flex-shrink: 0;
  border-top: 1px solid #E5E7EB;
  background: #F9FAFB;
  overflow: hidden;
}

.evidence-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.evidence-pane + .evidence-pane {
  border-left: 1px solid #E5E7EB;
}

.evidence-pane-title {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 0.65rem;
  font-weight: 600;
  color: #1E40AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  margin: 0;
  background: #EFF6FF;
  border-bottom: 1px solid #BFDBFE;
  flex-shrink: 0;
}

.evidence-pane-items {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
}

/* Content pane body */
.evidence-content-body {
  display: flex;
  flex-direction: column;
  padding: 6px 10px;
  overflow-y: auto;
  flex: 1;
}

.evidence-content-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1F2937;
  margin: 0 0 4px;
  line-height: 1.3;
}

.evidence-content-desc {
  font-size: 0.8rem;
  color: #374151;
  margin: 0 0 4px;
  line-height: 1.4;
}

.evidence-content-muted {
  color: #9CA3AF;
}

/* Findings shown in content pane (when overlapping current timestamp) */
.evidence-content-finding {
  margin-bottom: 8px;
}

.evidence-content-finding-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.evidence-content-finding-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: #2563EB;
  text-decoration: none;
  line-height: 1.3;
}

.evidence-content-finding-link:hover {
  text-decoration: underline;
}

.evidence-content-finding-desc {
  font-size: 0.8rem;
  color: #4B5563;
  margin: 6px 0 0;
  line-height: 1.4;
  padding-left: 2px;
}

/* Findings pane entries */
.evidence-finding-entry {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 0.8rem;
  color: #374151;
  transition: background-color 150ms ease;
}

.evidence-finding-entry:hover {
  background-color: #E5E7EB;
}

.evidence-finding-entry.active {
  background-color: #DBEAFE;
}

.evidence-finding-badge {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.evidence-finding-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-finding-time {
  font-size: 0.7rem;
  color: #6B7280;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Keyboard hints strip (Story 5.26) */
.preview-keyboard-hints {
  font-size: 0.7rem;
  color: #9CA3AF;
  text-align: center;
  padding: 4px 8px;
  user-select: none;
}

/* Active chapter highlighting */
.preview-chapter-entry.active {
  background-color: #DBEAFE;
}

/* Legacy standalone chapter list (Story 5.25) — kept for backward compat */
.preview-chapter-list {
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  border-top: 1px solid #E5E7EB;
  background: #F9FAFB;
  padding: 8px 0;
}

.preview-chapter-list[data-placement="above"] {
  border-top: none;
  border-bottom: 1px solid #E5E7EB;
}

.preview-chapter-list-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  padding: 4px 12px 6px;
  margin: 0;
}

.preview-chapter-items {
  display: flex;
  flex-direction: column;
}

.preview-chapter-entry {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 0.8rem;
  color: #374151;
  transition: background-color 150ms ease;
}

.preview-chapter-entry:hover {
  background-color: #E5E7EB;
}

.preview-chapter-time {
  font-size: 0.7rem;
  color: #6B7280;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 3em;
}

.preview-chapter-title-text {
  flex: 1;
}

.preview-chapter-tone {
  font-size: 0.7rem;
  color: #9CA3AF;
  font-style: italic;
}

/* Text preview (Story 7.2) */
.preview-text-container pre {
  overflow: auto;
  white-space: pre-wrap;
  max-height: calc(100vh - 8rem);
  padding: 1.5rem;
  background: var(--color-bg-secondary, #f9fafb);
  border-radius: 0.5rem;
  font-family: monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

.preview-text-container.markdown-body {
  max-height: calc(100vh - 8rem);
  overflow: auto;
  padding: 1.5rem;
}

.page-bullet {
  font-size: 10px;
  color: #9ca3af; /* gray-400 */
  width: 8px;
  text-align: center;
}

.page-label {
  font-size: 12px;
  color: #4b5563; /* gray-600 */
  flex: 1;
}

.page-status-dots {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

/* Status dots - Story 3.7 Task 4: Use CSS custom properties */
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-dot.dot-high {
  background-color: var(--color-severity-high-accent);
}

.status-dot.dot-medium {
  background-color: var(--color-severity-medium-accent);
}

.status-dot.dot-low {
  background-color: var(--color-severity-low-accent);
}

/* Traffic light dots in header - use accent colors */
.traffic-light-high {
  background-color: var(--color-severity-high-accent);
}
.traffic-light-medium {
  background-color: var(--color-severity-medium-accent);
}
.traffic-light-low {
  background-color: var(--color-severity-low-accent);
}

.status-overflow {
  font-size: 9px;
  color: #6b7280; /* gray-500 */
  font-weight: 500;
}

/* Loading state
   NOTE: Reuses @keyframes skeleton-pulse from Story 3.4 CSS (line ~611) for consistency.
   DO NOT define @keyframes skeleton-shimmer — use existing animation. */
.documents-loading-state {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* L1 fix: Loading text for slow connections */
.documents-loading-text {
  font-size: 12px;
  color: #374151; /* gray-700 - WCAG AAA (10:1 contrast) */
  text-align: center;
  margin-bottom: 4px;
}

.document-skeleton {
  height: 36px;
  background: #E5E7EB; /* gray-200 */
  border-radius: 4px;
  animation: skeleton-pulse 3s steps(2) infinite; /* Story 5.8: slowed, stepped */
  will-change: opacity;
}

.skeleton-filename {
  width: 60%;
  height: 12px;
  background-color: #D1D5DB;
  border-radius: 2px;
  margin: 12px;
}

/* Empty state */
.documents-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
}

.documents-empty-state p {
  font-size: 13px;
  color: #374151; /* gray-700 - WCAG AAA (10:1 contrast) */
}

/* Error state */
.documents-error-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
}

.documents-error-state p {
  font-size: 13px;
  color: #ef4444; /* red-500 */
}

/* Accessibility: respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .document-skeleton {
    animation: none !important;
  }
  .document-toggle-chevron {
    transition: none !important;
  }
}

/* Story 3.7 Task 1: No-pages file styling */
.document-file-no-pages .document-file-header {
  cursor: pointer;
}

.document-file-no-pages .document-file-header:hover {
  background-color: #fefce8; /* yellow-50 - indicates preview action */
}

/* ============================================================================
   End Documents Panel Component (Story 3.6)
   ============================================================================ */

/* ============================================================================
   Confidence Display (Story 4.1)
   ============================================================================ */

/* Findings list confidence text (plain text, not badge) */
.finding-confidence-text {
  font-size: 11px;
  font-weight: 400;
  color: #4B5563; /* gray-600 */
  margin-left: 8px; /* 2 whitespace equivalent */
  white-space: nowrap;
}

/* Finding meta container */
.finding-meta {
  display: flex;
  align-items: baseline; /* Baseline align text elements */
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

/* Detail panel confidence indicator */
.detail-confidence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: help;
  margin-left: 12px;
}

.detail-confidence:focus {
  outline: 2px solid #3B82F6; /* blue-500 */
  outline-offset: 2px;
}

.detail-confidence.confidence-high {
  background-color: var(--color-confidence-high-bg);
  color: var(--color-confidence-high-text);
}

.detail-confidence.confidence-medium {
  background-color: var(--color-confidence-medium-bg);
  color: var(--color-confidence-medium-text);
}

.detail-confidence.confidence-low {
  background-color: var(--color-confidence-low-bg);
  color: var(--color-confidence-low-text);
}

.detail-confidence-label {
  font-weight: 500;
}

.detail-confidence-value {
  font-weight: 600;
}

/* Detail header badges container */
.detail-header-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

/* Story 10.2b smoke-fix (2026-04-19): right-justified group for the
   reason chip + state checkmark. Severity + confidence stay on the left;
   chip + checkmark sit at the right edge of the header row. */
.detail-header-badges-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Sub-finding confidence badge */
.sub-finding-confidence {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
}

.sub-finding-confidence.confidence-high {
  background-color: var(--color-confidence-high-bg);
  color: var(--color-confidence-high-text);
}

.sub-finding-confidence.confidence-medium {
  background-color: var(--color-confidence-medium-bg);
  color: var(--color-confidence-medium-text);
}

.sub-finding-confidence.confidence-low {
  background-color: var(--color-confidence-low-bg);
  color: var(--color-confidence-low-text);
}

/* Info tooltip (non-error) */
.info-tooltip {
  position: fixed;
  z-index: 50;
  padding: 8px 12px;
  font-size: 13px;
  color: white;
  background-color: #2563eb; /* blue-600 */
  border-radius: 6px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  max-width: 280px;
  line-height: 1.4;
}

.info-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 1rem;
  border-width: 0 6px 6px 6px;
  border-style: solid;
  border-color: transparent transparent #2563eb transparent;
}

/* ============================================================================
   End Confidence Display (Story 4.1)
   ============================================================================ */

/* ============================================================================
   Export Dialog (Story 4.2) - Native <dialog> Element
   Browser requirement: Chrome 93+, Firefox 92+, Safari 15.4+ (for <dialog> + accent-color)
   ============================================================================ */

/* Export button in header */
.export-btn {
  transition: background-color 0.15s;
}

.export-btn:hover {
  background-color: #f3f4f6; /* gray-100 */
}

.export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Native dialog styling */
.export-dialog {
  border: none;
  border-radius: 0.5rem;
  padding: 0;
  max-width: 28rem; /* max-w-md equivalent */
  width: calc(100% - 2rem);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Story 10.11c iter-10 (Beat 2026-05-07 Bug 32): export-modal footer
 * (3 buttons — Annuler / Aperçu / Télécharger) overflows on phone widths:
 * "Annuler is cropped on its left, Télécharger is cropped on its right".
 * Tighten the footer padding (px-6 → 0.5rem each side) + gap (gap-3 →
 * 0.5rem) at ≤480px so the content area absorbs ~30px back into the
 * available width, fitting all 3 buttons natively. Beat directive:
 * "preserve text inside Télécharger and fit the 3 buttons". */
@media (max-width: 480px) {
  .export-dialog .flex.justify-end {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    gap: 0.5rem;
  }
  .export-dialog .flex.justify-end > button {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  /* Iter-11 (Beat 2026-05-07 Bug 32 minor): "EYE Aperçu" text appears
   * left-justified inside its button while Annuler + Télécharger look
   * centered. Reason: all 3 buttons use `flex items-center gap-1.5`
   * (left-align by default); the other two have content that nearly
   * fills the button so left-align is invisible. Aperçu's narrower
   * "👁 + Aperçu" content leaves visible right-padding. Add
   * `justify-content: center` to the SVG-bearing buttons so the
   * icon+text cluster centers within whatever button width remains. */
  .export-dialog .flex.justify-end > #export_preview,
  .export-dialog .flex.justify-end > #export_download {
    justify-content: center;
  }
}

/* Native dialog backdrop */
.export-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

/* L3 fix: Normalized to class selector for consistent specificity */
/* Dialog form elements - accent-color for native styling */
.export-dialog input[type='radio'],
.export-dialog input[type='checkbox'] {
  accent-color: var(--color-primary-600);
}

/* Focus states - use :focus-visible to only show ring for keyboard navigation */
.export-dialog button:focus-visible,
.export-dialog input:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

/* Dialog footer buttons */
.export-dialog .flex.justify-end button {
  min-width: 100px;
}

/* Ensure dialog is centered when open */
.export-dialog[open] {
  display: flex;
  flex-direction: column;
}

/* Story 10.8 smoke-test follow-up #14 (2026-05-02): unreviewed-state banner
   inside the export dialog. Sits between the header and the body. Hidden
   via the `hidden` attribute when all findings are reviewed. Color matches
   the per-page banner palette (amber-100 fill + amber-800 text) so the
   user sees a visual handshake between "what the dialog warned me about"
   and "what the export carries". */
.export-dialog-review-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  background-color: var(--color-amber-100, #FEF3C7);
  color: var(--color-amber-800, #92400E);
  border-bottom: 1px solid var(--color-amber-200, #FDE68A);
  font-size: 0.8125rem;
  line-height: 1.4;
}

/* The `display: flex` above outranks the UA `[hidden]{display:none}` rule, so
   without this guard the banner (amber background + /!\ icon) stays visible
   when JS sets `.hidden = true` for a fully-reviewed analysis — showing an
   empty, textless warning. Restore the hidden contract. */
.export-dialog-review-banner[hidden] {
  display: none;
}

.export-dialog-review-banner-icon {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin-top: 0.0625rem; /* optical-center alignment with first text line */
}

.export-dialog-review-banner-text {
  flex: 1 1 auto;
}

/* M1 fix: Removed unused .mobile-export-bar CSS (Task 7.2 kept button in header on all viewports) */

/* Sub-options of Constats: indented under the word "Constats" (not its checkbox) */
.export-findings-sub {
  margin-left: 1.75rem; /* align under label text, past checkbox + gap */
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: opacity 0.15s;
}

/* Grey out sub-options when Constats is unchecked (pure CSS via :has()) */
.space-y-2:has(#export_include_findings:not(:checked)) .export-findings-sub {
  opacity: 0.4;
  pointer-events: none;
}

/* ============================================================================
   End Export Dialog (Story 4.2)
   ============================================================================ */

/* ============================================================================
   Story 5.10: Regulation Viewer Overlay
   ============================================================================ */

.regulation-viewer-dialog {
  border: none;
  border-radius: 0.75rem;
  padding: 0;
  max-width: 56rem;
  width: 90vw;
  max-height: 90vh;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.regulation-viewer-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

.regulation-viewer-container {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.regulation-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0.75rem 0.75rem 0 0;
}

.regulation-viewer-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.regulation-viewer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Override github-markdown-css body sizing within our dialog */
.regulation-viewer-content .markdown-body {
  max-width: none;
  font-size: 0.9rem;
}

/* Section page separators */
.regulation-viewer-content hr {
  margin: 0.5rem 0 0.25rem;
  border-color: #e5e7eb;
}

/* PDF page link icon next to section headings */
.regulation-pdf-link {
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
  color: #6b7280;
  opacity: 0.5;
  transition: opacity 0.15s;
  vertical-align: middle;
}

.regulation-pdf-link:hover {
  opacity: 1;
  color: #2563eb;
}

.regulation-pdf-icon {
  width: 1rem;
  height: 1rem;
}

/* Loading state */
.regulation-viewer-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #6b7280;
  font-size: 0.875rem;
}

/* Error state */
.regulation-viewer-error {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #dc2626;
  font-size: 0.875rem;
}

/* Collected footnotes footer */
.regulation-footnotes {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 2px solid #e5e7eb;
}

.regulation-footnotes h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.5rem;
}

.regulation-footnotes p {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 0.25rem 0;
}

/* Story 14.3 AC 14.3.6 (D2) — cross-language authoritative-definition surface */
.regulation-def-mark {
  cursor: help;
  text-decoration: underline dotted;
}

.regulation-def-authoritative {
  margin: 0.125rem 0 0.5rem 1rem;
}

.regulation-def-authoritative-ref {
  white-space: nowrap;
  color: var(--color-gray-400);
}

.regulation-def-tooltip {
  position: fixed;
  z-index: 1100; /* above the regulation viewer dialog */
  max-width: 24rem;
  padding: 0.625rem 0.75rem;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-gray-200);
  border-radius: 0.375rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 0.8rem;
  color: var(--color-gray-700);
}

.regulation-def-tooltip-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.regulation-def-tooltip-separator {
  margin: 0.5rem 0 0.25rem;
  padding-top: 0.375rem;
  border-top: 1px dashed var(--color-gray-300);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-gray-500);
}

.regulation-def-tooltip-de-term {
  font-weight: 600;
}

.regulation-def-tooltip-de-ref {
  margin-top: 0.25rem;
  color: var(--color-gray-400);
}

/* ============================================================================
   End Regulation Viewer (Story 5.10)
   ============================================================================ */

/* ============================================================================
   Story 5.15: Debug Conversation Viewer
   ============================================================================ */

/* Debug-clickable severity badges — cursor + hover effect when is_debug_mode() adds .debug-clickable */
.debug-clickable { cursor: pointer; transition: filter 0.15s; }
.debug-clickable:hover { filter: brightness(1.2); box-shadow: 0 0 0 2px var(--color-debug); }

/* Sub-finding severity badge — smaller variant of .detail-status-badge */
.sub-finding-severity { font-size: 0.75rem; padding: 2px 6px; margin-left: 4px; vertical-align: middle; white-space: nowrap; }

/* Token/cost summary header in conversation modal */
.cv-token-summary { padding: 0.5rem 1rem; background: var(--color-severity-low-bg); color: var(--color-severity-low-text); border-radius: 4px; margin-bottom: 1rem; font-size: 0.85rem; }

/* Per-entry telemetry row (timing, bytes, model) */
.cv-entry-telemetry { padding: 2px 8px; font-size: 0.7rem; color: var(--color-debug); opacity: 0.8; font-family: monospace; }

/* ============================================================================
   End Debug Conversation Viewer (Story 5.15)
   ============================================================================ */

/* ============================================================================
   Shared button styles
   ============================================================================ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-button);
  color: #fff;
  background-color: var(--color-btn-primary);
  transition: background-color 0.15s ease;
}

/* DEFAULT (minimum) padding for the shared buttons — low specificity so any
   Tailwind padding utility (px-6, py-2, …) on the element wins REGARDLESS of
   source order. This sheet is appended AFTER the utilities (see input.css
   header), so a normal-specificity padding here silently clobbered stacked
   utilities: the inline re-analyze "Feu!" button shrank the moment
   .btn-primary was toggled on (mu51 smoke, Beat 2026-08-16), and
   index.html's hero px-6 py-3 never applied. Selector shape matters: a bare
   :where() (0,0,0) LOSES to Tailwind preflight's `button { padding: 0 }`
   (0,0,1), zeroing bare buttons — the :is(button, a, input) prefix pins
   specificity at exactly 0,0,1: later-in-cascade than preflight (wins),
   below every utility (loses, as intended). The bare :where() alternative
   covers non-form elements, which preflight never zeroes. */
:is(button, a, input):where(.btn-primary, .btn-secondary),
:where(.btn-primary, .btn-secondary) {
  padding: 0.375rem 0.75rem;
}

.btn-primary:hover {
  background-color: var(--color-btn-primary-hover);
}

/* Source-order guard (same class as `.progress-modal-overlay.hidden` below):
   these buttons set display:inline-flex, which wins the equal-specificity,
   source-order tie against Tailwind's `.hidden` (utilities are emitted BEFORE
   this appended component sheet). #new_project_toggle and .try-again-btn ship
   with `class="hidden btn-primary"` and must stay display:none until their
   bootstrap reveals them — otherwise the button is clickable before its
   listener attaches and early clicks are silently swallowed. */
.btn-primary.hidden,
.btn-secondary.hidden {
  display: none;
}

/* ============================================================================
   New Project Accordion (Story 6.1 Task 9)
   ============================================================================ */

#new_project_accordion_wrapper {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.3s ease;
}

#new_project_accordion_wrapper.collapsed {
  grid-template-rows: 0fr;
}

#new_project_accordion_wrapper > div {
  overflow: hidden;
  min-height: 0;
}

/* ============================================================================
   Project Accordion (Story 6.2)
   ============================================================================ */

.project-accordion-wrapper {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.3s ease;
}

.project-accordion-wrapper.collapsed {
  grid-template-rows: 0fr;
}

.project-accordion-wrapper > div {
  overflow: hidden;
  min-height: 0;
}

/* Secondary button style (outline variant) */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  /* padding: see the :where(.btn-primary, .btn-secondary) default above */
  border: 1px solid var(--color-btn-primary);
  color: var(--color-btn-primary);
  background: transparent;
  border-radius: var(--radius-button);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.btn-secondary:hover {
  background-color: var(--color-btn-primary);
  color: white;
}

/* Story 6.3: Page dimmer — fade in/out instead of abrupt toggle */
#page_dimmer {
  transition: opacity 0.25s ease;
  opacity: 0;
  pointer-events: none;
}
#page_dimmer.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Story 6.3: Active form sits above dimmer (z-40), below confirm dialog (z-50) */
.above-dimmer {
  position: relative;
  z-index: 41;
  background-color: white;
  border-radius: 0.5rem;
}

/* Story 6.3: Tree connector — vertical bar from chevron down through accordion.
   Absolutely positioned on the project row (outside overflow:hidden grid child). */
.project-tree-line {
  position: absolute;
  left: 1.25rem; /* align with chevron center (px-4 + half chevron) */
  top: 2.25rem;  /* start just below the header row (py-3 + badge height) */
  bottom: 0;
  width: 3px;
  border-radius: 2px;
  background-color: #C5D4EC; /* primary-200 */
  pointer-events: none;
}

/* ============================================================================
   Story 6.8: Progress Modal
   ============================================================================ */

.progress-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100; /* matches preview modal z-index */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Bug C root cause (Beat 2026-06-27): progress-modal.js shows/hides this
   overlay by toggling the Tailwind `.hidden` utility (`modal_overlay.classList
   .add/remove('hidden')`). But `build:css` APPENDS components.css AFTER the
   Tailwind utilities, so `.progress-modal-overlay { display: flex }` (here)
   wins the equal-specificity, source-order tie against `.hidden { display:none }`
   (Tailwind output) — meaning `.add('hidden')` could NOT actually hide the
   overlay (computed `display` stayed `flex`). On minimise/close the dimmer
   (#page_dimmer, hidden correctly via its own `.hidden`) disappeared while the
   modal stayed on screen → the "re-opens by itself WITHOUT a darkened backdrop,
   Réduire dead" symptom. A higher-specificity compound selector (0,2,0 > 0,1,0)
   restores the toggle regardless of source order. The sibling overlays are
   immune: `.cv-modal-overlay` is base `display:none` + a `--visible` modifier,
   the finding overlays are DOM add/remove, and the shortcut help is a native
   <dialog> — only this one relied on the `.hidden` toggle over a `display:flex`
   base. */
.progress-modal-overlay.hidden {
  display: none;
}

.progress-modal-container {
  position: relative;
  z-index: 1;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Full-screen on mobile/tablet */
@media (max-width: 1024px) {
  .progress-modal-container {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    height: 100%;
  }
}

.progress-modal-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.progress-modal-minimize-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  color: var(--color-gray-600, #4b5563);
  background: transparent;
  border: 1px solid var(--color-gray-300, #d1d5db);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background 0.15s;
}

.progress-modal-minimize-btn:hover {
  background: var(--color-gray-100, #f3f4f6);
}

/* Animate modal open (expand from badge) */
@keyframes modal-expand-in {
  0% { transform: scale(0.1); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Animate modal close (collapse to badge) */
@keyframes modal-collapse-out {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.1); opacity: 0; }
}

.modal-animate-in {
  animation: modal-expand-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal-animate-out {
  animation: modal-collapse-out 0.25s ease-in forwards;
}

/* ============================================================================
   Story 6.8: Badge Animations (AC 6.8.5)
   ============================================================================ */

/* Completed badge: heartbeat (two scale pulses over 1.5s) */
@keyframes badge-heartbeat {
  0%   { transform: scale(1); }
  15%  { transform: scale(1.15); }
  30%  { transform: scale(1); }
  45%  { transform: scale(1.1); }
  60%  { transform: scale(1); }
  100% { transform: scale(1); }
}

/* Failed badge: shake (left-right wobble) */
@keyframes badge-shake {
  0%, 100% { transform: translateX(0); }
  15%      { transform: translateX(-3px); }
  30%      { transform: translateX(3px); }
  45%      { transform: translateX(-2px); }
  60%      { transform: translateX(2px); }
  75%      { transform: translateX(-1px); }
}

/* Running badge: subtle pulse/glow */
@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}

.badge-animate-heartbeat {
  animation: badge-heartbeat 1.5s ease-in-out;
}

.badge-animate-shake {
  animation: badge-shake 0.6s ease-in-out;
}

.badge-animate-pulse {
  animation: badge-pulse 2s ease-in-out infinite;
}

/* Story 7.7: Awaiting attention — glow animation for taxonomy review */
@keyframes awaiting-glow {
  0%, 100% { box-shadow: 0 0 4px var(--color-severity-medium-accent); }
  50%      { box-shadow: 0 0 12px var(--color-severity-medium-accent); }
}

.awaiting-attention {
  animation: awaiting-glow 2s ease-in-out infinite;
  cursor: pointer;
}

/* Respect reduced motion for badge and modal animations */
@media (prefers-reduced-motion: reduce) {
  .badge-animate-heartbeat,
  .badge-animate-shake,
  .badge-animate-pulse,
  .awaiting-attention {
    animation: none !important;
  }
  .modal-animate-in,
  .modal-animate-out {
    animation: none !important;
  }
}

/* Eye icon overlay on badge hover (AC 6.8.4) */
.project-status-badge {
  position: relative;
  cursor: pointer;
  transition: box-shadow 0.15s;
  overflow: hidden;
  /* Smoke-fix 2026-04-19: project list squeezed the badge in narrow rows
     causing "Terminée" → "Termin" truncation. Lock badge to content width
     and forbid the parent flex from shrinking it. */
  flex-shrink: 0;
  white-space: nowrap;
}

.project-status-badge:hover {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3); /* blue ring for visibility */
}

/* Full-badge overlay with centered eye on hover */
.project-status-badge .badge-eye-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.75);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  font-size: 0.875rem;
}

.project-status-badge:hover .badge-eye-icon {
  opacity: 1;
}

/* Expand icon on minimized modal badge */
.badge-expand-icon {
  cursor: pointer;
  font-size: 0.75rem;
  margin-left: 0.25rem;
}

/* ============================================================================
   Toast notifications (show_toast / show_success / show_error)
   ============================================================================
   The toast machinery in lib/ui-utils.js appends `.toast .toast-success` /
   `.toast-error` to `#toast_container`. These rules originally lived inline
   inside upload.html only — meaning toasts on results.html appeared
   completely unstyled (white text on transparent background, bottom-right).
   Manual-test ripple (Story 10.6): hoisted here so every page that has the
   toast container picks them up uniformly. */

.toast {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  color: white;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  animation: toast-fade-in 0.3s ease-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.toast-success {
  background-color: var(--color-state-approved, #059669);
}
.toast-error {
  background-color: var(--color-action-negative, #DC2626);
}
.toast-fade-out {
  animation: toast-fade-out 0.3s ease-out forwards;
}
@keyframes toast-fade-in {
  from { opacity: 0; transform: translateY(-0.5rem); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.toast-sticky {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast-action-btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: white;
  background: var(--color-primary-600, #2563eb);
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background 0.15s;
}

.toast-action-btn:hover {
  background: var(--color-primary-700, #1d4ed8);
}

.toast-close-btn {
  padding: 0 0.375rem;
  font-size: 1.25rem;
  line-height: 1;
  color: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.toast-close-btn:hover {
  opacity: 1;
}

/* ============================================================================
   Story 6.5: Analysis Status Bar
   ============================================================================ */

.status-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  width: 100%;
  box-sizing: border-box;
  background: var(--color-gray-900, #111827);
  color: white;
  font-size: 0.875rem;
  border-top: 1px solid var(--color-gray-700, #374151);
}

.status-bar-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-bar-dot-running {
  background: #3B82F6;
  animation: status-bar-pulse 1.5s ease-in-out infinite;
}

.status-bar-dot-completed {
  background: #22C55E;
}

.status-bar-dot-failed {
  background: #EF4444;
}

@keyframes status-bar-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-bar-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-bar-btn {
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.25rem;
  color: white;
  cursor: pointer;
  transition: background 0.15s;
}

.status-bar-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.status-bar-close {
  padding: 0 0.375rem;
  font-size: 1.125rem;
  line-height: 1;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: color 0.15s;
}

.status-bar-close:hover {
  color: white;
}

/* ============================================================================
   Story 7.5c: Affirmation Tree Component
   ============================================================================ */

.affirmation-tree {
  font-size: 0.875rem;
}

.affirmation-tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.affirmation-tree-header h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-confidence-high-text);
  margin: 0;
}

/* Dimension row */
.dim-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 0.375rem;
  /* Visible so the pills dropdown OVERLAY can escape the row box; the
     collapsed state below re-clips for the max-height transition. */
  overflow: visible;
  /* A CEILING, not a size (Story 99.16b AC .5.2): the cap exists only so the
     collapse animates (max-height 0 <-> a number; `none` cannot transition).
     It was 10rem, which an expanded Affectation(s) row with eight wrapped pills
     outgrows — and with `overflow: visible` the excess painted over the next row.
     50rem was measured well beyond the tallest row at 1180px (eight pills); at
     375px a row with many long, wrapped pills can still exceed it (residual). */
  max-height: 50rem;
  transition: background-color 0.15s, max-height 0.3s ease, opacity 0.2s ease;
}

.dim-row.collapsed {
  overflow: hidden;
  max-height: 0 !important;
  /* border-box: padding is a hard floor under max-height:0 — without this,
     every hidden row still occupies 0.75rem (~800 rows = ~9600px of blank
     scroll after the 14.2b taxonomy resync). */
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  pointer-events: none;
}

.dim-row:hover {
  background-color: var(--color-bg-secondary);
}

.dim-row[data-needs-review="true"] {
  border-left: 3px solid var(--color-confidence-medium);
  padding-left: calc(0.5rem - 3px);
}

/* Tier indentation */
/* DEPTH IS NOT DRAWN (Beat, 2026-09-15). `data-tier` is still emitted on the row
   — it is a useful selector and a debugging handle — but nothing indents by it.
   The expert filling this form is answering questions about a building; the tier
   is a property of the TAXONOMY's dependency graph, not of the question, and a
   row's parent is frequently not even on screen (the cascade hides unanswered
   branches), so an indent pointed at nothing.

   The evidence that it carried no information: the rules stopped at tier 4, so
   the 190 dimensions the shipped taxonomy has at tiers 5-9 (57/64/46/15/8 — max
   depth is 9) drew flat, i.e. a nine-deep dependent rendered exactly like a root,
   and nobody reported it. It also cost up to 3.75rem of a 15rem label column.

   It was previously `margin-left` on `.dim-row`, which moved the whole row and
   put the value column at 474/494/514/534 for tiers 1-4 — four columns on one
   form, against `.dim-label`'s own promise that values "align in a column right
   of the labels". Both defects go away by not drawing depth at all. */

/* ONE column, not two. The checkmark is an in-flow flex item, so a row carrying
   one starts 2rem further right than a row that does not — measured at 1180px,
   label 226 / value 474 with a checkmark against 194 / 442 without, an offset of
   exactly `.dim-check`'s 1.5rem plus the row's own 0.5rem gap. `.dim-label`'s own
   comment says the values should "align in a column right of the labels"; with
   two starting offsets there were two columns, and the numeric rows (the ones
   that have a checkmark) were the ones out of line with the enum rows.
   Reserving the gutter where there is no checkmark gives every row one origin.
   The `:has()` selector is an established idiom in this stylesheet, not a novelty
   introduced here — it already scoped the chat-modal summary, the chat thread
   host, the finding-item edit combobox, the export sub-options and the page
   header. NO COUNT IS QUOTED ON PURPOSE. Three successive attempts to state one
   here were each wrong: "8 uses" counted prose mentions as selectors, "5 uses"
   was right only for the file BEFORE this rule existed, and the correction to
   that was stale the moment its own wording mentioned the selector one more time.
   A figure that changes whenever someone writes the word in a comment is a figure
   built to rot; the named call sites above are checkable and stay true. */
.dim-row:not(:has(> .dim-check))::before {
  content: '';
  flex: 0 0 1.5rem; /* = .dim-check width; the row's gap supplies the rest */
}

/* 4-state checkmark button */
.dim-check {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  min-width: 1.5rem;
  border-radius: 0.25rem;
  border: 2px solid var(--color-gray-300);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  transition: border-color 0.15s, background-color 0.15s;
}

.dim-check:hover { border-color: var(--color-status-muted); }

.dim-value-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  /* Ripple of F10.6-iter3-1 (Story 10.6 iter-3 review): both `--color-text-secondary`
     and `--color-bg-muted` are undefined in :root → the hex fallback always won,
     defeating theming. Renamed to canonical project tokens (gray-500 ≈ slate-500,
     gray-100 ≈ slate-100; visually negligible delta). */
  color: var(--color-text-muted);
  background: var(--color-gray-100);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  /* NO margin-left. It dates from when the badge sat BESIDE a number input and
     needed a gap of its own; the badge is now the value slot itself, a flex item
     in a row that already sets `gap: 0.5rem`, so the margin stacked on top of the
     gap and put this one row 4px right of every other — value column at 478
     against 474 (measured on `footprint_area_m2`, the only row on that page
     carrying a discovered value, which is what made it easy to miss).
     The input case is unaffected: the badge is empty there and
     `.dim-value-badge:empty { display: none }` takes it out of the layout. */
  vertical-align: middle;
  min-width: 1.5rem;
  text-align: center;
}
.dim-value-badge:empty { display: none; }

.dim-check[data-state="yes"] {
  background-color: var(--color-state-yes);
  border-color: var(--color-state-yes);
  color: white;
}

.dim-check[data-state="no"] {
  background-color: var(--color-severity-high-accent);
  border-color: var(--color-severity-high-accent);
  color: white;
}

/* `na` = « Non répondu » (Story 99.16b, Beat D1): asked, left unanswered —
   drawn as the EMPTY box, the same box as the never-asked `not_replied`. */
.dim-check[data-state="na"],
.dim-check[data-state="not_replied"] {
  background-color: white;
  border-color: var(--color-gray-300);
  color: var(--color-status-muted);
}

/* Dimension label */
/* Left title column (Story 99.16b AC .5.1, wireframe approved by Beat
   2026-10-02): the box and the title take HALF the row, so every value control
   starts at the same 50% column. The title WRAPS — the row titles are full
   sentences since 99.16b (« Le bâtiment comprend un garage ou un parking
   souterrain »), and the former 15rem column cut them with « … », hiding the
   very words that make the statement. `calc(50% - 2rem)`: the box (1.5rem, or
   the gutter that stands in for it) plus the row's 0.5rem gap complete the half.
   The narrow-screen rule at the end of this section still wins. */
.dim-label {
  flex: 0 0 calc(50% - 2rem);
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  color: var(--color-confidence-high-text);
  cursor: pointer;
}

.dim-label-text {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Needs-review amber indicator */
.dim-review-badge {
  flex-shrink: 0;
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  background-color: var(--color-confidence-medium-bg);
  color: var(--color-confidence-medium-text);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.15s, background-color 0.15s;
}

/* Story 99.16b AC .5.3 — the badge is a button (a click confirms the detected
   value, its title says so); the hover says it is clickable. */
.dim-review-badge:hover {
  border-color: var(--color-confidence-medium);
  background-color: white;
}

/* Enum multi-select dropdown */
.dim-enum-select {
  flex-shrink: 0;
  min-width: 10rem;
  max-width: 16rem;
  font-size: 0.875rem;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--color-gray-300);
  border-radius: 0.25rem;
  background: white;
}

/* Numeric entry for integer/decimal dimensions — the way to fill "{value}"
   wherever a number IS the answer (a display-only badge left no input
   affordance, Beat 2026-07-18). NOT always visible since 2026-09-15: a row whose
   stored value is a BAND ("Maximum 150 m2") renders the statement instead and
   carries no input, because no number expresses a bound. Denying the band
   through the 3-state checkmark brings the field back — see
   `render_value_slot`. */
.dim-value-input {
  flex-shrink: 0;
  width: 6rem;
  font-size: 0.875rem;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--color-gray-300);
  border-radius: 0.25rem;
  background: white;
}

/* "+ Ajouter une valeur" button — only shown for non-exclusive enum dimensions
   currently in single-select mode. Click converts the select to multi-select. */
.dim-add-value-btn {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.25rem;
  border: 1px solid var(--color-gray-300);
  background: white;
  color: var(--color-status-muted);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dim-add-value-btn:hover {
  border-color: var(--color-primary-600, #2563eb);
  color: var(--color-primary-600, #2563eb);
}

/* Tooltip */
.dim-tooltip {
  position: fixed;
  z-index: 50;
  max-width: 20rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  background-color: var(--color-gray-800);
  color: white;
  font-size: 0.75rem;
  line-height: 1.4;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  pointer-events: none;
}

.dim-tooltip-source {
  color: var(--color-gray-400);
  font-size: 0.625rem;
  margin-top: 0.25rem;
}

/* Story 99.16: a tooltip without curated help renders its excerpt as KB markdown (<p>, <li>),
   which the global `p` colour rule would repaint gray-600 on the gray-800 tooltip. Text keeps
   the tooltip's colour; consecutive paragraphs get a small gap instead of the default margins. */
.dim-tooltip p,
.dim-tooltip li {
  color: inherit;
  margin: 0;
}
.dim-tooltip p + p {
  margin-top: 0.25rem;
}

/* Info box (click-to-expand) */
.dim-info-box {
  margin: 0.25rem 0 0.5rem 2rem;
  padding: 0.75rem;
  border: 1px solid var(--color-gray-200);
  border-radius: 0.375rem;
  background-color: var(--color-bg-secondary);
  /* Match the tree rows' 0.875rem — 0.75rem body text was too small to
     read regulation excerpts comfortably (Beat 2026-07-18). */
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-gray-600);
  /* ONE scroll pane for the whole drawer, not one per list (Story 14.12c D12):
     nested panes fight each other and the drawer already has a natural bound.
     Room for ~10 double-line uses (description + source sub-line) plus the
     description and headings. `max-height`, never `height` — a short drawer
     must not be padded out to 26rem. */
  max-height: 26rem;
  overflow-y: auto;
  /* The standard properties only. Since Chromium 121 setting these makes the
     engine ignore `::-webkit-scrollbar-*` entirely, and Safari 18.2+ supports
     them too, so a webkit block would be dead on every engine that matters. */
  scrollbar-width: thin;
  scrollbar-color: var(--color-gray-400) transparent;
}

/* Styling hook for the uses list. NOT a scroll pane — the single pane is on
   `.dim-info-box` above (D12); do not add overflow here. These two metrics
   were inline in JS until Story 14.12c. */
.dim-info-box-uses {
  padding-left: 1rem;
  margin: 0.25rem 0;
}

.dim-info-box h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-confidence-high-text);
  margin: 0 0 0.375rem;
}

.dim-info-box-definitions {
  margin-bottom: 0.5rem;
}

.dim-info-box-def-item {
  margin-bottom: 0.375rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--color-gray-300);
}

.dim-info-box-def-excerpt {
  font-style: italic;
}

.dim-info-box-def-source {
  font-size: 0.75rem;
  color: var(--color-gray-500);
}

/* Superscript contextual-help affordance after dimension labels. */
.dim-info-hint {
  margin-left: 0.2rem;
  font-size: 0.7em;
  color: var(--color-primary-500);
  opacity: 0.75;
}

/* Shared multiselect-pills (packages/ui-shared) — explicit layout overrides.
   Tailwind now scans packages/ui-shared/src too (Story 14.9 AC 14.9.2), so
   most arbitrary-value utilities here (min-h-[2.25rem] etc.) ARE generated;
   these rules stay as a belt-and-braces fallback if content scanning ever
   regresses, plus the border/font-size readability tweaks tailwind's own
   utilities don't cover. */
.dim-pills {
  /* Story 99.16b AC .5.2: the multiselect FILLS the value column and its pills
     wrap (`.msp-pills` is a flex-wrap container) — it is no longer sized by its
     longest option nor capped at 28rem. */
  flex: 1 1 0;
  min-width: 0;
  /* Anchor for the dropdown overlay below. */
  position: relative;
}

/* Story 99.16b AC .4.3 — the pills row's empty choice: « Non répondu » after an
   expert clear, « À compléter » otherwise; `hidden` while a pill is set. */
.dim-pills-empty-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* `display: block` above outranks preflight's `[hidden]` rule (same specificity,
   later in the cascade) — without this the hint reads « À compléter » under a
   row whose pills are set (Story 99.16b code review iter 1). */
.dim-pills-empty-hint[hidden] {
  display: none;
}

.multiselect-pills .msp-pills {
  min-height: 2.25rem;
  background: white;
  /* Recognizable as a FIELD (Beat 2026-07-18): the tailwind `border`
     utility's 1px gray-200 was too faint. */
  border: 1px solid var(--color-gray-300);
  border-radius: 0.25rem;
}

.dim-pills:focus-within .msp-pills {
  border-color: var(--color-primary-500);
}

/* Match the contextual-help readability bump (Beat 2026-07-18): the
   component's text-xs badges were too small on this page. */
.dim-pills .msp-pill {
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
}

.dim-pills .msp-pill-remove {
  font-size: 1rem;
  line-height: 1;
}

.multiselect-pills .msp-input {
  min-width: 6rem;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.875rem;
}

/* Overlay, not in-flow: rendered inline it overlapped the badges inside
   the height-capped row (Beat 2026-07-18). Marked border + shadow so it
   reads as a dropdown panel. */
.dim-pills .msp-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  max-height: 12rem;
  border: 1px solid var(--color-gray-300);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Clickable variant — opens the regulation viewer on the source document. */
.dim-info-box-def-source-link {
  display: block;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}

.dim-info-box-def-source-link:hover {
  color: var(--color-primary-600);
}

/* The uses bracket sits INLINE after the document reference, so it cannot
   reuse `.dim-info-box-def-source-link` (which is `display: block`, and is the
   exact selector an E2E asserts on with a strict `toHaveText`). */
.dim-info-box-use-source-link {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}

/* The AFFORDANCE belongs to the interactive element only. Without a document
   the bracket renders as a <span> with no click handler (D5), and it must not
   look clickable: `underline` + `cursor: pointer` on an inert node is the same
   defect as the dead <button> this replaced, one layer down. Element-scoped
   rather than a second class, so the two brackets keep identical layout and
   cannot drift apart. */
button.dim-info-box-use-source-link {
  text-decoration: underline;
  cursor: pointer;
}

button.dim-info-box-use-source-link:hover {
  color: var(--color-primary-600);
}

/* Flash animation for updated dimensions */
@keyframes dim-flash {
  0% { background-color: var(--color-confidence-medium-bg); }
  100% { background-color: transparent; }
}

.dim-flash {
  animation: dim-flash 1.5s ease-out;
}

/* Narrow screens: the fixed label column doesn't fit — let rows wrap so
   the control drops under its label. */
@media (max-width: 640px) {
  .dim-row {
    flex-wrap: wrap;
  }
  .dim-label {
    flex: 1 1 100%;
  }
  /* No gutter here: the row wraps and the label takes the full width, so the
     column alignment the gutter exists for is already abandoned — reserving it
     would only steal 2rem from the narrowest screens. */
  .dim-row:not(:has(> .dim-check))::before {
    content: none;
  }
}

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
  .dim-row {
    transition: none !important;
  }
  .dim-flash {
    animation: none !important;
  }
  .dim-check {
    transition: none !important;
  }
}

/* ============================================================================
   Story 7.8: Taxonomy Divergence Warning Banner
   ============================================================================ */

.divergence-banner {
  padding: 12px 20px;
  background: var(--color-amber-100);
  border-bottom: 1px solid var(--color-amber-200);
  color: var(--color-amber-800);
  font-size: 14px;
  line-height: 1.5;
}

.divergence-banner--resolved {
  background: var(--color-gray-100);
  border-bottom-color: var(--color-gray-200);
  color: var(--color-gray-700);
}

.divergence-banner-text {
  margin: 0 0 8px;
}

.divergence-banner-details {
  margin: 0 0 8px;
  padding-left: 20px;
  font-size: 13px;
  font-family: monospace;
}

.divergence-banner-details li {
  margin-bottom: 2px;
}

.divergence-banner-button {
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-amber-900);
  background: var(--color-amber-200);
  border: 1px solid var(--color-amber-300);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.divergence-banner-button:hover {
  background: var(--color-amber-300);
}

/* Story 10.0: Universal undo/redo UI — help overlay + controls.
 * Help button is fixed bottom-right so it doesn't disturb layout or
 * intercept clicks in existing upload/results pages. All colors use the
 * project's existing --color-gray-* / --color-amber-* custom properties per
 * CLAUDE.md DRY rule — no hardcoded hex values. */
.keyboard-shortcut-help-button {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  /* Story 10.11 smoke-test follow-up — Beat: the prior light-gray-on-white
   * affordance was too subtle; users couldn't guess that the circle is the
   * keyboard-shortcut help. Switched to a darker palette + stronger weight
   * + subtle shadow so the button reads as an action affordance even at a
   * glance. Inverts on hover for additional feedback. */
  border: 1px solid var(--color-gray-700);
  background: var(--color-gray-700);
  color: white;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  /* z-index 150 sits above existing modals at z-index 100 (cv-modal-overlay,
   * progress-modal-overlay) so the accessibility help affordance stays
   * reachable, and below the help overlay itself at z-index 200. */
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.keyboard-shortcut-help-button:hover {
  background: var(--color-gray-900);
  border-color: var(--color-gray-900);
  transform: scale(1.05);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.keyboard-shortcut-help-button:active {
  transform: scale(0.98);
}

/* Story 10.11 (AC 10.11.A.2 — WCAG 2.4.7 Focus Visible): persistent focus
 * ring on the help button. Reuses --shadow-focus-ring to stay aligned with
 * the project-wide focus-ring affordance (CLAUDE.md DRY-colors rule). */
.keyboard-shortcut-help-button:focus-visible {
  box-shadow: var(--shadow-focus-ring);
  outline: none;
}

.keyboard-shortcut-help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.keyboard-shortcut-help-overlay[hidden] {
  display: none;
}

.keyboard-shortcut-help-panel {
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 8px;
  min-width: 20rem;
  position: relative;
}

.keyboard-shortcut-help-panel h2 {
  margin-top: 0;
}

/* Story 10.11 — semantic <section>/<h3>/<dl> a11y refactor (replaces the
 * <ul><li> blob). Each category renders as one <section> with a heading
 * and a definition-list of chord → label rows. */
.keyboard-shortcut-help-sections {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* Cap height for long binding lists; lets the user scroll inside the
   * dialog rather than blowing past the viewport. */
  max-height: 70vh;
  overflow-y: auto;
}

.keyboard-shortcut-help-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-gray-500);
  margin: 0 0 0.5rem;
}

.keyboard-shortcut-help-section dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4em 1.5em;
  margin: 0;
}

.keyboard-shortcut-help-section dt {
  display: flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.85rem;
  white-space: nowrap;
}

.keyboard-shortcut-help-section dd {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-gray-800);
}

.keyboard-shortcut-help-overlay kbd {
  display: inline-block;
  padding: 0.1em 0.45em;
  border: 1px solid var(--color-gray-300);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--color-gray-50);
  color: var(--color-gray-800);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8em;
  line-height: 1.2;
}

/* aria-live region — visually hidden but announced by screen readers. */
.keyboard-shortcut-help-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.keyboard-shortcut-help-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
}

/* Story 10.0 + 10.1 iter 2: Undo/redo controls.
 * Dual-dropdown layout: [↶ Undo] [▾] [Redo ↷] [▾] — caret paired with each
 * primary button on its trailing edge. Primary buttons carry visible chrome
 * (background + border + hover/active/disabled) so they read as buttons, not
 * bare glyphs (user direction 2026-04-18). */
/* Story 10.1 iter 3 (2026-04-18): review-progress stack. Label + 3-segment
 * bar showing approved (green) / rejected (red) / unreviewed (grey) counts
 * proportional to total. Bar aligns with the bottom of the undo/redo buttons
 * via flex center + natural height. */
.review-progress-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.125rem;
  min-width: 8rem;
}
.review-progress-bar {
  display: inline-flex;
  height: 0.4rem;
  background: var(--color-gray-200);
  border-radius: 2px;
  overflow: hidden;
  align-self: stretch;
}
.review-progress-bar-approved { background: var(--color-state-approved); transition: flex 150ms ease; }
.review-progress-bar-rejected { background: var(--color-state-rejected); transition: flex 150ms ease; }
.review-progress-bar-unreviewed { background: transparent; transition: flex 150ms ease; }

.undo-redo-controls {
  display: inline-flex;
  gap: 0.375rem;
  align-items: center;
  position: relative;
}

/* Bug 3 (2026-04-18): split-button wrapper — primary + caret fused into one
 * visual control. Shared border, rounded only on outer corners. */
.undo-redo-split-button {
  display: inline-flex;
  border-radius: 4px;
  overflow: hidden;
}
.undo-redo-split-button > :first-child {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}
.undo-redo-split-button > :last-child {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1px solid var(--color-gray-300);
}

.undo-btn,
.redo-btn {
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-300);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--color-gray-700);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.undo-btn:not(:disabled):hover,
.redo-btn:not(:disabled):hover {
  background: var(--color-gray-100);
  border-color: var(--color-gray-400);
  color: var(--color-gray-900);
}
.undo-btn:not(:disabled):active,
.redo-btn:not(:disabled):active {
  background: var(--color-gray-200);
  border-color: var(--color-gray-400);
}
.undo-btn:disabled,
.redo-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--color-gray-50);
  color: var(--color-gray-400);
  border-color: var(--color-gray-200);
}

.undo-caret,
.redo-caret {
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-300);
  padding: 0.25rem 0.35rem;
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-gray-600);
  transition: background 120ms ease;
}
.undo-caret:not(:disabled):hover,
.redo-caret:not(:disabled):hover { background: var(--color-gray-100); }
.undo-caret:disabled,
.redo-caret:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: var(--color-gray-400);
  border-color: var(--color-gray-200);
}

/* Story 10.1 iter 4 bug #19 (2026-04-18): visible keyboard-focus rings.
 * The split-button wrapper sets `overflow: hidden` (so the shared border
 * looks seamless), which clips the browser's default outline. We use an
 * inset box-shadow so the focus indicator stays inside each button's box. */
.undo-btn:focus-visible,
.redo-btn:focus-visible,
.undo-caret:focus-visible,
.redo-caret:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--color-primary-600, #0E429B);
  z-index: 1;
  position: relative;
}

.undo-dropdown,
.redo-dropdown {
  position: absolute;
  top: 100%;
  background: white;
  border: 1px solid var(--color-gray-300);
  border-radius: 4px;
  min-width: 20rem;
  /* Story 10.1 iter 3 polish (2026-04-18): cap width so dropdown never
   * overflows small viewports and the title has a predictable wrap column. */
  max-width: min(32rem, calc(100vw - 2rem));
  /* Viewport-relative max-height so long histories aren't double-scrolled. */
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  /* Anchor BOTH dropdowns to the RIGHT edge of the controls group — the
   * toolbar lives near the right edge of the page, so a left-anchored
   * dropdown would overflow off-screen. */
  right: 0;
}

.undo-dropdown[hidden],
.redo-dropdown[hidden] {
  display: none;
}

/* Story 10.1 iter 2 smoke-fix (bug 3, 2026-04-18): detail-panel state
 * checkmark — same class `.finding-state-checkmark` as the list checkmark
 * so the two render visually identical. Carries `data-state` directly on
 * the button (no `.finding-item` parent in the detail panel), so we add
 * button-level attribute selectors that complement the existing list rules
 * (`.finding-item[data-state=...] .finding-state-checkmark`). */
.finding-state-checkmark[data-state="approved"] {
  color: var(--color-state-approved);
  border-color: var(--color-state-approved);
  background: white;
}
.finding-state-checkmark[data-state="approved"]::before { content: "✓"; }
.finding-state-checkmark[data-state="rejected"] {
  color: var(--color-state-rejected);
  border-color: var(--color-state-rejected);
  background: white;
}
.finding-state-checkmark[data-state="rejected"]::before { content: "✗"; }

/* Detail-panel positioning — push the checkmark to the right edge of the
 * header badge row. */
.detail-state-checkmark {
  margin-left: auto;
}

/* Story 10.1 iter 3 (2026-04-18): rejected finding detail → title + description
 * rendered with strikethrough so the expert sees the finding as invalidated. */
#detail_panel[data-state="rejected"] .detail-title,
#detail_panel[data-state="rejected"] .detail-description {
  text-decoration: line-through;
  text-decoration-color: var(--color-state-rejected);
  text-decoration-thickness: 1.5px;
}

/* Story 10.1 iter 3 (2026-04-18): compact + polished dropdown row layout.
 * Icon • content (title stacked on timestamp) • surgical button. */
.undo-entry {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  border-bottom: 1px solid var(--color-gray-100);
  transition: background 100ms ease;
}
.undo-entry:last-child {
  border-bottom: none;
}

.undo-entry-icon {
  flex: 0 0 auto;
  padding-top: 0.125rem;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--color-gray-500);
}

.undo-entry-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0; /* allow overflow to ellipsis */
}

.undo-entry-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-800);
  line-height: 1.3;
  /* Story 10.1 iter 3 polish (2026-04-18): long titles wrap instead of being
   * cropped with ellipsis — the meta row (timestamp + surgical action) sits
   * BELOW the title, so the title has the full column width to spread into. */
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Story 10.1 iter 3 follow-up (2026-04-18): target-state pill below the
 * title — shows what the state WILL BECOME if the user clicks this entry.
 * Monospace + colored pill so it reads as "the action", not part of the
 * title. On the undo side the pill shows the PREVIOUS state (undo target);
 * on the redo side it shows the NEXT state (redo target). */
.undo-entry-chip {
  display: inline-flex;
  align-items: center;
  margin-top: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  line-height: 1.3;
  width: fit-content;
  white-space: nowrap;
}
.undo-entry-chip[data-state="unreviewed"] {
  background: var(--color-gray-100);
  color: var(--color-gray-700);
  border: 1px solid var(--color-gray-300);
}
.undo-entry-chip[data-state="approved"] {
  background: var(--color-state-approved-bg);
  color: var(--color-state-approved);
  border: 1px solid var(--color-state-approved);
}
.undo-entry-chip[data-state="rejected"] {
  background: var(--color-state-rejected-bg);
  color: var(--color-state-rejected);
  border: 1px solid var(--color-state-rejected);
}

/* Story 10.3: severity-typed chip in the undo/redo dropdown. Colored by
   the TARGET severity of the entry (undo → old snapshot; redo → new
   snapshot) so the user sees where the finding lands. */
.undo-entry-chip-severity[data-severity="high"] {
  background: var(--color-severity-high-bg);
  color: var(--color-severity-high-text);
  border: 1px solid var(--color-severity-high-accent);
}
.undo-entry-chip-severity[data-severity="medium"] {
  background: var(--color-severity-medium-bg);
  color: var(--color-severity-medium-text);
  border: 1px solid var(--color-severity-medium-accent);
}
.undo-entry-chip-severity[data-severity="low"] {
  background: var(--color-severity-low-bg);
  color: var(--color-severity-low-text);
  border: 1px solid var(--color-severity-low-accent);
}

.undo-entry-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.125rem;
}

.undo-entry-timestamp {
  font-size: 0.7rem;
  color: var(--color-gray-500);
  line-height: 1;
  flex: 0 0 auto;
}

.undo-entry-surgical {
  flex: 0 0 auto;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: transparent;
  border: 1px solid var(--color-gray-300);
  border-radius: 3px;
  color: var(--color-gray-700);
  cursor: pointer;
  white-space: nowrap;
}
.undo-entry-surgical:not(:disabled):hover {
  background: var(--color-gray-100);
  border-color: var(--color-gray-400);
}
.undo-entry-surgical:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.undo-entry:not(.undo-entry-conflict):not(.undo-entry-partial):hover {
  background: var(--color-gray-50);
}

/* Story 10.1 iter 4 bugs #29 + #30 (2026-04-18): make keyboard focus
 * highly visible on dropdown rows and the surgical buttons. Browser
 * default outlines are too subtle on these dense rows — users mistook
 * the focus ring on the surgical button (a thin "line in between"
 * entries) for a rendering bug. Strong primary tint background +
 * inset border ring makes the focused row unmistakable. */
.undo-entry:focus,
.undo-entry:focus-visible {
  outline: none;
  background: var(--color-primary-50);
  box-shadow: inset 0 0 0 2px var(--color-primary-600, #0E429B);
  position: relative;
  z-index: 1;
}
.undo-entry-surgical:focus,
.undo-entry-surgical:focus-visible {
  outline: none;
  border-color: var(--color-primary-600, #0E429B);
  box-shadow: 0 0 0 2px var(--color-primary-600, #0E429B);
  position: relative;
  z-index: 1;
}
/* The dropdown's `overflow-y: auto` was clipping the first row's focus
 * ring at the top edge — `scroll-padding-top` reserves space inside the
 * scroll container so the ring renders fully even on the first row. */
.undo-dropdown,
.redo-dropdown {
  scroll-padding-top: 4px;
}

.undo-entry-conflict {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--color-gray-50);
}

.undo-entry-partial {
  background: var(--color-amber-50);
}

.undo-dropdown-empty {
  padding: 0.75rem;
  color: var(--color-gray-500);
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
}

/* =============================================================================
   Story 10.2 — Inline-editable combobox picker + rejection reason chip
   ============================================================================= */

.inline-edit-combobox {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 220px;
  position: relative;
  padding: 0.25rem 0.5rem;
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-300);
  border-radius: 4px;
  /* Story 10.11 smoke-test follow-up #17 — establish a stacking context
   * ABOVE sibling finding-items' children. The `.finding-item > *` rule
   * (line ~1176) sets z-index:1 on every direct child of finding-item.
   * Both the combobox and the next finding-item's children compete at the
   * same z-1 in the parent's stacking context (same specificity 0,1,0)
   * and DOM order made the next finding paint over the listbox dropdown.
   * Defense in depth:
   *   - `isolation: isolate` forces a stacking context regardless of
   *     z-index, decoupling listbox descendants from siblings even if
   *     a future stylesheet drops the z-index value.
   *   - `z-index: 100 !important` wins the cascade unambiguously vs the
   *     inherited z-1 from `.finding-item > *` (same specificity → !important
   *     beats normal). 100 matches the modal/menu z-stack; the help button
   *     sits at z-150 and the confirm dialog at z-160, so any open modal
   *     still covers the picker. */
  isolation: isolate;
  z-index: 100 !important;
}

.inline-edit-combobox input[role="searchbox"] {
  flex: 1 1 auto;
  min-width: 150px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--color-gray-300);
  border-radius: 3px;
  font: inherit;
}

.inline-edit-combobox input[role="searchbox"]:focus-visible {
  outline: 2px solid var(--color-primary-600);
  outline-offset: 1px;
}

.inline-edit-combobox ul[role="listbox"] {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0.25rem 0 0 0;
  padding: 0.25rem 0;
  list-style: none;
  background: #ffffff;
  border: 1px solid var(--color-gray-300);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  max-height: 240px;
  overflow-y: auto;
  z-index: 10;
}

.inline-edit-combobox li[role="option"] {
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-gray-700);
}

.inline-edit-combobox li[role="option"][aria-selected="true"] {
  background: var(--color-action-bg, #eef3fb);
  color: var(--color-primary-700);
}

.inline-edit-combobox li[role="option"]:hover {
  background: var(--color-gray-100);
}

.inline-edit-combobox .inline-edit-save,
.inline-edit-combobox .inline-edit-cancel {
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--color-gray-300);
  border-radius: 3px;
  background: #ffffff;
  color: var(--color-gray-700);
  font-size: 0.85rem;
  cursor: pointer;
}

.inline-edit-combobox .inline-edit-save {
  background: var(--color-primary-600);
  color: #ffffff;
  border-color: var(--color-primary-600);
}

.inline-edit-combobox .inline-edit-save:hover,
.inline-edit-combobox .inline-edit-cancel:hover {
  filter: brightness(1.05);
}

.inline-edit-halo {
  animation: finding-state-halo-neutral 1.2s ease-out;
}

/* Story 10.2 — rejection reason chip (list-card + detail-panel)
   I-beam cursor flags it as inline-editable; click re-opens the picker. */
.finding-reason-chip {
  display: inline-block;
  max-width: 260px;
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--color-state-rejected);
  background: var(--color-state-rejected-bg);
  border: 1px solid var(--color-state-rejected-border);
  border-radius: 999px;
  cursor: text; /* I-beam — signals editable */
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.finding-reason-chip:focus-visible {
  outline: 2px solid var(--color-primary-600);
  outline-offset: 1px;
}

.finding-reason-chip:hover {
  filter: brightness(0.97);
}


/* Story 10.5 — Expert-added findings visual indicators */
.user-avatar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  letter-spacing: 0.01em;
  /* Iter 4 cleanup: vars are :root-defined — dropped fallback values to avoid
     a divergence bug-class (iter 3 caught #d1d5db vs #e5e7eb on sibling rules;
     Sonnet iter 4 caught #e5e7eb mismatching :root's #f3f4f6 for surface-neutral). */
  background: var(--color-surface-neutral);
  color: var(--color-text-primary);
  flex-shrink: 0;
}
.user-avatar-badge--sm { width: 1.5rem; height: 1.5rem; font-size: 0.75rem; }
.user-avatar-badge--md { width: 2rem; height: 2rem; font-size: 0.9rem; }

.finding-expert-avatar { margin-left: 0.25rem; }

.finding-confidence-expert { font-weight: 600; }

.detail-expert-author {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin: 0.25rem 0 0.5rem 0;
}

.expert-finding-add-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  flex-wrap: wrap;
}

/* Task 9 (code-review iter 7 T3-A): draft pills next to "+ Ajouter". */
.expert-finding-draft-pill {
  display: inline-flex;
  align-items: center;
  background: var(--color-surface-neutral);
  border: 1px solid var(--color-border-subtle);
  border-radius: 9999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  gap: 0.25rem;
}
.expert-finding-draft-pill-label {
  background: transparent;
  border: none;
  color: var(--color-text-primary);
  cursor: pointer;
  padding: 0;
}
.expert-finding-draft-pill-abandon {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.25rem;
  line-height: 1;
}
.expert-finding-draft-pill-abandon:hover {
  color: var(--color-action-negative);
}

/* Destructive button styling for Supprimer-le-brouillon. */
.btn-destructive {
  background: transparent;
  color: var(--color-action-negative);
  border: 1px solid var(--color-action-negative);
  border-radius: var(--radius-button);
  padding: 0.375rem 0.75rem;
  cursor: pointer;
}
.btn-destructive:hover {
  background: var(--color-action-negative);
  color: var(--color-surface-elevated);
}
.btn-add-expert-finding {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-button);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border-subtle);
  cursor: pointer;
}

/* Story 10.5 Phase C — modal layout + preview-card styles moved to
   apps/api/public/lib/chat/chat.css (imported at the top of this file).
   The Phase B `.expert-finding-modal-*` and `.expert-finding-preview-*`
   class blocks were deleted in Task 20.5 along with `expert-finding-modal.js`. */

.undo-entry-chip-lifecycle {
  background: var(--color-surface-neutral);
  color: var(--color-text-primary);
}

/* ─── Story 10.6 — Edit-pane integration (Task 5) ──────────────────── */

/* Top-header pencil-edit trigger (right-justified group). */
.modify-dropdown-trigger-top {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: 1px solid #D1D5DB; /* gray-300 */
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  color: #374151; /* gray-700 */
  transition: background-color 120ms ease, border-color 120ms ease;
}
.modify-dropdown-trigger-top:hover,
.modify-dropdown-trigger-top:focus-visible {
  background-color: #F9FAFB; /* gray-50 */
  border-color: #9CA3AF; /* gray-400 */
}
.modify-dropdown-trigger-pencil {
  width: 16px;
  height: 16px;
  display: block;
}

/* Detail-pane "view modified history" pencil (Story 10.7 ripple). Opens
   the audit-trail drawer pre-filtered to the current finding. Same
   glyph + 16px size as `.modify-dropdown-trigger-pencil` so a user
   reading down the column sees ONE pencil shape across all surfaces
   (list row indicator, detail-pane history trigger, top-right edit
   dropdown). */
.detail-history-trigger {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  color: var(--color-btn-primary, #2563EB);
  flex-shrink: 0;
}
.detail-history-trigger:hover,
.detail-history-trigger:focus-visible {
  background-color: #F3F4F6;
  outline: none;
}
.detail-history-trigger svg {
  width: 16px;
  height: 16px;
  display: block;
}
.modify-dropdown-trigger-caret {
  font-size: 10px;
  line-height: 1;
}

/* Bottom action-row trigger reuses .btn-action-secondary styling — no
   extra rules needed beyond the caret already inlined inside the markup. */

/* Detail-pane body wrapper — created so the editor can mount over the
   body content while the top header (severity + confidence) stays
   visible per AC 10.6.16 wireframes. */
.detail-pane-body {
  /* No layout change relative to the prior flat children — just a
     hookable container so the editor host has a clean target. */
}

/* Recovery banner (AC 10.6.18) — shown when a direct-edit draft exists. */
.finding-edit-recovery-banner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background-color: #FEF3C7; /* amber-100 */
  border: 1px solid #F59E0B; /* amber-500 */
  border-radius: 6px;
  font-size: 13px;
  color: #78350F; /* amber-900 */
}
/* F14 (manual-test ripple): banner now stacks one row per draft (direct
   edit + each AI brouillon). Each row keeps the original horizontal
   layout — label on the left, action button on the right. */
.finding-edit-recovery-banner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.finding-edit-recovery-banner-label {
  flex: 1;
}
.finding-edit-recovery-banner-button {
  background-color: #F59E0B;
  color: white;
  border: none;
  border-radius: var(--radius-button);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.finding-edit-recovery-banner-button:hover,
.finding-edit-recovery-banner-button:focus-visible {
  background-color: #D97706; /* amber-600 */
}

/* Edit-mode visual suppression (AC 10.6.16) — applied on the panel root
   when the editor mounts. Only the right-side controls (chip + checkmark
   + pen icon) and the bottom action row are hidden; the severity badge
   + confidence indicator stay visible per the wireframe. */
.detail-pane-editing .detail-header-badges-right .finding-reason-chip,
.detail-pane-editing .detail-header-badges-right .finding-state-checkmark,
.detail-pane-editing .modify-dropdown-trigger-top,
.detail-pane-editing .detail-action-buttons {
  display: none !important;
}

/* The confidence indicator value forces to "100%" per AC 10.6.10. We
   hide the original numeric content and add a pseudo-element with the
   forced value. The badge stays visible to preserve the layout. */
.detail-pane-editing .confidence-indicator-value {
  visibility: hidden;
  position: relative;
}
.detail-pane-editing .confidence-indicator-value::after {
  content: "100%";
  visibility: visible;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* ─── Finding editor (Task 3 — visual polish for Phase 2 mount) ────── */

.finding-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.finding-editor-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.finding-editor-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.finding-editor-field-active {
  border-color: var(--color-btn-primary, #2563EB);
  background-color: rgba(37, 99, 235, 0.04);
}
.finding-editor-label {
  font-size: 12px;
  font-weight: 600;
  color: #6B7280; /* gray-500 */
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.finding-editor-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #D1D5DB; /* gray-300 */
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}
.finding-editor-input:focus {
  outline: 2px solid var(--color-btn-primary, #2563EB);
  outline-offset: 1px;
}
.finding-editor-confidence-readonly {
  font-size: 13px;
  color: #6B7280;
  font-style: italic;
}
.finding-editor-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #E5E7EB;
}
.finding-editor-finish-btn {
  background-color: var(--color-btn-primary, #2563EB);
  color: white;
  border: none;
  border-radius: var(--radius-button);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.finding-editor-finish-btn:hover,
.finding-editor-finish-btn:focus-visible {
  background-color: var(--color-btn-primary-hover, #1D4ED8);
}
.finding-editor-cancel-btn {
  background-color: transparent;
  color: #374151;
  border: 1px solid #D1D5DB;
  border-radius: var(--radius-button);
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}
.finding-editor-cancel-btn:hover,
.finding-editor-cancel-btn:focus-visible {
  background-color: #F9FAFB;
}
.finding-editor-save-state {
  font-size: 12px;
  color: #6B7280;
  margin-left: auto;
}
.finding-editor-save-state-error {
  color: #B91C1C; /* red-700 */
  font-weight: 500;
}

/* ─── Cancel-confirmation popup (F20-redo manual-test ripple) ───────
   The overlay-backdrop + centered-dialog pattern matches the project's
   modal convention (same backdrop token as `.chat-modal-backdrop`). The
   dialog gets the canonical `.surface-elevated` background, a 1px subtle
   border, and box-shadow so it visibly sits above the underlying editor.
   Buttons use `.btn-secondary` / `.btn-destructive` from the project
   palette (no inline overrides). */
.finding-editor-cancel-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay-backdrop, rgba(0, 0, 0, 0.5));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}
.finding-editor-cancel-dialog {
  background: var(--color-surface-elevated, white);
  border: 1px solid var(--color-border-subtle, #e5e7eb);
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.finding-editor-cancel-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary, #111827);
}
.finding-editor-cancel-body {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text-secondary, #374151);
}
.finding-editor-cancel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ─── Edit-history side drawer (Task 6) ────────────────────────────── */

.finding-edit-history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
}
.finding-edit-history-drawer {
  width: min(480px, 90vw);
  height: 100vh;
  background: white;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.finding-edit-history-drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #E5E7EB;
  /* Story 10.11c Task 8.6 — `flex-wrap: wrap` lets `.audit-chain-head-current`
     (flex-basis: 100%) drop to a new line below the title/count/close row.
     Side-effect-free for the existing 3-item layout (no item carries
     `flex-basis: 100%`, so wrap never triggers without an explicit opt-in). */
  flex-wrap: wrap;
}
.finding-edit-history-drawer-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.finding-edit-history-drawer-count {
  background: #F3F4F6;
  color: #6B7280;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
}
.finding-edit-history-drawer-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #6B7280;
  padding: 0 4px;
}
/* Story 10.11c Task 8.6 (Beat directive 2026-05-08) — chain-head badge in
   the audit-trail drawer header. The full hash lives in the title attribute
   for hover-verify; the visible token is the 12-char prefix + ISO timestamp.
   `flex-basis: 100%` on this element + `flex-wrap: wrap` on the parent
   `.finding-edit-history-drawer-header` (set above) drop the badge to a
   new line below the existing title / count / close-button row.
   Font-family + color route through the project's CSS chokepoints
   (canonical 6-font monospace stack used elsewhere in the file +
   `--color-gray-600` from `:root`) so a brand-token rebrand picks them
   up without per-rule rewrites. */
.audit-chain-head-current {
  flex-basis: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: var(--color-gray-600);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audit-chain-head-current[hidden] {
  display: none;
}
.finding-edit-history-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.finding-edit-history-drawer-empty {
  font-style: italic;
  color: #6B7280;
}
.finding-edit-history-entry {
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #FAFAFA;
}
.finding-edit-history-entry-undone {
  opacity: 0.6;
  text-decoration: line-through;
}
.finding-edit-history-entry-undone .finding-edit-history-entry-undone-badge {
  text-decoration: none;
}
.finding-edit-history-entry-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.finding-edit-history-entry-icon {
  font-size: 14px;
}
.finding-edit-history-entry-time {
  color: #6B7280;
  font-variant-numeric: tabular-nums;
}
.finding-edit-history-entry-label {
  font-weight: 500;
}
.finding-edit-history-entry-undone-badge {
  margin-left: auto;
  background: #FEE2E2;
  color: #991B1B;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 500;
}
.finding-edit-history-entry-summary {
  margin: 0;
  font-size: 13px;
  color: #374151;
}
.finding-edit-history-entry-conversation-pill {
  display: inline-block;
  background: #EDE9FE;
  color: #5B21B6;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  align-self: flex-start;
}
.finding-edit-history-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}
.finding-edit-history-entry-action-btn {
  background: transparent;
  border: none;
  color: var(--color-btn-primary, #2563EB);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.finding-edit-history-entry-action-btn:hover {
  text-decoration: underline;
}
.finding-edit-history-entry-diff {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  font-size: 12px;
}
.finding-edit-history-entry-diff-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.finding-edit-history-entry-diff-old {
  color: #991B1B;
  font-family: ui-monospace, SFMono-Regular, monospace;
  white-space: pre-wrap;
}
.finding-edit-history-entry-diff-new {
  color: #065F46;
  font-family: ui-monospace, SFMono-Regular, monospace;
  white-space: pre-wrap;
}
.finding-edit-history-entry-diff-inline {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.5;
}

/* Word-level diff highlighting (shared between Modify-with-AI [👁 Différences]
   expansion and Historique des modifications drawer). Red strikethrough
   on removed text, green underline on added text. Reuses the canonical
   severity-high (red) + state-approved (green) tokens — same semantic
   pairing the rest of the codebase uses for negative / positive UI cues. */
.finding-modify-diff-removed {
  background: var(--color-severity-high-bg);
  color: var(--color-severity-high-text);
  text-decoration: line-through;
  text-decoration-color: var(--color-severity-high-text);
  padding: 0 2px;
  border-radius: 2px;
}
.finding-modify-diff-added {
  background: var(--color-state-approved-bg);
  color: var(--color-state-approved);
  text-decoration: underline;
  text-decoration-color: var(--color-state-approved);
  padding: 0 2px;
  border-radius: 2px;
}
.finding-edit-history-entry-conversation {
  padding: 8px;
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
}
.finding-edit-history-entry-conversation-feedback {
  margin: 0;
  padding: 0 0 0 8px;
  border-left: 2px solid #C7D2FE;
  font-style: italic;
  color: #374151;
  font-size: 13px;
}
.finding-edit-history-entry-conversation-pruned {
  margin: 6px 0 0;
  font-size: 12px;
  color: #6B7280;
  font-style: italic;
}
.finding-edit-history-entry-diff-empty {
  margin: 0;
  font-style: italic;
  color: #6B7280;
}

/* ─── Audit-trail drawer (Story 10.7) ──────────────────────────────── */

/* The drawer reuses `.finding-edit-history-overlay` + `.finding-edit-history-drawer`
   chrome (overlay, slide-in panel, header, count pill, close button) from
   the Story 10.6 styles above, adding `.audit-trail-drawer` only as a
   scope hook. Audit-specific styling lives below: filter row, entry rows
   (denser than 10.6), structured diff, scope chips. */

.audit-trail-drawer {
  width: min(640px, 95vw);
}

/* Slide-in / fade animation (smoke-fix 2026-05-01). The audit-trail
   drawer mounts with `.is-animated` on the overlay; JS adds `.is-open`
   on the next paint to trigger the enter transition, removes it again
   on close to reverse. The Story 10.6 edit-history drawer reuses the
   `.finding-edit-history-overlay` class WITHOUT `.is-animated`, so its
   instant-mount behavior is unchanged. */
.audit-trail-drawer-overlay.is-animated {
  background: rgba(0, 0, 0, 0);
  transition: background 180ms ease-out;
}
.audit-trail-drawer-overlay.is-animated.is-open {
  background: var(--color-overlay-backdrop, rgba(0, 0, 0, 0.4));
}
.audit-trail-drawer-overlay.is-animated .audit-trail-drawer {
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}
.audit-trail-drawer-overlay.is-animated.is-open .audit-trail-drawer {
  transform: translateX(0);
}
@media (prefers-reduced-motion: reduce) {
  .audit-trail-drawer-overlay.is-animated,
  .audit-trail-drawer-overlay.is-animated .audit-trail-drawer {
    transition: none;
  }
}

.audit-trail-drawer-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid #E5E7EB;
  background: #F9FAFB;
}
.audit-trail-drawer-filters select {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  font-size: 13px;
  padding: 6px 28px 6px 10px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  background-color: #FFFFFF;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%236B7280' stroke-width='1.5'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px 8px;
  color: #111827;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-overflow: ellipsis;
}
.audit-trail-drawer-filters select:focus-visible {
  outline: 2px solid var(--color-btn-primary, #2563EB);
  outline-offset: 1px;
}
.audit-trail-drawer-body {
  gap: 8px;
}

.audit-entry {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  background: #FFFFFF;
}
.audit-entry-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
}
.audit-entry-time {
  color: #6B7280;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Story 10.11c Task 8.6 — per-row content_hash short-form (12-char). Sits
   next to the timestamp in the entry header; full hash on hover via the
   `title` attribute. Light gray monospace mirrors the chain-head badge in
   the drawer header — the chain semantics are visually consistent. */
.audit-entry-hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: var(--color-gray-400);
  background: transparent;
  padding: 0;
  white-space: nowrap;
  cursor: help;
}
.audit-entry-scope {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 8px;
  background: #F3F4F6;
  color: #4B5563;
  white-space: nowrap;
}
.audit-entry-scope-audit-scope-finding {
  background: #DBEAFE;
  color: #1E3A8A;
}
.audit-entry-scope-audit-scope-analysis {
  background: #EDE9FE;
  color: #4C1D95;
}
.audit-entry-scope-audit-scope-project {
  background: #FEF3C7;
  color: #78350F;
}
.audit-entry-action-label {
  flex: 1 1 auto;
  font-weight: 500;
  color: #111827;
  word-break: break-word;
}
/* Story 11.33 AC 11.33.7 — the change-author line ("par {name}"). Without an
   explicit rule the bare <p> inherited the drawer's 16px base and rendered
   noticeably larger than the 13px header just above it; match the header size
   and use the muted metadata gray. */
.audit-entry-actor {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #6B7280;
}
.audit-entry-finding-title {
  flex: 1 1 100%;
  font-size: 12px;
  color: #4B5563;
  font-style: italic;
}
.audit-entry-undone-suffix,
.audit-entry-conversation-suffix {
  margin: 0;
  font-size: 12px;
  color: #6B7280;
  font-style: italic;
}

/* Diff details — replaces the iter-1 raw JSON.stringify dump with a
   structured field-by-field old → new view. */
.audit-entry-diff > summary {
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  color: var(--color-btn-primary, #2563EB);
  padding: 2px 0;
  user-select: none;
}
.audit-entry-diff > summary::-webkit-details-marker {
  display: none;
}
.audit-entry-diff > summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 4px;
  transition: transform 0.15s ease;
}
.audit-entry-diff[open] > summary::before {
  transform: rotate(90deg);
}
.audit-entry-diff-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding: 10px 12px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  font-size: 12px;
}
/* Reuses the .chat-finding-card-section / .chat-finding-card-label /
   .chat-finding-card-value classes for label + value visual rhythm —
   same DRY pattern as the Story 10.6 finding-edit-history drawer. The
   audit-entry-diff-* hooks below ride along for any drawer-specific
   overrides. */
.audit-entry-diff-row + .audit-entry-diff-row {
  margin-top: 6px;
}
.audit-entry-diff-row-label {
  margin-bottom: 2px;
}
.audit-entry-diff-inline {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.45;
}
.audit-entry-diff-empty {
  margin: 0;
  font-style: italic;
  color: #6B7280;
}

/* Annulation/Rétablissement target link (smoke-fix 2026-05-01).
   Clicking this anchor inside the drawer body scrolls the target
   audit_log entry into view and applies a 4s fade highlight. Inline
   link affordance — same color scheme as other clickable hints. */
.audit-entry-target-link {
  color: var(--color-btn-primary, #2563EB);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
}
.audit-entry-target-link:hover,
.audit-entry-target-link:focus-visible {
  color: #1D4ED8;
  outline: none;
}

/* Finding-title chip link (smoke-fix 2026-05-01). The whole chip text
   is clickable; trailing ↗ arrow is the visual "go elsewhere" cue.
   Click closes the drawer + opens the finding's detail pane in the
   host page — same UX as clicking the list item directly. */
.audit-entry-finding-title a.audit-entry-finding-link {
  color: var(--color-btn-primary, #2563EB);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
  font-style: normal;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.audit-entry-finding-title a.audit-entry-finding-link:hover,
.audit-entry-finding-title a.audit-entry-finding-link:focus-visible {
  color: #1D4ED8;
  outline: none;
}
.audit-entry-finding-link-arrow {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  /* Slight lift so the arrow optically aligns with the cap-line of the
     surrounding French text (which sits visually high in the chip). */
  margin-bottom: 1px;
}
@keyframes audit-entry-highlight-fade {
  0%   { background-color: var(--color-amber-200, #FDE68A); }
  20%  { background-color: var(--color-amber-200, #FDE68A); }
  100% { background-color: transparent; }
}
.audit-entry.is-highlighted {
  animation: audit-entry-highlight-fade 4s ease-out forwards;
}
@media (prefers-reduced-motion: reduce) {
  .audit-entry.is-highlighted {
    animation: none;
    /* Static target indicator for users who opt out of motion. */
    background-color: var(--color-amber-100, #FEF3C7);
  }
}

/* Report-level overflow menu (Story 10.7 — `[☰]` next to Export). The
   menu is portal-mounted to <body> via `mount_report_actions_menu`, so
   styling lives at the top level (not nested under any container).
   Mirrors the Story 10.6 `.finding-action-dropdown-row` chrome below
   with adjusted spacing for menu items vs. table rows. */
.report-actions-menu {
  min-width: 220px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.report-actions-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: #111827;
  text-align: left;
  border-radius: 6px;
  font-family: inherit;
}
.report-actions-menu-item:hover,
.report-actions-menu-item:focus-visible {
  background: #F3F4F6;
  outline: none;
}
.report-actions-menu-item-icon {
  font-size: 16px;
  line-height: 1;
  color: var(--color-btn-primary, #2563EB);
  display: inline-flex;
  align-items: center;
}
.report-actions-menu-item-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* ─── Finding action dropdown chrome (Task 4) ──────────────────────── */

.finding-action-dropdown-row:focus-visible {
  outline: 2px solid var(--color-btn-primary, #2563EB);
  outline-offset: -2px;
}

/* ============================================================================
   Story 10.9: feedback icons + dialog
   ============================================================================ */

/* Iter-9 (Beat 2026-05-07 Bug 19 round-4): drop the visible 1px line.
 * The 18px-tall coloured span between Modifier and the thumbs read as
 * "small vertical line, around half the height of the buttons" — visual
 * glitch. Beat directive: "remove the background, as that divider is
 * not needed". The element is kept as a layout spacer (margin:0 8px on
 * desktop) for the existing keyboard-shortcut help-overlay grouping —
 * but with `background: transparent` and the height adjusted to match
 * the button height, it no longer renders any visible line. */
.feedback-icons-divider {
  display: inline-block;
  width: 1px;
  height: 40px;
  background: transparent;
  margin: 0 8px;
  vertical-align: middle;
}

/* Split-button wrapper — the two thumb icons read as a single segmented
   control (1 button visually, 2 click targets) at the same height as the
   action buttons (Retenir / Modifier / Écarter). Shared rounded border;
   the seam between the two halves is a single 1px right-border on the
   first half. Mirrors the .undo-redo-split-button pattern. */
.feedback-thumbs-split {
  display: inline-flex;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
}

.feedback-icon-btn {
  background: transparent;
  border: none;
  border-radius: 0;
  /* Vertical padding matches .btn-action-secondary (10px) so the split
     button stands the same height as the action buttons next to it. */
  padding: 10px 14px;
  cursor: pointer;
  color: var(--color-gray-500, #6b7280);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 150ms ease;
}
.feedback-thumbs-split > .feedback-icon-btn:first-child {
  border-right: 1px solid var(--color-border-subtle);
}

.feedback-icon-btn:hover {
  background: var(--color-gray-100, #f3f4f6);
  color: var(--color-gray-700, #374151);
}

.feedback-icon-btn--filled.feedback-icon-btn--positive {
  color: var(--color-feedback-positive);
  background: var(--color-state-approved-bg, #dcfce7);
}

.feedback-icon-btn--filled.feedback-icon-btn--negative {
  color: var(--color-feedback-negative);
  background: var(--color-state-rejected-bg, #fee2e2);
}

.feedback-icon-btn--saving {
  opacity: 0.6;
  pointer-events: none;
}

/* Per-analysis feedback button — smiling-face icon serves as the permanent
   call-to-action affordance (Beat post-impl design 2026-05-04: replaces
   the prior chat-bubble + full-width amber banner). The button's visual
   state machine has TWO modes today: (a) default — yellow smiling face;
   (b) submitted — green check badge overlays the bottom-right of the
   face. The pre-10.10 red/green polarity classes (`--filled-positive`
   / `--filled-negative`) were dropped — they were 10.9 thumbs-era
   semantics that don't apply to the 10.10 emoji-Likert flow. */
.feedback-analysis-btn {
  background: transparent;
  border: 1px solid var(--color-gray-300);
  padding: 0.25rem 0.375rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.feedback-analysis-btn:hover {
  background: var(--color-amber-100);
  border-color: var(--color-feedback-emoji-selected);
  transform: scale(1.05);
}
.feedback-analysis-btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--color-primary-600, #0E429B);
}

.feedback-analysis-btn-icon-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.feedback-analysis-btn-face {
  display: block;
}

/* Green-check submitted badge overlays the bottom-right of the face.
   Hidden by default — JS toggles `feedback-analysis-btn--submitted` on
   the button when a feedback row exists for this analysis. */
.feedback-analysis-btn-check {
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: none;
  border-radius: 50%;
  /* Subtle white halo so the green badge reads against the yellow face. */
  box-shadow: 0 0 0 1.5px #ffffff;
}

.feedback-analysis-btn--submitted .feedback-analysis-btn-check {
  display: block;
}

/* ─── Dialog overlay + card ─────────────────────────────────────────────── */

.feedback-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 150ms ease-out;
}

.feedback-dialog-overlay--modal {
  align-items: center;
}

.feedback-dialog-overlay--open {
  opacity: 1;
}

.feedback-dialog {
  background: var(--color-bg-primary, #fff);
  width: 90%;
  max-width: 560px;
  border-radius: 8px 8px 0 0;
  padding: 20px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  transition: transform 250ms ease-out;
}

.feedback-dialog-overlay--modal .feedback-dialog {
  border-radius: 8px;
  transform: scale(0.95);
  transition: transform 150ms ease-out;
}

.feedback-dialog-overlay--open .feedback-dialog {
  transform: translateY(0);
}

.feedback-dialog-overlay--modal.feedback-dialog-overlay--open .feedback-dialog {
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .feedback-dialog-overlay,
  .feedback-dialog {
    transition: none !important;
  }
}

.feedback-dialog-title {
  margin: 0 0 12px;
  font-size: 1.1em;
  font-weight: 600;
  color: var(--color-gray-900, #111827);
}

.feedback-dialog-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.feedback-thumb-button {
  background: var(--color-bg-primary, #fff);
  border: 1px solid var(--color-gray-300, #d1d5db);
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--color-gray-600, #4b5563);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Modal mode (per-analysis) — larger thumb glyph but the button itself
   stays tight (no extra horizontal padding) so the click target wraps
   the SVG snugly. */
.feedback-dialog--modal .feedback-thumb-button {
  padding: 6px 8px;
}
.feedback-dialog--modal .feedback-thumb-button svg {
  width: 28px;
  height: 28px;
}
.feedback-dialog--drawer .feedback-thumb-button {
  padding: 6px 8px;
}
.feedback-dialog--drawer .feedback-thumb-button svg {
  width: 22px;
  height: 22px;
}

.feedback-thumb-button:hover {
  background: var(--color-gray-50);
}

.feedback-thumb-button--positive.feedback-thumb-button--active {
  background: var(--color-state-approved-bg, #dcfce7);
  color: var(--color-feedback-positive);
  border-color: var(--color-feedback-positive);
}

.feedback-thumb-button--negative.feedback-thumb-button--active {
  background: var(--color-state-rejected-bg, #fee2e2);
  color: var(--color-feedback-negative);
  border-color: var(--color-feedback-negative);
}

.feedback-dialog-textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 96px;
  padding: 8px;
  font: inherit;
  border: 1px solid var(--color-gray-300, #d1d5db);
  border-radius: 4px;
  field-sizing: content;
  max-height: 50vh;
}

/* Shared status slot — modify-with-AI checkbox + min-chars warning
   stack on the same grid cell so they share one reserved area below the
   textarea. Only one is visible at a time (visibility, not display) so
   the dialog height is invariant across all states. */
.feedback-dialog-status-slot {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 6px;
  min-height: 28px;
}
.feedback-dialog-status-slot > * {
  grid-row: 1;
  grid-column: 1;
}
.feedback-dialog-min-chars-hint {
  font-size: 0.8em;
  color: var(--color-gray-500);
}

.feedback-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

/* Drawer mode (per-finding) — stack actions vertically below the
   textarea so Submit reads as a clear "below" primary action with air
   around it. Cancel sits underneath. Both span full width — keeps the
   layout breathable when the modify-with-AI checkbox row is hidden
   (free-form 👍 path, where the previous flex-row layout felt squeezed).
   Modify-with-AI row also gets vertical breathing room. */
.feedback-dialog--drawer {
  padding: 24px 28px 22px;
}
.feedback-dialog--drawer .feedback-dialog-status-slot {
  margin: 14px 0 0;
  min-height: 32px;
}
.feedback-dialog--drawer .feedback-dialog-actions {
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 10px;
  margin-top: 4px;
}
.feedback-dialog--drawer .feedback-dialog-submit,
.feedback-dialog--drawer .feedback-dialog-cancel {
  width: 100%;
  padding: 10px 16px;
  justify-content: center;
}

/* ============================================================================
 * Story 10.10 — 5-emoji modal, validation pattern, banner glow,
 * cancelled-analysis chrome.
 * ============================================================================ */

/* 5-emoji selector — primary CTA at modal-open. */
.feedback-dialog-emoji-selector {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 16px 0 12px;
}
.feedback-emoji-button {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 6px;
  cursor: pointer;
  /* Emojis are self-coloured (yellow body + dark features) — no `color`
     inherit. Beat post-impl design (2026-05-04): drop the gray
     currentColor scheme; the highlighted background on hover provides
     the affordance, the rounded yellow rectangle marks selection. */
  transition: background 150ms, border-color 150ms, transform 100ms;
}
.feedback-emoji-button:hover {
  /* Soft amber tint to highlight the hovered emoji without competing
     with the yellow body. */
  background: var(--color-amber-100);
}
.feedback-emoji-button:focus-visible {
  outline: none;
  border-color: var(--color-feedback-emoji-selected);
}
.feedback-emoji-button--active {
  border-color: var(--color-feedback-emoji-selected);
  background: var(--color-amber-100);
  transform: scale(1.05);
}

/* Story 10.10 Beat post-impl design (2026-05-04, 11th pass): selected-
   emoji label row — 5 cells mirroring the emoji selector's flex layout
   so each cell sits directly under its corresponding emoji. Only the
   selected emoji's cell gets text; pre-allocated `min-height` on the row
   prevents layout jump. Per-cell text-alignment keeps the label centered
   UNDER the emoji (positions 2-4) or anchored to the box edge (1 and 5).
   Cells overflow horizontally so longer labels (~120px "Très insatisfait")
   extend without wrapping or pushing siblings. */
.feedback-dialog-emoji-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-height: 1.5em;
  margin: 6px 0 12px;
  padding: 0 4px;
}
.feedback-dialog-emoji-label-cell {
  flex: 0 0 40px; /* matches emoji button viewBox width */
  font-size: 1.05em;
  font-weight: 600;
  color: var(--color-gray-900, #111827);
  text-align: center;
  white-space: nowrap;
  overflow: visible;
}
.feedback-dialog-emoji-label-cell--pos-1 { text-align: left; }
.feedback-dialog-emoji-label-cell--pos-5 { text-align: right; }

/* Suggestions textarea + cancellation row — animated reveal. */
.feedback-dialog--emoji-likert .feedback-dialog-textarea--suggestions {
  width: 100%;
  margin-top: 10px;
  transition: opacity 350ms ease-out 100ms, max-height 350ms ease-out;
}
.feedback-dialog-cancellation-row {
  transition: max-height 350ms ease-out;
}

/* Generalized validation pattern — red border + inline hint per AC 10.10.10. */
.feedback-validation-error {
  border: 1px solid var(--color-state-rejected) !important;
  outline: none;
}
.feedback-validation-hint {
  color: var(--color-state-rejected);
  font-size: 0.85em;
  margin: 4px 0 6px;
}

/* First-analysis banner — full-width hand-raise CTA. */
.first-analysis-feedback-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--color-amber-100);
  border-bottom: 1px solid var(--color-amber-200);
  font-size: 0.95em;
  color: var(--color-amber-900);
}
.first-analysis-feedback-banner-cta {
  background: var(--color-feedback-emoji-selected);
  color: var(--color-on-action-primary);
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 500;
  border: none;
  cursor: pointer;
}
.first-analysis-feedback-banner-cta:hover { filter: brightness(0.85); }
.first-analysis-feedback-banner-dismiss {
  background: transparent;
  border: none;
  color: var(--color-amber-900);
  font-size: 1.4em;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}

/* Glow keyframes per Decision 11 — body-class drives the pulse on the
   `[💬]` button. Stops on first interaction (click / hover ≥ 800ms /
   submit-success); the JS removes the body class. */
@keyframes feedback-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(202, 138, 4, 0); }
  50%      { box-shadow: 0 0 0 6px rgba(202, 138, 4, 0.4); }
}
body.feedback-banner-active .feedback-analysis-btn {
  animation: feedback-glow 2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  body.feedback-banner-active .feedback-analysis-btn { animation: none; }
}

/* Story 10.10 — cancelled analysis state in the analyses dropdown.
   Visible-but-disabled per AC 10.10.14 (greyed background, strike-through
   text, reduced opacity, "Annulée" chip). */
.analysis-row--cancelled {
  background: var(--color-gray-100, #f3f4f6);
  opacity: 0.7;
}
.analysis-row--cancelled .analysis-summary,
.analysis-row--cancelled span:not(.analysis-cancelled-chip) {
  text-decoration: line-through;
}
.analysis-cancelled-chip {
  display: inline-block;
  background: var(--color-gray-200, #e5e7eb);
  color: var(--color-gray-700, #374151);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.75rem;
  margin-left: 6px;
}

/* ===========================================================================
 * Story 10.11b — per-analysis finding labels (top-level + sub-finding badges).
 *
 * The badge sits to the left of the title on every finding card AND inside
 * the detail-panel accordion sub-finding rows. Same visual treatment in both
 * places — single CSS class, same paint helper in results.js.
 *
 * Rejected greying (Decision 18): labels reflect export-walk order so on
 * screen they appear interleaved out of strict numeric order. The opacity
 * cue tells the user "these labels are valid, you're just in the screen
 * view, not the export view." NO textual caption per Beat decision —
 * greying is self-explanatory.
 *
 * `.finding-card` is a forward-compatible selector — today the cards carry
 * `.finding-item` and `data-state` is set on `.finding-item`. Both selectors
 * apply so the rule keeps working if a future refactor renames the wrapper.
 * ========================================================================= */
.finding-label {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  font-weight: 600;
  color: var(--color-gray-700, #374151);
  background: var(--color-gray-100, #f3f4f6);
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 6px;
  vertical-align: baseline;
  min-width: 2.25em;
  text-align: center;
}
.finding-label[hidden] {
  display: none;
}
.finding-item[data-state="rejected"] .finding-label,
.finding-card[data-state="rejected"] .finding-label,
.sub-finding-item[data-state="rejected"] .finding-label {
  opacity: var(--opacity-rejected);
}

/* Story 10.11c (AC 10.11c.HINT.1) — Shift-held mnemonic-hint badge.
 * Each registered chord button receives `data-shortcut-action="ctx:id"`
 * + a `--shortcut-hint` CSS custom property carrying the chord-display
 * token (e.g. '"↑E"', '"A"', JSON.stringify-wrapped for `content:`
 * consumption). The badge sits in the bottom-right corner of the button
 * with the button's own bg color at 85% alpha to mask underlying text.
 *
 * Per-button background override: chord-button consumers with a
 * non-default background must add `--shortcut-hint-bg: <their bg>`
 * on the same selector so the badge masks visibly (CLAUDE.md DRY-colors).
 *
 * `pointer-events: none` keeps the badge from absorbing clicks meant
 * for the button itself. `position: absolute` requires the host to be
 * positioned — the `[data-shortcut-action]` rule below sets
 * `position: relative` to guarantee a positioning context.
 */
[data-shortcut-action] {
  position: relative;
}

[data-shortcut-action]::after {
  content: var(--shortcut-hint);
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 0.7em;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 2px;
  background-color: var(--shortcut-hint-bg);
  opacity: var(--shortcut-hint-opacity);
  pointer-events: none;
  display: none;
  color: inherit;
}

body.shift-held [data-shortcut-action]::after {
  display: block;
}

/* Per-button background overrides — keep the badge's mask visible against
 * each button's actual background. Default `--shortcut-hint-bg` (white)
 * is fine on white-bg buttons; coloured buttons MUST override. */
.btn-action-primary[data-shortcut-action] {
  --shortcut-hint-bg: var(--color-btn-primary);
}
.btn-primary[data-shortcut-action] {
  --shortcut-hint-bg: var(--color-btn-primary);
}

/* ============================================================================
   Story 10.11c — Mobile/tablet polish (Tasks 4.5, 4.6, 4.8, 4.9, 4.12, 4.13)
   Each block targets ONE issue from the Beat-supplied 10-bug seed.
   ============================================================================ */

/* Task 4.6 (Issue 3): root-cause overflow control. Prevents the page chrome
 * from being draggable / horizontally-scrollable on mobile (which would
 * expose the cut-off top-bar region). NOT a viewport-meta zoom-disable —
 * `user-scalable=no` violates WCAG 2.1 SC 1.4.4. The overflow rule on body
 * is the structural fix; per-element flex/min-width audits below close the
 * remaining holes.
 *
 * Scoped to ≤1023px (mobile + tablet) so desktop layout — including
 * `.evidence-pane-title { position: sticky }` (styles.css:2656) — stays
 * unaffected. `overflow-x: hidden` on the document creates a containing
 * block that interferes with sticky positioning; mobile-only scope
 * preserves the desktop sticky contract.
 *
 * Iter-9 (Beat 2026-05-07 Bug 24): `overflow-x: hidden` per CSS spec
 * forces `overflow-y` away from `visible` — on mobile this can break
 * single-finger vertical scroll on the Projets list ("not scrollable
 * on mobile, just cropped at bottom" — Beat). `overflow-x: clip`
 * (Chrome 90+, Firefox 81+, Safari 16+) clips horizontally WITHOUT
 * affecting overflow-y. Cascade fallback: if `clip` unsupported, the
 * `hidden` declaration above wins. */
@media (max-width: 1023px) {
  html, body {
    overflow-x: hidden;
    overflow-x: clip;
    max-width: 100vw;
  }
  body {
    overscroll-behavior: contain;
  }
}

/* Task 4.5 (Issue 2) + Task 4.8 (Issue 5): page-header DRY tokens. Used by
 * `apps/api/public/lib/page-header.js` AND the Results-page hand-rolled
 * header (which the helper mirrors). Tokens-first so theme changes happen
 * in one place. */
:root {
  --page-header-padding: 0.625rem 1.25rem;
  --page-header-title-font-size: 1rem;
  --page-header-back-color: var(--color-gray-500, #6b7280);
  --page-header-spacing-back-to-title: 0.75rem;
}

.page-header {
  display: flex;
  align-items: center;
  gap: var(--page-header-spacing-back-to-title);
  padding: var(--page-header-padding);
  background: white;
  border-bottom: 1px solid var(--color-gray-200, #e5e7eb);
  min-width: 0;
}
/* Optional inner wrapper — pages with `<main class="max-w-4xl mx-auto">`
 * style content (e.g. /upload.html) wrap their header content in
 * `.page-header-inner` so the header line aligns with the centered main
 * column. Pages with full-width content (e.g. /results.html) skip the
 * wrapper. The wrapper inherits the same flex layout as `.page-header`
 * so children stack identically; padding moves up from `.page-header`
 * onto the wrapper to keep the white background full-width. */
.page-header:has(.page-header-inner) {
  padding: 0;
}
.page-header .page-header-inner {
  display: flex;
  align-items: center;
  gap: var(--page-header-spacing-back-to-title);
  padding: var(--page-header-padding);
  width: 100%;
  min-width: 0;
}
.page-header h1 {
  font-size: var(--page-header-title-font-size);
  font-weight: 600;
  color: var(--color-gray-900, #111827);
  margin: 0;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-header .nav-back-arrow {
  flex-shrink: 0;
}
/* Optional right-aligned actions container — e.g. `+ Nouveau projet` on
 * the Projets page. `margin-left: auto` pushes the actions to the right
 * edge without forcing a `justify-between` that would distort the
 * back-arrow + title spacing. */
.page-header .page-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Task 4.5 (Issue 2): Results-page header narrow-viewport polish.
 * Allow inner flex container to shrink so children can truncate.
 * Iter-4 (Beat post-impl 2026-05-07 Bug 13): the LEFT cluster (back-arrow +
 * title) needed `min-width: 0` too — without it the title was bleeding
 * into the Documents toggle on the right. The whole flex chain (inner-row
 * → LEFT cluster → h1 → results_project_name) now has `min-width: 0` so
 * the Tailwind `truncate` on results_project_name actually fires. */
#results_header > .flex-1 {
  min-width: 0;
}
#results_header > .flex-1 > .flex.items-center.gap-3 {
  min-width: 0;
  flex-shrink: 1;
}
#results_header #project_name {
  flex: 1 1 0;
  /* Story 11.41 — a FLOOR, not 0. The residency badge became a sibling of this
   * h1 in the header row (it used to be appended INSIDE it, where `truncate`
   * clipped it and the h1 intercepted its pointer events, so it had no hover
   * affordance — and in any case it never rendered, because the documents
   * response carried no `actual_confidentiality_mode` until this story).
   *
   * With `min-width: 0` the h1 yields 100% of its width to that sibling and the
   * project name renders as an empty box: measured 0.09px of h1 against a
   * 369px badge in a 438px row at 1280px viewport, with the name's own span
   * still 308px wide and entirely clipped. The badge truncates instead (rule
   * below); the name always keeps a readable stub. */
  min-width: 6rem;
  overflow: hidden;
}

/* The residency chips are flex ITEMS of that same row (Story 11.41). They must
 * be able to shrink, or the row overflows into the right-hand controls at
 * narrow widths — the chip text is long ("Confidentialité maximale — analyse
 * Swiss-hosted"). `display: inline-block` rather than the chips' default
 * `inline-flex` so `text-overflow: ellipsis` applies to their own text; they
 * carry a single text node, so the `gap` those rules set is inert anyway.
 * Scoped to #results_header: the same classes render on the project list
 * (`upload.js`), where they sit in a column and must keep their full text. */
#results_header .swiss-badge,
#results_header .tests-internes-badge,
#results_header .confidentiality-degraded-banner {
  min-width: 0;
  flex-shrink: 1;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#results_header .results-header-controls {
  /* Right-side cluster keeps natural width; LEFT shrinks first via the
   * truncation chain above. */
  flex-shrink: 0;
}

/* Tablet + mobile: hide keyboard-driven review-progress text+bar. Iter-5
 * (Beat 2026-05-07 Bug 22a): undo/redo controls used to be hidden too, but
 * Beat needs them on mobile (touch users undo per-action edits). Now they
 * stay visible and join the wrap at ≤639px. */
@media (max-width: 1023px) {
  #results_header .review-progress-stack {
    display: none;
  }
  #results_header .results-header-controls {
    gap: 0.75rem;
  }
}

/* Phone (≤639px): 2-line header wrap (Beat directive 2026-05-07 Bug 2):
 * "if width is not enough, extend vertically the space for 2 lines —
 * first is title, second is the 3 dots and other items missing".
 * Approach: `flex-wrap: wrap` on the inner row + each cluster takes
 * full width. Title prefix hidden; ALL controls visible (severity counts +
 * undo/redo + export + feedback + hamburger) — they wrap further within
 * row 2 if needed (iter-5 Beat 2026-05-07 Bug 22a hamburger + undo/redo
 * MUST stay visible on phone). */
@media (max-width: 639px) {
  #results_header > .flex-1 {
    flex-wrap: wrap;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  /* Row 1: back-arrow + title — full width of inner-row. */
  #results_header > .flex-1 > .flex.items-center.gap-3 {
    flex: 1 1 100%;
  }
  /* Row 2: ALL controls — flex-wrap inside so they overflow to row 2b/c
   * if row 2 still doesn't fit. Right-aligned so primary actions (export)
   * stay near the thumb-zone. */
  #results_header .results-header-controls {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding-top: 0.375rem;
    gap: 0.5rem;
  }
  #results_header .severity-counts {
    gap: 0.625rem;
  }
  #documents_toggle [data-i18n="results_documents_toggle"] {
    display: none;
  }
}

/* Iter-5 (Beat 2026-05-07 Bug 8 finalize): the global `?` keyboard-shortcut
 * help button is fixed bottom-right and overlays the per-finding feedback
 * button cluster on phone. Touch users don't use keyboard shortcuts;
 * hiding the button on coarse-pointer surfaces lets the feedback cluster
 * read cleanly. The shortcut overlay itself stays accessible via Shift+?
 * on bluetooth-keyboard tablets — only the FAB chrome is hidden. */
@media (pointer: coarse) {
  .keyboard-shortcut-help-button {
    display: none;
  }
}

/* Iter-5 (Beat 2026-05-07 Bug 19): right-swipe on a finding-item leaves a
 * white zone exposed where the translateX-animated card slides past the
 * findings panel's right edge. Root cause: `#findings_panel` had no
 * horizontal-overflow control, so during the swipe-cycle visual feedback
 * the translated card extended past its container creating a horizontal
 * scroll trail. `overflow-x: hidden` clips the swipe trail to the panel
 * boundary; the scroll-cycle still fires (the translateX animation is
 * still visible up to the panel edge). */
.findings-list,
#findings_panel {
  overflow-x: hidden;
}

/* Task 4.9 (Issue 6): WCAG 2.5.5 tap-target. The pencil trigger at the top
 * of the detail panel was 24×16 — well below the 44×44 minimum (and the
 * project's 48px touch-target token). Coarse-pointer media query scopes
 * the bump to touch surfaces only — desktop mouse keeps the compact
 * affordance. */
@media (pointer: coarse) {
  .modify-dropdown-trigger-top {
    min-height: var(--touch-target-min);
    min-width: var(--touch-target-min);
    padding: 8px 10px;
  }
  .modify-dropdown-trigger-bottom {
    min-height: var(--touch-target-min);
  }
  /* Iter-4 (Beat 2026-05-07 Bug 16/17): the prior fix made the checkmark
   * 48×48 to meet the WCAG tap-target minimum, but that size collision
   * with the pencil trigger to its right made it unrecognizable as a
   * checkbox. New approach: keep the VISIBLE checkbox at its existing
   * 22×22 (the recognizable affordance), extend the TAPPABLE area via an
   * `::after` pseudo-element with `position: absolute; inset: -13px` so
   * the hit-target is 48×48 (22 + 13×2 = 48). Pointer events on the
   * pseudo bubble to the parent button — same listener fires. The
   * `::before` pseudo carrying the ✓/✗ glyph is unaffected (it stays in
   * the button's normal flow). Applies to BOTH the list-row checkmark and
   * the detail-pane checkmark — they share the `.finding-state-checkmark`
   * class. */
  .finding-state-checkmark {
    position: relative;
  }
  .finding-state-checkmark::after {
    content: "";
    position: absolute;
    /* Extend each side by 13px → effective tap target = 22 + 26 = 48px. */
    inset: -13px;
    /* Ensure the hit-target wins over neighbors when their boxes overlap
     * (e.g. the pencil trigger sits ~5px to the right; without this the
     * pencil's larger `min-width: 48px` could capture taps that should
     * have hit the checkbox). */
    z-index: 1;
  }
}

/* Task 4.11 (Issue 8): feedback-icon-btn must render its SVG glyph at all
 * widths — the bug surface was the SVG getting flex-collapsed when the
 * action row overflowed. Pin natural size so the icon stays visible even
 * if the row crowds.
 *
 * Iter-4 (Beat post-impl 2026-05-07): SVG was STILL invisible. Root cause:
 * `.feedback-thumbs-split` (the inline-flex wrapper) was the flex-shrunk
 * element — its children survived but the wrapper itself collapsed to
 * zero width on iOS Safari, making both buttons invisible. `flex-shrink: 0`
 * on the wrapper is the load-bearing fix; SVG `display: block` prevents
 * the legacy inline-baseline behaviour that interacts badly with iOS Safari's
 * flex sizing pass. */
.feedback-thumbs-split {
  flex-shrink: 0;
}
.feedback-icon-btn {
  flex-shrink: 0;
}
.feedback-icon-btn svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: block;
}
@media (max-width: 639px) {
  /* Phone: action row tightens; thumbs split keeps natural size. The
   * Modifier label may compress to caret-only via flex-shrink on its
   * label span — no separate text-hide rule needed since caret has
   * `aria-hidden`. */
  .detail-action-buttons {
    gap: 0.5rem;
  }
  /* Iter-7 (Beat 2026-05-07 Bug 19 follow-up): drop the divider entirely
   * at phone widths — the gap-0.5rem already visually separates Modifier
   * from the thumbs cluster; the leftover 1px line read as a glitch
   * ("small vertical line, around half the height of the buttons" — Beat).
   */
  .feedback-icons-divider {
    display: none;
  }
  /* Iter-8 (Beat 2026-05-07 Bug 19 round-3): the .feedback-thumbs-split
   * wrapper itself has a 1px border that visually reads as another
   * small vertical line between Modifier and the thumb-up button on
   * narrow phones. The "split-button" segmented-control look (shared
   * border around two thumbs) isn't worth the extra visual noise on
   * mobile. Drop the wrapper border + the inner border-right divider
   * between the two thumbs (which is unnecessary when they have their
   * own backgrounds anyway). */
  .feedback-thumbs-split {
    border: none;
  }
  .feedback-thumbs-split > .feedback-icon-btn:first-child {
    border-right: none;
  }
}
@media (max-width: 400px) {
  /* Iter-6 (Beat 2026-05-07 Bug 19): on very narrow phones (Galaxy S-21
   * portrait = 360px), the action row's 5 elements still overflow even
   * with the divider gone. Drop the thumbs-DOWN button (the negative-
   * feedback half of the split) — users with negative feedback can still
   * use the global feedback dialog at the analysis level. Keeping
   * thumbs-up as the dominant affordance per Beat directive. */
  .detail-action-buttons .feedback-icon-btn--down {
    display: none;
  }
}

/* Task 4.12 (Issue 9): preview-modal centering + scale-to-fit at all
 * viewports. Image already has `object-contain max-w-full max-h-full` via
 * Tailwind utility classes — these rules anchor that contract via the
 * `.preview-image` test seam (DRY: the same selector the E2E spec asserts
 * against). PDF canvas inherits `m-auto` from the existing markup; this
 * block makes the centering rules viewport-agnostic. */
#preview_modal #preview_content {
  /* `safe center`: center a child when it fits, but fall back to start-alignment
     when it OVERFLOWS (zoomed-in PDF) so the leading edge stays scroll-reachable.
     Plain `center` clips the left/top of an overflowing flex item (max scrollLeft
     halved) in Chromium + Firefox — the "can't scroll fully left/up" bug.
     Story 12.23b code-review iter-1: this lived ONLY in the built styles.css and
     was reverted to plain `center` by a `build:css` rebuild — back-ported here. */
  align-items: safe center;
  justify-content: safe center;
  /* Beat smoke 2026-07-05 (item 7): positioning context for the absolutely-
     centred loading spinner / error message below. */
  position: relative;
}
/* Beat smoke 2026-07-05 (item 7): centre the loading spinner + error message in
   #preview_content. Its `justify-content: safe center` is tuned for the
   OVERFLOWING PDF/image scroll case (leading-edge reachable) and mis-placed a
   non-overflowing spinner against the right edge (margin:auto only half-centred
   it — auto margins race the safe-center free-space split). Take them out of the
   flex flow and centre absolutely — bulletproof, and invisible to the PDF/image
   flex layout (they're display:none while a spinner/error shows). */
#preview_loading,
#preview_error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}
#preview_image,
.preview-image,
#preview_canvas {
  /* Smoke-fix 2026-07-05 (Beat) — a click or a drag-pan must never select the
     image/canvas (the orange GTK/Ubuntu selection overlay), and the browser's
     native image-drag ghost must not hijack the pan. Scoped to the image +
     PDF canvas only, so text previews (transcripts, chapter lists) keep their
     selection. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
#preview_image,
.preview-image {
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  display: block;
}
/* Source-order/specificity guard (same class as `.btn-primary.hidden` and
   `.progress-modal-overlay.hidden`): preview-modal.js hides the <img> for every
   non-image preview by toggling `.hidden`, but the `#preview_image` ID selector
   above outranks Tailwind's `.hidden { display:none }`, so the <img> was never
   hidden — a broken-image placeholder carrying the previous image's filename
   stayed on screen above a video preview (Beat 2026-09-25). */
#preview_image.hidden,
.preview-image.hidden {
  display: none;
}

/* Task 4.13 (Issue 10): pinch-zoom scope isolation. The image element
 * receives `pinch-zoom` so two-finger gestures act on it; the modal
 * header + footer chrome receive `none` so gestures there don't leak
 * to the page (preventing the page-chrome-zoom bug Beat reported).
 * Manual gesture verification stays a host smoke-test step; this block
 * is the structural lock-in the E2E spec asserts against. */
#preview_image,
.preview-image {
  touch-action: pinch-zoom;
}
.preview-modal-header,
.preview-modal-controls,
#preview_modal > div > div > .flex.items-center.justify-between {
  touch-action: none;
}

/* ============================================================================
   Story 11.68 (FR-E11.179) — « Vu par l'IA » in the preview modal
   (`public/lib/seen-by-ai-view.js`). The view adds its own nodes (switch, line
   slot, overview, 1:1, loupe) and removes them at teardown — no change to the
   two modal markups. In « Vu par l'IA » the modal's own preview (canvas, image,
   spinner, error) is hidden by attribute, never by toggling its classes, so the
   original is shown again exactly as it was.
   ============================================================================ */
#preview_content[data-seen-by-ai="seen"] > :not(.seen-by-ai-view) {
  display: none !important;
}
.seen-by-ai-switch {
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-button);
  overflow: hidden;
  margin-left: auto;
  margin-right: 1rem;
}
.seen-by-ai-switch button {
  padding: 0.25rem 0.75rem;
  min-height: 36px;
  font-size: 0.875rem;
  color: var(--color-gray-700);
  background: var(--color-surface-elevated);
}
.seen-by-ai-switch button + button {
  border-left: 1px solid var(--color-border-subtle);
}
.seen-by-ai-switch button[aria-pressed="true"] {
  background: var(--color-primary-600);
  color: var(--color-on-action-primary);
}
/* No recorded image of this source: « Vu par l'IA » is shown but cannot be chosen; the line says why. */
.seen-by-ai-switch button:disabled {
  color: var(--color-gray-400);
  cursor: not-allowed;
}
.seen-by-ai-switch button:focus-visible,
.seen-by-ai-back:focus-visible,
.seen-by-ai-image-btn:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}
/* W4 — below 768 px the switch is a two-item segmented control under the title. */
@media (max-width: 767px) {
  .preview-modal-header.seen-by-ai-header {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
  .seen-by-ai-header .seen-by-ai-switch {
    order: 3;
    flex-basis: 100%;
    margin: 0;
  }
  .seen-by-ai-header .seen-by-ai-switch button {
    flex: 1 1 0;
  }
}
/* W5 — the one line under the title (not known, too large, remote, upper bound, error). */
.seen-by-ai-line {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--color-action-title);
  background: var(--color-action-bg);
  border-bottom: 1px solid var(--color-action-border);
}
.seen-by-ai-view {
  width: 100%;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.seen-by-ai-overview {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.seen-by-ai-intro {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--color-text-primary);
}
.seen-by-ai-hint,
.seen-by-ai-may-vary,
.seen-by-ai-loading,
.seen-by-ai-caption {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}
.seen-by-ai-loading.hidden,
.seen-by-ai-overview.hidden {
  display: none;
}
.seen-by-ai-images {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1rem;
  align-items: start;
}
.seen-by-ai-images.seen-by-ai-no-tiles {
  grid-template-columns: minmax(0, 1fr);
}
@media (max-width: 767px) {
  .seen-by-ai-images {
    grid-template-columns: minmax(0, 1fr);
  }
}
.seen-by-ai-whole,
.seen-by-ai-tiles-column,
.seen-by-ai-photo {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}
.seen-by-ai-tiles-column {
  gap: 1rem;
}
.seen-by-ai-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
}
.seen-by-ai-image-btn {
  display: block;
  max-width: 100%;
  padding: 0;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface-elevated);
  cursor: zoom-in;
  /* W4 — no callout, no selection: a hold is the loupe. */
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}
.seen-by-ai-image-btn img {
  display: block;
  max-width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}
.seen-by-ai-whole-btn {
  /* The button hugs the image: a reduced image narrower than the column is not stretched, nor framed wider. */
  width: fit-content;
}
.seen-by-ai-whole-btn img {
  max-height: 65vh;
  object-fit: contain;
}
.seen-by-ai-tile-grid {
  display: grid;
  gap: 0.25rem;
}
.seen-by-ai-tile-btn,
.seen-by-ai-tile-btn img {
  width: 100%;
}
.seen-by-ai-image-failed {
  cursor: default;
  padding: 0.5rem;
}
.seen-by-ai-image-error,
.seen-by-ai-photos-cause {
  font-size: 0.8125rem;
  color: var(--color-action-title);
}
/* Story 11.69 — a finding's source: one item per whole image sent (an image sent twice has two, each labelled by
   its send), the « Envoyée à » line or selector, the « may differ » mark, a selected remote group's note. */
.seen-by-ai-whole-item {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}
.seen-by-ai-whole-item + .seen-by-ai-whole-item {
  margin-top: 0.75rem;
}
.seen-by-ai-send {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-primary);
}
.seen-by-ai-sent-to-select {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.seen-by-ai-group-select {
  min-height: 36px;
  max-width: 100%;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-button);
  background: var(--color-surface-elevated);
  color: var(--color-text-primary);
  font-size: 0.875rem;
}
.seen-by-ai-group-select:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}
.seen-by-ai-may-differ {
  display: block;
  font-size: 0.75rem;
  color: var(--color-action-title);
}
.seen-by-ai-tile-btn .seen-by-ai-may-differ {
  padding: 0.125rem 0.25rem;
  text-align: left;
}
.seen-by-ai-remote-note {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--color-action-title);
  background: var(--color-action-bg);
  border: 1px solid var(--color-action-border);
  border-radius: var(--radius-button);
}
/* W3 — one image at 1:1 (one image pixel per CSS pixel; the size is set from the response). */
.seen-by-ai-one-to-one {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}
.seen-by-ai-one-to-one-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-primary);
}
.seen-by-ai-back {
  padding: 0.375rem 0.75rem;
  min-height: 36px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-button);
  background: var(--color-surface-elevated);
}
.seen-by-ai-one-to-one-badge {
  padding: 0 0.375rem;
  border-radius: var(--radius-button);
  background: var(--color-gray-200);
  font-size: 0.75rem;
}
.seen-by-ai-one-to-one-scroll {
  overflow: auto;
}
.seen-by-ai-one-to-one-scroll img {
  display: block;
  max-width: none;
  max-height: none;
}
/* The round 1:1 loupe (Beat D10 = B); it follows the pointer and never takes it. */
.seen-by-ai-loupe {
  --seen-by-ai-loupe-size: 10rem;
  position: fixed;
  z-index: 60;
  width: var(--seen-by-ai-loupe-size);
  height: var(--seen-by-ai-loupe-size);
  border-radius: 50%;
  border: 2px solid var(--color-surface-elevated);
  box-shadow: var(--shadow-modal);
  background-color: var(--color-surface-elevated);
  background-repeat: no-repeat;
  pointer-events: none;
}
.seen-by-ai-loupe.hidden {
  display: none;
}

/* ============================================================================
   Story 11.2 — non-blocking session-warning banner.
   NOT a modal — uses role="status" + aria-live="polite". Document-level
   keyboard chords keep working underneath (NFR-E10.35 modal-keyboard-scope
   exemption). Colors via existing project amber custom properties
   (CLAUDE.md DRY rule: no hardcoded hex).
   ============================================================================ */
#session-warning-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background-color: var(--color-amber-100);
  color: var(--color-amber-800);
  border-bottom: 1px solid var(--color-amber-300);
  font-size: 0.875rem;
}
.session-warning-banner__action {
  background-color: var(--color-amber-500);
  color: white;
  border: none;
  padding: 0.375rem 0.875rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.session-warning-banner__action:hover {
  background-color: var(--color-amber-800);
}

/* Story 11.20b AC 11.20b.9 / 11.20b.13 — Swiss-Hosted AI Mode visual surfaces. */
:root {
  --color-swiss-badge-bg: #dbeafe;
  --color-swiss-badge-fg: #1e40af;
  --color-confidentiality-degraded-bg: #fef3c7;
  --color-confidentiality-degraded-fg: #92400e;
  --color-tests-internes-badge-bg: #ede9fe;
  --color-tests-internes-badge-fg: #5b21b6;
}
.swiss-badge {
  background: var(--color-swiss-badge-bg);
  color: var(--color-swiss-badge-fg);
  border-radius: 9999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: help;
}
.confidentiality-degraded-banner {
  background: var(--color-confidentiality-degraded-bg);
  color: var(--color-confidentiality-degraded-fg);
  border-left: 4px solid var(--color-confidentiality-degraded-fg);
  padding: 8px 12px;
  border-radius: 0 4px 4px 0;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Story 11.41 AC 11.41.9 — the badge carries an admin-only models-used tooltip.
   `cursor: help` already signals it on .swiss-badge; this gives the same
   affordance to the degraded banner and the Tests-internes badge, and a visible
   focus ring so the keyboard path is discoverable. */
.models-used-host {
  cursor: help;
}
.models-used-host:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.tests-internes-badge {
  background: var(--color-tests-internes-badge-bg);
  color: var(--color-tests-internes-badge-fg);
  border-radius: 9999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.confidentiality-radio-group {
  border: 1px solid var(--color-radio-group-border);
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}
.confidentiality-radio-group legend {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-radio-legend);
  padding: 0 8px;
}
.confidentiality-radio-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.confidentiality-radio-option:hover { background: var(--color-radio-option-hover-bg); }
.confidentiality-radio-option input[type="radio"] { margin-top: 4px; cursor: pointer; }
.confidentiality-radio-option .option-label {
  font-weight: 500;
  color: var(--color-radio-option-label);
  display: flex;
  align-items: center;
  gap: 6px;
}
.confidentiality-radio-option .option-desc {
  font-size: 0.8125rem;
  color: var(--color-radio-option-desc);
  margin-top: 2px;
}

/* Story 13.2 Task 15 — antifeu-app user-chip menu chrome, MIRRORED from the
 * portal nav-band user menu (apps/customer-portal/src/styles/input.css, the
 * `.pum-*` block) for cross-app visual parity (Beat: "apply the same styling").
 * Identical class names + look; colours sourced from THIS app's design tokens
 * (--color-primary-* / --color-gray-* / --color-action-negative). Keep the two
 * blocks in sync when either changes. */
.pum-root { position: relative; }
.pum-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 9999px;
  background: var(--color-primary-500); color: var(--color-on-action-primary);
  font-size: 0.75rem; font-weight: 600; line-height: 1;
  border: 1px solid var(--color-header-chip-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  cursor: pointer; transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.pum-trigger:hover { background: var(--color-primary-400); }
.pum-trigger:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--color-primary-200); }

.pum-panel {
  position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 50;
  min-width: 15rem; padding: 0.375rem;
  background: var(--color-surface-elevated); color: var(--color-gray-800);
  border: 1px solid rgba(17, 24, 39, 0.08); border-radius: 0.75rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.12);
  transform-origin: top right; animation: pum-pop 0.12s ease-out;
}
@keyframes pum-pop {
  from { opacity: 0; transform: scale(0.96) translateY(-2px); }
  to { opacity: 1; transform: none; }
}

/* Story 12.23b item 8 (rev2, Beat 2026-06-22) — "speech bubble" open state,
 * MIRRORED from the portal (apps/customer-portal/src/styles/input.css). On open
 * (.pum-open on .pum-root) the avatar inverts to a white circle with dark
 * initials, and the panel grows a small tail pointing up at the circle. */
.pum-open .pum-trigger,
.pum-open .pum-trigger:hover {
  background: var(--color-surface-elevated);
  color: var(--color-primary-700);
  border-color: var(--color-header-chip-border-open);
}
.pum-open .pum-panel::before {
  content: ''; position: absolute;
  top: -0.3125rem; right: 0.6875rem;
  width: 0.625rem; height: 0.625rem;
  background: var(--color-surface-elevated);
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  border-left: 1px solid rgba(17, 24, 39, 0.08);
  border-top-left-radius: 0.1875rem;
  transform: rotate(45deg);
}

.pum-header {
  padding: 0.5rem 0.625rem 0.375rem; margin-bottom: 0.125rem;
  font-size: 0.75rem; font-weight: 600; color: var(--color-gray-500);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.pum-item {
  display: flex; align-items: center; gap: 0.625rem; width: 100%;
  padding: 0.5rem 0.75rem; border-radius: 0.5rem;
  font-size: 0.875rem; text-align: left; text-decoration: none;
  color: var(--color-gray-800);
  background: none; border: none; cursor: pointer;
}
.pum-item:hover { background: var(--color-gray-100); }
.pum-item-icon { display: inline-flex; flex: 0 0 auto; color: var(--color-gray-500); }
.pum-item-icon svg { width: 1rem; height: 1rem; }
.pum-item--danger { color: var(--color-action-negative); }
.pum-item--danger:hover { background: color-mix(in srgb, var(--color-action-negative) 8%, transparent); }
.pum-item--danger .pum-item-icon { color: var(--color-action-negative); }

.pum-divider {
  height: 1px; margin: 0.375rem 0.25rem; border: 0;
  background: var(--color-gray-200);
}

/* Story 12.35b AC 12.35b.1 — the organisation chip left of the user badge: the
 * session organisation's name in a pill on the header band (a button when it
 * opens the organisation menu, plain text otherwise). The name is cut with an
 * ellipsis; the full name is in its title. The width cap keeps the header
 * inside a phone screen. The menu reuses the .pum-panel / .pum-item chrome. */
.org-chip-trigger,
.org-chip-text {
  display: inline-flex; align-items: center; gap: 0.375rem;
  max-width: min(16rem, 40vw); height: 2rem; padding: 0 0.625rem;
  border-radius: 9999px; border: 1px solid var(--color-header-chip-border);
  color: var(--color-on-action-primary); font-size: 0.8125rem; line-height: 1;
}
.org-chip-trigger {
  background: transparent; cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.org-chip-trigger:hover { background: var(--color-primary-500); }
.org-chip-trigger:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--color-primary-200); }
.org-chip-text { border-style: dashed; }
.org-chip-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-chip-text.org-chip-label { display: inline-block; line-height: 2rem; }
.org-chip-icon { display: inline-flex; flex: 0 0 auto; }
.org-chip-icon svg { width: 0.875rem; height: 0.875rem; }
.org-chip-chevron { flex: 0 0 auto; font-size: 0.625rem; opacity: 0.8; }
.pum-open .org-chip-trigger,
.pum-open .org-chip-trigger:hover {
  background: var(--color-surface-elevated); color: var(--color-primary-700);
  border-color: var(--color-header-chip-border-open);
}
/* The check column keeps its width on unchecked rows, so the names align. */
.org-chip-row .pum-item-icon { width: 1rem; justify-content: center; }
.org-chip-row[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.org-chip-row[aria-busy="true"] { cursor: progress; }
.org-chip-note,
.org-chip-error {
  margin: 0.25rem 0.5rem; padding: 0.375rem 0.5rem; border-radius: 0.5rem;
  font-size: 0.75rem; line-height: 1.35; max-width: 16rem;
}
.org-chip-note { color: var(--color-gray-600); background: var(--color-gray-100); }
.org-chip-error {
  color: var(--color-action-negative);
  background: color-mix(in srgb, var(--color-action-negative) 8%, transparent);
}

/* ============================================================================
   i18n boot guard (Beat mu51 smoke 2026-08-15) — data-i18n elements ship with
   FRENCH placeholder text in the static HTML; over real network latency that
   French painted visibly before lib/i18n-boot.js applied the user's language
   (localhost never showed it). Hide the translatable ELEMENTS (visibility
   keeps layout stable, no reflow — box-scope caveat below) until the boot
   module stamps `i18n-ready` on <html> — which it does in a `finally`, so a
   failed bundle fetch reveals the French fallback instead of a blank page —
   OR until the reveal bound below elapses.

   THIRD reveal layer (Story 14.10 review T3-1, re-engineered iter 2
   F14.10-13): the JS reveal paths (the module `finally`, the <script> tag's
   inline onerror) all die with JavaScript itself (future CSP without
   unsafe-inline, a dependency throwing at module evaluation, JS disabled) or
   never fire at all (a hung boot fetch settles neither). So the HIDE ITSELF
   is a RUNNING ANIMATION (from/to both hidden, no fill): while it runs, the
   text is hidden; when it ends — or if animations never run at all — the
   computed value returns to the base (visible). The mechanism can only fail
   OPEN: every failure of the animation subsystem degrades to visible French,
   never to a blank page. Iter-1's first cut (base `visibility: hidden` +
   `forwards` reveal animation) had the polarity backwards — a disabled
   animation left the hide in force — and its ::placeholder variant was
   empirically INERT (Chromium ignores `animation-*` on the pseudo-element,
   per the CSS Pseudo-Elements ::first-line property restriction), so the
   placeholder guard is driven from the ELEMENT via an inherited custom
   property (probed working: hidden pre-bound, revealed at bound with no JS,
   revealed immediately under `animation: none !important`).

   HONEST TRADE (F14.10-9/F14.10-16 — do not "fix" one side blindly): the
   delay bounds BLANKNESS, the fetch timeout (i18n_fetch_timeout_ms) bounds
   the DATA-LAYER hang — different harms. On a slow-but-working network
   (boot round-trips between this bound and the fetch timeout) the page
   deliberately degrades to the pre-14.10 behavior: French text revealed at
   the bound, swapped to the user's language when the bundle lands. A blank,
   unclickable login page is worse than a French flash. Scope caveat
   (F14.10-17): `visibility: hidden` hides the whole element box (button
   chrome included), not "only the text" — pre-bound pages show layout
   skeleton without the tagged controls; bounded by the delay below.
   Known asymmetry, noticed and accepted (validation V14.10-10): in the
   band between this bound and the fetch timeout the user reads French
   with NO fallback-content signal — the story ships such signals
   elsewhere (detection hints), but here the notice would itself be in a
   language the user may not read. Recorded so iteration N+1 stops
   rediscovering it.

   --i18n-reveal-fallback-delay is a CSS-side infrastructure constant
   (browsers cannot read config/index.ts); single-sourced here (F14.10-11),
   sealed with the guard's shape by
   tests/lint-grep/i18n-boot-tag-on-every-page.test.ts. The title/aria
   attribute families stay unguarded by design — not painted; a pre-boot
   screen-reader announcement window is accepted (campaign home Story 14.5).
   ============================================================================ */
:root {
  --i18n-reveal-fallback-delay: 2.5s;
}
html:not(.i18n-ready) [data-i18n] {
  animation: i18n-boot-hide var(--i18n-reveal-fallback-delay, 2.5s);
}
html:not(.i18n-ready) [data-i18n-placeholder] {
  animation: i18n-boot-hide-placeholder var(--i18n-reveal-fallback-delay, 2.5s);
}
/* An element carrying BOTH attributes must run BOTH hides — `animation` is
   one property, so the rules above would otherwise cascade-exclude each
   other on such an element. */
html:not(.i18n-ready) [data-i18n][data-i18n-placeholder] {
  animation:
    i18n-boot-hide var(--i18n-reveal-fallback-delay, 2.5s),
    i18n-boot-hide-placeholder var(--i18n-reveal-fallback-delay, 2.5s);
}
[data-i18n-placeholder]::placeholder {
  opacity: var(--i18n-placeholder-opacity, 1);
}
@keyframes i18n-boot-hide {
  from, to { visibility: hidden; }
}
@keyframes i18n-boot-hide-placeholder {
  from, to { --i18n-placeholder-opacity: 0; }
}

/* ============================================================================
   Upload page helpers (Story 99.103 — CSP-ready refactor). These three rules
   were in an inline <style> block in upload.html; CSP `style-src 'self'`
   (shipped Report-Only by Story 99.102, enforced by Story 99.104) blocks a
   <style> element, so they moved to the built stylesheet. The rest of that
   block was a stale DUPLICATE of rules already here (.toast* / .error-tooltip)
   or Tailwind-provided (.sr-only / .animate-pulse / @keyframes pulse), so only
   the upload-unique rules survive. Hardcoded hexes dropped into the primary
   tokens (DRY — CLAUDE.md § DRY Constants).
   - .drag-over       lib/upload-file-intake.js + upload.js drop zones
   - .loading         generic busy state (opacity + no pointer events)
   - .tokenization-status  lib/upload-analysis-flow.js per-file status glyph
   ============================================================================ */
.drag-over {
  border-color: var(--color-primary-600) !important;
  background-color: var(--color-primary-50) !important;
}
.loading {
  opacity: 0.6;
  pointer-events: none;
}
.tokenization-status {
  font-size: 1.125rem;
  line-height: 1;
}
