/* ==========================================================================
   Tool market — public marketplace, upload form, my uploads and detail page.
   Built on the site's §54 editorial tokens; no page-specific theme branches.
   ========================================================================== */

.tool-market-body #app-main { max-width: 1320px; }

.tm-page {
    padding-bottom: clamp(56px, 8vw, 110px);
}
.tm-page--narrow { max-width: 1040px; margin-inline: auto; }

/* ── buttons ─────────────────────────────────────────────────────────────── */
.tm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-btn);
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 13.5px;
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.tm-btn:hover { background: var(--bg-subtle); color: var(--text-primary); text-decoration: none; }
.tm-btn:active { transform: scale(.98); }
.tm-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 2px; }
.tm-btn--primary {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--brand-contrast, #fff);
}
.tm-btn--primary:hover { background: var(--brand-hover, var(--brand)); border-color: var(--brand-hover, var(--brand)); color: var(--brand-contrast, #fff); }
.tm-btn--danger { border-color: color-mix(in srgb, #ff453a 45%, transparent); color: #ff453a; }
.tm-btn--danger:hover { background: color-mix(in srgb, #ff453a 10%, transparent); color: #ff453a; }
.tm-btn--sm { min-height: 34px; padding: 0 12px; font-size: 12.5px; }
.tm-btn[disabled], .tm-btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.tm-spin { animation: tm-spin 1s linear infinite; }
@keyframes tm-spin { to { transform: rotate(360deg); } }

.tm-text-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}
.tm-text-link:hover { color: var(--brand); text-decoration: none; }

.tm-eyebrow {
    display: block;
    font-family: var(--font-data);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* ── toolbar ─────────────────────────────────────────────────────────────── */
.tm-toolbar {
    display: grid;
    gap: 16px;
    padding: clamp(20px, 3vw, 30px) 0 0;
}
.tm-search {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 620px;
    padding: 6px 6px 6px 14px;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-pill);
    background: var(--bg-card);
}
.tm-search > i { color: var(--text-tertiary); font-size: 14px; }
.tm-search input {
    flex: 1;
    min-width: 0;
    height: 34px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 14px;
}
.tm-search input::placeholder { color: var(--text-tertiary); }
.tm-search-clear {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-tertiary);
    text-decoration: none;
}
.tm-search-clear:hover { background: var(--bg-subtle); color: var(--text-primary); }

.tm-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 0 13px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tm-chip span {
    font-family: var(--font-data);
    font-size: 10.5px;
    color: var(--text-tertiary);
}
.tm-chip:hover { border-color: var(--rule-strong); background: var(--bg-subtle); color: var(--text-primary); text-decoration: none; }
.tm-chip.is-active { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.tm-chip.is-active span { color: var(--brand); }

/* ── my recent strip ─────────────────────────────────────────────────────── */
.tm-mine-strip {
    margin-top: 26px;
    padding: 16px 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}
.tm-mine-strip-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.tm-mine-strip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-mine-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 7px 12px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 12.5px;
    text-decoration: none;
}
.tm-mine-pill:hover { border-color: var(--rule-strong); background: var(--bg-subtle); color: var(--text-primary); text-decoration: none; }
.tm-mine-pill-name { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); font-weight: 600; }
.tm-mine-pill-state { color: var(--text-tertiary); font-size: 11.5px; }

.tm-status-dot {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-tertiary);
}
.tm-status-dot[data-status="approved"] { background: #30d158; }
.tm-status-dot[data-status="pending"] { background: #ffd60a; }
.tm-status-dot[data-status="rejected"] { background: #ff453a; }
.tm-status-dot[data-status="error"] { background: #ff9f0a; }

/* ── marketplace grid ────────────────────────────────────────────────────── */
.tm-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 2vw, 22px);
    margin-top: clamp(26px, 4vw, 42px);
}
.tm-card {
    min-width: 0;
    border: 1px solid var(--rule);
    border-radius: var(--radius-l);
    background: var(--bg-card);
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.tm-card:hover {
    border-color: var(--rule-strong);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}
.tm-card-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.tm-card-link:hover { color: inherit; text-decoration: none; }

.tm-card-art {
    position: relative;
    display: flex;
    height: 132px;
    align-items: flex-end;
    justify-content: space-between;
    padding: 16px;
    background:
        radial-gradient(120% 150% at 12% 0%, color-mix(in srgb, var(--brand) 30%, transparent), transparent 62%),
        linear-gradient(135deg, color-mix(in srgb, var(--brand) 16%, var(--bg-subtle)), var(--bg-subtle));
}
.tm-card-art[data-category="developer"] {
    background:
        radial-gradient(120% 150% at 12% 0%, rgba(48, 209, 88, .26), transparent 62%),
        linear-gradient(135deg, rgba(48, 209, 88, .12), var(--bg-subtle));
}
.tm-card-art[data-category="design"] {
    background:
        radial-gradient(120% 150% at 12% 0%, rgba(255, 55, 95, .24), transparent 62%),
        linear-gradient(135deg, rgba(255, 55, 95, .12), var(--bg-subtle));
}
.tm-card-art[data-category="data"] {
    background:
        radial-gradient(120% 150% at 12% 0%, rgba(10, 132, 255, .26), transparent 62%),
        linear-gradient(135deg, rgba(10, 132, 255, .12), var(--bg-subtle));
}
.tm-card-art[data-category="education"] {
    background:
        radial-gradient(120% 150% at 12% 0%, rgba(255, 214, 10, .22), transparent 62%),
        linear-gradient(135deg, rgba(255, 214, 10, .12), var(--bg-subtle));
}
.tm-card-art[data-category="fun"] {
    background:
        radial-gradient(120% 150% at 12% 0%, rgba(191, 90, 242, .24), transparent 62%),
        linear-gradient(135deg, rgba(191, 90, 242, .12), var(--bg-subtle));
}
.tm-card-icon {
    display: inline-flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--text-primary) 14%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg-card) 62%, transparent);
    color: var(--text-primary);
    font-size: 21px;
    backdrop-filter: blur(8px);
}
.tm-card-cat {
    padding: 4px 9px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--bg-card) 72%, transparent);
    color: var(--text-secondary);
    font-family: var(--font-data);
    font-size: 10.5px;
    letter-spacing: .08em;
}
.tm-card-body { padding: 16px 17px 17px; }
.tm-card-title {
    margin: 0 0 8px;
    font-family: var(--font-editorial);
    font-size: 19px;
    font-weight: 700;
    font-stretch: 112%;
    letter-spacing: -.015em;
    line-height: 1.2;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tm-card-desc {
    display: -webkit-box;
    min-height: 40px;
    margin: 0 0 14px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.55;
}
.tm-card-desc--muted { color: var(--text-tertiary); font-style: italic; }
.tm-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--rule);
    color: var(--text-tertiary);
    font-size: 11.5px;
}
.tm-card-meta span, .tm-card-meta time { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.tm-card-meta time { margin-left: auto; font-family: var(--font-data); font-size: 10.5px; }
.tm-author { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── pager / empty / policy ──────────────────────────────────────────────── */
.tm-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 36px;
}
.tm-pager-state { color: var(--text-tertiary); font-family: var(--font-data); font-size: 11.5px; }

.tm-empty {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin-top: 34px;
    padding: clamp(46px, 8vw, 86px) 24px;
    border: 1px dashed var(--rule-strong);
    border-radius: var(--radius-l);
    text-align: center;
}
.tm-empty-icon {
    display: inline-flex;
    width: 58px;
    height: 58px;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: var(--bg-subtle);
    color: var(--text-tertiary);
    font-size: 25px;
}
.tm-empty h2 { margin: 4px 0 0; font-family: var(--font-editorial); font-size: 22px; font-weight: 700; }
.tm-empty p { max-width: 46ch; margin: 0 0 8px; color: var(--text-secondary); font-size: 13.5px; line-height: 1.7; }

.tm-policy {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: clamp(38px, 6vw, 70px);
    padding-top: 26px;
    border-top: 1px solid var(--rule-strong);
}
.tm-policy-item { display: flex; gap: 12px; min-width: 0; }
.tm-policy-item > i {
    flex: 0 0 auto;
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--bg-subtle);
    color: var(--brand);
    font-size: 16px;
}
.tm-policy-item strong { display: block; margin-bottom: 3px; font-size: 13px; color: var(--text-primary); }
.tm-policy-item span { display: block; color: var(--text-secondary); font-size: 12.5px; line-height: 1.6; }

