/* Токены */
:root {
  --mt-bg: #f4f6f5;
  --mt-fg: #1d2523;
  --mt-surface: #ffffff;
  --mt-border: #dde4e2;
  --mt-accent: #2e7d6b;
  --mt-accent2: #d9a441;
  --mt-shadow: 0 1px 3px rgba(29,37,35,.12), 0 4px 14px rgba(29,37,35,.08);
}
[data-theme="dark"] {
  --mt-bg: #141a18;
  --mt-fg: #e4eae8;
  --mt-surface: #1d2624;
  --mt-border: #2c3835;
  --mt-shadow: 0 1px 3px rgba(0,0,0,.5), 0 4px 14px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--mt-bg);
  color: var(--mt-fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
}
a { color: var(--mt-accent); }

.site-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.25rem;
  background: var(--mt-surface);
  border-bottom: 1px solid var(--mt-border);
  position: sticky; top: 0; z-index: 10;
}
.site-footer { padding: 1.5rem; text-align: center; font-size: .8rem; opacity: .6; }
.site-header img { width: 40px; height: 40px; }
.brand { display: flex; align-items: center; gap: .6rem; line-height: 1.15; text-decoration: none; color: inherit; }
.brand b { font-size: 1.25rem; }
.brand-slogan { display: block; font-size: .72rem; opacity: .65; }
.theme-toggle {
  margin-left: auto;
  border: 1px solid var(--mt-border); background: var(--mt-surface); color: inherit;
  border-radius: 999px; padding: .4rem .9rem; cursor: pointer; font-size: 1rem;
}
.theme-toggle:hover { border-color: var(--mt-accent); }

main { max-width: 960px; margin: 0 auto; width: 100%; padding: 0 .5rem; }
.hero { padding: 2rem 1.25rem 0; }
.hero h1 { margin: 0 0 .25rem; font-size: 1.9rem; }
.hero p { margin: 0; opacity: .7; }

.hot-news { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); padding: 1.25rem; }
.hot-news .news-item { border-left: 4px solid var(--mt-accent2); }

.news-feed { display: flex; flex-direction: column; gap: .75rem; padding: 0 1.25rem 1.25rem; }
.news-item {
  background: var(--mt-surface); border: 1px solid var(--mt-border);
  border-radius: 12px; box-shadow: var(--mt-shadow); padding: 1rem 1.25rem;
}
.news-item h2 { margin: .1rem 0 .3rem; font-size: 1.02rem; }
.news-item h2 a { color: inherit; text-decoration: none; }
.news-item h2 a:hover { color: var(--mt-accent); }
.news-item p { margin: 0; font-size: .88rem; opacity: .8; }
.news-date { font-size: .75rem; opacity: .55; }

.paginator { display: flex; gap: 1rem; align-items: center; justify-content: center; padding: 0 1.25rem 1.5rem; }
.paginator a { text-decoration: none; }
.news-more { display: block; text-align: center; padding: 0 1.25rem 1.5rem; }

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); padding: 1.25rem; }
.card {
  display: block; padding: 1.25rem;
  background: var(--mt-surface); border: 1px solid var(--mt-border);
  border-radius: 14px; box-shadow: var(--mt-shadow);
  text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 22px rgba(46,125,107,.25); }
.card h2 { margin: 0 0 .35rem; font-size: 1.05rem; }
.card p { margin: 0; font-size: .88rem; opacity: .75; }

/* Бургер-меню */
.menu-toggle {
  border: 1px solid var(--mt-border); background: var(--mt-surface); color: inherit;
  border-radius: 999px; padding: .4rem .9rem; cursor: pointer; font-size: 1rem;
}
.menu-toggle:hover { border-color: var(--mt-accent); }
/* hidden должен перебивать display:flex меню */
.site-menu[hidden], .submenu[hidden] { display: none; }
.site-menu {
  position: absolute; top: 100%; right: 1.25rem;
  display: flex; flex-direction: column; gap: .15rem;
  background: var(--mt-surface); border: 1px solid var(--mt-border);
  border-radius: 12px; box-shadow: var(--mt-shadow);
  padding: .5rem; min-width: 230px; z-index: 20;
}
.menu-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .75rem; border-radius: 8px;
}
.menu-item:hover { background: rgba(46,125,107,.08); }
.menu-item > a { flex: 1; text-decoration: none; color: inherit; opacity: .85; }
.menu-item > a:hover { color: var(--mt-accent); opacity: 1; }
.menu-arrow {
  border: none; background: none; color: inherit; cursor: pointer;
  font-size: .8rem; padding: .2rem .45rem; border-radius: 6px;
  transition: transform .15s ease;
}
.menu-arrow:hover { background: rgba(46,125,107,.12); }
.menu-item.open .menu-arrow { transform: rotate(90deg); }
.submenu {
  display: flex; flex-direction: column; gap: .1rem;
  margin-left: .5rem; padding: .3rem .5rem .3rem .75rem;
  border-left: 2px solid var(--mt-border);
}
.submenu a { font-size: .9rem; padding: .3rem .4rem; border-radius: 6px; text-decoration: none; color: inherit; opacity: .85; }
.submenu a:hover { background: rgba(46,125,107,.08); color: var(--mt-accent); opacity: 1; }

/* ─── Account (unified identity) ─── */
.account-wrap { max-width: 460px; margin: 0 auto 48px; }
.account-form { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.account-form label { display: flex; flex-direction: column; gap: 6px; color: var(--text-secondary, #8a8a8a); font-size: 14px; }
.account-form input { height: 42px; padding: 0 12px; border: 1px solid var(--border, #3333); border-radius: 10px; background: var(--surface, #fff1); color: inherit; font-size: 16px; }
.account-form input:focus { outline: 2px solid var(--accent, #4c8bf5); outline-offset: 1px; }
.account-form button, .account-actions button { height: 44px; border: 0; border-radius: 10px; background: var(--accent, #4c8bf5); color: #fff; font-size: 15px; cursor: pointer; }
.account-note { color: var(--text-secondary, #8a8a8a); font-size: 13px; margin: 4px 0 0; }
.account-links { text-align: center; font-size: 14px; }
.account-qr { display: flex; justify-content: center; padding: 16px; background: #fff; border-radius: 12px; margin: 12px 0; }
.account-empty { padding: 28px 20px; text-align: center; border: 1px dashed var(--border, #3333); border-radius: 12px; margin: 12px 0; }
.account-empty h2 { margin: 0 0 8px; }
.account-apps { list-style: none; padding: 0; }
.account-apps li { padding: 10px 0; border-bottom: 1px solid var(--border, #3332); }
.account-actions { margin-top: 20px; }
.account-providers { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.account-provider { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border: 1px solid var(--border, #3333); border-radius: 10px; text-decoration: none; color: inherit; font-size: 14px; }
.account-provider:hover { border-color: var(--accent, #4c8bf5); }
.account-map { height: 320px; border-radius: 12px; margin: 10px 0; background: #eef1f5; }
.account-car { border: 1px solid var(--border, #3332); border-radius: 14px; padding: 14px 16px; margin: 14px 0; }
.account-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.account-table th, .account-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border, #3332); }
.account-table th { color: #888; font-weight: 500; }
#file-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
#file-form input[type=text] { height: 40px; padding: 0 12px; border: 1px solid var(--border, #3333); border-radius: 10px; }
