/* PlengMa marketplace design system
   เพลงคุณ...เพลงมา! — Template-based composing */

:root {
    --bg: #fbf8f3;
    --surface: #ffffff;
    --ink: #17131f;
    --muted: #6b6577;
    --line: #e9e3d9;
    --night: #14101c;
    --night-2: #1f1830;
    --accent: #ff5a36;
    --accent-deep: #e0431f;
    --amber: #ffb627;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(23, 19, 31, 0.06), 0 12px 32px -12px rgba(23, 19, 31, 0.18);
    --font-head: 'Prompt', 'Noto Sans Thai', system-ui, sans-serif;
    --font-body: 'Noto Sans Thai', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a { color: inherit; }

h1, h2, h3 {
    margin: 0;
    font-family: var(--font-head);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

p { margin: 0; }

.wrap {
    width: min(1180px, 100% - 32px);
    margin-inline: auto;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-head);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.eyebrow::before {
    content: '';
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.8rem 1.4rem;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font: 600 0.98rem var(--font-head);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }

.btn-ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }

.btn-light { border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.btn-light:hover { border-color: #fff; }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.88rem; }

/* Header */
.mk-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(251, 248, 243, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.mk-header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 68px;
}

.mk-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font: 700 1.3rem var(--font-head);
}

.mk-brand img { width: 34px; height: 34px; object-fit: contain; }

.mk-brand small {
    display: block;
    font: 500 0.7rem var(--font-body);
    color: var(--muted);
    letter-spacing: 0.02em;
    margin-top: -4px;
}

.mk-nav {
    display: flex;
    gap: 6px;
    margin-left: auto;
    align-items: center;
}

.mk-nav a {
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--muted);
}

.mk-nav a:hover,
.mk-nav a.is-current { color: var(--ink); background: rgba(23, 19, 31, 0.06); }

.mk-nav .btn { color: #fff; margin-left: 8px; }
.mk-nav .btn:hover { background: var(--accent-deep); }

@media (max-width: 760px) {
    .mk-header-inner { flex-wrap: wrap; padding: 10px 0; gap: 8px 16px; }
    .mk-nav { width: 100%; margin-left: 0; flex-wrap: wrap; gap: 2px; }
    .mk-nav a { white-space: nowrap; }
    .mk-nav .btn { margin-left: auto; }
}

/* Hero */
.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(60% 80% at 85% 10%, rgba(255, 90, 54, 0.38), transparent 60%),
        radial-gradient(50% 70% at 5% 100%, rgba(255, 182, 39, 0.22), transparent 60%),
        var(--night);
    color: #fff;
}

.hero-grid {
    display: grid;
    gap: 48px;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    padding: 72px 0 80px;
}

.hero h1 {
    font-size: clamp(2.5rem, 6.4vw, 4.6rem);
    font-weight: 700;
    line-height: 1.08;
    margin: 16px 0 18px;
}

.hero h1 em {
    font-style: normal;
    color: var(--amber);
}

.hero-lead {
    max-width: 34rem;
    font-size: 1.12rem;
    color: rgba(255, 255, 255, 0.78);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.7);
}

.hero-points li::before { content: '✓'; margin-right: 6px; color: var(--amber); }

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; padding: 48px 0 56px; gap: 36px; }
}

