/* SACHME NASIR - Market Rates: isolated from sn-kline chart styles */
.sn-market, .sn-market * { box-sizing: border-box; }
.sn-market {
    --sn-market-primary: #0a4b6c;
    --sn-market-accent: #5cb4e0;
    --sn-market-border: #e0eaf0;
    --sn-market-green: #07866d;
    --sn-market-red: #e13c54;
    /* Keep a safe 5px inset on both sides, including narrow DNN containers. */
    width: calc(100% - 10px);
    max-width: calc(100% - 10px);
    margin-inline: 5px;
    min-width: 0;
    direction: rtl;
    font-family: inherit;
    color: #24343e;
}
.sn-market-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    min-width: 0;
    gap: 8px 14px;
    margin: 0 0 14px;
}
.sn-market-title {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--sn-market-primary);
    font-size: 20px;
    font-weight: 750;
    line-height: 1.8;
}
.sn-market-updated { color: #80909c; font-size: 12px; min-width: 0; overflow-wrap: anywhere; }
.sn-market-grid {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.sn-rate-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 203px;
    padding: 18px;
    border: 1px solid var(--sn-market-border);
    border-top: 3px solid var(--sn-market-accent);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 3px 16px rgba(10, 75, 108, .045);
    transition: box-shadow .2s ease, transform .2s ease;
}
.sn-rate-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 23px rgba(10, 75, 108, .1);
}
.sn-rate-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.sn-rate-name {
    margin: 0;
    color: #173c51;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.8;
}
.sn-rate-symbol {
    margin-top: 1px;
    color: #92a1a9;
    direction: ltr;
    text-align: right;
    font-size: 11px;
    letter-spacing: .3px;
}
.sn-rate-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    margin-top: 9px;
    background: var(--sn-market-accent);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(92, 180, 224, .12);
}
.sn-rate-main {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin: 20px 0 10px;
}
.sn-rate-price {
    display: inline-flex;
    align-items: baseline;
    direction: ltr;
    unicode-bidi: isolate;
    font-size: clamp(19px, 1.8vw, 28px);
    font-weight: 800;
    letter-spacing: -.4px;
    font-variant-numeric: tabular-nums;
    color: #0e364c;
    white-space: nowrap;
}
.sn-rate-price-major { color: inherit; font-size: 1em; }
.sn-rate-price-minor {
    color: #55788b;
    font-size: .72em;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
}
.sn-rate-unit { color: #768994; font-size: 12px; white-space: nowrap; }
.sn-rate-bottom { margin-top: auto; }
.sn-rate-change { font-size: 13px; font-weight: 700; min-height: 20px; }
.sn-rate-up { color: var(--sn-market-green); }
.sn-rate-down { color: var(--sn-market-red); }
.sn-rate-neutral { color: #84949e; }
.sn-rate-stale { border-top-color: #d7a24e; }
.sn-rate-stale .sn-rate-dot { background: #d7a24e; box-shadow: 0 0 0 4px rgba(215,162,78,.13); }
.sn-rate-unavailable { border-top-color: #c4cdd3; }
.sn-rate-unavailable .sn-rate-dot { background: #c4cdd3; box-shadow: none; }
@media (max-width: 1100px) {
    .sn-market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sn-rate-price { font-size: 25px; }
}
/* On phones, place the update timestamp below the title instead of forcing one line. */
@media (max-width: 720px) {
    .sn-market-heading { flex-direction: column; align-items: flex-start; gap: 2px; }
    .sn-market-title { font-size: 18px; line-height: 1.6; }
    .sn-market-updated { font-size: 11px; }
}
@media (max-width: 520px) {
    .sn-market-title { font-size: 17px; }
    .sn-market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .sn-rate-card { min-height: 159px; padding: 12px 11px; border-radius: 11px; }
    .sn-rate-top { gap: 6px; }
    .sn-rate-name { font-size: 12.5px; line-height: 1.65; }
    .sn-rate-symbol { font-size: 9.5px; letter-spacing: 0; }
    .sn-rate-dot { width: 7px; height: 7px; flex-basis: 7px; margin-top: 6px; box-shadow: 0 0 0 3px rgba(92,180,224,.12); }
    .sn-rate-change { font-size: 11px; line-height: 1.8; }
    .sn-rate-unit { font-size: 10.5px; }
    .sn-rate-main { margin-top: 15px; margin-bottom: 9px; gap: 4px; }
    .sn-rate-price { font-size: clamp(20px, 5.6vw, 27px); letter-spacing: -.6px; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .sn-rate-card { transition: none; }
    .sn-rate-card:hover { transform: none; }
}
@media (max-width: 360px) {
    .sn-market-grid { gap: 7px; }
    .sn-rate-card { padding: 11px 9px; }
    .sn-rate-name { font-size: 11.5px; }
    .sn-rate-price { font-size: 18.5px; letter-spacing: -.85px; }
    .sn-rate-symbol { font-size: 9px; }
}

/* Hide only optional values unavailable from the source. */
.sn-market [hidden] { display: none !important; }

/* V17: weekday + Persian date only; source timestamp when available. */
.sn-rate-dated {
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
    align-items: baseline;
    column-gap: 4px;
    row-gap: 0;
    direction: rtl;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid #edf2f5;
    color: #738995;
    font-weight: 400;
    font-size: 10.5px;
    line-height: 1.8;
    text-align: right;
    min-width: 0;
}
.sn-rate-date-label {
    flex: 0 0 auto;
    color: #8095a2;
}
.sn-rate-date-primary {
    min-width: 0;
    color: #5b7382;
    overflow-wrap: normal;
}
.sn-rate-date-clock { color: #7e919c; }
.sn-rate-change[hidden] { display: none !important; }
@media (max-width: 520px) {
    .sn-rate-card { min-height: 194px; }
    .sn-rate-dated {
        margin-top: 7px;
        padding-top: 7px;
        font-size: 9.5px;
        column-gap: 3px;
        line-height: 1.85;
    }
}
@media (max-width: 360px) {
    .sn-rate-dated { font-size: 9px; }
}

/* V23: ONE tooltip only -- the browser's native title popup on <time>. */
.sn-rate-market { color: #728a9a; font-size: 10px; margin-top: 2px; }
.sn-rate-relative {
    display: inline-block;
    cursor: help;
    text-decoration: underline dotted #9caeb8;
    text-underline-offset: 3px;
}
@media (max-width: 520px) { .sn-rate-market { font-size: 9px; } }

/* V26: larger primary digits on phones, with a smaller decimal fraction. */
@media (max-width: 520px) {
    .sn-rate-price { line-height: 1.35; }
    .sn-rate-price-minor { font-size: .68em; }
    .sn-rate-main { min-width: 0; }
}

/* V27: CSS cache bust only; existing mobile price sizes stay as v26. */
