@font-face {
    font-family: Like3Sans;
    src: url("../font/IRANYekan.woff2") format("woff2"),
         url("../font/IRANYekan.woff") format("woff"),
         url("../font/IRANYekan.ttf") format("truetype"),
         local("Tahoma");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Like3Sans;
    src: url("../font/BYekan.woff2") format("woff2"),
         url("../font/BYekan.ttf") format("truetype"),
         local("Tahoma");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #ffffff;
    --surface: #f1f1f1;
    --surface-2: #fafafa;
    --card: #fafafa;
    --text: #22242a;
    --muted: #7a7a7a;
    --border: #dddddd;
    --gold: #f6c244;
    --gold-dark: #d49d18;
    --green: #39a94c;
    --red: #d64545;
    --shadow: 0 18px 45px rgba(0, 0, 0, .08);
    --radius: 16px;
}

[data-theme="dark"] {
    --bg: #121212;
    --surface: #202020;
    --surface-2: #181818;
    --card: #181818;
    --text: #f7f7f7;
    --muted: #b8b8b8;
    --border: #333;
    --shadow: 0 18px 45px rgba(0, 0, 0, .3);
}

* {
    box-sizing: border-box;
}

html {
    direction: rtl;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Like3Sans, Tahoma, Arial, sans-serif;
    line-height: 1.8;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button:disabled {
    cursor: not-allowed;
    opacity: .72;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    max-width: 1440px;
    margin: 0 auto;
    padding: 18px 24px 0;
}

.topbar {
    min-height: 132px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: center;
}

.digital-clock {
    justify-self: start;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    min-width: 190px;
    box-shadow: var(--shadow);
    text-align: center;
}

.digital-clock strong {
    display: block;
    direction: ltr;
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1;
    color: var(--gold-dark);
    letter-spacing: 1px;
}

.digital-clock span {
    color: var(--muted);
    font-size: 15px;
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: 150px;
    max-width: 100%;
    height: auto;
    padding: 15px;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 15px;
}

.header-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle,
.link-button,
.auth-link,
.search-form button,
.form-stack button {
    border: 0;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    padding: 9px 18px;
    cursor: pointer;
}

.theme-toggle {
    width: 48px;
    height: 48px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    position: relative;
}

.theme-icon {
    width: 22px;
    height: 22px;
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    display: none;
}

html:not([data-theme="dark"]) .theme-icon-light,
[data-theme="dark"] .theme-icon-dark {
    display: block;
}

.auth-link.primary,
.form-stack button,
.search-form button {
    background: var(--gold);
    color: #111;
    font-weight: 700;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 8px;
    margin-bottom: 12px;
}

.main-nav a {
    padding: 8px 18px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
}

.main-nav a.active,
.main-nav a:hover {
    background: var(--gold);
    color: #111;
}

.search-form {
    display: flex;
    gap: 8px;
    background: var(--surface);
    padding: 10px;
    border-radius: var(--radius);
}

.search-form input {
    flex: 1;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 999px;
    padding: 12px 18px;
    outline: 0;
}

.page-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 18px 24px 40px;
}

.notice,
.locked-banner {
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 16px;
    font-weight: 700;
}

.notice.success {
    background: rgba(57, 169, 76, .14);
    color: var(--green);
}

.notice.error,
.locked-banner {
    background: rgba(214, 69, 69, .13);
    color: var(--red);
}

.locked-banner a {
    text-decoration: underline;
    font-weight: 900;
}

.hero-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}

