/* Additive styles for DK Gold demo; original brand styles remain intact. */
html, body {height:auto; min-height:100%;}
body {overflow-x:hidden; overflow-y:auto; justify-content:flex-start;}
main {margin-top:0; padding:30px 20px 50px; flex-grow:1; justify-content:flex-start;}
.market-board {width:100%; max-width:1100px; text-align:left;}
.market-heading {text-align:center; margin:0 auto 36px;}
.market-heading .eyebrow {color:var(--text-gold); font-size:.7rem; letter-spacing:.22em; margin-bottom:12px;}
.market-heading h1 {font:400 clamp(1.8rem,4vw,3.1rem)/1.2 'Playfair Display',serif;}
.market-heading h1 em {color:var(--text-gold);}
.market-heading [lang=ar] {font:1.5rem 'Amiri',serif; margin-top:10px;}
.market-status {color:var(--text-muted); font-size:.78rem; margin-top:16px;}
.market-group {margin-bottom:34px;}
.market-group h2 {font:400 1.45rem 'Playfair Display',serif; color:var(--text-gold); margin-bottom:14px;}
.market-group h2 span {font:1.15rem 'Amiri',serif; color:var(--text-muted); margin-left:10px;}
.price-grid {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px;}
.price-card {padding:18px; border:1px solid rgba(212,175,55,.22); border-radius:12px; background:linear-gradient(145deg,rgba(212,175,55,.07),rgba(255,255,255,.015)); min-width:0;}
.price-card.silver {border-color:rgba(210,210,210,.2); background:linear-gradient(145deg,rgba(220,220,220,.055),rgba(255,255,255,.01));}
.price-card h3 {font-size:.94rem; font-weight:500; margin-bottom:12px;}
.price-card h3 small {font:1rem 'Amiri',serif; color:var(--text-muted); margin-left:8px;}
.price-main {font-size:clamp(1.1rem,2vw,1.6rem); font-weight:500; color:var(--text-light);}
.price-main small {font-size:.72rem; color:var(--text-muted);}
.price-usd {color:var(--text-muted); font-size:.82rem; margin-top:6px;}
.price-change {color:var(--text-muted); font-size:.78rem; margin-top:12px;}
.price-change.up {color:#72d6a0;} .price-change.down {color:#f28b89;}
.history {padding:22px; border:1px solid rgba(212,175,55,.22); border-radius:12px;}
.history-head {display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;}
.history-head label {font-size:.78rem; color:var(--text-muted);}
.history select {margin-left:8px; background:#17181c; color:#f5f5f7; border:1px solid #5c5035; border-radius:6px; padding:8px;}
.history-controls {display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; margin:14px 0;}
.history-controls button {background:transparent; color:var(--text-muted); border:1px solid #4a4130; border-radius:6px; padding:8px 14px; cursor:pointer;}
.history-controls button[aria-pressed=true] {color:#0b0c10; background:var(--text-gold);}
.chart-placeholder {display:flex; flex-direction:column; align-items:stretch; justify-content:center; min-width:0; min-height:200px; color:var(--text-muted); font-size:.85rem; text-align:center; border:1px dashed rgba(212,175,55,.16); border-radius:8px; padding:12px;}.chart-placeholder svg {display:block; width:100%; height:auto; max-width:100%;}
.market-disclaimer {color:var(--text-muted); text-align:center; font-size:.73rem; line-height:1.6;}
footer {flex-shrink:0;}
@media(max-width:700px){.price-grid {grid-template-columns:repeat(2,minmax(0,1fr));} main {padding:18px 14px 32px;} .price-card {padding:14px;} .history {padding:16px;} }
@media(max-width:360px){.price-grid {grid-template-columns:1fr;}}


/* Gold & Silver Budget Calculator */
.budget-calculator {
    padding: 24px;
    border: 1px solid rgba(212,175,55,.28);
    border-radius: 14px;
    background: linear-gradient(145deg,
        rgba(212,175,55,.07), rgba(255,255,255,.015));
}
.calculator-intro {
    color: var(--text-muted);
    font-size: .85rem;
    line-height: 1.8;
    margin-bottom: 22px;
}
.calculator-intro span {
    display: block;
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
}
.calculator-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 14px;
}
.calculator-fields label {
    display: flex;
    flex-direction: column;
    gap: 9px;
    color: var(--text-muted);
    font-size: .8rem;
}
.calculator-fields input,
.calculator-fields select {
    width: 100%;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(212,175,55,.35);
    border-radius: 8px;
    background: #17181c;
    color: var(--text-light);
    font: inherit;
    font-size: .95rem;
}
.calculator-fields input:focus,
.calculator-fields select:focus {
    outline: 2px solid var(--text-gold);
    outline-offset: 2px;
}
.calculator-result {
    margin-top: 22px;
    padding: 24px;
    text-align: center;
    border-radius: 12px;
    background: rgba(212,175,55,.07);
}
.calculator-result p {
    color: var(--text-muted);
    font-size: .82rem;
    line-height: 1.7;
}
.calculator-result strong {
    display: block;
    margin: 10px 0;
    color: var(--text-gold);
    font-size: clamp(1.7rem,4vw,2.5rem);
    font-weight: 500;
}
.calculator-disclaimer {
    margin-top: 20px;
    color: var(--text-muted);
    font-size: .74rem;
    line-height: 1.8;
}
.calculator-disclaimer p + p {
    margin-top: 12px;
    font-family: 'Amiri', serif;
    font-size: .95rem;
}
@media(max-width:700px) {
    .budget-calculator { padding: 16px; }
    .calculator-fields { grid-template-columns: 1fr; }
}

/* Gold color for KWD/kg only */
.price-card .price-kg {
    color: #e8c45c;
}

.price-card .price-usd {
    color: #a8a8a8;
}


/* Market connection indicator */
#market-status::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 9px;
  background: #a0a0a0;
  vertical-align: middle;
}
#market-status[data-state="connected"]::before {
  background: #22c55e;
}
#market-status[data-state="unavailable"]::before {
  background: #ef4444;
}
#market-status[data-state="outdated"]::before {
  background: #f59e0b;
}

