/* ابزارهای رایگان (/tools/...). پایه‌ی صفحه از learn.css و رنگ‌ها از theme.css می‌آید. */

.ft-tool { margin-bottom: 38px; }
.ft-tabs { margin-bottom: 14px; flex-wrap: wrap; max-width: 100%; }

.ft-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 16px; padding: 18px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); align-items: end; }
.ft-form label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--text-muted); min-width: 0; }
.ft-form label[hidden] { display: none; }
.ft-form label.wide, .ft-form .ft-fields { grid-column: 1 / -1; }
.ft-form .ui-input { height: 42px; width: 100%; font-family: var(--font-num); font-size: 17px; direction: ltr; text-align: left; box-sizing: border-box; }
.ft-form select.ui-input { direction: rtl; text-align: right; font-family: inherit; }
.ft-form small { font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.ft-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 16px; }
.ft-submit { height: 42px; padding: 0 22px; justify-self: start; }
.ft-form .ft-submit { grid-column: 1 / -1; }

.ft-error { margin: 12px 0 0; padding: 10px 14px; border: 1px solid var(--c-red); border-radius: var(--radius); color: var(--c-red); font-size: 16px; }
.ft-error[hidden] { display: none; }

.ft-result { margin-top: 18px; }
.ft-result[hidden] { display: none; }
.ft-result-note, .ft-note { font-size: 14px; color: var(--text-muted); margin: 0 0 10px; line-height: 1.9; }
.ft-iv-badge { display: inline-block; padding: 6px 14px; margin-bottom: 12px; border: 1px solid var(--accent-blue); border-radius: var(--radius); color: var(--text-strong); font-size: 17px; }
.ft-iv-badge[hidden] { display: none; }
.ft-iv-badge b { font-family: var(--font-num); color: var(--accent-blue); }

.ft-scroll { overflow-x: auto; margin-bottom: 14px; }
.ft-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); font-size: 16px; }
.ft-table th, .ft-table td { padding: 9px 14px; border-bottom: 1px solid var(--border-color); text-align: right; color: var(--text-light); vertical-align: top; }
.ft-table thead th { font-size: 14px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.ft-table tbody th { font-weight: 400; color: var(--text-muted); white-space: nowrap; }
.ft-table tr:last-child th, .ft-table tr:last-child td { border-bottom: 0; }
.ft-table td[data-out], .ft-iv-table td { font-family: var(--font-num); color: var(--text-strong); }
.ft-table td.ft-left { font-size: 15px; line-height: 1.9; }
.ft-table td[data-out], .ft-iv-table td { direction: ltr; text-align: right; }
.ft-iv-table a { color: var(--accent-blue); text-decoration: none; border-bottom: 1px solid currentColor; font-family: inherit; }

.ft-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 16px 18px; background: var(--bg-card); border: 1px solid var(--border-color); border-right: 3px solid var(--accent-blue); border-radius: var(--radius); margin-bottom: 14px; }
.ft-big span { font-size: 16px; color: var(--text-muted); }
.ft-big b { font-family: var(--font-num); font-size: 30px; color: var(--text-strong); }
.ft-big small { font-size: 15px; color: var(--text-muted); }
.ft-steps { margin: 0 0 12px; padding-right: 22px; font-size: 16px; line-height: 2; color: var(--text-light); font-family: var(--font-text); }
.ft-rule, .ft-warn { font-size: 15px; line-height: 1.95; margin: 0 0 8px; color: var(--text-light); }
.ft-warn { color: var(--c-amber); }

.ft-terms { list-style: none; padding: 0; margin: 0; }
.ft-terms li { margin-bottom: 6px; }
.learn section ul.ft-terms li { font-size: 16px; line-height: 1.95; }

.ft-others { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.learn section .ft-others a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); text-decoration: none; color: var(--text-light); transition: border-color 0.15s ease; }
.learn section .ft-others a:hover { border-color: var(--accent-blue); }
.ft-others b { font-size: 17px; color: var(--text-strong); }
.ft-others span { font-size: 14px; color: var(--text-muted); }

/* نمودار تاریخچه */
.ft-chart svg { direction: ltr; }
.ft-chart .ft-iv { fill: none; stroke: var(--accent-blue); stroke-width: 2.2; stroke-linejoin: round; }
.ft-chart .ft-hv { fill: none; stroke: var(--text-muted); stroke-width: 1.5; stroke-dasharray: 4 3; stroke-linejoin: round; }
.ft-key { display: inline-block; width: 22px; height: 0; border-top: 2px solid var(--accent-blue); vertical-align: middle; margin-left: 4px; }
.ft-key.hv { border-top: 2px dashed var(--text-muted); }
.ft-glance { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 800px) {
    .ft-form { padding: 14px; grid-template-columns: minmax(0, 1fr); }
    .ft-fields { grid-template-columns: minmax(0, 1fr); }
    .ft-submit { width: 100%; justify-self: stretch; }
    .ft-glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ft-glance div:nth-child(2) { border-left: 0; }
    .ft-glance div:nth-child(n+3) { border-top: 1px solid var(--border-color); }
    .ft-big b { font-size: 26px; }
    .ft-table th, .ft-table td { padding: 8px 10px; font-size: 15px; }
}
