/* ============================================================================
   manage.css — キュリオマート 出品管理 (diver-market port)
   ============================================================================
   hamster-stream /curiomart/manage/manage.css の移植。独立アプリでは共有
   bubblegum.css / curiomart.css を読み込まないため、このページが使う
   デザイントークンと共通チューム (top bar / section / footer / loader) を
   ここに内包して自己完結させている。
   ============================================================================ */

/* ─── デザイントークン (bubblegum 継承) ─── */
:root {
    --b-bg:    #fff8fb;
    --b-bg2:   #ffeef5;
    --b-card:  #ffffff;
    --b-paper: #fdeef3;
    --b-ink:   #4a1f2e;
    --b-ink2:  #7e3a55;
    --b-ink3:  #b88aa0;
    --b-pink:  #ff2d7a;
    --b-pinkD: #d6075e;
    --b-pinkS: #ffe1ec;
    --b-pinkE: #ffa4c4;
    --b-yel:   #ffd24a;
    --b-yelS:  #fff0b8;
    --b-mint:  #9fe8c8;
    --b-lav:   #cdb7ff;
    --b-font:  "M PLUS Rounded 1c", "Zen Maru Gothic", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
    --b-fontT: "Zen Maru Gothic", "M PLUS Rounded 1c", system-ui, sans-serif;
}

/* hidden 属性をこのシートの display 指定より常に優先させる */
[hidden] {
    display: none !important;
}

/* ─── Base ─── */
html, body {
    background: var(--b-bg);
    color: var(--b-ink);
    font-family: var(--b-font);
}
.curiomart-body {
    background: var(--b-bg);
    color: var(--b-ink);
    font-family: var(--b-font);
    font-weight: 500;
    min-height: 100vh;
    margin: 0;
    padding-top: 88px; /* curiomart-top-bar 固定分の余白 */
}

/* ─── Top Bar ─── */
.curiomart-top-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 88px;
    background: var(--b-yelS);
    border-bottom: 3px solid var(--b-ink);
    box-shadow: 0 4px 0 var(--b-yel), 0 6px 16px rgba(74, 31, 46, 0.12);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 24px;
    z-index: 150;
    box-sizing: border-box;
}
.curiomart-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--b-ink);
}
.curiomart-logo-mark {
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 1px 0 var(--b-pinkD));
}
.curiomart-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}
.curiomart-logo-en {
    font-family: var(--b-fontT);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 5px;
    color: var(--b-pinkD);
}
.curiomart-logo-ja {
    font-family: var(--b-fontT);
    font-size: 22px;
    font-weight: 900;
    color: var(--b-ink);
    margin-top: 4px;
}
.curiomart-top-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}
.curiomart-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--b-ink);
    font-family: var(--b-font);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    padding: 6px 12px;
    border: 2px solid var(--b-ink);
    border-radius: 999px;
    background: var(--b-card);
    box-shadow: 2px 2px 0 var(--b-ink);
}
.curiomart-back-link:hover { background: var(--b-pinkS); }

/* ─── Main / Section ─── */
.curiomart-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 28px 80px;
    box-sizing: border-box;
}
.curiomart-section { margin-bottom: 44px; }
.curiomart-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    position: relative;
}
.curiomart-section-title {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    line-height: 1;
}
.curiomart-section-en {
    font-family: var(--b-fontT);
    font-size: 11px;
    color: var(--b-ink2);
    letter-spacing: 4px;
    font-weight: 800;
}
.curiomart-section-ja {
    font-family: var(--b-fontT);
    font-size: 22px;
    font-weight: 900;
    color: var(--b-ink);
    margin-top: 2px;
}
.curiomart-section-header::after {
    content: '';
    flex: 1;
    height: 3px;
    background: var(--b-ink);
    border-radius: 999px;
}

/* ─── Empty / Error states ─── */
.curiomart-empty {
    text-align: center;
    padding: 60px 28px;
    color: var(--b-ink);
    font-family: var(--b-font);
    font-weight: 800;
}
.curiomart-empty-title {
    font-family: var(--b-fontT);
    font-size: 18px;
    font-weight: 900;
    color: var(--b-ink);
}
.curiomart-empty-sub {
    font-size: 13px;
    color: var(--b-ink2);
    margin-top: 6px;
}

