/**
 * Tarkari Mart Core - Kalimati B2B Graded Quotation Styles
 */

/* The theme caps every page entry at 760px for readable prose (components.css).
   That is right for articles and wrong here: the rate list is a scanning tool,
   and 109 one-line rows want the container's full 1200px. The list caps its own
   width below, so releasing the cap cannot make anything run edge-to-edge.
   Browsers without :has() keep the narrow layout, which still works. */
.entry:has(.tmc-kq-wrapper) {
    max-width: none;
}

/*
 * The theme lays the page out as `grid-template-columns: 1fr`, and a 1fr track
 * never shrinks below its content's min-content width. Every row name is a
 * nowrap ellipsis line, so on a narrow screen that min-content is wider than
 * the viewport and the whole widget leaks past the edge. Pinning the track to
 * minmax(0, 1fr) lets the rows shrink and ellipsise the way they are designed
 * to instead.
 */
.layout--full:has(.tmc-kq-wrapper) {
    grid-template-columns: minmax(0, 1fr);
}

.tmc-kq-wrapper {
    width: 100%;
    margin: 20px 0 80px;
    font-family: inherit;
    color: #1e293b;
    position: relative;
    box-sizing: border-box;
}

/* Rows, the Add button and the chip are all toggled with the hidden
   attribute, and the flex/display rules below would otherwise win. */
.tmc-kq-wrapper [hidden] {
    display: none !important;
}

/* ── 1. Header ────────────────────────────────────────────────────────────── */

.tmc-kq-header {
    background: linear-gradient(135deg, #14532d 0%, #166534 100%);
    color: #fff;
    padding: 9px 14px;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(20, 83, 45, 0.15);
}

/*
 * The theme sets `.entry__content h2, .entry__content h3 { margin-top: 3rem }`
 * and `.entry__content ul { padding-left }`, both at (0,1,1) — high enough to
 * outweigh a plain class selector, so the widget's own headings and list carry
 * their selector back through .tmc-kq-wrapper.
 */
.entry__content .tmc-kq-wrapper .tmc-kq-title,
.entry__content .tmc-kq-wrapper .tmc-kq-sheet-title,
.entry__content .tmc-kq-wrapper #tmc-kq-modal-title,
.entry__content .tmc-kq-wrapper .tmc-kq-success-title {
    margin-top: 0;
}

.entry__content .tmc-kq-wrapper .tmc-kq-list {
    list-style: none;
    padding-left: 0;
}

.entry__content .tmc-kq-wrapper .tmc-kq-list > .tmc-kq-row {
    margin: 0;
}

/*
 * One compact band: the badge and the widget's own title share a line, the
 * day's figures sit under them, then the guidance line. Anything longer is
 * ellipsised rather than allowed to wrap the band into a second hero.
 */
.tmc-kq-header-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    row-gap: 2px;
}

.tmc-kq-badge-live {
    grid-column: 1;
    grid-row: 1;
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #bbf7d0;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    margin: 0;
    white-space: nowrap;
}

