@font-face {
    font-family: "IRANSansX";
    src: url("/fonts/IRANSansX-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IRANSansX";
    src: url("/fonts/IRANSansX-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IRANSansX";
    src: url("/fonts/IRANSansX-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;
    font-family: "IRANSansX", Tahoma, Arial, sans-serif;
    background: #f6f6f6;
    color: #222;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f6f6f6;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 24px;
    padding: 18px 10px 32px;
    overflow-x: hidden;
}

.selector-area {
    width: min(378px, calc(100vw - 20px));
    align-self: center;
}

.provider-status {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(520px, calc(100vw - 20px));
    min-height: 46px;
    align-self: center;
    padding: 8px 12px;
    border: 1px solid #d7dde5;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.provider-status__indicator {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: #9aa3af;
    flex: 0 0 auto;
}

.provider-status[data-state="healthy"] .provider-status__indicator {
    background: #16a34a;
}

.provider-status[data-state="warning"] .provider-status__indicator {
    background: #f59e0b;
}

.provider-status[data-state="offline"] .provider-status__indicator {
    background: #dc2626;
}

.provider-status__content {
    min-width: 0;
    flex: 1 1 auto;
}

.provider-status__label {
    color: #4b5563;
    font-size: 11px;
    line-height: 1.6;
}

.provider-status__details {
    color: #111827;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.provider-status__updated {
    color: #6b7280;
    font-size: 11px;
    white-space: nowrap;
}

.symbol-select {
    position: relative;
    width: 100%;
    direction: rtl;
}

.symbol-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 39px;
    padding: 0 13px 0 12px;
    border: 1px solid #2f79d8;
    border-radius: 4px;
    background: #5a99ee;
    color: #fff;
    font: 700 14px/1 "IRANSansX", Tahoma, Arial, sans-serif;
    text-align: right;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.symbol-select__trigger:focus-visible {
    outline: 2px solid #9bcaff;
    outline-offset: 2px;
}

.symbol-select__arrow {
    width: 0;
    height: 0;
    margin-right: 12px;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    border-top: 5px solid #fff;
    flex: 0 0 auto;
}

.symbol-select__menu {
    position: absolute;
    z-index: 20;
    top: 43px;
    right: 0;
    left: 0;
    max-height: min(430px, calc(100vh - 68px));
    overflow: hidden;
    border: 1px solid #ddd;
    background: #f7f7f7;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.15);
}

.symbol-select__search-wrap {
    padding: 4px;
}

.symbol-select__search {
    width: 100%;
    height: 40px;
    padding: 7px 9px;
    border: 1px solid #58a9f5;
    border-radius: 4px;
    background: #fff;
    color: #222;
    font: 14px/1.4 "IRANSansX", Tahoma, Arial, sans-serif;
    box-shadow:
        inset 0 0 0 1px rgba(88, 169, 245, 0.28),
        0 0 4px rgba(88, 169, 245, 0.72);
}

.symbol-select__search:focus {
    outline: none;
    border-color: #4aa3ff;
}

.symbol-select__status {
    padding: 8px 22px;
    color: #777;
    font-size: 14px;
}

.symbol-select__status:empty {
    display: none;
}

.symbol-select__options {
    max-height: 376px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.symbol-select__option {
    min-height: 32px;
    padding: 7px 22px 7px 10px;
    color: #252525;
    font: 14px/18px "IRANSansX", Tahoma, Arial, sans-serif;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.symbol-select__option:hover,
.symbol-select__option[aria-selected="true"] {
    background: #075fb8;
    color: #fff;
    font-weight: 700;
}

.strategy-analysis {
    width: min(1100px, calc(100vw - 20px));
    align-self: center;
    border: 1px solid #d7dde5;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.strategy-analysis__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
}

.strategy-analysis__toggle {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    border: 0;
    background: transparent;
    color: #1f2937;
    font: 700 14px/1.5 "IRANSansX", Tahoma, Arial, sans-serif;
    text-align: right;
    cursor: pointer;
}

.strategy-analysis__toggle:focus-visible,
.strategy-analysis__calculate:focus-visible,
.strategy-analysis__field select:focus-visible,
.strategy-analysis__field input:focus-visible {
    outline: 2px solid #9bcaff;
    outline-offset: 2px;
}

.strategy-analysis__arrow {
    width: 9px;
    height: 9px;
    margin-right: 12px;
    border-bottom: 2px solid #4b5563;
    border-left: 2px solid #4b5563;
    transform: rotate(-45deg);
    transition: transform 150ms ease;
    flex: 0 0 auto;
}

.strategy-analysis__toggle[aria-expanded="true"] .strategy-analysis__arrow {
    transform: rotate(135deg);
}

.strategy-analysis__calculate {
    min-height: 34px;
    padding: 0 15px;
    border: 1px solid #2f79d8;
    border-radius: 4px;
    background: #5798ef;
    color: #fff;
    font: 500 12px/1.4 "IRANSansX", Tahoma, Arial, sans-serif;
    white-space: nowrap;
    cursor: pointer;
}

.strategy-analysis__calculate:hover:not(:disabled) {
    background: #337edc;
}

.strategy-analysis__calculate:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.strategy-analysis__body {
    padding: 14px 16px 18px;
    border-top: 1px solid #e5e7eb;
}

.strategy-analysis__controls {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 14px;
    margin-bottom: 12px;
}

.strategy-analysis__field {
    display: grid;
    gap: 5px;
    min-width: 210px;
    color: #4b5563;
    font-size: 12px;
}

.strategy-analysis__field[hidden] {
    display: none;
}

.strategy-analysis__field select,
.strategy-analysis__field input {
    height: 36px;
    padding: 5px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #111827;
    font: 13px/1.4 "IRANSansX", Tahoma, Arial, sans-serif;
}

.strategy-analysis__field input {
    direction: ltr;
    text-align: left;
}

.strategy-analysis__status {
    min-height: 22px;
    margin: 4px 0 10px;
    color: #64748b;
    text-align: center;
    font-size: 12px;
}

.strategy-analysis__status[data-state="error"] {
    color: #b91c1c;
}

.strategy-analysis__chart {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #fff;
    padding: 12px;
}

.strategy-analysis__chart-title {
    margin-bottom: 4px;
    color: #1f2937;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
}

.strategy-analysis__svg {
    display: block;
    width: 100%;
    min-width: 720px;
    height: auto;
    font-family: "IRANSansX", Tahoma, Arial, sans-serif;
}

.strategy-chart__grid {
    stroke: #e5e7eb;
    stroke-width: 1;
}

.strategy-chart__axis {
    stroke: #64748b;
    stroke-width: 1.25;
}

.strategy-chart__zero {
    stroke: #7d8794;
    stroke-width: 1.5;
}

.strategy-chart__label {
    fill: #475569;
    font-size: 11px;
}

.strategy-chart__axis-title {
    fill: #334155;
    font-size: 12px;
    font-weight: 700;
}

.strategy-analysis__legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
    margin-top: 4px;
    color: #475569;
    font-size: 11px;
}

.strategy-analysis__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.strategy-analysis__legend-swatch {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.option-chain {
    width: min(1800px, calc(100vw - 20px));
    align-self: center;
}

.underlying-panel {
    width: min(565px, calc(100vw - 20px));
    align-self: center;
}

.underlying-panel__title {
    margin: 0 0 14px;
    color: #006cff;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
}

.underlying-panel__table-wrap {
    overflow-x: auto;
}

.underlying-panel__table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    table-layout: fixed;
    direction: ltr;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.underlying-panel__table th,
.underlying-panel__table td {
    height: 51px;
    border: 1px solid #d9dee5;
    padding: 7px 8px;
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
    line-height: 1.35;
}

.underlying-panel__table th {
    height: 46px;
    background: #5798ef;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.underlying-panel__table tbody tr {
    background: #f1f1f1;
}

.underlying-panel__table a {
    color: #111;
    text-decoration: none;
}

.underlying-panel__table a:hover {
    color: #006cff;
    text-decoration: underline;
}

.underlying-panel__price-change {
    margin-right: 6px;
    font-size: 12px;
    direction: ltr;
    unicode-bidi: isolate;
}

.underlying-panel__price-change--positive {
    color: #16803a;
}

.underlying-panel__price-change--negative {
    color: #c62828;
}

.underlying-panel__price-change--neutral {
    color: #6b7280;
}

.option-chain__topline {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 18px;
    min-height: 28px;
    margin-bottom: 12px;
}

.option-chain__title {
    margin: 0 0 12px;
    color: #006cff;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
}

.option-chain__tables {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    direction: ltr;
}

.option-chain__panel {
    min-width: 0;
    direction: rtl;
}

.option-chain__updated {
    color: #666;
    font-size: 12px;
    min-width: 148px;
}

.option-chain__reload {
    height: 28px;
    min-width: 92px;
    padding: 0 14px;
    border: 1px solid #3f86dd;
    border-radius: 4px;
    background: #5798ef;
    color: #fff;
    font-family: "IRANSansX", Tahoma, Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.option-chain__reload:hover {
    background: #337edc;
}

.option-chain__reload:focus-visible {
    outline: 2px solid #9bcaff;
    outline-offset: 2px;
}

.option-chain__reload:disabled {
    cursor: wait;
    opacity: 0.72;
}

.option-chain__table-wrap {
    width: 100%;
    overflow-x: auto;
    direction: ltr;
}

.option-chain__table {
    width: calc(100% - 1px);
    min-width: 800px;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    direction: ltr;
    background: #fff;
}

.option-chain__col-symbol {
    width: 10%;
}

.option-chain__col-expiry {
    width: 10%;
}

.option-chain__col-exercise,
.option-chain__col-price {
    width: 10%;
}

.option-chain__col-small {
    width: 8%;
}

.option-chain__col-volume {
    width: 10%;
}

.option-chain__col-check {
    width: 7%;
}

.option-chain__table th,
.option-chain__table td {
    height: 51px;
    border: 1px solid #d9dee5;
    padding: 7px 8px;
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
}

.option-chain__table th {
    height: 46px;
    background: #5798ef;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.option-chain__table tbody tr:nth-child(odd) {
    background: #f1f1f1;
}

.option-chain__table tbody tr:nth-child(even) {
    background: #fff;
}

.option-chain__table a {
    color: #111;
    text-decoration: none;
}

.option-chain__table a:hover {
    color: #006cff;
    text-decoration: underline;
}

.option-chain__symbol,
.option-chain__date {
    direction: rtl;
}

.option-chain__date {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 7px;
}

.option-chain__remaining {
    font-size: 15px;
}

.option-chain__jalali {
    color: #7f8793;
    font-size: 9px;
}

.option-chain__status {
    min-height: 20px;
    margin-top: 10px;
    color: #666;
    text-align: center;
    font-size: 13px;
}

.market-checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #5798ef;
    cursor: pointer;
}

@media (max-width: 1200px) {
    .option-chain__tables {
        grid-template-columns: minmax(0, 1fr);
    }

    .option-chain__table {
        min-width: 900px;
    }
}

@media (max-width: 620px) {
    .strategy-analysis__header,
    .strategy-analysis__controls {
        align-items: stretch;
        flex-direction: column;
    }

    .strategy-analysis__calculate,
    .strategy-analysis__field {
        width: 100%;
    }
}