/* ─── Footer ─── */
.curiomart-footer {
    background: var(--b-ink);
    color: #fff;
    padding: 24px 36px;
    margin-top: 40px;
    border-top: 4px solid var(--b-yel);
}
.curiomart-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 12px;
}
.curiomart-footer-link {
    color: #fff;
    font-family: var(--b-font);
    font-weight: 800;
    font-size: 12px;
    text-decoration: none;
    opacity: 0.85;
}
.curiomart-footer-link:hover { color: var(--b-yel); opacity: 1; }
.curiomart-footer-copy {
    color: var(--b-yel);
    font-family: var(--b-fontT);
    font-weight: 900;
    font-size: 12px;
}

/* ─── Loader (旧 nox_loader.gif の置き換え — CSS スピナー) ─── */
.cm-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 16px;
}
.cm-loader-text {
    color: var(--b-ink2);
    font-family: var(--b-font);
    font-weight: 800;
    font-size: 13px;
    text-align: center;
}
.cm-spinner {
    width: 28px;
    height: 28px;
    border: 4px solid var(--b-pinkS);
    border-top-color: var(--b-pinkD);
    border-radius: 50%;
    animation: cm-spin 0.8s linear infinite;
}
@keyframes cm-spin {
    to { transform: rotate(360deg); }
}

/* ─── ポイントアイコン (旧 point-icn.png の置き換え — インライン SVG) ─── */
.cm-pt-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    vertical-align: -3px;
}
.cm-manage-stat-value .cm-stat-icon {
    width: 18px;
    height: 18px;
}
.cm-analytics-total-value .cm-pt-icon { width: 20px; height: 20px; }
.cm-manage-product-price .cm-pt-icon { width: 14px; height: 14px; }

/* ─── Guest (not logged in / no permission) ─── */
.cm-manage-guest {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}
.cm-manage-guest-card {
    background: var(--b-card);
    border: 3px solid var(--b-ink);
    border-radius: 22px;
    box-shadow: 6px 6px 0 var(--b-ink);
    padding: 38px 32px;
    text-align: center;
    max-width: 480px;
}
.cm-manage-guest-card h1 {
    font-family: var(--b-fontT);
    font-weight: 900;
    color: var(--b-pinkD);
    font-size: 22px;
    margin: 0 0 12px;
}
.cm-manage-guest-card p {
    color: var(--b-ink);
    font-weight: 600;
    line-height: 1.6;
    margin: 0 0 24px;
}
.cm-manage-cta-btn {
    display: inline-block;
    background: var(--b-pinkD);
    color: #fff;
    border: 2.5px solid var(--b-ink);
    border-radius: 999px;
    padding: 12px 24px;
    font-family: var(--b-fontT);
    font-weight: 800;
    text-decoration: none;
    box-shadow: 3px 3px 0 var(--b-ink);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.cm-manage-cta-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--b-ink);
}

/* ─── Header ─── */
.cm-manage-header {
    margin-bottom: 20px;
    text-align: center;
}
.cm-manage-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0 0 8px;
}
.cm-manage-title-en {
    font-family: var(--b-fontT);
    font-weight: 900;
    color: var(--b-pinkD);
    font-size: 14px;
    letter-spacing: 6px;
    opacity: 0.7;
}
.cm-manage-title-ja {
    font-family: var(--b-fontT);
    font-weight: 900;
    color: var(--b-pinkD);
    font-size: 24px;
}
.cm-manage-sub {
    color: var(--b-ink);
    font-weight: 600;
    font-size: 13px;
    margin: 0;
}

/* ─── Stats ─── */
.cm-manage-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.cm-manage-stat-card {
    background: var(--b-paper);
    border: 2.5px solid var(--b-ink);
    border-radius: 14px;
    box-shadow: 3px 3px 0 var(--b-ink);
    padding: 14px 16px;
    text-align: center;
}
.cm-manage-stat-value {
    font-family: var(--b-fontT);
    font-weight: 900;
    color: var(--b-pinkD);
    font-size: 24px;
    line-height: 1.1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}