.tmc-kq-title {
    grid-column: 2;
    grid-row: 1;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    margin: 0;
    line-height: 1.3;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/*
 * Wraps rather than ellipsises below the tablet line: a nowrap line's
 * min-content width would widen the theme's 1fr grid column and push the whole
 * widget past the viewport, where the clip would be invisible instead of tidy.
 */
.tmc-kq-subtitle {
    grid-column: 1 / -1;
    color: #dcfce7;
    font-size: 12px;
    margin: 0;
    line-height: 1.4;
}

.tmc-kq-meta {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 14px;
    font-size: 12px;
    color: #f0fdf4;
    white-space: nowrap;
}

/* The two long notes only fit once the band has room for them. */
.tmc-kq-meta-auto,
.tmc-kq-meta-open {
    display: none;
}

.tmc-kq-meta span strong {
    color: #fff;
}

.tmc-kq-meta-open {
    background: rgba(34, 197, 94, 0.25);
    border: 1px solid rgba(187, 247, 208, 0.4);
    color: #bbf7d0;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* ── 2. Quality Grading Legend ────────────────────────────────────────────── */

.tmc-kq-grade-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.tmc-kq-legend-card {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
}

.tmc-kq-legend-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}

.tmc-kq-legend-card p {
    /* The grade copy is answered inside the sheet, where the choice is made. */
    display: none;
    margin: 0;
    font-size: 11.5px;
    line-height: 1.35;
    opacity: 0.8;
}

.tmc-kq-legend--best {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}

.tmc-kq-legend--good {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}

.tmc-kq-legend--mix {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

/* ── 3. Toolbar / Search ─────────────────────────────────────────────────── */

/* 109 rows to scan, so the search stays reachable while the list scrolls. */
.tmc-kq-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 16px;
    position: sticky;
    top: calc(var(--header-height, 70px) - 1px);
    z-index: 40;
    background: #fff;
    padding: 8px 0 10px;
}

.tmc-kq-search-box {
    position: relative;
    flex: 1;
    max-width: 480px;
}

.tmc-kq-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.tmc-kq-search-input {
    width: 100%;
    height: 44px;
    padding: 10px 38px 10px 42px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #0f172a;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tmc-kq-search-input:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.tmc-kq-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.tmc-kq-search-clear:hover {
    color: #475569;
}

.tmc-kq-quick-stats {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
}

.tmc-kq-no-results {
    padding: 28px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    text-align: center;
    color: #64748b;
    font-size: 15px;
    margin-bottom: 20px;
}

/* ── 4. Commodity Rate List ───────────────────────────────────────────────── */

.tmc-kq-list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.tmc-kq-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 10px 0 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.tmc-kq-row:last-child {
    border-bottom: none;
}

.tmc-kq-row:nth-child(even) {
    background: #fafbfc;
}

.tmc-kq-row:hover {
    background: #f0fdf4;
}

/* Added rows stay green-tinted so the picked items are findable while scrolling. */
.tmc-kq-row.is-added {
    background: #ecfdf5;
    box-shadow: inset 3px 0 0 #16a34a;
}

.tmc-kq-row-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0 8px 12px;
    background: none;
    border: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.tmc-kq-idx {
    flex: 0 0 auto;
    width: 26px;
    color: #94a3b8;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.tmc-kq-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tmc-kq-rate {
    flex: 0 0 auto;
    color: #166534;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tmc-bench {
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.tmc-bench--min { background: #fef3c7; color: #92400e; }
.tmc-bench--avg { background: #e0f2fe; color: #075985; }
.tmc-bench--max { background: #dcfce7; color: #166534; }

.tmc-kq-unit-pill {
    display: inline-block;
    flex: 0 0 auto;
    white-space: nowrap;
    background: #f1f5f9;
    color: #475569;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* Quality Grade Pill Radio Group */

.tmc-grade-pill-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tmc-grade-pill {
    position: relative;
    display: block;
    cursor: pointer;
    user-select: none;
}

.tmc-grade-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tmc-pill-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    transition: all 0.15s ease;
}

.tmc-pill-icon {
    flex: 0 0 auto;
    font-size: 16px;
    line-height: 1;
}

.tmc-pill-title {
    flex: 1 1 auto;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
}

.tmc-pill-price {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tmc-grade-radio:focus-visible + .tmc-pill-btn {
    outline: 2px solid #16a34a;
    outline-offset: 2px;
}

/* Checked States */

.tmc-grade-pill--best .tmc-grade-radio:checked + .tmc-pill-btn {
    background: #dcfce7;
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
}
.tmc-grade-pill--best .tmc-grade-radio:checked + .tmc-pill-btn .tmc-pill-title,
.tmc-grade-pill--best .tmc-grade-radio:checked + .tmc-pill-btn .tmc-pill-price {
    color: #14532d;
}

.tmc-grade-pill--good .tmc-grade-radio:checked + .tmc-pill-btn {
    background: #e0f2fe;
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
}
.tmc-grade-pill--good .tmc-grade-radio:checked + .tmc-pill-btn .tmc-pill-title,
.tmc-grade-pill--good .tmc-grade-radio:checked + .tmc-pill-btn .tmc-pill-price {
    color: #0369a1;
}

.tmc-grade-pill--mix .tmc-grade-radio:checked + .tmc-pill-btn {
    background: #fef3c7;
    border-color: #d97706;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.25);
}
.tmc-grade-pill--mix .tmc-grade-radio:checked + .tmc-pill-btn .tmc-pill-title,
.tmc-grade-pill--mix .tmc-grade-radio:checked + .tmc-pill-btn .tmc-pill-price {
    color: #b45309;
}

/* Stepper */

.tmc-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.tmc-step-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: #f8fafc;
    color: #334155;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    user-select: none;
}

.tmc-step-btn:hover {
    background: #e2e8f0;
}

.tmc-step-input {
    width: 72px;
    height: 42px;
    border: none;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    padding: 0;
    margin: 0;
    outline: none;
    -moz-appearance: textfield;
}

.tmc-step-input::-webkit-outer-spin-button,
.tmc-step-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Add button — the only control a row offers before it is picked */

.tmc-kq-add {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #166534;
    color: #fff;
    border: none;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease;
}

.tmc-kq-add:hover {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(22, 101, 52, 0.25);
}

.tmc-kq-add-icon {
    font-size: 14px;
    line-height: 1;
}

/* Once picked, the row reports its own grade, quantity and line total. */

.tmc-kq-chip {
    /* Shrinkable, or a long chip would steal the row name's width entirely. */
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tmc-kq-chip-text {
    font-size: 12.5px;
    font-weight: 700;
    color: #14532d;
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 999px;
    padding: 5px 10px;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}

.tmc-kq-chip-edit,
.tmc-kq-chip-del {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    background: #fff;
    color: #166534;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}

.tmc-kq-chip-edit:hover {
    background: #f0fdf4;
}

.tmc-kq-chip-del {
    color: #b91c1c;
    border-color: #fecaca;
}

.tmc-kq-chip-del:hover {
    background: #fef2f2;
}

/* ── 4b. Grade & Quantity Bottom Sheet ────────────────────────────────────── */

.tmc-kq-sheet {
    position: fixed;
    inset: 0;
    z-index: 10000; /* above the sticky summary bar's 9999 */
    display: none;
    align-items: flex-end;
    justify-content: center;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
}

.tmc-kq-sheet.is-open {
    display: flex;
    animation: tmcFadeIn 0.18s ease;
}

.tmc-kq-sheet-panel {
    width: min(560px, 100%);
    max-height: 88vh;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    animation: tmcSheetUp 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tmcSheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.tmc-kq-sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #14532d 0%, #166534 100%);
    border-radius: 16px 16px 0 0;
}

.tmc-kq-sheet-title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
    color: #fff;
}

.tmc-kq-sheet-meta {
    margin: 3px 0 0;
    font-size: 12px;
    color: #bbf7d0;
}

.tmc-kq-sheet-sep {
    margin: 0 5px;
    opacity: 0.6;
}

.tmc-kq-sheet-close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.tmc-kq-sheet-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tmc-kq-sheet-body {
    padding: 16px 18px 6px;
    overflow-y: auto;
}

.tmc-kq-sheet-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin: 0 0 8px;
}

.tmc-grade-pill-group + .tmc-kq-sheet-label {
    margin-top: 18px;
}

.tmc-kq-sheet-qty {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.tmc-kq-qty-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tmc-kq-qty-preset {
    min-width: 38px;
    height: 38px;
    padding: 0 9px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.tmc-kq-qty-preset:hover {
    background: #e2e8f0;
}

.tmc-kq-qty-preset.is-active {
    background: #166534;
    border-color: #166534;
    color: #fff;
}

.tmc-kq-sheet-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 18px 16px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 4px 4px;
}

.tmc-kq-sheet-sum {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    color: #475569;
}

.tmc-kq-sheet-sum strong {
    color: #14532d;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.tmc-kq-sheet-note {
    font-size: 11px;
    color: #94a3b8;
}

.tmc-kq-sheet-actions {
    display: flex;
    gap: 8px;
}

/* Honeypot stays out of sight and out of the tab order for real buyers. */
.tmc-kq-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ── 5. Sticky Floating Summary Bar ───────────────────────────────────────── */

.tmc-kq-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #0f172a;
    color: #fff;
    border-top: 2px solid #22c55e;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.22);
    animation: tmcSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tmcSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.tmc-kq-bottom-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.tmc-kq-bottom-summary {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tmc-kq-summary-icon {
    position: relative;
    color: #4ade80;
    display: flex;
    align-items: center;
}

.tmc-kq-badge-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    border: 2px solid #0f172a;
}

.tmc-kq-summary-text {
    font-size: 14px;
    line-height: 1.35;
}

.tmc-kq-summary-items {
    color: #cbd5e1;
    font-size: 13px;
}

.tmc-kq-summary-items strong {
    color: #f8fafc;
}

.tmc-kq-summary-total {
    color: #e2e8f0;
    font-size: 14px;
}

.tmc-kq-summary-total strong {
    color: #4ade80;
    font-size: 16px;
    font-weight: 700;
}

.tmc-kq-summary-note {
    font-size: 11px;
    color: #94a3b8;
    margin-left: 6px;
}

.tmc-kq-bottom-cta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tmc-kq-btn-clear {
    background: transparent;
    border: 1px solid #475569;
    color: #cbd5e1;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.tmc-kq-btn-clear:hover {
    background: #334155;
    color: #fff;
}

.tmc-kq-btn-send {
    background: #16a34a;
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35);
}

.tmc-kq-btn-send:hover {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.45);
}

.tmc-kq-btn-whatsapp-bar {
    background: #25D366;
    color: #fff;
    border: none;
    padding: 11px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
}

.tmc-kq-btn-whatsapp-bar:hover {
    background: #1EBE5D;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.45);
}

/* ── 6. Wholesale Quotation Modal ─────────────────────────────────────────── */

.tmc-kq-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: tmcFadeIn 0.2s ease;
}

@keyframes tmcFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tmc-kq-modal-card {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 660px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
}

.tmc-kq-modal-header {
    background: #166534;
    color: #fff;
    padding: 16px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.tmc-kq-modal-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tmc-kq-modal-icon {
    font-size: 24px;
}

.tmc-kq-modal-header h3 {
    margin: 0;
    font-size: 17px;
    color: #fff;
    font-weight: 700;
}

.tmc-kq-modal-subtitle {
    margin: 2px 0 0;
    font-size: 12px;
    color: #bbf7d0;
}

.tmc-kq-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.85;
}

.tmc-kq-modal-close:hover {
    opacity: 1;
}

.tmc-kq-form {
    padding: 20px 22px;
}

/* Modal Selected Items Review */

.tmc-kq-preview-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.tmc-kq-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.tmc-kq-green {
    color: #166534;
}

.tmc-kq-preview-table-wrap {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
}

.tmc-kq-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.tmc-kq-preview-table th {
    background: #f1f5f9;
    padding: 7px 10px;
    text-align: left;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    border-bottom: 1px solid #e2e8f0;
}

.tmc-kq-preview-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
}

.tmc-kq-preview-table tr:last-child td {
    border-bottom: none;
}

.tmc-kq-btn-del {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
}

/* Guest / Account Notice Banner */

.tmc-kq-guest-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    color: #166534;
    margin-bottom: 15px;
}

.tmc-kq-guest-banner--user {
    background: #f0f9ff;
    border-color: #7dd3fc;
    color: #0369a1;
}

.tmc-kq-guest-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.tmc-kq-guest-text strong {
    font-weight: 700;
}

/* Modal Form Fields */

.tmc-kq-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.tmc-kq-form-field {
    display: flex;
    flex-direction: column;
}

.tmc-kq-full-width {
    grid-column: span 2;
    margin-bottom: 12px;
}

.tmc-kq-form-field label {
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 4px;
}

.tmc-req {
    color: #dc2626;
}

.tmc-kq-form-field input,
.tmc-kq-form-field select,
.tmc-kq-form-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #0f172a;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tmc-kq-form-field input:focus,
.tmc-kq-form-field select:focus,
.tmc-kq-form-field textarea:focus {
    border-color: #16a34a;
    outline: none;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
}

.tmc-kq-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e5e7eb;
    padding-top: 14px;
    margin-top: 14px;
}

