/* 1fn.ru — single CSS file */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root{
  --primary:#1B365D;--accent:#50C878;
  --bg:#fff;--bg2:#f5f5f5;
  --text:#111827;--text2:#6b7280;
  --border:#e5e7eb;
  --up:#16a34a;--down:#dc2626;
}
.dark{
  --primary:#50C878;--accent:#50C878;
  --bg:#1B1B1B;--bg2:#222;
  --text:#f3f4f6;--text2:#9ca3af;
  --border:#333;
  --up:#22c55e;--down:#ef4444;
}

html{font-family:'Inter',system-ui,sans-serif;font-feature-settings:'cv02','cv03','cv04','cv11';font-variant-numeric:tabular-nums;line-height:1.5}
body{background:var(--bg);color:var(--text);min-height:100vh;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
::selection{background:var(--accent);color:#fff}
.up{color:var(--up)}.down{color:var(--down)}

/* Header */
.header{position:sticky;top:0;z-index:50;border-bottom:1px solid var(--border);background:rgba(255,255,255,.95);backdrop-filter:blur(8px)}
.dark .header{background:rgba(27,27,27,.95)}
.header-inner{display:flex;align-items:center;gap:2rem;max-width:80rem;margin:0 auto;padding:0 1rem;height:3.5rem}
.logo{font-size:1.5rem;font-weight:700;color:var(--primary);letter-spacing:-.02em}
.logo-1{color:var(--accent)}.dark .logo-1{color:#fff}
.logo-dot{color:var(--text2);font-weight:400}
.nav{display:flex;gap:.25rem;flex:1}
.nav a{padding:.5rem .75rem;border-radius:.375rem;font-size:.875rem;font-weight:500;color:#4b5563;transition:background .15s,color .15s}
.nav a:hover{background:#f3f4f6;color:var(--primary)}
.dark .nav a{color:#9ca3af}
.dark .nav a:hover{background:#2a2a2a;color:var(--accent)}
.theme-btn{display:flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;border-radius:.375rem;border:none;background:0 0;color:var(--text2);cursor:pointer;font-size:1.25rem}
.theme-btn:hover{background:var(--bg2)}

/* Burger */
.burger{display:none;flex-direction:column;gap:4px;padding:8px;background:0 0;border:none;cursor:pointer}
.burger span{display:block;width:20px;height:2px;background:var(--text);border-radius:1px;transition:transform .2s,opacity .2s}
.burger.open span:nth-child(1){transform:translateY(6px) rotate(45deg)}
.burger.open span:nth-child(2){opacity:0}
.burger.open span:nth-child(3){transform:translateY(-6px) rotate(-45deg)}
.mobile-menu{display:none;position:absolute;top:3.5rem;left:0;right:0;background:var(--bg);border-bottom:1px solid var(--border);padding:.5rem 0;z-index:40;box-shadow:0 4px 12px rgba(0,0,0,.1)}
.mobile-menu.open{display:block}
.mobile-menu a{display:block;padding:.75rem 1.5rem;font-size:.9375rem;color:var(--text)}
.mobile-menu a:hover{background:var(--bg2);color:var(--primary)}
@media(max-width:768px){.nav{display:none}.burger{display:flex}.header-inner{justify-content:space-between}}

/* Main */
.main{max-width:80rem;margin:0 auto;padding:1.5rem 1rem}

/* Hero */
.hero{text-align:center;padding:2rem 0 1.5rem}
.hero h1{font-size:2rem;font-weight:700;color:var(--primary);margin:0 0 .5rem}
.hero p{font-size:1.125rem;color:var(--text2);max-width:40rem;margin:0 auto}

/* Section */
.section{margin-bottom:2rem}
.section-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}
.section-title{font-size:1.25rem;font-weight:600;margin:0 0 1rem}
.section-title a{color:inherit}
.section-title a:hover{color:var(--primary)}
.view-all{font-size:.875rem;color:var(--primary)}

/* Page titles */
.page-title{font-size:1.75rem;font-weight:700;margin:0 0 .5rem}
.page-subtitle{color:var(--text2);margin:0 0 1.5rem;font-size:.9375rem}

/* Indices */
.indices-row{display:flex;gap:1rem;overflow-x:auto}
.index-card{flex:1;min-width:180px;padding:1rem;border:1px solid var(--border);border-radius:.5rem;display:flex;flex-direction:column;gap:.25rem;background:var(--bg)}
.index-name{font-size:.75rem;font-weight:600;color:var(--text2);text-transform:uppercase;letter-spacing:.05em}
.index-value{font-size:1.25rem;font-weight:700}

/* Currency */
.currency-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:.75rem}
.currency-card{padding:.75rem 1rem;border:1px solid var(--border);border-radius:.5rem;display:flex;align-items:center;gap:.75rem;background:var(--bg)}
.currency-code{font-weight:700;font-size:.875rem;min-width:2.5rem}
.currency-rate{font-weight:500}

/* Tables */
.data-table{border:1px solid var(--border);border-radius:.5rem;overflow-x:auto;margin-bottom:1rem}
.data-table .thead{display:grid;padding:.5rem 1rem;font-size:.75rem;font-weight:600;color:var(--text2);text-transform:uppercase;letter-spacing:.05em;background:var(--bg2);border-bottom:1px solid var(--border)}
.data-table .row{display:grid;padding:.5rem 1rem;font-size:.875rem;border-bottom:1px solid var(--border);transition:background .1s;color:var(--text)}
.data-table .row:last-child{border-bottom:none}
.data-table .row:hover{background:var(--bg2)}
.data-table a.row{text-decoration:none}
.ticker{font-weight:600;color:var(--primary)}
.stock-name{color:var(--text2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.muted{color:var(--text2);font-size:.8125rem}

/* 5-col table */
.cols-5 .thead,.cols-5 .row{grid-template-columns:80px 1fr 110px 90px 100px}
@media(max-width:768px){.cols-5 .thead,.cols-5 .row{grid-template-columns:65px 1fr 90px 70px}.cols-5 .thead span:nth-child(5),.cols-5 .row span:nth-child(5){display:none}}

/* 6-col table */
.cols-6 .thead,.cols-6 .row{grid-template-columns:80px 1fr 110px 90px 100px 100px}
@media(max-width:768px){.cols-6 .thead,.cols-6 .row{grid-template-columns:65px 1fr 90px 70px}.cols-6 .thead span:nth-child(5),.cols-6 .row span:nth-child(5),.cols-6 .thead span:nth-child(6),.cols-6 .row span:nth-child(6){display:none}}

/* Valuty 5-col */
.cols-v .thead,.cols-v .row{grid-template-columns:1fr 70px 80px 120px 150px}
@media(max-width:768px){.cols-v .thead,.cols-v .row{grid-template-columns:1fr 60px 100px 120px}.cols-v .thead span:nth-child(3),.cols-v .row span:nth-child(3){display:none}}

/* Div calendar 5-col */
.cols-d .thead,.cols-d .row{grid-template-columns:80px 1fr 120px 110px 100px}
@media(max-width:768px){.cols-d .thead,.cols-d .row{grid-template-columns:65px 1fr 100px 80px}.cols-d .thead span:nth-child(5),.cols-d .row span:nth-child(5){display:none}}

/* Bonds 6-col */
.cols-b .thead,.cols-b .row{grid-template-columns:90px 1fr 90px 80px 100px 80px;min-width:600px}

/* Sort bar */
.sort-bar{display:flex;align-items:center;gap:.5rem;margin-bottom:1.5rem;flex-wrap:wrap}
.sort-label{font-size:.8125rem;color:var(--text2)}
.sort-btn{font-size:.8125rem;padding:.375rem .75rem;border:1px solid var(--border);border-radius:.375rem;color:var(--text2);background:var(--bg);cursor:pointer;transition:all .15s}
.sort-btn:hover{border-color:var(--primary);color:var(--primary)}
.sort-btn.active{background:var(--primary);color:#fff;border-color:var(--primary)}

/* Quick links */
.quick-links{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:.75rem}
.quick-link{display:flex;align-items:center;gap:.5rem;padding:1rem;border:1px solid var(--border);border-radius:.5rem;font-weight:500;transition:border-color .15s,background .15s}
.quick-link:hover{border-color:var(--primary);background:var(--bg2)}

/* Breadcrumbs */
.breadcrumbs{display:flex;gap:.5rem;font-size:.8125rem;color:var(--text2);margin-bottom:1.5rem}
.breadcrumbs a{color:var(--primary)}

/* Stock detail */
.stock-header{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;margin-bottom:1.5rem;flex-wrap:wrap}
.stock-price{font-size:2rem;font-weight:700;text-align:right}
.stock-change{font-size:1rem}
.short-name{font-weight:400;color:var(--text2);font-size:1.25rem}
.full-name{color:var(--text2);margin:.25rem 0 0;font-size:.9375rem}

/* Metrics grid */
.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:.75rem;margin-bottom:2rem}
.metric{padding:.75rem;border:1px solid var(--border);border-radius:.5rem;display:flex;flex-direction:column;gap:.25rem}
.metric-label{font-size:.75rem;color:var(--text2);text-transform:uppercase;letter-spacing:.03em}
.metric-mono{font-size:.8125rem;font-family:monospace}
@media(max-width:768px){.stock-header{flex-direction:column}.stock-price{text-align:left}.metrics{grid-template-columns:repeat(2,1fr)}}

/* Div table 3-col */
.cols-3 .thead,.cols-3 .row{grid-template-columns:1fr 1fr 1fr}

/* FAQ */
.faq{margin-top:2rem}
.faq h2{font-size:1.25rem;font-weight:600;margin-bottom:1rem}
.faq details{border:1px solid var(--border);border-radius:.5rem;padding:.75rem 1rem;margin-bottom:.5rem}
.faq summary{font-weight:500;cursor:pointer}
.faq p{margin:.5rem 0 0;color:var(--text2);font-size:.9375rem;line-height:1.6}

/* Cards grid (education) */
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:1rem}
.card{display:block;padding:1.25rem;border:1px solid var(--border);border-radius:.5rem;transition:border-color .15s,box-shadow .15s}
.card:hover{border-color:var(--primary);box-shadow:0 2px 8px rgba(0,0,0,.06)}
.card-category{font-size:.75rem;color:var(--primary);font-weight:600;text-transform:uppercase}
.card-title{font-size:1rem;font-weight:600;margin:.5rem 0}
.card-excerpt{font-size:.875rem;color:var(--text2);line-height:1.5;margin:0}
.card-date{font-size:.75rem;color:var(--text2);margin-top:.5rem;display:block}
.empty{text-align:center;padding:3rem;color:var(--text2)}

/* News list */
.news-item{display:block;padding:1rem 1.25rem;border:1px solid var(--border);border-radius:.5rem;margin-bottom:.75rem}
.news-item:hover{border-color:var(--primary)}
.news-item h2{font-size:1rem;font-weight:600;margin:0}
.news-item p{margin:.375rem 0 0;font-size:.875rem;color:var(--text2);line-height:1.5}
.news-item time{font-size:.75rem;color:var(--text2)}

/* Article */
.article{max-width:720px}
.article header{margin-bottom:2rem}
.article-category{font-size:.75rem;color:var(--primary);font-weight:600;text-transform:uppercase}
.article h1{font-size:2rem;font-weight:700;margin:.5rem 0;line-height:1.3}
.article-meta{display:flex;align-items:center;gap:.75rem;margin-top:1rem;font-size:.875rem;color:var(--text2)}
.article-date{font-size:.8125rem;color:var(--text2)}
.article-content h2{font-size:1.375rem;font-weight:600;margin:2rem 0 .75rem}
.article-content h3{font-size:1.125rem;font-weight:600;margin:1.5rem 0 .5rem}
.article-content p{margin:0 0 1rem;line-height:1.7}
.article-content ul,.article-content ol{margin:0 0 1rem;padding-left:1.5rem}
.article-content li{margin-bottom:.375rem;line-height:1.6}
.article-content table{width:100%;border-collapse:collapse;margin:1rem 0;font-size:.9375rem}
.article-content th,.article-content td{padding:.5rem .75rem;border:1px solid var(--border);text-align:left}
.article-content th{background:var(--bg2);font-weight:600;font-size:.8125rem;text-transform:uppercase}
.article-content blockquote{border-left:3px solid var(--primary);padding:.75rem 1rem;margin:1rem 0;background:var(--bg2);border-radius:0 .375rem .375rem 0}
.article-content a{color:var(--primary);text-decoration:underline;text-underline-offset:2px}

/* Calculator */
.calc{max-width:480px}
.calc-fields{display:flex;flex-direction:column;gap:1rem;margin-bottom:1.5rem}
.calc-field{display:flex;flex-direction:column;gap:.25rem}
.calc-label{font-size:.8125rem;font-weight:500;color:var(--text2)}
.calc-input{padding:.625rem .75rem;border:1px solid var(--border);border-radius:.5rem;font-size:1rem;background:var(--bg);color:var(--text);outline:none;transition:border-color .15s}
.calc-input:focus{border-color:var(--primary)}
.calc-btn{width:100%;padding:.75rem;background:var(--primary);color:#fff;border:none;border-radius:.5rem;font-size:1rem;font-weight:600;cursor:pointer;transition:opacity .15s}
.calc-btn:hover{opacity:.9}
.calc-result{margin-top:1.5rem;display:grid;grid-template-columns:1fr 1fr;gap:.75rem}
.calc-item{padding:.75rem;border:1px solid var(--border);border-radius:.5rem}
.calc-item-label{display:block;font-size:.75rem;color:var(--text2);text-transform:uppercase;letter-spacing:.03em;margin-bottom:.25rem}
.calc-item-value{font-size:1.25rem;font-weight:700}
.calc-item-muted{font-size:1.125rem;font-weight:600;color:var(--text2)}
.calc-item-green{font-size:1.125rem;font-weight:600;color:var(--up)}

/* Share buttons */
.share{display:flex;align-items:center;gap:.5rem;margin:1.5rem 0}
.share-label{font-size:.8125rem;color:var(--text2)}
.share-btn{display:inline-flex;align-items:center;justify-content:center;padding:.375rem .75rem;font-size:.8125rem;font-weight:500;border:1px solid var(--border);border-radius:.375rem;background:var(--bg);color:var(--text);cursor:pointer;transition:border-color .15s,background .15s}
.share-btn:hover{border-color:var(--primary);background:var(--bg2)}

/* Disclaimer */
.disclaimer{padding:1rem;background:var(--bg2);border-radius:.5rem;font-size:.75rem;color:var(--text2);line-height:1.6}

/* Info block */
.info{margin-top:2rem;max-width:720px}
.info h2{font-size:1.25rem;font-weight:600;margin-bottom:.75rem}
.info p{color:var(--text2);line-height:1.7;margin-bottom:.75rem;font-size:.9375rem}

/* Footer */
.footer{margin-top:4rem;border-top:1px solid var(--border);background:var(--bg2);padding:2.5rem 0 1.5rem}
.footer-inner{max-width:80rem;margin:0 auto;padding:0 1rem}
.footer-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:2rem;margin-bottom:2rem}
.footer h3{font-size:.875rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:#374151;margin-bottom:.75rem}
.dark .footer h3{color:#d1d5db}
.footer ul{list-style:none;display:flex;flex-direction:column;gap:.5rem}
.footer ul a{font-size:.875rem;color:var(--text2);transition:color .15s}
.footer ul a:hover{color:var(--primary)}
.footer-copy{display:flex;justify-content:space-between;align-items:center;font-size:.75rem;color:var(--text2)}
.footer-copy a{color:var(--text2)}
.footer-copy a:hover{color:var(--primary)}
@media(max-width:768px){.footer-grid{grid-template-columns:1fr}.footer-copy{flex-direction:column;gap:.5rem}}

/* 404 */
.not-found{text-align:center;padding:4rem 1rem}
.not-found h1{font-size:4rem;font-weight:700;color:var(--primary);margin:0}
.not-found p{font-size:1.25rem;color:var(--text2);margin:1rem 0 2rem}
.not-found a{padding:.75rem 1.5rem;background:var(--primary);color:#fff;border-radius:.5rem;font-weight:500}

/* Skeleton */
@keyframes shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}
.skeleton{background:linear-gradient(90deg,var(--bg2) 25%,var(--border) 50%,var(--bg2) 75%);background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:.25rem}

@media(max-width:768px){.hero h1{font-size:1.5rem}}