.cm-manage-stat-label {
    color: var(--b-ink);
    font-weight: 700;
    font-size: 11px;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

/* ─── Section header (with add button) ─── */
.cm-manage-add-btn {
    background: var(--b-pinkD);
    color: #fff;
    border: 2.5px solid var(--b-ink);
    border-radius: 999px;
    padding: 8px 18px;
    font-family: var(--b-fontT);
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--b-ink);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.cm-manage-add-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--b-ink);
}
.cm-manage-add-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 var(--b-ink);
}

/* ─── Products grid (1 列, list-like) ─── */
.cm-manage-products-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cm-manage-product-card {
    background: var(--b-paper);
    border: 2.5px solid var(--b-ink);
    border-radius: 14px;
    box-shadow: 3px 3px 0 var(--b-ink);
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 14px;
    align-items: center;
}
.cm-manage-product-thumb {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--b-yelS);
    border: 2px solid var(--b-ink);
}
.cm-manage-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cm-manage-product-thumb-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--b-pinkD);
}
.cm-manage-product-info {
    min-width: 0;
}
.cm-manage-product-title {
    font-family: var(--b-fontT);
    font-weight: 900;
    color: var(--b-pinkD);
    font-size: 15px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cm-manage-product-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.cm-manage-product-status {
    display: inline-block;
    border: 2px solid var(--b-ink);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 800;
}
.cm-manage-product-status.is-published {
    background: var(--b-mint, #9fe8c8);
    color: var(--b-ink);
}
.cm-manage-product-status.is-unpublished {
    background: #eee;
    color: #888;
}
/* 審査ステータス (公開には管理者承認が必要) */
.cm-manage-product-status.is-review {
    background: var(--b-lav, #cdb7ff);
    color: var(--b-ink);
}
.cm-manage-product-status.is-rejected {
    background: #ffd2d2;
    color: #b00040;
    cursor: help;
}
.cm-manage-product-price {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--b-pinkD);
    font-weight: 800;
    font-size: 13px;
}
.cm-manage-product-stats {
    color: var(--b-ink);
    font-weight: 600;
    font-size: 12px;
}
.cm-manage-product-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
}

/* ─── Empty state ─── */
.cm-manage-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--b-ink);
}
.cm-manage-empty-emoji {
    font-size: 48px;
    margin-bottom: 12px;
}
.cm-manage-empty-title {
    font-family: var(--b-fontT);
    font-weight: 900;
    color: var(--b-pinkD);
    font-size: 18px;
    margin-bottom: 6px;
}
.cm-manage-empty-text {
    font-weight: 600;
    font-size: 13px;
}

/* ============================================================================
   Common buttons
   ============================================================================ */
.cm-btn {
    background: var(--b-card);
    color: var(--b-ink);
    border: 2px solid var(--b-ink);
    border-radius: 999px;
    padding: 8px 16px;
    font-family: var(--b-fontT);
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--b-ink);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.cm-btn:hover:not(:disabled) {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--b-ink);
}
.cm-btn:active:not(:disabled) {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 var(--b-ink);
}
.cm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.cm-btn-primary {
    background: var(--b-pinkD);
    color: #fff;
}
.cm-btn-secondary {
    background: var(--b-yelS);
}
.cm-btn-danger {
    background: #d44;
    color: #fff;
}
.cm-btn-link {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: var(--b-pinkD);
    text-decoration: underline;
    padding: 4px 8px;
}
.cm-btn-link:hover:not(:disabled) {
    box-shadow: none;
    transform: none;
}
.cm-btn-danger-link {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: #d44;
    text-decoration: underline;
    padding: 4px 8px;
}
.cm-btn-danger-link:hover:not(:disabled) {
    box-shadow: none;
    transform: none;
}
.cm-btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* ============================================================================
   Modal
   ============================================================================ */