/* Scheduled price refresh countdown */
.refresh-timer {
  margin: 16px auto 0;
  padding: 14px 18px;
  max-width: 380px;
  border: 1px solid rgba(212,175,55,.25);
  border-radius: 12px;
  background: rgba(212,175,55,.045);
  text-align: center;
}
.refresh-label {
  color: var(--text-muted);
  font-size: .76rem;
}
.refresh-countdown {
  color: var(--text-gold);
  font-size: 1.8rem;
  font-weight: 500;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
  margin: 8px 0;
}
.refresh-time {
  color: var(--text-muted);
  font-size: .76rem;
}


/* Discreet footer visitor counter */
.visitor-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 9px auto 0;
    color: #a8a8a8;
    font-size: .72rem;
    line-height: 1.6;
}
.visitor-counter svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    color: #b99a55;
}
.visitor-counter[hidden] {
    display: none;
}


@media(max-width:700px){
  .history-controls {
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .history-controls button {
    min-width:0;
    padding:10px 4px;
    font-size:.78rem;
    line-height:1.4;
    white-space:normal;
  }
  .chart-placeholder {
    padding:8px;
  }
}


/* Bilingual gold calculator mode selector */
.calculator-mode {
    margin: 22px 0;
}
.calculator-mode-title {
    color: var(--text-gold);
    font-size: .95rem;
    text-align: center;
    margin-bottom: 12px;
}
.calculator-mode-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.calculator-mode-option {
    position: relative;
    display: block;
    cursor: pointer;
}
.calculator-mode-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.calculator-mode-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 84px;
    padding: 14px 10px;
    border: 1px solid rgba(212,175,55,.5);
    border-radius: 14px;
    background: #1c1b18;
    color: #e8e0d2;
    font-size: clamp(.82rem, 2vw, 1.1rem);
    text-align: center;
    transition: background .2s, color .2s;
}
.calculator-mode-button [lang="ar"] {
    font-family: 'Amiri', serif;
    font-size: 1.15em;
}
.calculator-mode-option input:checked + .calculator-mode-button {
    background: linear-gradient(145deg, #f5d47b, #e8b942);
    color: #17130b;
    border-color: #f5d47b;
    font-weight: 600;
}
.calculator-mode-option input:focus-visible + .calculator-mode-button {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}
.refresh-time-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.refresh-clock-icon {
    color: #20b8f5;
    flex-shrink: 0;
}
@media (max-width: 360px) {
    .calculator-mode-options { gap: 8px; }
    .calculator-mode-button { padding: 12px 6px; }
}


/* Compact calculator toggle */
.calculator-mode {
    margin: 12px 0 16px;
}
.calculator-mode-title {
    font-size: .82rem;
    margin-bottom: 8px;
}
.calculator-mode-options {
    gap: 10px;
}
.calculator-mode-button {
    min-height: 52px;
    padding: 7px 10px;
    gap: 2px;
    border-radius: 10px;
    font-size: clamp(.75rem, 1.5vw, .92rem);
}
.calculator-mode-button [lang="ar"] {
    font-size: 1.05em;
}


/* Arabic disclaimer alignment */
.calculator-disclaimer p[lang="ar"] {
    direction: rtl;
    text-align: right;
}

.calculator-disclaimer p[lang="en"] {
    direction: ltr;
    text-align: left;
}


/* Centered market price cards v11 */
.price-card {
    text-align: center;
}

.price-card h3,
.price-card .price-main,
.price-card .price-kg,
.price-card .price-usd,
.price-card .price-change {
    text-align: center;
}

.price-card .price-change {
    margin-top: 12px;
}

/* Extra breathing room below market snapshot */
#live-price-notice {
    margin-bottom: 32px;
}


/* Two-line percentage hierarchy v12 */
.price-card .price-change {
    font-size: 0.88rem;
    font-weight: 500;
    text-align: center;
    margin-top: 14px;
    margin-bottom: 3px;
}

.price-card .price-change-24 {
    font-size: 0.68rem;
    font-weight: 400;
    color: #a8a8a8;
    text-align: center;
    line-height: 1.5;
    margin: 0;
}


