@layer components {
  .brand .brand-lockup { width: clamp(122px, 14vw, 160px); height: auto; aspect-ratio: 16 / 5; }
  .brand-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
  .avatar-preview { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 15px; }
  .avatar-preview .logo-sizes { margin: 0; }
  .tool-workspace { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, .95fr); gap: 15px; align-items: start; }
  .tool-workspace .tool-panel { grid-row: span 2; max-width: none; }
  .tool-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .tool-grid label:has(textarea), .tool-grid label:has(input[type=file]) { grid-column: 1 / -1; }
  .tool-grid textarea { padding: 10px; width: 100%; min-width: 0; resize: vertical; border: 1px solid #A7B9D1; border-radius: 8px; color: var(--ink); background: white; font: inherit; }
  .tool-panel p { color: var(--muted); }
  #tool-status { min-height: 1.45em; }
  #tool-status[data-state=error] { color: #a32323; }
  #tool-status[data-state=success] { color: #11654d; }
  #tool-output pre, #prompt-output, #inquiry-preview { margin: 0; padding: 14px; min-width: 0; max-height: 440px; overflow: auto; border: 1px solid #CEDAE9; border-radius: 8px; background: #EFF4FA; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .94rem; }
  #tool-output figure { margin: 0 0 14px; min-width: 0; }
  #tool-output figcaption { margin: 0 0 6px; font-weight: 650; }
  #tool-output img { width: auto; height: auto; max-inline-size: 100%; max-block-size: 360px; object-fit: contain; object-position: left top; outline: 1px solid var(--line); border-radius: 4px; }
  .image-comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
  #tool-output .is-enlarged img { width: 100%; }
  .swatches { display: flex; margin-bottom: 12px; gap: 6px; }
  .swatches span { border: 1px solid var(--line); min-height: 44px; border-radius: 7px; width: 60px; }
  .policy-note { padding: clamp(14px,2vw,22px); background: #edf3fb; border-radius: 12px; border: 1px solid #D6E2F0; min-width: 0; }
  .policy-note h2, .related h2, .study-group h2 { font-size: clamp(1.25rem,2.6vw,1.83rem); margin-bottom: .48em; }
  .policy-note p + p { margin-top: 10px; }
  .review-note { margin-bottom: 24px; color: #303D57; }
  .related, .study-group { margin-top: 32px; }
  .lesson-index { padding-left: 1.6rem; }
  .lesson-index li { padding: 8px 0; }
  .lesson-index a { color: #1d4ed8; display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; font-weight: 720; text-decoration-thickness: 1px; }
  .lesson-index small { color: #43546D; }
  .lesson { margin-inline: auto; font-size: 1rem; overflow-wrap: anywhere; }
  .lesson pre { max-width: 100%; overflow: auto; overflow-wrap: anywhere; }
  .lesson a, .prompt-notes a { overflow-wrap: anywhere; }
  .lesson p, .lesson li { margin-block: .65em; }
  .lesson table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse; }
  .lesson td,.lesson th { border: 1px solid var(--line); padding: 6px 8px; }
  .lesson blockquote { border-left: 3px solid #60A5FA; margin-inline: 0; padding-left: 13px; }
  .lesson .code-sample { margin-block: 16px; }
  .code-sample button { margin: 0 6px 10px 0; }
  .study-answer { margin-block: 21px; padding: 12px 15px; border: 1px solid #CBD9EE; border-radius: 9px; background: #F2F6FD; }
  .study-answer summary { font-weight: 740; }
  .prompt-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.35fr); gap: 20px; align-items: start; }
  .prompt-notes { max-width: none; }
  .prompt-notes ul { padding-left: 22px; }
  .prompt-notes li + li { margin-top: 6px; }
  .prompt-notes p { margin-block: 10px; }
  .favorite-toggle { align-self: center; font-weight: 680; margin-top: 14px; }
  #inquiry-form button { margin-top: 14px; }
}
@layer responsive {
  @media (max-width: 740px) { .brand-review-grid, .tool-workspace, .prompt-layout { grid-template-columns: 1fr; } .tool-workspace .tool-panel { grid-row: auto; } }
  @media (max-width: 450px) { .tool-grid { grid-template-columns: 1fr; } }
}
@layer components {
  .ops-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(125px,1fr)); gap: 12px; }
  .ops-cards div { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
  .ops-cards dt { color: var(--muted); }
  .ops-cards dd { margin: 0; font-weight: 740; font-size: 1.25rem; }
  .ops-table { max-width: 100%; overflow: auto; margin-block: 16px; }
  .ops-table table { border-collapse: collapse; min-width: 100%; background: white; }
  .ops-table caption { text-align: left; width: fit-content; font-weight: 700; padding: 10px; }
  .ops-table th, .ops-table td { border: 1px solid var(--line); padding: 8px 12px; white-space: nowrap; text-align: left; }
}