.cm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(74, 31, 46, 0.5);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}
.cm-modal-overlay[hidden] {
    display: none;
}
.cm-modal-content {
    background: var(--b-paper);
    border: 3px solid var(--b-ink);
    border-radius: 18px;
    box-shadow: 5px 5px 0 var(--b-ink);
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cm-modal-content-sm {
    max-width: 440px;
}
.cm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 2px solid var(--b-ink);
    background: var(--b-pinkS);
}
.cm-modal-title {
    font-family: var(--b-fontT);
    font-weight: 900;
    color: var(--b-pinkD);
    font-size: 18px;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cm-modal-close {
    background: var(--b-paper);
    color: var(--b-ink);
    border: 2px solid var(--b-ink);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    font-weight: 900;
    box-shadow: 2px 2px 0 var(--b-ink);
    flex-shrink: 0;
}
.cm-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.cm-modal-footer {
    padding: 14px 20px;
    border-top: 2px solid var(--b-ink);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--b-yelS);
}
/* form 内 footer はモーダル端まで広げる */
form.cm-modal-body .cm-modal-footer {
    margin: 16px -20px -20px;
}

/* ─── Form ─── */
.cm-form-group {
    margin-bottom: 16px;
}
.cm-form-row {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}
.cm-form-row .cm-form-group {
    flex: 1;
    min-width: 140px;
    margin-bottom: 0;
}
.cm-form-tilde {
    color: var(--b-ink);
    font-weight: 800;
    align-self: center;
    padding: 0 4px;
}
.cm-form-label {
    display: block;
    color: var(--b-ink);
    font-family: var(--b-fontT);
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 6px;
}
.cm-required {
    color: #d6075e;
}
.cm-form-hint {
    color: #888;
    font-weight: 600;
    font-size: 11px;
    margin-left: 6px;
}
.cm-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--b-ink);
    border-radius: 10px;
    background: #fff;
    font-family: var(--b-font);
    font-size: 14px;
    color: var(--b-ink);
    box-sizing: border-box;
}
.cm-input:focus {
    outline: 3px solid var(--b-pinkS);
    outline-offset: -1px;
}
.cm-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}
.cm-form-error {
    background: #ffe5ed;
    color: #b00040;
    border: 2px solid #d6075e;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 13px;
    margin: 12px 0;
}
/* 再審査の注意書き (P2-A: 内容変更 → 承認リセット) */
.cm-reapproval-note {
    background: var(--b-yelS);
    border: 2px dashed var(--b-ink);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--b-ink);
    font-weight: 600;
    font-size: 12px;
    line-height: 1.6;
    margin: 12px 0;
}

/* ─── Images grid ─── */
.cm-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.cm-images-grid:empty {
    display: none;
}
.cm-image-card {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--b-yelS);
    border: 2px solid var(--b-ink);
    border-radius: 10px;
    overflow: hidden;
}
.cm-image-card[draggable="true"] {
    cursor: grab;
}
.cm-image-card.is-drag-source {
    opacity: 0.4;
}
.cm-image-card.is-drag-over {
    outline: 3px dashed var(--b-pinkD);
    outline-offset: -3px;
}
.cm-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cm-image-card.is-uploading {
    display: flex;
    align-items: center;
    justify-content: center;
}
.cm-image-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.cm-image-loader .cm-spinner {
    width: 22px;
    height: 22px;
    border-width: 3px;
}
.cm-image-phase {
    font-size: 10px;
    font-weight: 800;
    color: var(--b-ink2);
}
.cm-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--b-ink);
    font-weight: 600;
}
.cm-image-order {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--b-pinkD);
    color: #fff;
    border: 1.5px solid var(--b-ink);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 900;
}
.cm-image-controls {
    position: absolute;
    bottom: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
}
.cm-image-btn {
    background: rgba(255, 255, 255, 0.92);
    color: var(--b-ink);
    border: 1.5px solid var(--b-ink);
    border-radius: 999px;
    width: 26px;
    height: 26px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
}
.cm-image-btn.cm-image-remove {
    background: #d44;
    color: #fff;
}

/* 購入履歴あり → 画像編集ロックの注意書き (P2-D) */
.cm-images-locked-note {
    background: var(--b-pinkS);
    border: 2px solid var(--b-pinkD);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--b-pinkD);
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 12px;
}