/* Enhanced price movement animation v14 */
.price-card.price-glow-up {
  animation: priceCardUp 5s ease-out both;
}

.price-card.price-glow-down {
  animation: priceCardDown 5s ease-out both;
}

.price-card.price-glow-up .price-main {
  animation: priceTextUp 5s ease-out both;
}

.price-card.price-glow-down .price-main {
  animation: priceTextDown 5s ease-out both;
}

@keyframes priceCardUp {
  0%, 15% {
    border-color: #4ade80;
    box-shadow: inset 0 0 0 1px #4ade80,
                0 0 22px rgba(74,222,128,.4);
  }
  100% {
    border-color: rgba(212,175,55,.22);
    box-shadow: none;
  }
}

@keyframes priceCardDown {
  0%, 15% {
    border-color: #fb7185;
    box-shadow: inset 0 0 0 1px #fb7185,
                0 0 22px rgba(251,113,133,.4);
  }
  100% {
    border-color: rgba(212,175,55,.22);
    box-shadow: none;
  }
}

@keyframes priceTextUp {
  0%, 15% {
    color: #4ade80;
    text-shadow: 0 0 14px rgba(74,222,128,.55);
  }
  100% {
    color: var(--text-light);
    text-shadow: none;
  }
}

@keyframes priceTextDown {
  0%, 15% {
    color: #fb7185;
    text-shadow: 0 0 14px rgba(251,113,133,.55);
  }
  100% {
    color: var(--text-light);
    text-shadow: none;
  }
}

.price-direction-arrow {
  display: inline-block;
  margin-left: 7px;
  font-size: .85em;
  font-weight: 700;
  vertical-align: middle;
  opacity: 1;
}

.price-direction-arrow[data-direction="up"] {
  color: #4ade80;
}

.price-direction-arrow[data-direction="down"] {
  color: #fb7185;
}

.price-direction-arrow[data-direction="neutral"] {
  color: #9ca3af;
}

@media (prefers-reduced-motion: reduce) {
  .price-card.price-glow-up,
  .price-card.price-glow-down,
  .price-card.price-glow-up .price-main,
  .price-card.price-glow-down .price-main,
  .price-direction-arrow {
    animation: none;
  }
}


/* Bilingual jewellery boutique identity v18 */
.market-heading .boutique-identity {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 12px;
    margin: -8px auto 16px;
    line-height: 1.6;
    letter-spacing: normal;
}

.boutique-identity-en {
    color: #d4af37;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(.58rem, 1.5vw, .88rem);
    font-weight: 500;
    letter-spacing: .06em;
    white-space: nowrap;
}

.boutique-identity-dot {
    color: #ffffff;
    font-size: 1rem;
    flex-shrink: 0;
}

.market-heading .boutique-identity-ar {
    color: #bcb8b6;
    font-family: 'Amiri', serif;
    font-size: clamp(.9rem, 2vw, 1.35rem);
    font-weight: 400;
    white-space: nowrap;
    margin: 0;
}

@media (max-width: 480px) {
    .market-heading .boutique-identity {
        gap: 6px;
    }

    .boutique-identity-en {
        font-size: clamp(.43rem, 2.1vw, .65rem);
        letter-spacing: 0;
    }

    .market-heading .boutique-identity-ar {
        font-size: clamp(.72rem, 3vw, .95rem);
    }
}

/* Separate USD card layout v1 */
.price-card.gold:not(.usd-standalone) .price-kg,
.price-card.gold:not(.usd-standalone) .price-usd {
    display: none !important;
}
.price-card.usd-standalone {
    grid-column: 1 / -1;
    width: 100%;
    box-sizing: border-box;
}
.price-card.usd-standalone .price-main {
    margin-top: 12px;
}


/* USD compact card and flag v2 */
.price-card.usd-standalone {
    grid-column: auto;
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

.price-card.usd-standalone .usd-country-flag {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 1.25rem;
    line-height: 1;
}

.price-card.usd-standalone h3 {
    padding-right: 30px;
    padding-left: 30px;
}


/* Circular US flag v3 */
.price-card.usd-standalone .usd-country-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    background: #202126;
    border: 1px solid rgba(212,175,55,.55);
    font-size: 23px;
    line-height: 1;
    top: 10px;
    right: 12px;
}

/* DK_MARKET_WEEKEND_V1 */

.dk-market-closed[hidden] {
    display: none !important;
}

.dk-market-closed {
    text-align: center;
    margin: 8px auto 20px;
}

.dk-market-closed-title {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: #d65b5b;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .05em;
}

.dk-market-closed-title svg {
    flex-shrink: 0;
}

.dk-market-reopens {
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 12px;
}

body.dk-market-weekend-closed #market-status,
body.dk-market-weekend-closed #next-refresh {
    display: none !important;
}

/* Remove dynamically generated snapshot timestamp */
#live-price-notice {
    display: none !important;
}

/* Compact dashboard heading */
.market-heading {
    padding-top: 8px;
}

@media (max-width: 700px) {
    .dk-market-closed-title {
        font-size: 12px;
        gap: 7px;
    }
}