/* ── notices / badges ────────────────────────────────────────────────────── */
.tm-notice {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding: 14px 16px;
    border: 1px solid var(--rule);
    border-left: 3px solid var(--text-tertiary);
    border-radius: var(--radius-s);
    background: var(--bg-subtle);
}
.tm-notice[data-kind="approved"] { border-left-color: #30d158; }
.tm-notice[data-kind="pending"] { border-left-color: #ffd60a; }
.tm-notice[data-kind="rejected"] { border-left-color: #ff453a; }
.tm-notice[data-kind="error"] { border-left-color: #ff9f0a; }
.tm-notice > i { color: var(--text-secondary); font-size: 16px; margin-top: 1px; }
.tm-notice strong { display: block; margin-bottom: 3px; color: var(--text-primary); font-size: 13px; }
.tm-notice span { display: block; color: var(--text-secondary); font-size: 12.5px; line-height: 1.6; }

.tm-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-family: var(--font-data);
    font-size: 10px;
    letter-spacing: .04em;
    white-space: nowrap;
}
.tm-badge[data-status="approved"] { border-color: color-mix(in srgb, #30d158 40%, transparent); color: #248a3d; }
.tm-badge[data-status="pending"] { border-color: color-mix(in srgb, #ffd60a 50%, transparent); color: #8a6d00; }
.tm-badge[data-status="rejected"] { border-color: color-mix(in srgb, #ff453a 40%, transparent); color: #c9261d; }
.tm-badge[data-status="error"] { border-color: color-mix(in srgb, #ff9f0a 45%, transparent); color: #a55a00; }
.tm-badge--live { border-color: color-mix(in srgb, var(--brand) 45%, transparent); color: var(--brand); }

[data-mode="dark"] .tm-badge[data-status="approved"] { color: #6ee787; }
[data-mode="dark"] .tm-badge[data-status="pending"] { color: #ffe066; }
[data-mode="dark"] .tm-badge[data-status="rejected"] { color: #ff8a80; }
[data-mode="dark"] .tm-badge[data-status="error"] { color: #ffc46b; }

/* ── upload form ─────────────────────────────────────────────────────────── */
.tm-form {
    display: grid;
    gap: 22px;
    margin-top: 30px;
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid var(--rule);
    border-radius: var(--radius-l);
    background: var(--bg-card);
}
.tm-form-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(180px, .6fr); gap: 18px; }
.tm-field { display: grid; gap: 7px; min-width: 0; }
.tm-field-label { color: var(--text-primary); font-size: 12.5px; font-weight: 650; }
.tm-field-label em { color: var(--text-tertiary); font-style: normal; font-weight: 500; }
.tm-field-hint { color: var(--text-tertiary); font-size: 11.5px; line-height: 1.55; }
.tm-input, .tm-select, .tm-textarea {
    width: 100%;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-s);
    background: var(--bg-body);
    color: var(--text-primary);
    font: inherit;
    font-size: 13.5px;
}
.tm-input, .tm-select { height: 42px; padding: 0 12px; }
.tm-textarea { min-height: 92px; padding: 11px 12px; line-height: 1.6; resize: vertical; }
.tm-input:focus, .tm-select:focus, .tm-textarea:focus {
    border-color: var(--brand);
    outline: 0;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.tm-drop {
    position: relative;
    display: flex;
    min-height: 132px;
    align-items: center;
    gap: 14px;
    padding: 20px;
    border: 1px dashed var(--rule-strong);
    border-radius: var(--radius-m);
    background: var(--bg-subtle);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.tm-drop:hover, .tm-drop.is-dragover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, var(--bg-subtle)); }
.tm-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tm-drop-icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--bg-card);
    color: var(--brand);
    font-size: 22px;
}
.tm-drop-copy { display: grid; gap: 4px; min-width: 0; }
.tm-drop-copy strong { color: var(--text-primary); font-size: 13.5px; }
.tm-drop-copy span { color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.tm-drop-file { margin-left: auto; color: var(--brand); font-family: var(--font-data); font-size: 11.5px; }

.tm-review-note {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
    border-radius: var(--radius-s);
    background: color-mix(in srgb, var(--brand) 7%, transparent);
}
.tm-review-note > i { color: var(--brand); font-size: 17px; margin-top: 1px; }
.tm-review-note p { margin: 0; color: var(--text-secondary); font-size: 12.5px; line-height: 1.65; }
.tm-review-note strong { color: var(--text-primary); }

.tm-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: 4px; }

.tm-checklist {
    margin-top: 26px;
    padding: 20px 22px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-m);
    background: var(--bg-subtle);
}
.tm-checklist h2 { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--text-primary); }
.tm-checklist ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tm-checklist li { display: flex; gap: 8px; color: var(--text-secondary); font-size: 12.5px; line-height: 1.55; }
.tm-checklist li i { color: #30d158; font-size: 13px; margin-top: 2px; }

/* ── my uploads ──────────────────────────────────────────────────────────── */
.tm-stat-band {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 30px;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}
.tm-stat-band > div { padding: 18px 16px; border-left: 1px solid var(--rule); }
.tm-stat-band > div:first-child { border-left: 0; padding-left: 0; }
.tm-stat-band span { display: block; color: var(--text-tertiary); font-family: var(--font-data); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.tm-stat-band b { display: block; margin-top: 5px; color: var(--text-primary); font-family: var(--font-data); font-size: 23px; font-weight: 500; font-variant-numeric: tabular-nums; }

.tm-my-list { display: grid; gap: 14px; margin-top: 28px; }
.tm-my-card {
    padding: 18px 20px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-m);
    background: var(--bg-card);
}
.tm-my-card[data-status="rejected"] { border-left: 3px solid #ff453a; }
.tm-my-card[data-status="error"] { border-left: 3px solid #ff9f0a; }
.tm-my-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.tm-my-title { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; min-width: 0; }
.tm-my-title h2 { margin: 0; font-family: var(--font-editorial); font-size: 18px; font-weight: 700; color: var(--text-primary); }
.tm-my-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--text-tertiary); font-size: 11.5px; }
.tm-my-desc { margin: 9px 0 0; color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.tm-review-result { display: flex; gap: 9px; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--bg-subtle); }
.tm-review-result[data-status="approved"] > i { color: #30d158; }
.tm-review-result[data-status="rejected"] > i { color: #ff453a; }
.tm-review-result[data-status="error"] > i { color: #ff9f0a; }
.tm-review-result p { margin: 0; color: var(--text-secondary); font-size: 12.5px; line-height: 1.6; }
.tm-review-result strong { color: var(--text-primary); }
.tm-my-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tm-my-actions form { display: inline-flex; margin: 0; }

/* ── detail ──────────────────────────────────────────────────────────────── */
.tm-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
    gap: clamp(20px, 3vw, 36px);
    margin-top: 30px;
    align-items: start;
}
.tm-preview-card {
    min-width: 0;
    border: 1px solid var(--rule);
    border-radius: var(--radius-l);
    background: var(--bg-card);
    overflow: hidden;
}
.tm-preview-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--rule);
    background: var(--bg-subtle);
}
.tm-preview-dots { display: inline-flex; gap: 5px; }
.tm-preview-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--rule-strong); }
.tm-preview-address {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--text-tertiary);
    font-family: var(--font-data);
    font-size: 10.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tm-preview-open { color: var(--text-tertiary); font-size: 14px; text-decoration: none; }
.tm-preview-open:hover { color: var(--brand); }
.tm-preview-frame { display: block; width: 100%; height: min(68vh, 720px); border: 0; background: #fff; }
.tm-preview-note { margin: 0; padding: 11px 16px; border-top: 1px solid var(--rule); color: var(--text-tertiary); font-size: 11.5px; line-height: 1.55; }

.tm-detail-side { display: grid; gap: 18px; }
.tm-side-block { padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.tm-side-block:last-child { border-bottom: 0; padding-bottom: 0; }
.tm-side-author { display: flex; align-items: center; gap: 7px; margin: 7px 0 0; color: var(--text-primary); font-size: 13.5px; font-weight: 600; }
.tm-side-author a { color: inherit; text-decoration: none; }
.tm-side-author a:hover { color: var(--brand); text-decoration: underline; }
.tm-facts { display: grid; gap: 8px; margin: 10px 0 0; }
.tm-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tm-facts dt { color: var(--text-tertiary); font-size: 11.5px; font-weight: 500; }
.tm-facts dd { margin: 0; color: var(--text-primary); font-family: var(--font-data); font-size: 11.5px; text-align: right; }
.tm-side-reason { margin: 8px 0 0; color: var(--text-secondary); font-size: 12.5px; line-height: 1.65; }
.tm-side-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-side-actions form { display: inline-flex; margin: 0; }
.tm-side-warning { display: flex; gap: 9px; padding: 12px 13px; border: 1px solid var(--rule); border-radius: var(--radius-s); background: var(--bg-subtle); }
.tm-side-warning > i { color: var(--text-tertiary); font-size: 15px; margin-top: 1px; }
.tm-side-warning p { margin: 0; color: var(--text-secondary); font-size: 11.5px; line-height: 1.6; }
.tm-side-warning code { color: var(--text-primary); font-size: 10.5px; }

/* ── responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1040px) {
    .tm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tm-policy { grid-template-columns: 1fr; gap: 14px; }
    .tm-detail-layout { grid-template-columns: 1fr; }
    .tm-preview-frame { height: min(62vh, 620px); }
}
@media (max-width: 720px) {
    .tm-grid { grid-template-columns: 1fr; }
    .tm-form-grid { grid-template-columns: 1fr; }
    .tm-stat-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tm-stat-band > div { border-left: 0; border-top: 1px solid var(--rule); padding-left: 0; }
    .tm-stat-band > div:first-child, .tm-stat-band > div:nth-child(2) { border-top: 0; }
    .tm-stat-band > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--rule); }
    .tm-my-head { align-items: flex-start; }
    .tm-my-meta { width: 100%; }
    .tm-search { max-width: none; }
    .tm-drop { align-items: flex-start; flex-wrap: wrap; }
    .tm-drop-file { margin-left: 0; width: 100%; }
    .tm-form-actions { justify-content: stretch; }
    .tm-form-actions .tm-btn { flex: 1; }
}
@media (max-width: 420px) {
    .tm-stat-band { grid-template-columns: 1fr; }
    .tm-stat-band > div:nth-child(even) { padding-left: 0; border-left: 0; }
    .tm-stat-band > div { border-top: 1px solid var(--rule); }
    .tm-stat-band > div:first-child { border-top: 0; }
    .tm-card-art { height: 112px; }
}