/* dropzone */
.cm-images-add {
    border: 2.5px dashed var(--b-ink);
    border-radius: 14px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    color: var(--b-ink);
    background: var(--b-paper);
    transition: background 0.15s ease;
}
.cm-images-add:hover {
    background: var(--b-yelS);
}
.cm-images-add.is-dragging {
    background: var(--b-pinkS);
    border-color: var(--b-pinkD);
}
.cm-images-add svg {
    color: var(--b-pinkD);
    margin-bottom: 6px;
}
.cm-images-add-text {
    font-family: var(--b-fontT);
    font-weight: 800;
    font-size: 13px;
}
.cm-images-add-sub {
    color: #888;
    font-size: 11px;
    margin-top: 4px;
}

/* ============================================================================
   Sales analytics (過去 30 日 — /api/market/stats/daily)
   ============================================================================ */
.cm-analytics-section { margin-bottom: 24px; }
.cm-analytics-card {
    background: var(--b-paper);
    border: 2.5px solid var(--b-ink);
    border-radius: 14px;
    box-shadow: 3px 3px 0 var(--b-ink);
    padding: 18px 20px;
}
.cm-analytics-totals {
    display: flex;
    gap: 24px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.cm-analytics-total-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cm-analytics-total-label {
    font-family: var(--b-fontT);
    font-weight: 800;
    color: var(--b-ink);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.cm-analytics-total-value {
    font-family: var(--b-fontT);
    font-weight: 900;
    color: var(--b-pinkD);
    font-size: 26px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cm-analytics-total-item-muted .cm-analytics-total-value { color: var(--b-ink); font-size: 18px; }
.cm-analytics-chart {
    width: 100%;
    min-height: 140px;
}
.cm-analytics-empty {
    text-align: center;
    color: var(--b-ink);
    font-weight: 600;
    padding: 28px 0;
}
.cm-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 120px;
    padding: 0 4px;
    border-bottom: 2px solid var(--b-ink);
}
.cm-chart-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    height: 100%;
    justify-content: flex-end;
    min-width: 0;
}
.cm-chart-bar {
    width: 100%;
    background: linear-gradient(180deg, var(--b-pink), var(--b-pinkD));
    border-radius: 4px 4px 0 0;
    border: 1.5px solid var(--b-ink);
    transition: background 0.15s ease;
    box-sizing: border-box;
}
.cm-chart-bar:hover { background: linear-gradient(180deg, var(--b-pinkD), var(--b-pinkD)); }
.cm-chart-bar-label {
    font-size: 9px;
    color: var(--b-ink);
    font-weight: 700;
    line-height: 1;
}
.cm-chart-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 11px;
    color: #888;
    font-weight: 600;
}

/* ============================================================================
   Product type tabs (image / video — video は Phase 2 準備中)
   ============================================================================ */
.cm-form-type {
    margin-bottom: 14px;
}
.cm-type-tabs {
    display: inline-flex;
    border: 2.5px solid var(--b-ink);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: 3px 3px 0 var(--b-ink);
    background: var(--b-paper);
}
.cm-type-tab {
    background: transparent;
    border: 0;
    padding: 8px 18px;
    font-family: var(--b-fontT);
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    color: var(--b-ink);
    transition: background 0.12s ease, color 0.12s ease;
}
.cm-type-tab + .cm-type-tab {
    border-left: 2px solid var(--b-ink);
}
.cm-type-tab.is-active {
    background: var(--b-pinkD);
    color: #fff;
}
.cm-type-tab:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}
.cm-type-badge {
    display: inline-block;
    background: var(--b-yel);
    color: var(--b-ink);
    border: 1.5px solid var(--b-ink);
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 10px;
    font-weight: 900;
    vertical-align: 1px;
}

/* ============================================================================
   Video upload card (Phase 2 準備中 — 案内のみ)
   ============================================================================ */