.hero-board > div,
.update-card,
.seo-content,
.full-table-card,
.auth-card,
.detail-card,
.related-box {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-board > div:first-child,
.seo-content,
.auth-card,
.detail-card,
.related-box {
    padding: 22px;
}

.hero-board-copy {
    display: grid;
    gap: 14px;
    overflow: hidden;
    min-width: 0;
}

.eyebrow {
    color: var(--gold-dark);
    font-weight: 900;
    margin: 0 0 4px;
}

h1,
h2,
h3 {
    line-height: 1.45;
    margin-top: 0;
}

.update-card {
    padding: 22px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.update-card span {
    color: var(--muted);
    font-weight: 800;
}

.update-card strong {
    color: var(--gold-dark);
    font-size: 22px;
    line-height: 1.4;
}

.update-card small {
    color: var(--muted);
}

.update-card button {
    margin-top: auto;
    border: 0;
    background: var(--gold);
    color: #111;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 900;
    cursor: pointer;
}

.update-card.is-stale {
    border-color: rgba(214, 69, 69, .45);
    background: rgba(214, 69, 69, .08);
}

.update-card.is-stale strong,
.stale-warning {
    color: var(--red);
}

.board-grid.two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.gold-board-widget {
    --board-bg: rgba(17, 24, 39, .06);
    --ticker-bg: var(--surface);
    --ticker-border: rgba(0, 0, 0, .08);
    --text-main: var(--text);
    --text-muted: var(--muted);
    --value-neutral: var(--gold-dark);
    --value-up: var(--green);
    --value-down: var(--red);
    --ticker-radius: 14px;
    --ticker-gap: 18px;
    display: grid;
    gap: 10px;
    direction: rtl;
    min-width: 0;
    overflow: hidden;
}

[data-theme="dark"] .gold-board-widget {
    --board-bg: rgba(255, 255, 255, .04);
    --ticker-border: rgba(255, 255, 255, .08);
}

.market-marquee {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    background: var(--ticker-bg);
    border: 1px solid var(--ticker-border);
    border-radius: var(--ticker-radius);
    position: relative;
    direction: rtl;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}


.market-marquee:hover .market-marquee-track {
    animation-play-state: paused;
}

.market-marquee-track {
    display: flex;
    width: max-content;
    will-change: transform;
    animation: marketTickerMove var(--ticker-speed, 26s) linear infinite;
}

.market-marquee-row {
    display: flex;
    align-items: center;
    gap: var(--ticker-gap);
    padding: 12px 18px;
    flex-shrink: 0;
    direction: rtl;
}

.market-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: max-content;
    font-size: 14px;
    color: var(--text-main);
}

.market-label {
    color: var(--text-muted);
    font-weight: 700;
}

.market-value {
    direction: ltr;
    unicode-bidi: plaintext;
    font-weight: 800;
    color: var(--value-neutral);
}

.market-icon {
    font-size: 12px;
    line-height: 1;
    color: var(--value-neutral);
}

.market-value.is-up,
.market-icon.is-up {
    color: var(--value-up);
}

.market-value.is-down,
.market-icon.is-down {
    color: var(--value-down);
}

.market-value.is-neutral,
.market-icon.is-neutral {
    color: var(--value-neutral);
}


@keyframes marketTickerMove {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(50%);
    }
}

.price-panel {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 420px;
}

.panel-head {
    min-height: 58px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
}

.panel-head h2 {
    margin: 0;
    font-size: 22px;
    flex: 1;
}

.panel-icon {
    min-width: 46px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(246, 194, 68, .2);
    color: var(--gold-dark);
    font-weight: 900;
    font-size: 13px;
    padding: 0 10px;
}

.panel-head a {
    color: var(--muted);
    font-size: 13px;
}

.price-table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(126px, 1fr);
    flex: 1;
}

.price-row {
    min-height: 126px;
    padding: 14px 16px;
    border-inline-end: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.price-subsection-title {
    padding: 12px 16px 6px;
    color: var(--gold-dark);
    font-size: 13px;
    font-weight: 900;
}


.price-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.market-item-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 13px;
    display: inline-grid;
    place-items: center;
    background: rgba(246, 194, 68, .16);
    border: 1px solid rgba(246, 194, 68, .28);
    overflow: hidden;
    color: var(--gold-dark);
    font-size: 12px;
    font-weight: 900;
    direction: rtl;
}

.market-item-icon img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.price-title {
    font-size: 18px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.price-row strong {
    direction: ltr;
    text-align: right;
    font-size: clamp(17.5px, 2.5vw, 30px);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -1px;
}

.change {
    font-weight: 900;
    direction: ltr;
    text-align: right;
}

.up {
    color: var(--green);
}

.down {
    color: var(--red);
}

.neutral {
    color: var(--muted);
}

.seo-content {
    margin-top: 18px;
}

.keyword-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.keyword-cloud a {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 14px;
}

.section-heading {
    margin-bottom: 18px;
}

.full-table-card {
    overflow-x: auto;
}

.market-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.market-table th,
.market-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    text-align: right;
}

.market-table th {
    background: var(--surface);
    font-weight: 900;
}

.market-table td strong {
    direction: ltr;
    display: inline-block;
}

.auth-card {
    max-width: 500px;
    margin: 30px auto;
}

.form-stack {
    display: grid;
    gap: 14px;
}

.form-stack label {
    display: grid;
    gap: 6px;
    font-weight: 800;
}

.form-stack input {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--bg);
    color: var(--text);
    outline: 0;
}

.auth-note {
    text-align: center;
    color: var(--muted);
}

.auth-note a {
    color: var(--gold-dark);
    font-weight: 900;
}

