@layer features {
.improvement-titlebar { align-items: center; }
.improvement-live-status { position: sticky; top: 10px; z-index: 15; margin: 0 0 12px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.improvement-live-status[hidden] { display: none; }
.improvement-live-status[data-tone="success"] { border-color: var(--sea); }
.improvement-live-status[data-tone="error"] { border-color: var(--danger); }
.improvement-guide { background: linear-gradient(135deg, color-mix(in srgb, var(--sea) 9%, var(--card)), var(--card)); }
.improvement-steps { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin: 16px 0; padding: 0; list-style: none; }
.improvement-steps li { display: flex; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.improvement-steps li > span { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: var(--sea); color: var(--button-text, #081317); font-weight: 800; }
.improvement-steps strong, .improvement-steps small { display: block; }
.improvement-steps small { margin-top: 4px; color: var(--ink-soft); line-height: 1.4; }
.improvement-counts { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.improvement-counts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); }
.improvement-counts span { color: var(--ink-soft); }
.improvement-counts strong { font-size: 1.35rem; }
.improvement-filters, .improvement-actions, .improvement-decision-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.improvement-actions form, .improvement-decision-row form { margin: 0; }
.improvement-decision-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.improvement-decision-row > .button:first-child { min-width: 150px; }
.improvement-list { display: grid; gap: 14px; }
.improvement-card { min-width: 0; padding: 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.improvement-card > header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 12px; color: var(--ink-soft); font-size: 12px; }
.improvement-card > header strong { color: var(--ink); font-size: 15px; }
.improvement-card-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.improvement-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.improvement-pair > div, .improvement-correction, .improvement-review-note { min-width: 0; padding: 10px; border-radius: 7px; background: var(--surface-2); }
.improvement-pair span { display: block; margin-bottom: 5px; color: var(--ink-soft); font-size: 11px; font-weight: 700; letter-spacing: .025em; text-transform: uppercase; }
.improvement-card pre, .table pre { max-height: 260px; margin: 0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); font: inherit; }
.improvement-correction { margin-bottom: 10px; border-left: 3px solid var(--sea); }
.improvement-correction strong, .improvement-review-note strong { display: block; margin-bottom: 5px; }
.improvement-review-note { margin-bottom: 10px; border-left: 3px solid var(--warning, #d1a43a); }
.improvement-review-note p { margin: 0; }
.improvement-card .button, .improvement-actions .button { min-height: 38px; white-space: nowrap; }
.improvement-empty { padding: 28px 18px; border: 1px dashed var(--border); border-radius: 10px; text-align: center; color: var(--ink-soft); }
.improvement-empty strong { display: block; color: var(--ink); font-size: 1.1rem; }
.improvement-dialog { width: min(780px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 18px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.improvement-history-dialog { width: min(1100px, calc(100vw - 28px)); }
.improvement-dialog::backdrop { background: rgba(0,0,0,.62); }
.improvement-dialog .ai-form { margin: 0; }
.improvement-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.improvement-dialog-heading h2, .improvement-dialog-heading h3, .improvement-dialog-heading p { margin-top: 0; }
.improvement-dialog-heading p { margin-bottom: 0; color: var(--ink-soft); }
.improvement-advanced-fields { margin-top: 12px; }
.improvement-history-search { display: grid; grid-template-columns: minmax(220px,1fr) minmax(180px,auto) auto auto; align-items: end; gap: 10px; margin-bottom: 15px; }
.improvement-history-list { display: grid; gap: 10px; }
.history-card > details > summary { cursor: pointer; color: var(--ink); font-weight: 650; }
.history-card > details[open] > summary { margin-bottom: 12px; }
.improvement-advanced { padding: 0; overflow: clip; }
.improvement-advanced > summary { cursor: pointer; padding: 16px; list-style-position: inside; }
.improvement-advanced > summary span { display: inline-flex; flex-direction: column; gap: 3px; margin-left: 5px; }
.improvement-advanced > summary small { color: var(--ink-soft); font-weight: 400; }
.improvement-advanced-body { display: grid; gap: 24px; padding: 0 16px 18px; }
.improvement-advanced-body > section { padding-top: 20px; border-top: 1px solid var(--border); }
.ai-tag.status-implemented { border-color: var(--sea); }
.ai-tag.status-rejected, .ai-tag.status-archived { opacity: .82; }
@media (max-width: 850px) {
  .improvement-steps, .improvement-counts { grid-template-columns: 1fr; }
  .improvement-history-search { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .improvement-pair { grid-template-columns: 1fr; }
  .improvement-titlebar { align-items: flex-start; }
  .improvement-history-search { grid-template-columns: 1fr; }
  .improvement-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); padding: 14px; }
  .improvement-decision-row > *, .improvement-decision-row form, .improvement-decision-row .button { width: 100%; }
}

.improvement-card > header,
.improvement-pair span { font-size: var(--lumi-font-size-sm); }
}
