@layer views {
  .image-viewer-screen {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(247, 245, 239, 0.96);
  }

  .image-viewer-screen[hidden] { display: none; }

  .detail-header {
    margin-bottom: 12px;
  }

  .status-pill {
    padding: 7px 10px;
    border-radius: 999px;
    background: #e8f4ee;
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 800;
  }

  .stage-control-panel {
    display: flex;
    flex: 1 1 520px;
    justify-content: flex-end;
    margin: 2px 0 0 auto;
  }

  .stage-control-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
  }

  .stage-control-status .status-pill {
    display: grid;
    min-height: 34px;
    place-items: center;
    padding: 0 10px;
    border-radius: 8px;
    text-align: center;
  }

  .stage-step-button {
    display: inline-flex;
    min-height: 34px;
    min-width: 116px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 13px;
    border: 1px solid rgba(47, 125, 92, 0.24);
    border-radius: 999px;
    background: linear-gradient(180deg, #fbfefd 0%, #edf7f2 100%);
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 14px rgba(34, 79, 61, 0.08);
  }

  .stage-step-button span {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 999px;
    background: rgba(47, 125, 92, 0.1);
    font-size: 22px;
    font-weight: 700;
    line-height: 0.82;
  }

  .stage-step-button:hover:not(:disabled) {
    border-color: rgba(47, 125, 92, 0.42);
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 9px 18px rgba(34, 79, 61, 0.12);
    transform: translateY(-1px);
  }

  .stage-step-button:active:not(:disabled) {
    transform: translateY(0);
  }

  .stage-step-button.is-next {
    border-color: rgba(47, 125, 92, 0.3);
    background: linear-gradient(180deg, #f8fffb 0%, #e7f4ee 100%);
  }

  .stage-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 0 0 4px;
    padding-left: 12px;
    border-left: 1px solid rgba(47, 125, 92, 0.18);
  }

  .stage-action-bar:empty {
    display: none;
  }

  .stage-quick-action {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid rgba(47, 125, 92, 0.26);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 7px 16px rgba(47, 125, 92, 0.11);
  }

  .stage-quick-action.is-primary {
    background: var(--green);
    color: #ffffff;
  }

  .stage-quick-action.is-secondary {
    background: #f6fbf8;
    color: var(--green-dark);
  }

  .stage-quick-action.is-closure {
    border-color: #d6cec1;
    background: #fffdf9;
    color: #776453;
    box-shadow: none;
  }

  .stage-quick-action:hover:not(:disabled) {
    transform: translateY(-1px);
  }

  .stage-quick-action.is-primary:hover:not(:disabled) {
    background: var(--green-dark);
  }

  .detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }

  .stage-content,
  .right-rail {
    min-width: 0;
  }

  .product-editor {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfa;
  }

  .composition-panel {
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfa;
  }

  .composition-heading {
    margin-bottom: 8px;
  }

  .product-editor-heading-line {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
  }

  .product-editor-heading-line h3 {
    flex: 0 1 auto;
  }

  .product-category-quick-picker {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    margin-left: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
  }

  .product-category-quick-picker select {
    min-width: 112px;
    min-height: 32px;
    padding: 0 28px 0 9px;
    border: 1px solid #b8d8c7;
    border-radius: 8px;
    background: #eef7f1;
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 900;
  }

  .product-category-quick-picker select:disabled {
    border-color: #e0e5e2;
    background: #f5f6f4;
    color: #6a7770;
  }

  .editor-toggle-button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(47, 125, 92, 0.28);
    border-radius: 8px;
    background: #2f7d5c;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(47, 125, 92, 0.18);
  }

  .editor-toggle-button:hover:not(:disabled) {
    background: #246a4d;
  }

  .editor-toggle-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
  }

  .compact-actions {
    display: flex;
    gap: 8px;
  }

  .stage-note-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
  }

  .stage-note-title-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
  }

  .stage-note-heading {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px;
  }

  .stage-progress-meter {
    display: grid;
    width: 245px;
    gap: 5px;
  }

  .stage-progress-meter[hidden] {
    display: none;
  }

  .stage-progress-meter span {
    color: #4f5b62;
    font-size: 13px;
    font-weight: 900;
  }

  .stage-progress-meter span strong {
    margin-left: 4px;
    color: var(--green-dark);
    font-size: 20px;
    line-height: 1;
  }

  .stage-progress-meter i {
    display: block;
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7edf0;
  }

  .stage-progress-meter b {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #d9a441 0%, #75a977 48%, #2f7d5c 100%);
    transition: width 180ms ease;
  }

  .product-editor-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .product-editor-summary span {
    padding: 5px 8px;
    border-radius: 999px;
    background: #eef6f1;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 800;
  }

  .product-editor-summary span.is-priority {
    background: #ffffff;
    color: #1c6b48;
    border: 1px solid rgba(47, 125, 92, 0.22);
    box-shadow: 0 6px 14px rgba(47, 125, 92, 0.08);
  }

  .product-editor:not(.is-expanded) .editor-grid {
    display: none;
  }

  .product-editor.is-expanded .product-editor-summary {
    margin-bottom: 10px;
  }

  .editor-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .product-editor-form {
    grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.45fr);
    align-items: start;
  }

  .editor-column {
    display: grid;
    min-width: 0;
    gap: 10px;
  }

  .editor-section {
    display: grid;
    min-width: 0;
    gap: 10px;
    padding: 10px;
    border: 1px solid #dfe7e2;
    border-radius: 8px;
    background: #ffffff;
  }

  .editor-section-main,
  .editor-section-business {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-section-category,
  .editor-section-platform {
    grid-template-columns: minmax(0, 1fr);
  }

  .editor-section-title {
    display: flex;
    grid-column: 1 / -1;
    min-width: 0;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 2px;
  }

  .editor-section-title strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
  }

  .editor-section-title span {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .editor-grid label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .editor-grid input::placeholder,
  .editor-grid textarea::placeholder {
    color: #8a9692;
    font-size: 12px;
    font-weight: 650;
  }

  .unit-input {
    position: relative;
    display: block;
    min-width: 0;
  }

  .unit-input input {
    width: 100%;
    padding-right: 34px;
  }

  .unit-input b {
    position: absolute;
    top: 50%;
    right: 11px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    transform: translateY(-50%);
    pointer-events: none;
  }

  .editor-grid .wide {
    grid-column: span 2;
  }

  .category-picker-field {
    display: grid;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .category-picker-field legend {
    margin: 0;
    padding: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .category-picker-field legend span {
    margin-left: 6px;
    color: #7f8d88;
    font-size: 11px;
    font-weight: 750;
  }

  .spec-picker-field {
    grid-column: 1 / -1;
  }

  .empty-choice-hint {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
  }

  .inline-text-action {
    justify-self: start;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .inline-text-action:hover:not(:disabled) {
    color: var(--green);
  }

  .category-choice-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .category-choice-grid.compact {
    max-height: 82px;
    overflow: auto;
    padding-right: 2px;
  }

  .category-choice {
    display: inline-flex !important;
    min-height: 34px;
    align-items: center;
    gap: 6px !important;
    padding: 0 10px;
    border: 1px solid #d7e4dc;
    border-radius: 999px;
    background: #f5faf7;
    color: var(--green-dark) !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    cursor: pointer;
  }

  .category-choice input {
    width: 14px;
    height: 14px;
    min-height: 14px;
    padding: 0;
    accent-color: var(--green);
  }

  .category-choice.muted-choice {
    color: #687771 !important;
    background: #f8faf8;
  }

  .launch-channel-field {
    display: grid;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .launch-channel-field legend {
    margin: 0;
    padding: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .launch-channel-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .launch-channel-options label {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid #d7e4dc;
    border-radius: 999px;
    background: #f5faf7;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 900;
  }

  .launch-channel-options input {
    width: 14px;
    height: 14px;
    min-height: 14px;
    padding: 0;
    accent-color: var(--green);
  }

  .dropzone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 64px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px dashed #9bb8a9;
    border-radius: 8px;
    background: var(--panel-soft);
  }

  .dropzone[hidden] {
    display: none;
  }

  .dropzone.dragging {
    border-color: var(--green);
    background: #e2f3e9;
  }

  .dropzone.is-disabled {
    cursor: not-allowed;
    opacity: 0.58;
  }

  .dropzone strong,
  .dropzone span {
    display: block;
  }

  .dropzone span {
    margin-top: 3px;
  }

  .paste-status {
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 800;
  }

  .paste-status[data-state="error"] {
    color: var(--coral);
  }

  .dropzone-actions {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    align-items: center;
    gap: 8px;
  }

  .dropzone-actions button {
    min-width: 78px;
  }

  .stage-checklist {
    margin-top: 12px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfa;
  }

  .stage-checklist h3 small {
    margin-left: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .checklist-count {
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 800;
  }

  .checklist-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .checklist-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 4px 8px;
    min-width: 0;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: #3f4742;
    font-size: 13px;
    font-weight: 800;
  }

  .checklist-item.complete {
    border-color: #cfe3d7;
    background: #f0f8f3;
  }

  .checklist-item.pending {
    border-color: #eadfca;
    background: #fffaf0;
  }

  .checklist-marker {
    display: inline-grid;
    grid-row: 1 / 3;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 999px;
    background: #edf1ef;
    color: #6b746f;
    font-size: 12px;
    font-weight: 900;
  }

  .checklist-item.complete .checklist-marker {
    background: var(--green);
    color: #ffffff;
  }

  .checklist-item.pending .checklist-marker {
    background: #f2dfb6;
    color: #7b6120;
  }

  .checklist-item > span:not(.checklist-marker) {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .checklist-item small {
    grid-column: 2;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .checklist-remove {
    min-height: 24px;
    padding: 0 7px;
    border: 1px solid #ead7d1;
    border-radius: 7px;
    background: #fff7f4;
    color: var(--coral);
    font-size: 12px;
    font-weight: 800;
  }

  .checklist-add-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 10px;
  }

  .image-wall {
    display: grid;
    grid-template-columns: repeat(var(--image-wall-columns, 4), minmax(0, 1fr));
    gap: 10px;
    overflow-anchor: none;
  }

  .image-wall.is-loading {
    align-items: start;
  }

  .image-wall.is-stage-grouped {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .image-stage-section {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--stage-color, var(--green)) 18%, #ffffff);
    border-left: 4px solid var(--stage-color, var(--green));
    border-radius: 8px;
    background: color-mix(in srgb, var(--stage-bg, #edf5f1) 58%, #ffffff);
  }

  .image-stage-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 26px;
  }

  .image-stage-section-header strong {
    min-width: 0;
    overflow: hidden;
    color: var(--stage-color, var(--green-dark));
    font-size: 13px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .image-stage-section-header em {
    min-width: 0;
    margin-left: auto;
    overflow: hidden;
    color: color-mix(in srgb, var(--stage-color, var(--green-dark)) 68%, var(--muted));
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .image-stage-section-header span {
    display: inline-flex;
    min-width: 24px;
    height: 22px;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--stage-color, var(--green-dark));
    font-size: 12px;
    font-weight: 900;
  }

  .image-stage-evaluation-summary {
    display: grid;
    grid-column: 1 / -1;
    gap: 4px;
    margin-top: 6px;
    padding: 7px 10px;
    border: 1px solid rgba(47, 125, 92, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.56);
    box-shadow: 0 5px 12px rgba(43, 66, 56, 0.05);
  }

  .image-stage-evaluation-summary p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #33423c;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .image-stage-evaluation-summary:not(.is-expanded) p:nth-of-type(n + 3) {
    display: none;
  }

  .image-stage-evaluation-summary.is-expanded p {
    display: block;
    overflow: visible;
    -webkit-line-clamp: initial;
  }

  .image-stage-evaluation-summary strong {
    margin-right: 4px;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 900;
  }

  .image-stage-evaluation-summary span {
    margin-right: 6px;
    color: #87928d;
    font-weight: 800;
  }

  .image-stage-evaluation-summary b {
    font-weight: 800;
  }

  .image-stage-evaluation-summary button {
    justify-self: start;
    min-height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6b7772;
    font-size: 11px;
    font-weight: 800;
  }

  .image-stage-evaluation-summary button:hover {
    color: var(--green-dark);
  }

  .image-stage-section-grid {
    display: grid;
    grid-template-columns: repeat(var(--image-wall-columns, 4), minmax(0, 1fr));
    gap: 10px;
    align-items: start;
    min-width: 0;
  }

  .image-wall-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
  }

  .image-stage-filter {
    display: flex;
    gap: 6px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .image-stage-filter::-webkit-scrollbar {
    display: none;
  }

  .skeleton-filter {
    min-width: 90px;
    color: transparent;
    pointer-events: none;
  }

  .skeleton-filter span {
    display: inline-block;
    width: 20px;
    height: 14px;
    border-radius: 999px;
  }

  .image-stage-filter-button {
    display: inline-flex;
    min-height: 32px;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: #4f5961;
    font-size: 12px;
    font-weight: 800;
  }

  .image-stage-filter-button::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--stage-color, var(--green));
  }

  .image-stage-filter-button:first-child::before {
    background: linear-gradient(135deg, var(--green), var(--blue), var(--coral));
  }

  .image-stage-filter-button span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
  }

  .image-stage-filter-button em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
  }

  .image-stage-filter-button.done {
    border-color: #b7d6c4;
    background: #e8f4ee;
    color: var(--green-dark);
    box-shadow: inset 0 -3px 0 rgba(47, 125, 92, 0.16);
  }

  .image-stage-filter-button.current:not(.active) {
    border-color: color-mix(in srgb, var(--stage-color, var(--green)) 34%, #ffffff);
    background: color-mix(in srgb, var(--stage-bg, #edf5f1) 62%, #ffffff);
  }

  .image-stage-filter-button.active {
    border-color: color-mix(in srgb, var(--stage-color, var(--green)) 44%, #ffffff);
    background: var(--stage-bg, #e8f4ee);
    color: var(--stage-color, var(--green-dark));
  }

  .image-stage-filter-button:first-child.active {
    border-color: #b7d6c4;
    background: #edf5f1;
    color: var(--green-dark);
  }

  .image-sort-control {
    display: flex;
    min-width: 150px;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .image-sort-control select {
    min-height: 32px;
    padding: 0 28px 0 10px;
    border-radius: 999px;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 800;
  }

  .image-wall-column {
    display: grid;
    align-content: start;
    gap: 10px;
    min-width: 0;
  }

  .stage-material-add {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .stage-image-add-button,
  .stage-link-add-button {
    display: grid;
    width: 100%;
    min-height: 48px;
    grid-template-columns: auto auto;
    gap: 6px;
    place-items: center;
    justify-content: center;
    border: 1px dashed color-mix(in srgb, var(--stage-color, var(--green)) 28%, #ffffff);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.42);
    color: color-mix(in srgb, var(--stage-color, var(--green)) 78%, #6f7773);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  }

  .stage-image-add-button span,
  .stage-link-add-button span {
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
  }

  .stage-image-add-button strong,
  .stage-link-add-button strong {
    font-size: 12px;
    font-weight: 900;
  }

  .stage-image-add-button:hover:not(:disabled),
  .stage-image-add-button:focus-visible,
  .stage-link-add-button:hover:not(:disabled),
  .stage-link-add-button:focus-visible,
  .stage-material-add.dragging .stage-image-add-button {
    border-color: color-mix(in srgb, var(--stage-color, var(--green)) 50%, #ffffff);
    background: rgba(255, 255, 255, 0.72);
    transform: translateY(-1px);
  }

  .stage-image-add-button.is-disabled {
    cursor: not-allowed;
    opacity: 0.48;
  }

  .stage-link-add-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
  }

  .image-add-status {
    display: block;
    padding: 7px 8px 0;
    color: var(--green-dark);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
  }

  .image-add-status[data-state="error"] {
    color: var(--coral);
  }

  .image-card {
    position: relative;
    display: block;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
  }

  .product-link-card {
    display: grid;
    min-height: 188px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--stage-color, var(--green)) 22%, var(--line));
    border-top: 4px solid var(--stage-color, var(--green));
    border-radius: 8px;
    background: #ffffff;
  }

  .product-link-card-cover {
    width: calc(100% - 18px);
    aspect-ratio: 16 / 9;
    margin: 6px 9px 0;
    overflow: hidden;
    border-radius: 6px;
    background: #edf1ef;
  }

  .product-link-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .product-link-card-head {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 9px 0;
  }

  .product-link-card-head span {
    color: var(--stage-color, var(--green-dark));
    font-size: 11px;
    font-weight: 900;
  }

  .product-link-card-head button {
    min-height: 26px;
    padding: 0 7px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }

  .product-link-open {
    display: grid;
    min-width: 0;
    align-content: start;
    gap: 7px;
    padding: 8px 10px 12px;
    border: 0;
    background: transparent;
    text-align: left;
  }

  .product-link-domain {
    min-width: 0;
    overflow: hidden;
    color: #8a5d36;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .product-link-open strong {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .product-link-open p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #65706b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .product-link-open p.is-empty {
    color: #a1aaa6;
    font-weight: 600;
  }

  .product-link-open small {
    display: -webkit-box;
    overflow: hidden;
    color: #7a8580;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .product-link-purpose-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .product-link-purpose-tags span {
    padding: 3px 6px;
    border-radius: 999px;
    background: #edf4f0;
    color: #35634f;
    font-size: 10px;
    font-weight: 800;
  }

  .product-link-status {
    color: #69736f;
    font-size: 11px;
    font-weight: 800;
  }

  .product-link-status.is-ok {
    color: var(--green-dark);
  }

  .product-link-status.is-login_required {
    color: #9b6a16;
  }

  .product-link-status.is-removed,
  .product-link-status.is-unreachable {
    color: #b75545;
  }

  .product-link-open em {
    align-self: end;
    color: var(--green-dark);
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
  }

  .product-link-open em b {
    font-size: 14px;
  }

  .product-link-card footer {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
  }

  .product-link-card footer span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .product-link-card footer time {
    flex: 0 0 auto;
  }

  .product-link-panel {
    width: min(720px, calc(100vw - 28px));
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
  }

  .product-link-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .product-link-form-grid label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .product-link-form-grid .wide {
    grid-column: 1 / -1;
  }

  .product-link-clean-option {
    display: flex !important;
    min-height: 42px;
    align-items: center;
    grid-template-columns: auto 1fr;
    padding-top: 20px;
  }

  .product-link-clean-option input {
    width: 18px;
    height: 18px;
  }

  .product-link-normalization {
    display: grid;
    gap: 4px;
    min-height: 52px;
    padding: 10px 12px;
    border-left: 3px solid #9ba8a2;
    background: #f5f7f6;
    color: #68736e;
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  .product-link-normalization.is-cleaned {
    border-left-color: var(--green);
    background: #edf7f2;
    color: var(--green-dark);
  }

  .product-link-normalization.is-preserved {
    border-left-color: #c49342;
    background: #fff8e9;
    color: #795c25;
  }

  .product-link-normalization code {
    color: inherit;
    font-size: 11px;
    white-space: normal;
  }

  .product-link-purpose-field {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .product-link-purpose-field legend {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .product-link-purpose-options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }

  .product-link-purpose-options label {
    display: flex;
    min-height: 34px;
    align-items: center;
    grid-template-columns: auto 1fr;
    gap: 6px;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8faf9;
    color: #42514a;
    cursor: pointer;
  }

  .product-link-purpose-options input {
    width: 16px;
    height: 16px;
  }

  .product-link-preview {
    display: grid;
    grid-template-columns: 124px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 96px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f9f8;
  }

  .product-link-preview-media {
    display: grid;
    width: 124px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    place-items: center;
    border-radius: 6px;
    background: #e8eeeb;
    color: #7a8580;
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
  }

  .product-link-preview-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .product-link-preview-copy {
    display: grid;
    min-width: 0;
    gap: 5px;
  }

  .product-link-preview-copy strong,
  .product-link-preview-copy span,
  .product-link-preview-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .product-link-preview-copy strong {
    color: var(--ink);
    font-size: 14px;
  }

  .product-link-preview-copy span,
  .product-link-preview-copy small {
    color: var(--muted);
    font-size: 11px;
  }

  .product-link-preview-actions {
    display: grid;
    gap: 7px;
  }

  .product-link-preview-actions button,
  .product-link-preview-actions label {
    min-width: 96px;
    margin: 0;
  }

  .product-link-cover-upload {
    cursor: pointer;
  }

  .product-link-library-panel {
    display: grid;
    width: min(1100px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    grid-template-rows: auto auto auto minmax(0, 1fr);
    overflow: hidden;
  }

  .product-link-library-filters {
    display: grid;
    grid-template-columns: minmax(210px, 1.6fr) repeat(5, minmax(120px, 1fr));
    gap: 8px;
  }

  .product-link-library-filters input,
  .product-link-library-filters select {
    min-width: 0;
  }

  .product-link-library-summary {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .product-link-library-list {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 180px;
    overflow-y: auto;
    padding-right: 3px;
  }

  .product-link-library-item {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
  }

  .product-link-library-cover {
    display: grid;
    width: 112px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    place-items: center;
    border-radius: 6px;
    background: #edf1ef;
    color: #7f8a85;
    font-size: 11px;
  }

  .product-link-library-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .product-link-library-main {
    display: grid;
    min-width: 0;
    gap: 5px;
  }

  .product-link-library-title,
  .product-link-library-meta {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
  }

  .product-link-library-title strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .product-link-library-title > span {
    flex: 0 0 auto;
    color: var(--green-dark);
    font-size: 11px;
    font-weight: 850;
  }

  .product-link-library-main > small,
  .product-link-library-meta,
  .product-link-library-related {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
  }

  .product-link-library-main > small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .product-link-library-related {
    color: #895f22;
  }

  .product-link-library-side {
    display: grid;
    min-width: 116px;
    justify-items: stretch;
    gap: 6px;
  }

  .product-link-library-side button {
    min-height: 34px;
  }

  .product-link-library-empty {
    margin: 0;
    padding: 32px 16px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    text-align: center;
  }

  .image-card-media {
    position: relative;
    overflow: hidden;
  }

  .image-kind-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 4px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--stage-color, #202124) 88%, #202124);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
  }

  .image-wall.is-stage-grouped .image-kind-badge {
    display: none;
  }

  .image-new-badge {
    position: absolute;
    top: 9px;
    right: 10px;
    z-index: 3;
    width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 999px;
    background: #c45f4a;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.86), 0 4px 10px rgba(196, 95, 74, 0.2);
  }

  .image-pinned-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 4;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(47, 125, 92, 0.92);
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 6px 14px rgba(47, 125, 92, 0.18);
  }

  .image-card.is-pinned .image-new-badge {
    top: 37px;
  }

  .image-menu-button {
    position: absolute;
    top: 40px;
    right: 8px;
    z-index: 3;
  }

  .image-comment-hint {
    position: absolute;
    left: 8px;
    right: 48px;
    bottom: 8px;
    z-index: 3;
    max-width: calc(100% - 64px);
    padding: 3px 7px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: rgba(38, 49, 44, 0.68);
    font-size: 11px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    backdrop-filter: blur(8px);
  }

  .image-comment-hint:hover {
    color: var(--green-dark);
  }

  .image-card.placeholder {
    border-style: dashed;
    background: #fffdf8;
  }

  .image-card.is-pending {
    border-color: #c9d4cf;
  }

  .image-card.is-pending img {
    opacity: 0.68;
    filter: saturate(0.82);
  }

  .image-card.is-pending::after {
    content: "";
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.82);
    border-top-color: var(--green);
    border-radius: 999px;
    animation: image-upload-spin 0.8s linear infinite;
  }

  .image-card.is-failed {
    border-color: #e0a093;
    background: #fff5f2;
  }

  .image-card[draggable="true"] {
    cursor: grab;
  }

  .image-card.is-dragging {
    opacity: 0.52;
  }

  .image-card.is-drop-target {
    outline: 3px solid var(--green);
    outline-offset: 2px;
  }

  .image-card.is-drop-target::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 -1px;
    z-index: 4;
    width: 4px;
    background: var(--green);
  }

  .image-stage-section.is-drop-target {
    outline: 3px solid var(--stage-color);
    outline-offset: 3px;
  }

  .image-card.main-image {
    border-color: var(--green);
  }

  .image-card.main-image .image-kind-badge {
    background: var(--green);
  }

  .image-card img {
    display: block;
    width: 100%;
    min-height: 96px;
    max-height: 230px;
    object-fit: cover;
    cursor: pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  .skeleton-image-card {
    pointer-events: none;
  }

  .skeleton-image-media {
    width: 100%;
  }

  .skeleton-image-footer {
    min-height: 58px;
  }

  .skeleton-image-footer span {
    width: 68%;
    height: 12px;
    border-radius: 999px;
  }

  .skeleton-image-footer em {
    width: 38px;
    height: 26px;
    border-radius: 999px;
  }

  @keyframes skeleton-shimmer {
    0% {
      background-position: 120% 0;
    }
    100% {
      background-position: -120% 0;
    }
  }

  .product-thumb,
  #viewerImage {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  .replace-image-btn {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #c9d4cf;
    border-radius: 7px;
    background: #ffffff;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 800;
  }

  .replace-image-btn:disabled {
    cursor: progress;
    opacity: 0.54;
  }

  @keyframes image-upload-spin {
    to {
      transform: rotate(360deg);
    }
  }

  .image-card-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-top: 1px solid var(--line);
  }

  .image-caption-line {
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
  }

  .image-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .image-like-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 3;
    min-height: 30px;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #5e6660;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 5px 14px rgba(20, 29, 25, 0.14);
    backdrop-filter: blur(10px);
  }

  .image-like-btn.active {
    border-color: rgba(185, 74, 60, 0.26);
    background: #fff3f0;
    color: var(--coral);
  }

  .image-like-btn:disabled {
    opacity: 0.48;
  }

  .image-card-meta {
    display: flex;
    min-width: 0;
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: 6px;
    color: #7b828a;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
  }

  .image-card-meta span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .image-card-owner {
    flex: 1 1 auto;
  }

  .product-comment-box {
    display: grid;
    gap: 10px;
    margin: 12px 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfa;
  }

  .product-comment-box .rail-heading {
    margin-bottom: 0;
  }

  .product-comments {
    display: grid;
    gap: 8px;
    max-height: 190px;
    overflow: auto;
  }

  .stage-evaluation-select {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .stage-evaluation-select select {
    min-height: 32px;
    padding: 0 30px 0 10px;
    border-radius: 999px;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 800;
  }

  .stage-evaluation-item {
    border-color: rgba(47, 125, 92, 0.12);
    background: rgba(255, 255, 255, 0.62);
  }

  .comment-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .comment-reply-btn.danger {
    color: var(--coral);
  }

  .product-comment-box textarea {
    min-height: 74px;
  }

  .notes {
    display: grid;
    gap: 10px;
    margin-top: 6px;
  }

  .note {
    padding: 12px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--coral);
    border-radius: 8px;
    background: #fffaf6;
  }

  .note p {
    margin: 4px 0 0;
    color: #555b61;
    font-size: 14px;
  }

  .right-rail {
    display: grid;
    gap: 12px;
  }

  .rail-section {
    padding: 14px;
    box-shadow: none;
  }

  .rail-heading {
    margin-bottom: 12px;
  }

  .rail-heading span {
    color: var(--green-dark);
    font-weight: 800;
  }

  .erp-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .erp-row {
    display: grid;
    min-width: 0;
    gap: 5px;
    padding: 7px;
    border: 1px solid #e1e8e4;
    border-radius: 8px;
    background: #ffffff;
  }

  .erp-row label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .erp-control-row {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) 66px 48px;
    gap: 5px;
    align-items: start;
  }

  .erp-row .search-picker input {
    min-height: 32px;
    padding: 0 28px 0 9px;
    font-size: 13px;
    font-weight: 650;
  }

  .erp-row .search-picker::after {
    top: 13px;
    right: 11px;
  }

  .erp-row .tiny-button {
    min-width: 0;
    min-height: 32px;
    padding: 0 6px;
    font-size: 13px;
  }

  .composition-price-input {
    width: 100%;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 7px;
    background: #ffffff;
    color: var(--text);
    font-size: 13px;
    font-weight: 620;
  }

  .composition-price-input.is-auto {
    background: #f4faf7;
    color: var(--green-dark);
  }

  .composition-price-input::placeholder {
    color: #9da8a2;
    font-weight: 560;
  }

  .composition-price-row {
    min-height: 14px;
  }

  .composition-price-hint {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
  }

  .composition-price-hint.erp {
    color: var(--green-dark);
  }

  .version-list {
    display: grid;
    gap: 8px;
  }

  .timeline-list {
    display: grid;
    gap: 6px;
  }

  .timeline-item {
    position: relative;
    display: grid;
    gap: 2px;
    padding: 8px 10px 8px 13px;
    border-left: 3px solid var(--green);
    border-radius: 8px;
    background: #f6fbf8;
  }

  .timeline-item.version_snapshot {
    border-left-color: #b9892e;
    background: #fffaf0;
  }

  .timeline-item.note_snapshot {
    border-left-color: #466f9f;
    background: #f4f8fd;
  }

  .timeline-item.image_commented {
    border-left-color: #7661a9;
    background: #f8f5fc;
  }

  .timeline-item strong,
  .timeline-item p,
  .timeline-item time {
    display: block;
    margin: 0;
  }

  .timeline-item strong {
    overflow: hidden;
    font-size: 13px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .timeline-item p,
  .timeline-item time {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .version-item {
    padding: 10px;
    border-radius: 8px;
    background: #f6f3ea;
  }

  .version-item strong,
  .version-item p {
    display: block;
    margin: 0;
  }

  .version-item p {
    margin-top: 4px;
  }

  .todo-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
  }

  .todo-inline span {
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid #d9e1de;
    border-radius: 999px;
    background: #f7faf8;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 800;
  }


  .image-viewer-panel {
    position: relative;
    display: grid;
    grid-template-columns: 124px minmax(0, 1fr) 320px;
    width: min(1280px, 100%);
    height: min(760px, calc(100vh - 44px));
    max-height: calc(100vh - 44px);
    border-radius: 8px;
    background: #fffefa;
    overflow: hidden;
    box-shadow: 0 20px 52px rgba(36, 40, 44, 0.12);
  }

  .image-viewer-drag-handle {
    display: none;
  }

  .viewer-close-x {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 8;
    display: grid;
    width: 32px;
    height: 32px;
    min-height: 0;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(214, 219, 216, 0.86);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #30343a;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(28, 34, 31, 0.12);
  }

  .viewer-close-x:hover {
    background: #ffffff;
  }

  .image-viewer-main {
    position: relative;
    display: grid;
    min-height: 520px;
    place-items: center;
    background: #fbfaf6;
  }

  .image-viewer-main img {
    display: block;
    max-width: calc(100% - 36px);
    max-height: min(720px, calc(100vh - 80px));
    border-radius: 8px;
    object-fit: contain;
  }

  .image-viewer-main.is-draft {
    background:
      linear-gradient(135deg, rgba(47, 129, 99, 0.08), rgba(189, 137, 37, 0.08)),
      #f7faf8;
  }

  .image-viewer-main.is-draft img {
    box-shadow: 0 18px 44px rgba(28, 34, 31, 0.14);
  }

  .image-viewer-main.is-replacing img {
    opacity: 0.68;
  }

  .image-viewer-main.is-replacing::after {
    position: absolute;
    top: 16px;
    left: 50%;
    z-index: 3;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #17382c;
    content: "图片替换中...";
    font-size: 13px;
    font-weight: 900;
    transform: translateX(-50%);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  }

  .image-viewer-main.is-draft.is-replacing::after {
    content: "图片保存中...";
  }

  .viewer-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 42px;
    height: 56px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    color: #354039;
    font-size: 42px;
    line-height: 1;
    transform: translateY(-50%);
  }

  .viewer-nav:hover {
    background: #ffffff;
  }

  .viewer-nav.prev {
    left: 14px;
  }

  .viewer-nav.next {
    right: 14px;
  }

  .viewer-dots {
    display: none;
  }

  .image-viewer-side {
    display: flex;
    max-height: 100%;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
    padding: 52px 12px 12px;
    border-left: 1px solid #ebe7de;
    background: #ffffff;
    overflow: auto;
  }

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

  .viewer-heading h3 {
    margin-top: 2px;
    font-size: 22px;
    line-height: 1.15;
  }

  .viewer-heading .small {
    min-height: 30px;
    padding: 0 9px;
    font-size: 12px;
  }

  .viewer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .viewer-meta span {
    padding: 3px 6px;
    border-radius: 999px;
    background: #eef6f1;
    color: var(--green-dark);
    font-size: 11px;
    font-weight: 800;
  }

  .viewer-like-btn {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 5;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #4f5d56;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 5px 14px rgba(20, 29, 25, 0.16);
    backdrop-filter: blur(10px);
  }

  .viewer-like-btn.active {
    border-color: rgba(185, 74, 60, 0.24);
    background: #fff3f0;
    color: var(--coral);
  }

  .viewer-like-users {
    margin: -2px 0 0;
    color: #8b918c;
    font-size: 11px;
    font-weight: 450;
    line-height: 1.35;
  }

  .viewer-like-users[hidden] {
    display: none;
  }

  .viewer-caption-block {
    display: grid;
    gap: 8px;
  }

  .viewer-caption-body-text {
    margin: 0;
    color: #4f565d;
    font-size: 14px;
    font-weight: 450;
    line-height: 1.65;
    white-space: pre-wrap;
  }

  .viewer-caption-body-text[hidden] {
    display: none;
  }

  .viewer-caption-block[hidden],
  .viewer-caption-label[hidden],
  .viewer-caption-readonly[hidden] {
    display: none;
  }

  .viewer-caption-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
  }

  .viewer-caption-header .small,
  .viewer-caption-actions .small {
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
  }

  .viewer-caption-label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }

  .viewer-caption-readonly {
    display: grid;
    gap: 8px;
    color: var(--ink);
  }

  .viewer-caption-readonly > span {
    display: none;
  }

  .viewer-caption-readonly strong,
  .viewer-caption-readonly p {
    margin: 0;
    color: var(--ink);
  }

  .viewer-caption-readonly strong {
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.32;
  }

  .viewer-caption-readonly p {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #2e3338;
    font-size: 15px;
    font-weight: 470;
    line-height: 1.72;
    white-space: pre-wrap;
  }

  .viewer-caption-readonly strong:empty::before,
  .viewer-caption-readonly p:empty::before {
    color: rgba(90, 98, 105, 0.5);
  }

  .viewer-caption-label input,
  .viewer-caption-label select,
  .viewer-caption-label textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
  }

  .viewer-caption-label input,
  .viewer-caption-label select {
    min-height: 38px;
    padding: 0 11px;
    font-size: 16px;
    font-weight: 720;
  }

  .viewer-caption-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
  }

  .viewer-caption-label textarea {
    min-height: 74px;
    padding: 10px 11px;
    font-size: 13px;
    font-weight: 450;
    line-height: 1.35;
  }

  .viewer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .viewer-actions button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .viewer-actions .danger {
    border-color: #ead7d1;
    color: var(--coral);
  }

  .viewer-hint {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
  }

  .viewer-comment-box {
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfa;
  }

  .viewer-comment-box .rail-heading h3 {
    font-size: 15px;
    line-height: 1.2;
  }

  .viewer-comments {
    display: grid;
    gap: 5px;
    max-height: clamp(180px, 28vh, 320px);
    overflow: auto;
  }

  .viewer-comment {
    padding: 6px;
    border-radius: 7px;
    background: #ffffff;
    border: 1px solid var(--line);
  }

  .viewer-comment.is-reply {
    background: #f7fbf8;
  }

  .comment-empty-text {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
  }

  .viewer-comment strong,
  .viewer-comment p,
  .viewer-comment em {
    display: block;
    margin: 0;
  }

  .viewer-comment strong {
    font-size: 12px;
  }

  .viewer-comment time,
  .viewer-comment em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
  }

  .comment-reply-target {
    display: inline-block;
    margin-top: 3px;
    color: var(--green-dark);
    font-size: 11px;
    font-weight: 800;
  }

  .viewer-comment p {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.3;
  }

  .comment-reply-btn {
    margin-top: 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 800;
    text-align: left;
  }

  .comment-reply-btn:hover {
    text-decoration: underline;
  }

  .comment-expand-btn {
    width: fit-content;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 900;
    text-align: left;
  }

  .comment-expand-btn:hover {
    text-decoration: underline;
  }

  .viewer-comment-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .viewer-comment-actions button {
    min-height: 36px;
    font-size: 13px;
  }

  .mention-input-wrap {
    position: relative;
  }

  .mention-input-wrap textarea {
    width: 100%;
    min-height: 70px;
    font-size: 13px;
    line-height: 1.35;
  }

  .mention-suggestions {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: calc(100% + 6px);
    z-index: 4;
    display: grid;
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 32px rgba(28, 34, 38, 0.16);
  }

  .mention-suggestions[hidden] {
    display: none;
  }

  .mention-suggestions button {
    min-height: 30px;
    padding: 0 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 800;
    text-align: left;
  }

  .mention-suggestions button:hover {
    background: #eef6f1;
  }

  .viewer-stage-tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .viewer-stage-tabs button {
    min-height: 28px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--muted);
    white-space: nowrap;
  }

  .viewer-stage-tabs button.active {
    border-color: var(--green);
    background: #eef8f2;
    color: var(--green-dark);
    font-weight: 800;
  }

  .viewer-media-rail {
    min-width: 0;
    padding: 16px 14px;
    border-right: 1px solid #ebe7de;
    background: #fffefa;
    overflow: auto;
  }

  .viewer-thumbs {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .viewer-thumbs button {
    display: block;
    min-width: 0;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 16px;
    background: transparent;
    color: var(--muted);
    text-align: left;
    overflow: hidden;
  }

  .viewer-thumbs button.active {
    border-color: var(--coral);
    background: #ffffff;
  }

  .viewer-thumbs img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 14px;
    object-fit: cover;
  }

  .viewer-thumbs span {
    display: none;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  @media (max-width: 1240px) {
    .board-detail-layout,
    .detail-grid {
      grid-template-columns: 1fr;
    }

    .erp-form {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-panel {
      position: static;
    }

    .right-rail {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .image-viewer-panel {
      grid-template-columns: minmax(0, 1fr);
    }

    .viewer-media-rail {
      order: 2;
      padding: 10px;
      border-right: 0;
      border-top: 1px solid #ebe7de;
      overflow-x: auto;
    }

    .viewer-media-rail .viewer-thumbs {
      flex-direction: row;
    }

    .viewer-media-rail .viewer-thumbs button {
      width: 72px;
      min-width: 72px;
      border-radius: 12px;
    }

    .viewer-media-rail .viewer-thumbs img {
      border-radius: 10px;
    }

    .image-viewer-main {
      order: 1;
      min-height: 420px;
    }

    .image-viewer-side {
      order: 3;
    }
  }

  @media (max-width: 820px) {
    .metrics,
    .right-rail {
      grid-template-columns: 1fr 1fr;
    }
    .editor-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .erp-form {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .image-wall {
      grid-template-columns: repeat(var(--image-wall-columns, 2), minmax(0, 1fr));
    }

    .image-stage-section-grid {
      grid-template-columns: repeat(var(--image-wall-columns, 2), minmax(0, 1fr));
    }

    .checklist-list {
      grid-template-columns: 1fr;
    }

    .checklist-add-form {
      grid-template-columns: 1fr;
    }

    .dropzone {
      align-items: stretch;
      flex-direction: column;
    }

    .dropzone-actions {
      justify-content: flex-end;
    }

    .image-viewer-screen {
      padding: 10px;
    }

    .image-viewer-panel {
      max-height: calc(100vh - 20px);
    }

    .image-viewer-main {
      min-height: 300px;
    }
  }

  @media (max-width: 560px) {
    .metrics,
    .right-rail,
    .topbar-actions,
    .editor-grid,
    .erp-form,
    .todo-filters,
    .view-toolbar {
      grid-template-columns: 1fr;
    }

    .image-wall {
      grid-template-columns: 1fr;
    }

    .image-stage-section {
      padding: 8px;
    }

    .image-stage-section-grid {
      grid-template-columns: 1fr;
    }

    .editor-grid .wide {
      grid-column: span 1;
    }
  }

  @media (max-width: 820px) {
    .card-menu-button,
    .image-menu-button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 30px;
      padding: 0 10px;
      border: 1px solid #c9d4cf;
      border-radius: 8px;
      background: #ffffff;
      color: var(--green-dark);
      font-size: 12px;
      font-weight: 900;
    }

    .card-menu-button {
      position: absolute;
      right: 8px;
      bottom: 8px;
    }

    .detail-header {
      align-items: stretch;
      gap: 8px;
      margin-bottom: 8px;
    }

    .detail-header h2 {
      font-size: 24px;
      line-height: 1.14;
    }

    .detail-header .section-label {
      font-size: 11px;
    }

      .stage-control-panel {
        flex: 1 1 100%;
        justify-content: flex-start;
        margin: 0;
      }

      .stage-control-status {
        justify-content: flex-start;
        gap: 6px;
      }

    .stage-control-status .status-pill,
    .stage-step-button {
      min-height: 32px;
      padding: 0 8px;
      font-size: 12px;
    }

    .stage-step-button {
      min-width: 96px;
      flex: 0 0 auto;
    }

    .stage-step-button span {
      width: 18px;
      height: 18px;
      font-size: 19px;
    }

    .stage-action-bar {
      gap: 6px;
      margin-left: 2px;
      padding-left: 8px;
    }

    .stage-quick-action {
      min-height: 34px;
      padding: 0 12px;
      border-radius: 9px;
      font-size: 12px;
    }

    .dropzone-actions button,
    .viewer-actions button {
      width: 100%;
    }

    .detail-grid {
      gap: 12px;
    }

    .product-editor,
    .composition-panel,
    .product-comment-box,
    .stage-checklist,
    .rail-section {
      padding: 10px;
    }

    .product-editor {
      margin-bottom: 8px;
    }

    .composition-panel {
      margin-bottom: 8px;
      padding: 8px;
    }

    .composition-heading {
      margin-bottom: 5px;
    }

    .composition-heading h3 {
      font-size: 18px;
      line-height: 1.1;
    }

    .composition-heading span {
      font-size: 16px;
    }

    .erp-row {
      grid-template-columns: 52px minmax(0, 1fr);
      align-items: center;
      gap: 4px;
      padding: 7px;
      border-radius: 7px;
    }

    .erp-row label {
      margin-bottom: 2px;
      font-size: 11px;
      line-height: 1.15;
    }

    .erp-control-row {
      grid-template-columns: minmax(0, 1.18fr) 54px 42px;
      gap: 4px;
    }

    .erp-row .erp-control-row {
      grid-column: 2;
    }

    .erp-control-row .tiny-button {
      width: 42px;
      min-width: 42px;
      min-height: 30px;
      padding: 0 4px;
      font-size: 11px;
      font-weight: 760;
    }

    .erp-control-row .search-picker input {
      min-height: 30px;
      padding: 0 24px 0 8px;
      font-size: 12px;
      font-weight: 620;
    }

    .erp-control-row .search-picker::after {
      top: 11px;
      right: 10px;
      width: 7px;
      height: 7px;
    }

    .composition-price-input {
      min-height: 30px;
      padding: 0 5px;
      font-size: 12px;
      font-weight: 560;
    }

    .composition-price-row {
      grid-column: 2;
      min-height: 12px;
    }

    .composition-price-hint {
      font-size: 10px;
    }

    .product-editor .panel-title-row.compact,
    .stage-note-heading {
      margin-bottom: 8px;
    }

    .product-editor .panel-title-row h3,
    .stage-note-heading h3 {
      font-size: 18px;
      line-height: 1.15;
    }

    .product-editor-heading-line {
      width: 100%;
      flex-wrap: wrap;
      justify-content: flex-start;
    }

    .product-category-quick-picker {
      order: 3;
      width: 100%;
      margin: 0;
    }

    .product-category-quick-picker select {
      flex: 1 1 auto;
    }

    .editor-toggle-button {
      min-height: 30px;
      padding: 0 10px;
      font-size: 12px;
    }

    .compact-actions {
      display: grid;
      grid-template-columns: 1fr;
      width: auto;
      gap: 6px;
    }

    .compact-actions button {
      min-height: 32px;
      font-size: 12px;
    }

    .product-editor-summary {
      gap: 5px;
    }

    .product-editor-summary span {
      padding: 3px 6px;
      font-size: 10px;
      line-height: 1.15;
    }

    .editor-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 7px;
    }

    .editor-grid label {
      gap: 4px;
      font-size: 11px;
    }

    .editor-grid input {
      min-height: 34px;
      padding: 0 9px;
    }

    .editor-grid textarea {
      min-height: 48px;
      padding: 7px 8px;
    }

    .editor-grid .wide {
      grid-column: 1 / -1;
    }

    .dropzone {
      display: grid;
      gap: 8px;
      min-height: 0;
      margin-bottom: 8px;
      padding: 10px;
    }

    .dropzone strong {
      font-size: 15px;
      line-height: 1.25;
    }

    .dropzone span {
      margin-top: 2px;
      font-size: 12px;
      line-height: 1.35;
    }

    .dropzone-actions {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      width: 100%;
      gap: 6px;
    }

    .dropzone-actions #undoImageEditBtn {
      grid-column: auto;
    }

    .dropzone-actions button {
      min-width: 0;
      min-height: 32px;
      padding: 0 7px;
      font-size: 12px;
    }

    .image-wall-toolbar {
      grid-template-columns: minmax(0, 1fr);
      gap: 8px;
    }

    .image-sort-control {
      justify-content: space-between;
    }

    .image-sort-control select {
      width: auto;
      min-width: 142px;
    }

    .image-wall {
      display: grid;
      grid-template-columns: repeat(var(--image-wall-columns, 2), minmax(0, 1fr));
      gap: 10px;
      align-items: start;
    }

    .image-wall.is-stage-grouped {
      grid-template-columns: 1fr;
      gap: 12px;
    }

    .image-stage-section-grid {
      grid-template-columns: repeat(var(--image-wall-columns, 2), minmax(0, 1fr));
    }

    .image-wall-column {
      gap: 12px;
    }

    .image-card {
      border: 1px solid rgba(32, 33, 36, 0.1);
      border-radius: 8px;
      background: #ffffff;
      box-shadow: 0 2px 8px rgba(28, 34, 38, 0.06);
      overflow: hidden;
    }

    .image-card.placeholder {
      border: 1px dashed rgba(47, 125, 92, 0.24);
      background: #fffdf8;
    }

    .image-card.main-image {
      border-color: rgba(47, 125, 92, 0.38);
    }

    .image-card img {
      width: 100%;
      height: auto;
      min-height: 112px;
      max-height: none;
      border-radius: 0;
      background: #f1f2ee;
      object-fit: cover;
      box-shadow: none;
    }

    .image-card-footer {
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 4px 8px;
      align-items: start;
      padding: 8px;
      border-top: 1px solid rgba(32, 33, 36, 0.06);
      background: #ffffff;
    }

    .image-caption-line {
      display: -webkit-box;
      color: #202124;
      font-size: 13px;
      font-weight: 800;
      line-height: 1.35;
      white-space: normal;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
    }

    .image-card-meta {
      display: flex;
      grid-column: 1 / -1;
      align-items: center;
      justify-content: flex-start;
      gap: 6px;
      min-width: 0;
      color: #7b828a;
      font-size: 11px;
      font-weight: 700;
      line-height: 1.2;
    }

    .image-card-meta span {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .replace-image-btn {
      min-height: 26px;
      padding: 0 7px;
      border: 0;
      background: #f2f4f1;
      color: #53635a;
      font-size: 11px;
    }

    .image-kind-badge,
    .image-pinned-badge,
    .image-comment-hint {
      font-size: 10px;
    }

    .image-kind-badge {
      top: 6px;
      left: 6px;
      padding: 3px 6px;
      background: rgba(32, 33, 36, 0.48);
    }

    .image-pinned-badge {
      top: 6px;
      right: 38px;
      padding: 3px 6px;
    }

    .image-new-badge {
      top: 9px;
      right: 40px;
      width: 7px;
      height: 7px;
    }

    .image-card.is-pinned .image-new-badge {
      top: 32px;
    }

    .image-comment-hint {
      left: 6px;
      right: 44px;
      bottom: 6px;
      max-width: none;
    }

    .image-like-btn {
      right: 6px;
      bottom: 6px;
      min-height: 30px;
      padding: 0 8px;
    }

    .image-menu-button {
      top: 6px;
      right: 6px;
      min-width: 28px;
      min-height: 28px;
      width: 28px;
      padding: 0;
      border: 0;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.86);
      box-shadow: 0 4px 12px rgba(28, 34, 38, 0.12);
      color: transparent;
      font-size: 0;
    }

    .image-menu-button::before {
      content: "...";
      color: #26312c;
      font-size: 14px;
      font-weight: 900;
      letter-spacing: 1px;
      transform: translateY(-2px);
    }

    .product-comments {
      max-height: none;
    }

    .right-rail {
      grid-template-columns: 1fr;
    }
    .modal-screen,
    .image-viewer-screen {
      align-items: end;
      padding: 0;
    }

    .image-viewer-screen {
      align-items: flex-end;
      padding-top: max(21px, env(safe-area-inset-top));
      background: rgba(247, 245, 239, 0.96);
      overscroll-behavior: contain;
      touch-action: none;
    }

    .modal-panel {
      width: 100%;
      max-height: 88vh;
      border-radius: 16px 16px 0 0;
      overflow: auto;
      padding: 18px 16px max(18px, env(safe-area-inset-bottom));
    }

    .image-viewer-panel {
      position: relative;
      display: flex;
      flex-direction: column;
      width: 100%;
      height: min(94dvh, calc(100dvh - 21px));
      max-height: min(94dvh, calc(100dvh - 21px));
      border-radius: 18px 18px 0 0;
      overflow-y: auto;
      transform: translateY(var(--viewer-drawer-y, 0));
      transition: transform 0.22s ease;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
      touch-action: pan-y;
    }

    .image-viewer-panel.is-dragging {
      transition: none;
    }

    .image-viewer-drag-handle {
      position: absolute;
      top: 4px;
      left: 50%;
      z-index: 9;
      display: grid;
      width: 54px;
      height: 9px;
      min-height: 0;
      place-items: center;
      padding: 0;
      border: 1px solid rgba(255, 255, 255, 0.36);
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.24);
      box-shadow: 0 3px 10px rgba(22, 35, 30, 0.08);
      backdrop-filter: blur(10px);
      color: #7b828a;
      font-size: 0;
      font-weight: 900;
      transform: translateX(-50%);
      touch-action: none;
    }

    .image-viewer-drag-handle span {
      display: block;
      width: 30px;
      height: 2px;
      border-radius: 999px;
      background: rgba(105, 116, 111, 0.48);
    }

    .viewer-close-x {
      position: absolute;
      top: 10px;
      right: 10px;
      width: 32px;
      height: 32px;
      border-color: rgba(255, 255, 255, 0.68);
      background: rgba(255, 255, 255, 0.72);
      color: rgba(32, 38, 34, 0.78);
      font-size: 20px;
      box-shadow:
        0 6px 18px rgba(22, 35, 30, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.62);
      backdrop-filter: blur(14px);
    }

    .image-viewer-main {
      order: 1;
      height: clamp(430px, 118vw, 620px);
      min-height: 0;
      flex: 0 0 auto;
      overflow: hidden;
      background: #ffffff;
      touch-action: none;
      user-select: none;
    }

    .image-viewer-main img {
      max-width: calc(100% - 24px);
      max-height: clamp(430px, 118vw, 620px);
    }

    .image-viewer-main > img.is-slide-hidden {
      opacity: 0;
    }

    .viewer-slide-track {
      position: absolute;
      inset: 0;
      z-index: 3;
      display: flex;
      width: 200%;
      height: 100%;
      pointer-events: none;
      background: #ffffff;
      will-change: transform;
      backface-visibility: hidden;
      transform: translate3d(0, 0, 0);
    }

    .viewer-slide-track img {
      width: 50%;
      height: 100%;
      max-width: none;
      max-height: none;
      flex: 0 0 50%;
      object-fit: contain;
      transform: translateZ(0);
    }

    .viewer-slide-track.is-next {
      animation: viewer-track-next 0.36s cubic-bezier(0.22, 0.74, 0.18, 1) both;
    }

    .viewer-slide-track.is-prev {
      animation: viewer-track-prev 0.36s cubic-bezier(0.22, 0.74, 0.18, 1) both;
    }

    @keyframes viewer-track-next {
      from { transform: translate3d(0, 0, 0); }
      to { transform: translate3d(-50%, 0, 0); }
    }

    @keyframes viewer-track-prev {
      from { transform: translate3d(-50%, 0, 0); }
      to { transform: translate3d(0, 0, 0); }
    }

    .viewer-nav {
      display: none;
    }

    .viewer-dots {
      position: absolute;
      bottom: 10px;
      left: 50%;
      z-index: 5;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      padding: 5px 7px;
      border-radius: 999px;
      background: rgba(22, 35, 30, 0.18);
      transform: translateX(-50%);
      backdrop-filter: blur(10px);
    }

    .viewer-dots[hidden] {
      display: none;
    }

    .viewer-dots span {
      width: 5px;
      height: 5px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.46);
      transition: width 0.18s ease, background 0.18s ease;
    }

    .viewer-dots span.active {
      width: 13px;
      background: #ffffff;
    }

    .image-viewer-side {
      order: 3;
      flex: 0 0 auto;
      max-height: none;
      padding: 12px 14px max(14px, env(safe-area-inset-bottom));
      overflow: visible;
      overscroll-behavior: contain;
      touch-action: pan-y;
    }

    .viewer-heading {
      position: relative;
      display: block;
      padding-right: 0;
    }

    .viewer-heading .section-label {
      margin-bottom: 3px;
      color: #767b82;
      font-size: 12px;
      font-weight: 620;
      line-height: 1.15;
      text-transform: none;
    }

    .viewer-heading h3 {
      max-width: 100%;
      font-size: 17px;
      font-weight: 680;
      line-height: 1.28;
      letter-spacing: 0;
    }

    .viewer-heading .small {
      position: static;
      margin-top: 10px;
      min-height: 30px;
      padding: 0 12px;
      border-radius: 999px;
      background: #ffffff;
      color: #30343a;
      font-size: 13px;
      font-weight: 700;
    }

    .viewer-meta {
      gap: 6px;
      margin-top: 8px;
    }

    .viewer-meta span {
      padding: 3px 8px;
      background: #eff8f4;
      color: #207255;
      font-size: 11px;
      font-weight: 650;
      line-height: 1.25;
    }

    .viewer-like-btn {
      right: 12px;
      bottom: 12px;
      min-height: 30px;
      padding: 0 12px;
      border-color: rgba(255, 255, 255, 0.46);
      background: rgba(255, 255, 255, 0.36);
      font-size: 12px;
      font-weight: 680;
      box-shadow: 0 4px 12px rgba(20, 29, 25, 0.1);
    }

    .viewer-caption-block {
      margin-top: 4px;
      gap: 6px;
    }

    .viewer-caption-body-text {
      margin-top: 2px;
      color: #4e555d;
      font-size: 14px;
      font-weight: 430;
      line-height: 1.68;
    }

    .viewer-caption-header {
      font-size: 12px;
      font-weight: 650;
    }

    .viewer-caption-header .small,
    .viewer-caption-actions .small {
      min-height: 28px;
      padding: 0 11px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 650;
    }

    .viewer-caption-actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(66px, 88px));
      justify-content: start;
      max-width: 100%;
      overflow: hidden;
    }

    .viewer-caption-label {
      margin-top: 6px;
      gap: 5px;
      color: #626973;
      font-size: 13px;
      font-weight: 650;
    }

    .viewer-caption-readonly {
      margin-top: 8px;
      gap: 9px;
      color: #24272d;
    }

    .viewer-caption-readonly strong {
      padding: 0;
      font-size: 22px;
      font-weight: 900;
      line-height: 1.28;
    }

    .viewer-caption-readonly p {
      min-height: 0;
      padding: 0;
      font-size: 17px;
      line-height: 1.72;
    }

    .viewer-actions {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .viewer-actions button {
      min-height: 38px;
      padding: 0 10px;
      border-radius: 10px;
      font-size: 13px;
      font-weight: 680;
    }

    .viewer-caption-label textarea {
      min-height: 72px;
      border-color: #e6e8eb;
      border-radius: 12px;
      padding: 10px 12px;
      background: #ffffff;
      color: #202124;
      font-size: 16px !important;
      font-weight: 430;
      line-height: 1.55;
    }

    .viewer-caption-label input,
    .viewer-caption-label select {
      min-height: 36px;
      border-color: #e6e8eb;
      border-radius: 12px;
      padding: 0 12px;
      font-size: 16px !important;
      font-weight: 680;
    }

    .viewer-hint {
      color: #777d85;
      font-size: 12px;
      line-height: 1.45;
    }

    .viewer-comment-box {
      gap: 10px;
      margin-top: 8px;
      padding: 14px 0 0;
      border: 0;
      border-top: 1px solid #eef0f1;
      border-radius: 0;
      background: transparent;
    }

    .viewer-comment-box .rail-heading h3 {
      color: #343941;
      font-size: 16px;
      font-weight: 780;
      line-height: 1.3;
    }

    .viewer-comments {
      gap: 12px;
      max-height: none;
      overflow: visible;
    }

    .viewer-comment {
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
    }

    .viewer-comment.is-reply {
      padding-left: 12px;
      border-left: 2px solid #edf2ef;
      background: transparent;
    }

    .viewer-comment strong {
      color: #646b75;
      font-size: 13px;
      font-weight: 760;
      line-height: 1.3;
    }

    .viewer-comment time,
    .viewer-comment em {
      color: #9aa0a8;
      font-size: 12px;
      font-weight: 500;
    }

    .viewer-comment p {
      margin-top: 5px;
      color: #30343a;
      font-size: 15px;
      font-weight: 450;
      line-height: 1.55;
    }

    .comment-reply-target,
    .comment-reply-btn,
    .comment-expand-btn {
      font-size: 12px;
      font-weight: 700;
    }

    .mention-input-wrap textarea {
      min-height: 42px;
      border-color: transparent;
      border-radius: 999px;
      padding: 10px 14px;
      background: #f4f5f6;
      color: #30343a;
      font-size: 15px !important;
      line-height: 1.35;
      resize: none;
    }

    .viewer-comment-actions button {
      min-height: 34px;
      border-radius: 999px;
    }

    .viewer-media-rail {
      order: 2;
      flex: 0 0 auto;
      padding: 10px 14px;
      border-right: 0;
      border-top: 1px solid #ebe7de;
      border-bottom: 1px solid #ebe7de;
      background: #fffefa;
      overflow-x: auto;
    }

    .viewer-thumbs {
      display: flex;
      gap: 8px;
      overflow-x: auto;
      flex-direction: row;
    }

    .viewer-thumbs button {
      width: 74px;
      min-width: 74px;
      border-radius: 12px;
    }

    .viewer-thumbs img {
      border-radius: 10px;
    }
  }

  @media (max-width: 420px) {
    .topbar-actions,
    .sidebar-section,
    .dropzone-actions {
      grid-template-columns: 1fr;
    }

    .topbar-actions {
      grid-template-columns: 1fr 1fr;
    }

    .compact-actions {
      grid-template-columns: 1fr 1fr;
    }

    .product-editor .compact-actions {
      grid-template-columns: 1fr;
      width: auto;
    }

    .dropzone-actions {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .board-panel,
    .detail-panel {
      padding: 10px;
    }
    .image-card img {
      min-height: 104px;
    }
  }

  @media (max-width: 680px) {
    .product-link-panel {
      max-height: calc(100vh - 20px);
      overflow-y: auto;
    }

    .product-link-form-grid {
      grid-template-columns: minmax(0, 1fr);
    }

    .product-link-form-grid .wide {
      grid-column: auto;
    }

    .product-link-clean-option {
      padding-top: 0;
    }

    .product-link-preview {
      grid-template-columns: 92px minmax(0, 1fr);
    }

    .product-link-preview-media {
      width: 92px;
    }

    .product-link-preview-actions {
      grid-column: 1 / -1;
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .product-link-preview-actions button,
    .product-link-preview-actions label {
      min-width: 0;
      width: 100%;
    }

    .product-link-library-panel {
      width: 100%;
      max-height: calc(100vh - 20px);
      padding: 16px;
    }

    .product-link-library-filters {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-link-library-filters input {
      grid-column: 1 / -1;
    }

    .product-link-library-item {
      grid-template-columns: 82px minmax(0, 1fr);
      align-items: start;
    }

    .product-link-library-cover {
      width: 82px;
    }

    .product-link-library-side {
      grid-column: 1 / -1;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

  }

  @media (max-width: 820px) {
    .product-editor-form {
      grid-template-columns: 1fr;
    }

    .editor-column {
      gap: 8px;
    }

    .editor-section-main,
    .editor-section-business {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .editor-section-category,
    .editor-section-platform {
      gap: 9px;
    }

    .category-choice-grid.compact {
      max-height: 124px;
    }
  }

  @media (max-width: 420px) {
    .editor-section-main,
    .editor-section-business {
      grid-template-columns: 1fr;
    }

    .category-choice {
      min-height: 32px;
      padding: 0 9px;
      font-size: 11px !important;
    }
  }
}
