/* BSK Mobile Shell 0.4.0: phone layer for the vendor dashboard (My listings, Buy package, Agency profile, Leads, Staff).
 * Phones only (720 px and below). Desktop is not changed.
 * Silver at rest, green when touched or chosen, khaki only for small icons.
 * Every rule starts with body.bsk-m-app .bskpl-dash, so it wins over the listing plugin's own styles,
 * which load later on the same page. Tables: .bskpl-table (listings, orders) and .bskpl-tbl (leads, staff). */

@media (max-width: 720px) {
  /* Header: avatar and name side by side; the buttons below in a grid, New listing full width first */
  body.bsk-m-app .bskpl-dash .bskpl-dash-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: center; margin-top: 10px; padding: 12px; border-radius: 12px; }
  body.bsk-m-app .bskpl-dash .bskpl-avatar { width: 44px; height: 44px; font-size: 16px; }
  body.bsk-m-app .bskpl-dash .bskpl-dash-id { flex: none; min-width: 0; }
  body.bsk-m-app .bskpl-dash .bskpl-dash-id h1 { font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
  body.bsk-m-app .bskpl-dash .bskpl-kicker { font-size: 11px; }
  body.bsk-m-app .bskpl-dash .bskpl-credits { font-size: 13px; margin-top: 2px; }
  body.bsk-m-app .bskpl-dash .bskpl-dash-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
  body.bsk-m-app .bskpl-dash .bskpl-dash-actions > a.bskpl-btn:not(.bskpl-btn-ghost) { grid-column: 1 / -1; order: -1; }
  body.bsk-m-app .bskpl-dash .bskpl-dash-actions > form { margin: 0; }

  /* The page's own spacer blocks above the dashboard are kept short on a phone, so the dashboard starts higher */
  body.bsk-m-app:has(.bskpl-dash) .wp-block-spacer { height: 6px !important; }

  /* Account bar: one row on a phone (Search by ID, Agencies, the account button) */
  body.bsk-m-app .bskpl-dash .bskpl-topbar { flex-wrap: nowrap; gap: 8px; padding: 8px 10px; }
  body.bsk-m-app .bskpl-dash .bskpl-top-links { flex: 1 1 auto; min-width: 0; width: auto; justify-content: flex-start; gap: 12px; }
  body.bsk-m-app .bskpl-dash .bskpl-top-actions { flex: 0 0 auto; width: auto; justify-content: flex-end; }
  body.bsk-m-app .bskpl-dash .bskpl-top-link { font-size: 13px; white-space: nowrap; }

  /* Buttons: silver at rest, green when touched */
  body.bsk-m-app .bskpl-dash .bskpl-btn { min-height: 44px; min-width: 0; padding: 0 12px; background: var(--bsk-m-silver); border: 1px solid #d8d3c3; color: var(--bsk-m-ink); text-decoration: none; }
  body.bsk-m-app .bskpl-dash .bskpl-dash-actions .bskpl-btn { white-space: nowrap; font-size: 13px; gap: 6px; }
  body.bsk-m-app .bskpl-dash .bskpl-btn .bskpl-i { color: var(--bsk-m-khaki); }
  body.bsk-m-app .bskpl-dash .bskpl-btn:hover { background: var(--bsk-m-silver); border-color: #d8d3c3; color: var(--bsk-m-ink); }
  body.bsk-m-app .bskpl-dash .bskpl-btn:active { background: var(--bsk-m-green); border-color: var(--bsk-m-green); color: #fff; }
  body.bsk-m-app .bskpl-dash .bskpl-btn:active .bskpl-i { color: #fff; }
  body.bsk-m-app .bskpl-dash .bskpl-btn:focus-visible { outline: 2px solid var(--bsk-m-green); outline-offset: 2px; }
  body.bsk-m-app .bskpl-dash .bskpl-dash-actions .bskpl-btn,
  body.bsk-m-app .bskpl-dash .bskpl-full,
  body.bsk-m-app .bskpl-dash .bskpl-actions .bskpl-btn { width: 100%; }

  /* Owner tabs: a grid of tiles, four to a row. Green when chosen or touched */
  body.bsk-m-app .bskpl-dash .bskpl-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; padding: 0; border: 0; border-radius: 0; background: none; }
  body.bsk-m-app .bskpl-dash .bskpl-tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 66px; padding: 8px 4px; border: 0; border-radius: 12px; background: var(--bsk-m-silver); color: var(--bsk-m-ink); font-size: 12px; font-weight: 700; line-height: 1.15; text-align: center; text-decoration: none; overflow-wrap: anywhere; }
  body.bsk-m-app .bskpl-dash .bskpl-tabs a .bskpl-i { width: 22px; height: 22px; color: var(--bsk-m-khaki); }
  body.bsk-m-app .bskpl-dash .bskpl-tabs a:hover { background: var(--bsk-m-silver); color: var(--bsk-m-ink); }
  body.bsk-m-app .bskpl-dash .bskpl-tabs a:active,
  body.bsk-m-app .bskpl-dash .bskpl-tabs a.on,
  body.bsk-m-app .bskpl-dash .bskpl-tabs a[aria-current="page"] { background: var(--bsk-m-green); color: #fff; }
  body.bsk-m-app .bskpl-dash .bskpl-tabs a:active .bskpl-i,
  body.bsk-m-app .bskpl-dash .bskpl-tabs a.on .bskpl-i,
  body.bsk-m-app .bskpl-dash .bskpl-tabs a[aria-current="page"] .bskpl-i { color: #fff; }

  /* Summary tiles: two to a row, the number above its label */
  body.bsk-m-app .bskpl-dash .bskpl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
  body.bsk-m-app .bskpl-dash .bskpl-kpi { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border-radius: 12px; }
  body.bsk-m-app .bskpl-dash .bskpl-kpi-ic { width: 34px; height: 34px; }
  body.bsk-m-app .bskpl-dash .bskpl-kpi b { font-size: 22px; }
  body.bsk-m-app .bskpl-dash .bskpl-kpi > div > span { font-size: 12px; line-height: 1.2; }

  body.bsk-m-app .bskpl-dash .bskpl-box { padding: 12px; border-radius: 12px; }
  body.bsk-m-app .bskpl-dash .bskpl-section-head { flex-wrap: wrap; }

  /* My listings: filter chips above the list (All, Live, Waiting, Draft) */
  body.bsk-m-app .bskpl-dash .bsk-d-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 12px; }
  body.bsk-m-app .bskpl-dash .bsk-d-chip { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 52px; padding: 6px 4px; border: 0; border-radius: 12px; background: var(--bsk-m-silver); color: var(--bsk-m-ink); font: inherit; cursor: pointer; }
  body.bsk-m-app .bskpl-dash .bsk-d-chip span { font-size: 12px; font-weight: 700; line-height: 1.1; }
  body.bsk-m-app .bskpl-dash .bsk-d-chip b { font-size: 17px; font-weight: 900; line-height: 1.1; }
  body.bsk-m-app .bskpl-dash .bsk-d-chip:active,
  body.bsk-m-app .bskpl-dash .bsk-d-chip[aria-pressed="true"] { background: var(--bsk-m-green); color: #fff; }
  body.bsk-m-app .bskpl-dash .bsk-d-chip:focus-visible { outline: 2px solid var(--bsk-m-green); outline-offset: 2px; }
  body.bsk-m-app .bskpl-dash .bsk-d-empty { margin: 4px 0 0; padding: 14px 4px; color: var(--bsk-m-muted); font-size: 14px; text-align: center; }
  body.bsk-m-app .bskpl-dash .bsk-d-empty[hidden] { display: none; }

  /* Tables become cards: one row per card, each cell shows its column name. Covers the listings, orders, leads and staff tables */
  body.bsk-m-app .bskpl-dash .bskpl-tablewrap,
  body.bsk-m-app .bskpl-dash .bskpl-tblwrap { overflow: visible; border: 0; background: none; }
  body.bsk-m-app .bskpl-dash :is(.bskpl-table, .bskpl-tbl) { display: block; width: 100%; min-width: 0; border: 0; background: none; border-collapse: separate; }
  body.bsk-m-app .bskpl-dash :is(.bskpl-table, .bskpl-tbl) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.bsk-m-app .bskpl-dash :is(.bskpl-table, .bskpl-tbl) tbody { display: grid; gap: 10px; }
  body.bsk-m-app .bskpl-dash :is(.bskpl-table, .bskpl-tbl) tr { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--bsk-m-line); border-radius: 12px; background: #fff; }
  body.bsk-m-app .bskpl-dash :is(.bskpl-table, .bskpl-tbl) tr[hidden] { display: none; }
  body.bsk-m-app .bskpl-dash :is(.bskpl-table, .bskpl-tbl) td { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; min-width: 0; padding: 0; border: 0; font-size: 14px; text-align: right; }
  body.bsk-m-app .bskpl-dash :is(.bskpl-table, .bskpl-tbl) td::before { content: attr(data-label); color: var(--bsk-m-muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; text-align: left; }
  body.bsk-m-app .bskpl-dash :is(.bskpl-table, .bskpl-tbl) td[data-label=""]::before { content: none; }
  body.bsk-m-app .bskpl-dash :is(.bskpl-table, .bskpl-tbl) td:first-child { display: block; text-align: left; }
  body.bsk-m-app .bskpl-dash :is(.bskpl-table, .bskpl-tbl) td.bskpl-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; padding-top: 10px; border-top: 1px solid #eef1f4; white-space: normal; }
  body.bsk-m-app .bskpl-dash :is(.bskpl-table, .bskpl-tbl) td.bskpl-nowrap { justify-content: flex-end; gap: 6px; }
  body.bsk-m-app .bskpl-dash .bskpl-prop { min-width: 0; width: 100%; }
  body.bsk-m-app .bskpl-dash .bskpl-thumb { width: 84px; height: 62px; }
  body.bsk-m-app .bskpl-dash .bskpl-reject { display: block; flex-basis: 100%; text-align: left; }

  /* Row actions: touch-size chips. Delete stays red so it is not mistaken for a normal action */
  body.bsk-m-app .bskpl-dash .bskpl-link { min-height: 40px; padding: 0 12px; border: 1px solid #d8d3c3; border-radius: 999px; background: var(--bsk-m-silver); color: var(--bsk-m-green); font-size: 14px; text-decoration: none; }
  body.bsk-m-app .bskpl-dash .bskpl-link .bskpl-i { color: var(--bsk-m-khaki); }
  body.bsk-m-app .bskpl-dash .bskpl-link:hover { text-decoration: none; }
  body.bsk-m-app .bskpl-dash .bskpl-link:active { background: var(--bsk-m-green); border-color: var(--bsk-m-green); color: #fff; }
  body.bsk-m-app .bskpl-dash .bskpl-link:active .bskpl-i { color: #fff; }
  body.bsk-m-app .bskpl-dash .bskpl-link.danger { color: #b42318; }
  body.bsk-m-app .bskpl-dash .bskpl-link.danger:active { background: #b42318; border-color: #b42318; color: #fff; }

  /* Packages: one card per row. A colour band on top: Standard plain, Hot orange, Super Hot red, Dealer gold */
  body.bsk-m-app .bskpl-dash .bskpl-packs { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  body.bsk-m-app .bskpl-dash .bskpl-pack { --tier: #d8d3c3; padding: 16px; border: 1px solid var(--bsk-m-line); border-top: 6px solid var(--tier); border-radius: 12px; }
  body.bsk-m-app .bskpl-dash .bskpl-pack[data-tier="hot"] { --tier: #f26b1d; }
  body.bsk-m-app .bskpl-dash .bskpl-pack[data-tier="superhot"] { --tier: #d7262e; border-color: #d7262e; border-width: 2px; border-top-width: 6px; }
  body.bsk-m-app .bskpl-dash .bskpl-pack[data-tier="dealer"] { --tier: #b7791f; border-color: #b7791f; border-width: 2px; border-top-width: 6px; }
  body.bsk-m-app .bskpl-dash .bskpl-pack[data-tier="superhot"] .bskpl-pack-tag { background: #d7262e; }
  body.bsk-m-app .bskpl-dash .bskpl-pack h3 { font-size: 17px; }
  body.bsk-m-app .bskpl-dash .bskpl-pack-price { font-size: 24px; }
  body.bsk-m-app .bskpl-dash .bskpl-pack .bskpl-form { display: grid; gap: 10px; }
  body.bsk-m-app .bskpl-dash .bskpl-pack .bskpl-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
  body.bsk-m-app .bskpl-dash .bskpl-pack .bskpl-form select,
  body.bsk-m-app .bskpl-dash .bskpl-pack .bskpl-form input:not([type="hidden"]):not([type="file"]) { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid #cdd3dc; border-radius: var(--radius); background: #fff; color: var(--bsk-m-ink); font: inherit; font-size: 16px; font-weight: 400; }

  /* Agency profile: one column, a heading for each of the three groups, inputs at 16 px so phones do not zoom in */
  body.bsk-m-app .bskpl-dash .bskpl-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  body.bsk-m-app .bskpl-dash .bsk-d-sec { grid-column: 1 / -1; margin: 8px 0 -4px; color: var(--bsk-m-green); font-size: 13px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
  body.bsk-m-app .bskpl-dash input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
  body.bsk-m-app .bskpl-dash select,
  body.bsk-m-app .bskpl-dash textarea { font-size: 16px; }
  body.bsk-m-app .bskpl-dash .bskpl-field input:not([type="checkbox"]):not([type="file"]):not([type="hidden"]),
  body.bsk-m-app .bskpl-dash .bskpl-field select { min-height: 44px; }
}