.cm-video-card {
    border: 2.5px dashed var(--b-ink);
    border-radius: 14px;
    padding: 24px 18px;
    text-align: center;
    cursor: pointer;
    background: var(--b-paper);
    transition: background 0.15s ease, border-color 0.15s ease;
}
.cm-video-card:hover { background: var(--b-pinkS); }
.cm-video-card.is-disabled {
    cursor: not-allowed;
    opacity: 0.75;
}
.cm-video-card.is-disabled:hover { background: var(--b-paper); }
.cm-video-empty { color: var(--b-ink); }
.cm-video-empty svg {
    color: var(--b-pinkD);
    margin-bottom: 6px;
}
.cm-video-empty-text {
    font-family: var(--b-fontT);
    font-weight: 800;
    font-size: 14px;
}
.cm-video-empty-sub {
    color: #888;
    font-size: 11px;
    margin-top: 4px;
}
.cm-video-loaded {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.cm-video-filename {
    font-family: var(--b-fontT);
    font-weight: 800;
    color: var(--b-pinkD);
    font-size: 14px;
    word-break: break-all;
}
.cm-video-progress {
    width: 100%;
    height: 14px;
    background: var(--b-yelS);
    border: 2px solid var(--b-ink);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.cm-video-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--b-pinkD);
    transition: width 0.2s ease;
}
.cm-video-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--b-ink);
    font-family: var(--b-fontT);
    font-weight: 800;
    font-size: 10px;
}

/* ─── Thumbnail ─── */
.cm-thumb-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 2px solid var(--b-ink);
    border-radius: 12px;
    background: var(--b-paper);
}
.cm-thumb-preview {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--b-yelS);
    border: 2px solid var(--b-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--b-pinkD);
    cursor: pointer;
    flex-shrink: 0;
}
.cm-thumb-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cm-thumb-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================================================
   Owner Preview Modal (原本確認 — 認証付き画像)
   ============================================================================ */
.cm-preview-content {
    max-width: 860px;
}
.cm-preview-body {
    overscroll-behavior: contain;
}
.cm-preview-note {
    color: var(--b-ink);
    font-weight: 600;
    font-size: 12px;
    margin: 0 0 12px;
}
.cm-preview-stage {
    background: var(--b-ink);
    border: 2px solid var(--b-ink);
    border-radius: 12px;
    min-height: 320px;
    max-height: 64vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.cm-preview-stage img {
    max-width: 100%;
    max-height: 64vh;
    object-fit: contain;
    display: block;
}
.cm-preview-stage .cm-spinner {
    border-color: rgba(255, 255, 255, 0.25);
    border-top-color: var(--b-pinkE);
}
.cm-preview-error {
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 24px;
    text-align: center;
}
.cm-preview-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 14px;
}
.cm-preview-counter {
    font-family: var(--b-fontT);
    font-weight: 900;
    color: var(--b-ink);
    font-size: 13px;
    min-width: 64px;
    text-align: center;
}

/* ============================================================================
   Mobile
   ============================================================================ */
@media (max-width: 768px) {
    .curiomart-top-bar {
        height: 76px;
        padding: 0 16px;
        gap: 12px;
    }
    .curiomart-body { padding-top: 76px; }
    .curiomart-logo-mark { font-size: 26px; }
    .curiomart-logo-en { font-size: 10px; letter-spacing: 3px; }
    .curiomart-logo-ja { font-size: 18px; }
    .curiomart-main { padding: 18px 14px 60px; }
    .curiomart-section-ja { font-size: 18px; }

    .cm-manage-title-ja { font-size: 20px; }
    .cm-manage-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .cm-manage-stat-value { font-size: 20px; }
    .cm-manage-product-card {
        grid-template-columns: 64px 1fr;
    }
    .cm-manage-product-thumb {
        width: 64px;
        height: 64px;
    }
    .cm-manage-product-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
    .cm-manage-product-title { white-space: normal; }
    .cm-form-row { flex-direction: column; align-items: stretch; gap: 8px; }
    .cm-form-row .cm-form-group { min-width: 0; }
    .cm-form-tilde { display: none; }
    .cm-modal-body { padding: 14px; }
    form.cm-modal-body .cm-modal-footer {
        margin: 14px -14px -14px;
    }
    .cm-preview-stage { min-height: 220px; }
}