/* Template card + waveform art */
.tcard {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tcard:hover { transform: translateY(-3px); }
.tcard[hidden] { display: none; }

.tart {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 168px;
    padding: 14px;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(140deg, var(--c1, #8b1f15), var(--c2, #e07b2c));
    overflow: hidden;
}

.tart .wave {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.55);
}

.pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: rgba(20, 16, 28, 0.55);
    backdrop-filter: blur(6px);
    font: 600 0.74rem var(--font-head);
    letter-spacing: 0.04em;
}

.pill-open { background: var(--amber); color: var(--night); }

.tart-top {
    position: absolute;
    top: 12px;
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.play {
    position: relative;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-left: auto;
    border-radius: 50%;
    background: #fff;
    color: var(--night);
    font-size: 1rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.play.is-off { background: rgba(255, 255, 255, 0.35); color: #fff; box-shadow: none; }

.tbody {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px 18px;
    flex: 1;
}

.tcat {
    font: 600 0.74rem var(--font-head);
    letter-spacing: 0.1em;
    color: var(--accent);
    text-transform: uppercase;
}

.tbody h3 { font-size: 1.15rem; }
.tbody h3 a { text-decoration: none; }
.tmeta { color: var(--muted); font-size: 0.9rem; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
    padding: 0.18rem 0.65rem;
    border-radius: 999px;
    background: #f1ece3;
    font-size: 0.78rem;
    color: var(--muted);
}

.tfoot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}

.price { font: 600 0.95rem var(--font-head); }
.price small { font: 400 0.78rem var(--font-body); color: var(--muted); }

/* Hero featured card (dark) */
.hero-card {
    position: relative;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
}

.hero-card .tart {
    min-height: 220px;
    border-radius: 16px;
}

.hero-card h2 { font-size: 1.4rem; margin: 18px 0 4px; }
.hero-card p { color: rgba(255, 255, 255, 0.7); font-size: 0.95rem; }
.hero-card .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }

/* Sections */
.section { padding: 72px 0; }
.section-alt { background: #f4efe6; }

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
}

.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-top: 8px; }
.section-head p { max-width: 36rem; color: var(--muted); margin-top: 8px; }

.grid {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Category tiles */
.cat-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 130px;
    padding: 16px;
    border-radius: var(--radius);
    color: #fff;
    text-decoration: none;
    background: linear-gradient(140deg, var(--c1), var(--c2));
    overflow: hidden;
    transition: transform 0.15s ease;
}

.cat-tile:hover { transform: translateY(-2px); }
.cat-tile strong { font: 600 1.05rem var(--font-head); }
.cat-tile span { font-size: 0.85rem; opacity: 0.85; }

/* Steps */
.steps { counter-reset: step; }

.step {
    position: relative;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.step::before {
    counter-increment: step;
    content: counter(step);
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: var(--ink);
    color: var(--amber);
    font: 700 1.1rem var(--font-head);
}

.step h3 { font-size: 1.15rem; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 0.95rem; }

/* Lyric demo */
.demo {
    display: grid;
    gap: 28px;
    grid-template-columns: 1fr 1fr;
    align-items: center;
}

.lyric-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.95rem;
}

.lyric-table th,
.lyric-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.lyric-table th {
    background: #f4efe6;
    font: 600 0.78rem var(--font-head);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.lyric-table tr:last-child td { border-bottom: 0; }
.lyric-table .num { color: var(--muted); white-space: nowrap; }
.lyric-table .mine { font-weight: 600; }

.table-scroll { overflow-x: auto; }

@media (max-width: 860px) {
    .demo { grid-template-columns: 1fr; }
}

/* CTA band */
.cta-band {
    padding: 56px 32px;
    border-radius: 28px;
    text-align: center;
    color: #fff;
    background:
        radial-gradient(60% 120% at 80% 0%, rgba(255, 90, 54, 0.5), transparent 60%),
        var(--night);
}

.cta-band h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.cta-band p { margin: 12px auto 0; max-width: 34rem; color: rgba(255, 255, 255, 0.75); }
.cta-band .hero-actions { justify-content: center; }

/* Catalog page */
.page-head {
    padding: 48px 0 28px;
}

.page-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: 10px 0 10px; }
.page-head p { max-width: 40rem; color: var(--muted); }

.catalog {
    display: grid;
    gap: 32px;
    grid-template-columns: 220px 1fr;
    align-items: start;
    padding-bottom: 72px;
}

.filters {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filters h2 {
    margin-bottom: 8px;
    font: 600 0.78rem var(--font-head);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.fbtn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.8rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    font: 500 0.95rem var(--font-body);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.fbtn:hover { background: rgba(23, 19, 31, 0.06); }
.fbtn.is-active { background: var(--ink); color: #fff; }
.fbtn span { font-size: 0.8rem; opacity: 0.6; }

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 0.55rem 0.8rem;
    font-size: 0.92rem;
    color: var(--muted);
    cursor: pointer;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.search,
.select {
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font: 400 0.95rem var(--font-body);
    color: var(--ink);
}

.search { flex: 1 1 220px; }
.search:focus,
.select:focus { outline: none; border-color: var(--ink); }

.count { align-self: center; margin-left: auto; color: var(--muted); font-size: 0.9rem; }

.empty { padding: 48px 0; text-align: center; color: var(--muted); }

@media (max-width: 860px) {
    .catalog { grid-template-columns: 1fr; gap: 16px; }
    .filters {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 4px;
    }
    .filters h2, .toggle { display: none; }
    .fbtn { white-space: nowrap; gap: 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
    .filters .toggle-mobile { display: flex; }
}

/* Detail page */
.crumbs { padding: 22px 0 0; font-size: 0.9rem; color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

.detail {
    display: grid;
    gap: 40px;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
    padding: 24px 0 72px;
}

.detail .tart { min-height: 320px; border-radius: var(--radius); }
.detail h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 8px 0 8px; }
.detail .lead { color: var(--muted); font-size: 1.05rem; }

.panel {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.buy { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 14px; }
.buy .big-price { font: 700 2rem var(--font-head); }
.buy .big-price small { font: 400 0.9rem var(--font-body); color: var(--muted); }

.spec { display: grid; gap: 10px; margin: 0; }
.spec div { display: flex; justify-content: space-between; gap: 16px; font-size: 0.93rem; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; font-weight: 500; text-align: right; }

.notice {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: #fff4e0;
    color: #7a4a00;
    font-size: 0.9rem;
}

.audio { width: 100%; margin-top: 14px; }

.block { margin-top: 40px; }
.block h2 { font-size: 1.5rem; margin-bottom: 14px; }
.block ul { margin: 0; padding-left: 1.2rem; color: var(--muted); }
.block li + li { margin-top: 6px; }

@media (max-width: 900px) {
    .detail { grid-template-columns: 1fr; }
    .buy { position: static; }
}

/* Packages */
.plans {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    align-items: stretch;
}

.plan { display: flex; flex-direction: column; gap: 12px; }
.plan.is-featured { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.plan h3 { font-size: 1.3rem; }
.plan .big-price { font: 700 1.8rem var(--font-head); }
.plan ul { margin: 0; padding-left: 1.2rem; color: var(--muted); font-size: 0.95rem; flex: 1; }
.plan li + li { margin-top: 6px; }

/* Footer */
.mk-footer {
    margin-top: 0;
    padding: 48px 0 36px;
    background: var(--night);
    color: rgba(255, 255, 255, 0.72);
}

.mk-footer-grid {
    display: grid;
    gap: 32px;
    grid-template-columns: 1.4fr 1fr 1fr;
}

.mk-footer h4 { margin: 0 0 10px; font: 600 0.82rem var(--font-head); letter-spacing: 0.1em; text-transform: uppercase; color: #fff; }
.mk-footer a { display: block; padding: 3px 0; text-decoration: none; }
.mk-footer a:hover { color: #fff; }
.mk-footer .brand-line { font: 700 1.3rem var(--font-head); color: #fff; }
.mk-footer small { display: block; margin-top: 28px; color: rgba(255, 255, 255, 0.45); }

@media (max-width: 760px) {
    .mk-footer-grid { grid-template-columns: 1fr; }
    .section { padding: 52px 0; }
}

.flash { margin: 16px 0; padding: 12px 16px; border-radius: var(--radius-sm); }
.flash-error { background: #fde8e4; color: #8b1f15; }
.flash-success { background: #e3f4e6; color: #1b5e2b; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}

/* Top charts */
.chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chart-row {
    display: grid;
    grid-template-columns: 44px 44px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 12px 18px 12px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.chart-row.is-playing { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255, 90, 54, 0.18); }

.chart-rank {
    text-align: center;
    font: 700 1.3rem var(--font-head);
    color: var(--muted);
}

.chart-rank.is-top { color: var(--accent); }

.chart-play {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
}

.chart-play:hover { background: var(--accent); }

.chart-info { display: flex; flex-direction: column; min-width: 0; }
.chart-info a { font: 600 1rem var(--font-head); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-info small { color: var(--muted); }
.chart-plays { color: var(--muted); font-size: 0.88rem; white-space: nowrap; }

@media (max-width: 560px) {
    .chart-row { grid-template-columns: 32px 44px 1fr; }
    .chart-plays { display: none; }
}

.audio-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.audio-tabs .fbtn { border: 1px solid var(--line); border-radius: 999px; background: var(--surface); white-space: nowrap; gap: 8px; }
.audio-tabs .fbtn.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.plans-single { grid-template-columns: minmax(280px, 520px); }

.tsum {
    margin: 0;
    font-size: 0.92rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tag-sample { background: #fff4e0; color: #7a4a00; font-weight: 600; }

.pick-if {
    margin-top: 14px;
    padding: 14px 16px;
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: #fff4ef;
    font-size: 0.95rem;
}

/* Order flow */
.flow {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
    counter-reset: flow;
}

.flow li {
    counter-increment: flow;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--muted);
    font: 500 0.88rem var(--font-head);
}

.flow li::before { content: counter(flow) '. '; }
.flow li.is-current { border-color: var(--accent); color: var(--ink); box-shadow: 0 0 0 2px rgba(255, 90, 54, 0.15); }
.flow li.is-done { background: var(--ink); border-color: var(--ink); color: #fff; }

@media (max-width: 560px) { .flow { grid-template-columns: 1fr 1fr; } }

.order-form { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.order-form fieldset { margin: 0; border: 1px solid var(--line); }
.order-form legend { padding: 0 8px; font: 600 1rem var(--font-head); }
.order-form label,
.slip-form label,
.revise-form label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-weight: 500; font-size: 0.95rem; }

.order-form input[type="text"],
.order-form input[type="date"],
.order-form select,
.order-form textarea,
.revise-form textarea,
.slip-form input[type="file"] {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font: 400 1rem var(--font-body);
    color: var(--ink);
}

.order-form input:focus,
.order-form select:focus,
.order-form textarea:focus,
.revise-form textarea:focus { outline: none; border-color: var(--ink); }

.field-error { color: #b3261e; font-weight: 400; }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

.choice-grid { display: grid; gap: 12px; }

.choice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
}

.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255, 90, 54, 0.15); }
.choice input { margin-top: 5px; accent-color: var(--accent); }
.choice span { display: flex; flex-direction: column; gap: 2px; }
.choice small { color: var(--muted); font-size: 0.85rem; }
.choice em { font: 600 0.9rem var(--font-head); font-style: normal; color: var(--accent-deep); }

.buy-form { display: flex; flex-direction: column; gap: 14px; }

.order-block { margin-bottom: 18px; }
.order-block h2 { font-size: 1.25rem; margin-bottom: 12px; }
.story-text { white-space: normal; color: var(--ink); }

.draft { padding: 16px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fdfbf7; }
.draft.is-latest { border-color: var(--accent); }
.draft header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.lyrics { margin: 0 0 10px; font: 400 1.05rem/1.9 var(--font-body); white-space: pre-wrap; }
.draft-actions { display: grid; gap: 16px; margin-top: 12px; }

.chip { padding: 0.15rem 0.7rem; border-radius: 999px; background: #f1ece3; font-size: 0.8rem; }
.chip-sent { background: #fff4e0; color: #7a4a00; }
.chip-approved { background: #e3f4e6; color: #1b5e2b; }
.chip-revision_requested { background: #eee9f8; color: #3b2f7a; }

.quote-head { display: flex; flex-wrap: wrap; gap: 28px; margin-bottom: 12px; }
.quote-head div { display: flex; flex-direction: column; }
.quote-total { font: 700 1.3rem var(--font-head); }
.notice-ok { background: #e3f4e6; color: #1b5e2b; }

.chart-row-pinned { border-color: var(--amber); background: #fffaf0; }
.chart-badge { padding: 0.15rem 0.7rem; border-radius: 999px; background: var(--amber); color: var(--night); font-weight: 600; }
@media (max-width: 560px) { .chart-row-pinned .chart-badge { display: none; } }

.sample-card { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; align-items: center; }
@media (max-width: 860px) { .sample-card { grid-template-columns: 1fr; } }

.chart-title { font: 600 1rem var(--font-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Brand lockup + social */
.mk-brand { gap: 12px; }

.mk-brand-mark {
    flex: none;
    width: 62px;
    height: 36px;
    border-radius: 10px;
    background-color: #f5ead5;
    background-repeat: no-repeat;
    background-size: 128% auto;
    background-position: 50% 47.5%;
    box-shadow: inset 0 0 0 1px rgba(23, 19, 31, 0.06);
}

.mk-brand-text { display: flex; flex-direction: column; justify-content: center; line-height: 1; gap: 4px; }

.mk-wordmark {
    font: 700 1.45rem/1 var(--font-head);
    letter-spacing: -0.02em;
    color: var(--ink);
}

.mk-wordmark b { color: var(--accent); font-weight: 700; }

.mk-sub {
    font: 500 0.72rem/1 var(--font-body);
    letter-spacing: 0.32em;
    color: var(--muted);
    padding-left: 2px;
}

.mk-nav .mk-social {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    margin-left: 6px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: #1877f2;
}

.mk-nav .mk-social:hover { border-color: #1877f2; background: #eef4ff; color: #1877f2; }

@media (max-width: 760px) {
    .mk-brand-mark { width: 54px; height: 32px; }
    .mk-wordmark { font-size: 1.3rem; }
    .mk-nav .mk-social { margin-left: auto; }
    .mk-nav .btn { margin-left: 8px; }
}

@media (max-width: 760px) {
    .mk-header-inner { flex-wrap: wrap; }
    .mk-nav { flex-wrap: wrap; }
    .mk-nav .btn { margin-left: 0; flex: 1 1 100%; order: 10; margin-top: 6px; }
    .mk-nav .mk-social { margin-left: auto; }
}

/* Brand lockup v2: transparent vector mark + one-line wordmark */
.mk-brand { gap: 10px; align-items: center; }
.mk-logo { display: block; height: 40px; width: auto; flex: none; }
.mk-wordmark { font: 700 1.5rem/1 var(--font-head); letter-spacing: -0.015em; }
.mk-sub {
    align-self: center;
    margin-left: 2px;
    padding-left: 12px;
    border-left: 1.5px solid var(--line);
    font: 500 1.05rem/1.2 var(--font-head);
    letter-spacing: 0.01em;
    color: var(--muted);
}

@media (max-width: 760px) {
    .mk-logo { height: 32px; }
    .mk-wordmark { font-size: 1.3rem; }
    .mk-sub { font-size: 0.95rem; padding-left: 10px; }
}
@media (max-width: 380px) { .mk-sub { display: none; } }

/* ปุ่มเล่นตัวอย่างบนการ์ดแม่แบบ (กดฟังที่หน้ารายการได้เลย) */
.tart-wrap { position: relative; }
.tart-wrap .play-btn {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 3;
    margin: 0;
    padding: 0;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    transition: transform 0.15s ease, background 0.15s ease;
}
.tart-wrap .play-btn:hover { transform: scale(1.08); }
.tart-wrap .play-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.tart-wrap .play-btn.is-loading { opacity: 0.8; }
.tart-wrap .play-btn.is-playing { background: var(--amber); }
.tart-wrap .pbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: 4px; background: rgba(0, 0, 0, 0.25); pointer-events: none; }
.tart-wrap .pbar b { display: block; width: 0; height: 100%; background: var(--amber); }
.tcard.is-playing { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.tcard.is-playing .tart::before {
    content: '♪ กำลังเล่นตัวอย่าง';
    position: absolute;
    left: 14px;
    bottom: 22px;
    z-index: 2;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: rgba(20, 16, 28, 0.6);
    backdrop-filter: blur(6px);
    font: 600 0.74rem var(--font-head);
}

/* ไอคอนบนหน้าปกแม่แบบหมวดร้านค้า / ธุรกิจ (เรือธง) */
.tart .tart-icon { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; pointer-events: none; }
.tart .shop-icon { display: block; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35)); }
.tart.has-icon .wave { color: rgba(255, 255, 255, 0.26); }
.tart-wrap .tart.has-icon { min-height: 176px; }
.fbtn .flag { margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--amber); color: var(--night); font: 700 0.68rem var(--font-head); font-style: normal; letter-spacing: 0.04em; }
.fbtn.is-active .flag { background: var(--amber); color: var(--night); }