.tmc-kq-modal-footer-sum {
    font-size: 13px;
    color: #4b5563;
}

.tmc-kq-modal-footer-sum strong {
    color: #166534;
    font-size: 16px;
}

.tmc-kq-modal-buttons {
    display: flex;
    gap: 8px;
}

.tmc-kq-btn-cancel {
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #4b5563;
}

.tmc-kq-btn-cancel:hover {
    background: #f3f4f6;
}

.tmc-kq-btn-submit {
    padding: 9px 18px;
    border: none;
    background: #166534;
    color: #fff;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.tmc-kq-btn-submit:hover:not(:disabled) {
    background: #15803d;
}

.tmc-kq-btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.tmc-kq-btn-whatsapp {
    padding: 9px 18px;
    border: none;
    background: #25D366;
    color: #fff;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
}

.tmc-kq-btn-whatsapp:hover:not(:disabled) {
    background: #1EBE5D;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.4);
}

.tmc-kq-btn-whatsapp:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.tmc-kq-btn-whatsapp--alt {
    background: #075E54;
    box-shadow: 0 2px 6px rgba(7, 94, 84, 0.3);
}

.tmc-kq-btn-whatsapp--alt:hover:not(:disabled) {
    background: #128C7E;
    box-shadow: 0 4px 10px rgba(7, 94, 84, 0.4);
}