.price-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.big-price {
    direction: ltr;
    text-align: right;
    font-size: clamp(44px, 8vw, 86px);
    font-weight: 900;
    line-height: 1.1;
    margin: 16px 0;
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.detail-list div {
    background: var(--surface);
    border-radius: 12px;
    padding: 12px;
}

.detail-list dt {
    color: var(--muted);
}

.detail-list dd {
    margin: 0;
    font-weight: 900;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.mini-grid a {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.mini-grid strong {
    display: block;
    direction: ltr;
    text-align: right;
}

.site-footer {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 24px 40px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.empty-state {
    grid-column: 1 / -1;
    min-height: 260px;
    padding: 18px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero.compact {
    margin-block: 18px;
    padding: 24px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-block: 18px;
}

.admin-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.admin-card.wide {
    margin-block: 18px;
}

.admin-card h2 {
    margin-block-start: 0;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 14px;
}

.admin-stats div {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
}

.admin-stats dt {
    color: var(--muted);
    font-size: .88rem;
}

.admin-stats dd {
    margin: 4px 0 0;
    font-weight: 900;
}

.admin-form {
    display: grid;
    gap: 16px;
}

.admin-form label {
    display: grid;
    gap: 7px;
    font-weight: 800;
}

.admin-form input,
.admin-form select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--bg);
    color: var(--text);
    padding: 12px 14px;
    outline: 0;
}

.admin-form small {
    color: var(--muted);
    font-weight: 500;
}

.form-grid.two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid.three {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 11px 12px;
}

.checkbox-grid input {
    width: auto;
}

.inline-actions {
    display: inline-block;
    margin-inline-end: 8px;
    margin-block-start: 8px;
}

.secondary-button {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid var(--border);
    padding: 10px;
    text-align: start;
    vertical-align: top;
}

.admin-table th {
    color: var(--muted);
    font-size: .88rem;
}

.price-row:hover {
    background: rgba(246, 194, 68, .08);
}

.price-panel.gold .market-item-icon,
.price-panel.coin .market-item-icon {
    background: rgba(246, 194, 68, .18);
}

.price-panel.currency .market-item-icon {
    background: rgba(57, 169, 76, .12);
    border-color: rgba(57, 169, 76, .22);
}

.price-panel.crypto .market-item-icon {
    background: rgba(120, 120, 120, .12);
    border-color: rgba(120, 120, 120, .22);
}

.table-title-link,
.detail-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.detail-title {
    flex-wrap: wrap;
}

.market-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
}

.market-tabs a {
    border-radius: 999px;
    color: var(--muted);
    font-weight: 900;
    padding: 8px 16px;
    transition: background .18s ease, color .18s ease;
}

.market-tabs a.active,
.market-tabs a:hover {
    background: var(--gold);
    color: #111;
}

.market-panel-hidden {
    display: none;
}

.panel-icon img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    display: block;
}

.market-item-icon img[src$=".svg"] {
    width: 30px;
    height: 30px;
}

.currency .market-item-icon,
.full-table-card .market-item-icon {
    background: var(--bg);
}

.refresh-status.is-success {
    color: var(--green);
    font-weight: 900;
}

.refresh-status.is-warning {
    color: var(--gold-dark);
    font-weight: 900;
}

.refresh-status.is-error {
    color: var(--red);
    font-weight: 900;
}

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: .78rem;
    line-height: 1.8;
}

.field-hint.success {
    color: var(--green);
}

.field-hint.warning,
.notice.warning {
    color: var(--gold-dark);
}

@media (max-width: 920px) {
    .topbar,
    .hero-board,
    .board-grid.two-col,
    .detail-list,
    .mini-grid,
    .admin-grid,
    .form-grid.two,
    .form-grid.three,
    .checkbox-grid,
    .admin-stats {
        grid-template-columns: 1fr;
    }

    .digital-clock,
    .brand,
    .header-actions {
        justify-self: center;
        padding: 1px 10px 10px 1px;
    }

    .price-table {
        grid-template-columns: 1fr;
    }

    .price-panel {
        min-height: auto;
    }

    .search-form {
        flex-direction: column;
    }

    .brand-mark {
        letter-spacing: -3px;
    }

    .market-marquee-row {
        padding: 10px 14px;
        gap: 14px;
    }
}

@media (max-width: 520px) {
    .price-row strong {
        font-size: clamp(24px, 9vw, 36px);
    }

    .market-item-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    .market-tabs a {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }

    .market-item {
        font-size: 12px;
    }
}


.price-panel .panel-head > a {
    min-width: 72px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(246, 194, 68, .16);
    border: 1px solid rgba(246, 194, 68, .28);
    color: var(--gold-dark);
    font-size: 12px;
    font-weight: 900;
    direction: rtl;
    padding: 8px 12px;
    white-space: nowrap;
}
