/* The price table section on the home page and /prices — design v2, 2026-10-13.
   On a desktop the table gets real columns (weight · sell · buy · spread · 24 h change), and the
   column beside it two working cards instead of an explanation: «ذهبك كم يساوي الآن؟» and
   «نبّهني عند سعر معيّن»; under the table, the 24-hour movement of gram 21. A phone keeps the
   two-line rows and the calculator link it had. home-tools.js fills the cards. */

.ht-d { display: none !important; }

/* ---- the cards (desktop only through .mq-desk-only) ---- */
.ht-conv, .ht-alert, .ht-day { padding: 18px; display: grid; gap: 14px; margin: 0; }
.ht-h { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; }
.ht-h .ico-c { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--gold-grad); color: #1a1203; }
.ht-h b { font-size: 15px; display: block; line-height: 1.4; }
.ht-h small { font-size: 12px; color: var(--text-3); }
.ht-k { display: flex; gap: 8px; }
.ht-k .chip { flex: 1; justify-content: center; }
.ht-in { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.ht-in input, .ht-target { width: 100%; min-width: 0; height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: 18px; font-weight: 800; direction: ltr; text-align: start; outline: 0; }
.ht-in input:focus, .ht-target:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--glow); }
.ht-seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.ht-seg button, .ht-seg label span { height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; border: 0; background: none; }
.ht-seg button[aria-pressed='true'], .ht-seg input:checked + span { background: var(--gold-grad); color: #1a1203; }
.ht-dir { display: grid; grid-template-columns: 1fr 1fr; }
.ht-dir label { display: grid; }
.ht-dir input { position: absolute; opacity: 0; pointer-events: none; }
.ht-dir input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.ht-dir .ico { width: 13px; height: 13px; }
.ht-out { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ht-out > div { padding: 12px 14px; display: grid; gap: 3px; min-width: 0; }
.ht-out > div + div { border-inline-start: 1px solid var(--line); background: var(--gold-grad-soft); }
.ht-out small { font-size: 11.5px; color: var(--text-2); font-weight: 700; }
.ht-out .num { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.ht-out em { font-style: normal; font-size: 11px; color: var(--text-2); }
.ht-now { font-size: 12px; color: var(--text-3); margin-top: -4px; }
.ht-now b { color: var(--text-2); }
.ht-day[hidden] { display: none !important; }
.ht-range { display: grid; gap: 10px; }
.ht-bar { position: relative; height: 8px; border-radius: 99px; margin: 4px 8px 0; background: linear-gradient(270deg, color-mix(in srgb, var(--down) 60%, transparent), var(--surface-2) 50%, color-mix(in srgb, var(--up) 60%, transparent)); }
.ht-bar i { position: absolute; top: 50%; inset-inline-start: 50%; width: 16px; height: 16px; border-radius: 50%; background: var(--gold-grad); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-gold); transform: translate(50%, -50%); transition: inset-inline-start .6s var(--ease); }
.ht-lh { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.ht-lh > div { display: grid; gap: 2px; justify-items: start; }
.ht-lh > div:nth-child(2) { justify-items: center; }
.ht-lh > div:last-child { justify-items: end; }
.ht-lh small, .ht-g small { font-size: 11.5px; color: var(--text-3); font-weight: 700; }
.ht-lh b { font-size: 14.5px; font-weight: 800; }
.ht-g { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ht-g > div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); display: grid; gap: 2px; }
.ht-g b { font-size: 14.5px; font-weight: 800; }
.ht-g b.up { color: var(--up); }
.ht-g b.down { color: var(--down); }

/* ---- the desktop table ---- */
@media (min-width: 881px) {
  .ht-d { display: revert !important; }
  .ht-m, .ht-tbl .buy em { display: none !important; }
  .ht-tbl .rowh, .ht-tbl .prow { grid-template-columns: minmax(220px, 1.5fr) minmax(0, 1.15fr) minmax(0, 1.1fr) minmax(0, .8fr) 150px; grid-template-areas: none; gap: 14px; padding: 15px 22px; }
  .ht-sv .rowh, .ht-sv .prow { grid-template-columns: minmax(220px, 1.5fr) minmax(0, 1.15fr) minmax(0, 1.1fr) minmax(0, .8fr); }
  .ht-tbl .rowh span:not(:first-child) { text-align: end; }
  .ht-tbl .prow.hot { background: linear-gradient(270deg, color-mix(in srgb, var(--gold) 8%, transparent), transparent 70%); }
  .ht-tbl .prow.hot:hover { background: var(--gold-grad-soft); }
  .ht-tbl .prow .w { grid-area: auto; display: flex; align-items: center; gap: 12px; }
  .ht-tbl .wt { display: grid; gap: 2px; }
  .ht-tbl .w b { display: flex; align-items: center; gap: 8px; font-size: 15.5px; font-weight: 800; }
  .ht-tbl .wi { width: 38px; height: 38px; border-radius: 12px; display: grid !important; place-items: center; flex: none; background: var(--surface-2); border: 1px solid var(--line); font-size: 11px; font-weight: 800; color: var(--text-2); }
  .ht-tbl .prow.hot .wi { background: var(--gold-grad-soft); border-color: var(--line-gold); color: var(--gold-ink); }
  .ht-tbl .tag { display: inline-block !important; white-space: nowrap; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 6px; color: #1a1203; background: var(--gold-grad); }
  .ht-tbl .k.is-on, .ht-tbl .k .p { display: contents; }
  .ht-tbl .sell, .ht-tbl .buy, .ht-tbl .cell-spr { grid-area: auto; text-align: end; justify-self: end; }
  .ht-tbl .sell[hidden] { display: block; visibility: hidden; }
  .ht-tbl .buy { font-size: 15px; font-weight: 700; color: var(--text); }
  .ht-tbl .cell-spr { display: block !important; font-size: 13.5px; font-weight: 700; color: var(--text-3); }
  .ht-tbl .cell-chg { grid-area: auto; justify-self: end; }
  .ht-tbl .cell-chg.flat { display: inline-flex; color: var(--text-3); background: var(--surface-2); }
  /* a whole cell flashing reads as a box drawn round the figure; tint it instead */
  .ht-tbl .flash-up, .ht-tbl .flash-down { box-shadow: none !important; animation: ht-flash .9s ease-out !important; border-radius: 8px; }
  .ht-foot { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 12px 22px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12px; color: var(--text-3); }
  .ht-foot b { color: var(--text-2); font-weight: 800; }
  .ht-foot .t { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 5px; }
  .ht-day { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'h g' 'r r'; align-items: center; gap: 14px 24px; padding: 16px 20px; }
  .ht-day > .ht-h { grid-area: h; }
  .ht-day > .ht-g { grid-area: g; grid-template-columns: auto auto; }
  .ht-day > .ht-g > div { padding: 8px 14px; min-width: 120px; }
  .ht-day > .ht-range { grid-area: r; }
  /* the table and the converter box stand at the same height (the customer, 2026-10-13) */
  .mq-split:has(.ht-conv) { align-items: stretch; }
  .mq-split:has(.ht-conv) > aside { position: static; }
  .mq-split:has(.ht-conv) > .mq-stack, .mq-split:has(.ht-conv) > aside { align-content: stretch; grid-template-rows: 1fr; }
  .mq-split:has(.ht-conv) > aside .ht-conv { align-content: space-between; }
}
@keyframes ht-flash { 0% { background: color-mix(in srgb, var(--gold) 22%, transparent); } 100% { background: transparent; } }