/* Success Notice */

.tmc-kq-success {
    padding: 32px 24px;
    text-align: center;
}

.tmc-kq-success-icon {
    font-size: 44px;
    margin-bottom: 10px;
}

.tmc-kq-success-title {
    color: #166534;
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 10px;
}

.tmc-kq-success-desc {
    color: #334155;
    font-size: 14px;
    margin-bottom: 8px;
}

.tmc-kq-success-desc strong {
    background: #dcfce7;
    color: #15803d;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 15px;
}

.tmc-kq-success-sub {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 22px;
}

.tmc-kq-success-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* ── 7. Responsive Adaptations ────────────────────────────────────────────── */

@media (min-width: 901px) {
    .tmc-kq-title {
        font-size: 19px;
    }

    /* Roomy enough for the guidance line to stay on one tidy, clipped row. */
    .tmc-kq-subtitle {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* The container is wide enough for the two explanatory notes to sit inline. */
    .tmc-kq-meta-auto {
        display: inline-block;
    }

    /* Desktop gets the same bottom sheet, just wider and lifted off the edge. */
    .tmc-kq-sheet {
        align-items: flex-end;
        padding: 0 24px 24px;
    }

    .tmc-kq-sheet-panel {
        width: min(720px, 100%);
        border-radius: 16px;
    }

    .tmc-kq-sheet-head {
        border-radius: 16px 16px 0 0;
    }

    .tmc-kq-sheet-foot {
        border-radius: 0 0 16px 16px;
    }
}

/*
 * A wholesale list is scanned, not read: at full container width the rate rows
 * run in two newspaper columns so roughly twice as many are visible per fold.
 */
@media (min-width: 1100px) {
    .tmc-kq-meta-open {
        display: inline-block;
    }

    .tmc-kq-list {
        columns: 2;
        column-gap: 32px;
    }

    /* A row must never straddle the column break. */
    .tmc-kq-row {
        break-inside: avoid;
    }

    .tmc-kq-row:nth-child(even) {
        background: none;
    }

    /* A half-width column has no room for name, unit, rate and chip: the chip
       already carries the unit and the chosen-grade total, so the name wins. */
    .tmc-kq-row.is-added .tmc-kq-unit-pill,
    .tmc-kq-row.is-added .tmc-kq-rate {
        display: none;
    }

    .tmc-kq-row:hover {
        background: #f0fdf4;
    }
}

@media (max-width: 680px) {
    .tmc-kq-header {
        padding: 9px 12px;
    }

    /* A sticky search bar would cost too much of a short viewport. */
    .tmc-kq-toolbar {
        position: static;
        padding: 0;
    }

    .tmc-kq-title {
        font-size: 16px;
    }

    /* The grade copy now lives in the sheet, where the choice is actually made. */
    .tmc-kq-grade-legend {
        display: none;
    }

    .tmc-kq-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .tmc-kq-search-box {
        max-width: none;
    }

    .tmc-kq-row {
        padding-right: 6px;
    }

    .tmc-kq-row-main {
        padding-left: 8px;
    }

    .tmc-kq-idx {
        display: none;
    }

    .tmc-kq-add {
        padding: 6px 10px;
    }

    /*
     * A phone row has no room for name, unit, rate, chip and both chip buttons.
     * Added rows are the ones that matter, so they take a second line for the
     * chip rather than ellipsising the line total down to nothing.
     */
    .tmc-kq-row.is-added {
        flex-wrap: wrap;
        padding-bottom: 7px;
    }

    .tmc-kq-row.is-added .tmc-kq-chip {
        flex: 1 0 100%;
        order: 3;
    }

    .tmc-kq-chip-text {
        max-width: none;
        flex: 1 1 auto;
    }

    .tmc-kq-bottom-container {
        flex-direction: column;
        align-items: stretch;
    }

    .tmc-kq-bottom-summary {
        justify-content: space-between;
    }

    .tmc-kq-bottom-cta {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .tmc-kq-bottom-cta button {
        flex: 1;
        justify-content: center;
        padding: 9px 12px;
        font-size: 13px;
    }

    .tmc-kq-sheet-actions {
        width: 100%;
    }

    .tmc-kq-sheet-actions button {
        flex: 1;
        justify-content: center;
        padding: 11px;
    }

    .tmc-kq-modal-buttons {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .tmc-kq-modal-buttons button {
        width: 100%;
        justify-content: center;
        padding: 11px;
    }

    .tmc-kq-success-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .tmc-kq-success-actions a,
    .tmc-kq-success-actions button {
        width: 100%;
        justify-content: center;
        padding: 10px;
    }

    .tmc-kq-form-grid {
        grid-template-columns: 1fr;
    }

    .tmc-kq-full-width {
        grid-column: span 1;
    }
}
