:root {
  --ahm-bg: #f6f4ef;
  --ahm-panel: rgba(255,255,255,0.88);
  --ahm-panel-strong: rgba(255,255,255,0.96);
  --ahm-text: #141414;
  --ahm-muted: #69645d;
  --ahm-border: rgba(20,20,20,0.08);
  --ahm-border-strong: rgba(20,20,20,0.12);
  --ahm-chip: #efe9dd;
  --ahm-accent: #9f5b2d;
  --ahm-radius-xl: 24px;
  --ahm-radius-lg: 18px;
  --ahm-radius-md: 14px;
  --ahm-shadow: 0 14px 34px rgba(20,20,20,0.05);
}
html, body { background: var(--ahm-bg); color: var(--ahm-text); }
body.ahm-parser-body { margin: 0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.ahm-parser-body input, .ahm-parser-body select, .ahm-parser-body textarea, .ahm-parser-body button { font: inherit; }
.ahm-shell { min-height: 100vh; display: grid; grid-template-columns: 228px 1fr; }
.ahm-rail { border-right: 1px solid var(--ahm-border); padding: 24px 18px; position: sticky; top: 0; height: 100vh; box-sizing: border-box; display: flex; flex-direction: column; background: rgba(246,244,239,.72); backdrop-filter: blur(10px); }
.ahm-brand__eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--ahm-muted); margin-bottom: 8px; }
.ahm-brand__title, .ahm-page-title, .ahm-section-title, .ahm-login-card__title { font-family: Georgia, "Times New Roman", serif; letter-spacing: -0.02em; }
.ahm-brand__title { font-size: 28px; }
.ahm-nav { margin-top: 26px; display: grid; gap: 8px; }
.ahm-nav__group { display: grid; gap: 6px; }
.ahm-nav__link { text-decoration: none; color: var(--ahm-text); border: 1px solid transparent; border-radius: 14px; padding: 11px 14px; transition: .15s ease; }
.ahm-nav__link:hover, .ahm-nav__link.is-active { background: rgba(255,255,255,.86); border-color: var(--ahm-border); }
.ahm-nav__subnav { display: grid; gap: 6px; padding-left: 14px; }
.ahm-nav__sublink { text-decoration: none; color: var(--ahm-muted); border: 1px solid transparent; border-radius: 12px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; transition: .15s ease; }
.ahm-nav__sublink:hover, .ahm-nav__sublink.is-active { background: rgba(255,255,255,.72); border-color: var(--ahm-border); color: var(--ahm-text); }
.ahm-nav__sublink.has-unread { background: #fff4e4; border-color: rgba(159,91,45,.24); color: var(--ahm-text); box-shadow: 0 8px 22px rgba(159,91,45,.10); }
.ahm-nav__sublink.has-unread strong { background: var(--ahm-accent); color: #fff; font-weight: 800; }
.ahm-nav__sublink.is-bumped { animation: ahm-nav-attention 1.2s ease-in-out 2; }
@keyframes ahm-nav-attention {
  0%, 100% { transform: translateX(0); box-shadow: 0 8px 22px rgba(159,91,45,.10); }
  45% { transform: translateX(4px); box-shadow: 0 12px 30px rgba(159,91,45,.24); }
}
.ahm-nav__sublink strong { min-width: 24px; height: 24px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--ahm-chip); color: var(--ahm-text); font-size: 12px; padding: 0 6px; }
.ahm-rail__footer { margin-top: auto; color: var(--ahm-muted); font-size: 14px; }
.ahm-user { margin-bottom: 10px; }
.ahm-main { padding: 24px; max-width: 1320px; width: 100%; box-sizing: border-box; }
.ahm-page-header { margin-bottom: 18px; }
.ahm-page-title { margin: 0 0 4px; font-size: 38px; line-height: 1.05; }
.ahm-page-subtitle { margin: 0; color: var(--ahm-muted); font-size: 15px; }
.ahm-notice { background: #fff7ea; border: 1px solid rgba(201,111,50,.18); padding: 12px 16px; border-radius: 16px; margin-bottom: 18px; }
.ahm-notice--error { background: #fff1ef; border-color: rgba(165, 66, 44, .18); }
.ahm-panel { background: var(--ahm-panel); border: 1px solid var(--ahm-border); box-shadow: var(--ahm-shadow); border-radius: var(--ahm-radius-xl); padding: 20px; backdrop-filter: blur(12px); }
.ahm-panel--feed { padding: 18px; }
.ahm-toolbar { display: flex; gap: 14px; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; flex-wrap: wrap; }
.ahm-toolbar--tight { align-items: center; }
.ahm-grid { display: grid; gap: 20px; }
.ahm-grid--2 { grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); }
.ahm-section-title { margin: 0 0 16px; font-size: 24px; }

.ahm-grid--sources { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); align-items: start; }
.ahm-panel--source-form { position: sticky; top: 24px; }
.ahm-panel-note, .ahm-panel-subnote { color: var(--ahm-muted); font-size: 14px; line-height: 1.45; }
.ahm-panel-note { margin: -6px 0 14px; }
.ahm-panel-subnote { margin-top: -8px; }
.ahm-filters--sources { width: min(100%, 620px); }
.ahm-form, .ahm-filter-row { display: grid; gap: 12px; }
.ahm-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ahm-field { display: grid; gap: 6px; font-size: 14px; color: var(--ahm-muted); min-width: 0; }
.ahm-field--search { min-width: 280px; }
.ahm-field--small { max-width: 130px; }
.ahm-field input, .ahm-field select, .ahm-field textarea {
  appearance: none; border: 1px solid var(--ahm-border); background: rgba(255,255,255,0.8); border-radius: 14px; padding: 11px 13px; color: var(--ahm-text); box-sizing: border-box; width: 100%;
}
.ahm-field input:focus, .ahm-field select:focus, .ahm-field textarea:focus {
  outline: none; border-color: rgba(20,20,20,.22); box-shadow: 0 0 0 4px rgba(20,20,20,.04);
}
.ahm-field textarea { resize: vertical; min-height: 110px; }
.ahm-field small { color: var(--ahm-muted); }
.ahm-checkboxes { display: flex; flex-wrap: wrap; gap: 14px; }
.ahm-check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ahm-text); }
.ahm-form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ahm-button {
  display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--ahm-border);
  background: rgba(255,255,255,.82); color: var(--ahm-text); text-decoration: none; cursor: pointer;
}
.ahm-button:hover { background: #fff; }
.ahm-button--primary { background: var(--ahm-text); color: #fff; border-color: var(--ahm-text); }
.ahm-button--small { padding: 8px 11px; font-size: 13px; }
.ahm-button--wide { width: 100%; }
.ahm-link { color: var(--ahm-accent); text-decoration: none; }
.ahm-list, .ahm-table { display: grid; gap: 12px; }
.ahm-row, .ahm-log { border: 1px solid var(--ahm-border); border-radius: var(--ahm-radius-lg); padding: 16px; background: rgba(255,255,255,.66); }
.ahm-row h3, .ahm-log__message { margin: 0 0 8px; font-size: 17px; }
.ahm-row__meta, .ahm-log__meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--ahm-muted); font-size: 13px; }
.ahm-row__actions { display: flex; gap: 8px; flex-wrap: wrap; align-content: flex-start; justify-content: flex-end; }
.ahm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
.ahm-row__url { color: var(--ahm-muted); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; margin-top: 8px; }
.ahm-row__error { color: #8a3822; font-size: 13px; margin-top: 10px; }
.ahm-chip { background: var(--ahm-chip); border-radius: 999px; padding: 5px 10px; display: inline-flex; }
.ahm-chip--error { background: rgba(168, 56, 34, .12); color: #8a3822; }
.ahm-empty { color: var(--ahm-muted); padding: 8px 4px; }
.ahm-empty--table { padding: 18px; }
.ahm-log__context { margin: 12px 0 0; white-space: pre-wrap; word-break: break-word; background: rgba(20,20,20,.04); border-radius: 14px; padding: 12px; font-size: 12px; }

.ahm-table--sources .ahm-row--source {
  display: block;
  padding: 0;
  overflow: hidden;
  cursor: default;
}
.ahm-table--sources .ahm-source-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  min-height: 56px;
}
.ahm-table--sources .ahm-source-card__summary {
  min-width: 0;
  flex: 1 1 auto;
}
.ahm-table--sources .ahm-source-card__title-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ahm-table--sources .ahm-source-card__summary h3 {
  margin: 0;
  min-width: 0;
  font-size: 17px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ahm-table--sources .ahm-source-card__summary .ahm-chip {
  flex: 0 0 auto;
}
.ahm-table--sources .ahm-row__actions[data-ahm-source-actions] {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.ahm-table--sources .ahm-row__actions[data-ahm-source-actions] form {
  margin: 0;
}
.ahm-table--sources .ahm-row__actions[data-ahm-source-actions] .ahm-button {
  padding: 8px 12px;
}
.ahm-table--sources .ahm-source-card__details {
  border-top: 1px solid var(--ahm-border);
  padding: 12px 18px 14px;
  background: rgba(255,255,255,.42);
}
.ahm-table--sources .ahm-source-card__meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--ahm-muted);
  font-size: 13px;
  line-height: 1.45;
}
.ahm-table--sources .ahm-row__url {
  margin-top: 8px;
}
.ahm-table--sources .ahm-row__runtime {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 16px;
  margin-top: 10px;
  color: var(--ahm-muted);
  font-size: 13px;
  line-height: 1.45;
}
.ahm-table--sources .ahm-row__runtime strong {
  color: var(--ahm-text);
  font-weight: 600;
}
.ahm-table--sources .ahm-row__error {
  margin-top: 10px;
}
.ahm-table--sources .ahm-row--source.is-open .ahm-source-card__head {
  background: rgba(20,20,20,.018);
}
.ahm-table--sources .ahm-row--source.is-collapsed .ahm-source-card__details {
  display: none;
}
.ahm-dashboard-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 14px; flex-wrap: wrap; }
.ahm-filters { flex: 1; min-width: 0; }
.ahm-filter-row { grid-template-columns: minmax(280px, 2.2fr) repeat(2, minmax(150px, 1fr)) 120px; align-items: end; }
.ahm-dashboard-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.ahm-filter-summary { color: var(--ahm-muted); font-size: 14px; }
.ahm-table-card { border: 1px solid var(--ahm-border); background: var(--ahm-panel-strong); border-radius: 18px; overflow: hidden; }
.ahm-news-table { display: grid; }
.ahm-news-head, .ahm-news-row {
  display: grid; grid-template-columns: minmax(420px, 3fr) minmax(150px, 1.15fr) minmax(150px, 1fr) minmax(140px, 1fr) minmax(110px, .75fr); gap: 12px; align-items: start;
}
.ahm-news-head { padding: 12px 16px; border-bottom: 1px solid var(--ahm-border-strong); color: var(--ahm-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; background: rgba(20,20,20,.02); }
.ahm-news-row { padding: 14px 16px; border-bottom: 1px solid var(--ahm-border); }
.ahm-news-row:last-child { border-bottom: 0; }
.ahm-news-col { min-width: 0; font-size: 14px; line-height: 1.45; }
.ahm-news-col--title { display: grid; gap: 6px; }
.ahm-news-title { font-size: 15px; line-height: 1.45; font-weight: 600; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ahm-news-published { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; color: var(--ahm-muted); font-size: 12px; line-height: 1.35; }
.ahm-news-published strong { color: var(--ahm-text); font-size: 13px; font-weight: 600; }
.ahm-news-col--action { display: flex; justify-content: flex-start; }
.ahm-pagination { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-top: 1px solid var(--ahm-border); background: rgba(20,20,20,.015); }
.ahm-pagination__gap, .ahm-pagination__summary { color: var(--ahm-muted); font-size: 13px; }
.ahm-pagination__summary { margin-left: auto; }

.ahm-login-body { min-height: 100vh; }
.ahm-login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.ahm-login-card {
  width: min(100%, 420px); background: var(--ahm-panel-strong); border: 1px solid var(--ahm-border); border-radius: 24px; box-shadow: var(--ahm-shadow); padding: 30px;
}
.ahm-login-card__eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--ahm-muted); margin-bottom: 10px; }
.ahm-login-card__title { font-size: 44px; line-height: 1; margin: 0 0 10px; }
.ahm-login-card__subtitle { color: var(--ahm-muted); margin: 0 0 20px; }
.ahm-login-form { gap: 16px; }
.ahm-login-form__actions { margin-top: 4px; }

@media (max-width: 1280px) {
  .ahm-filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ahm-news-head, .ahm-news-row { grid-template-columns: minmax(240px, 2fr) repeat(4, minmax(100px, .9fr)); }
}
@media (max-width: 1080px) {
  .ahm-shell { grid-template-columns: 1fr; }
  .ahm-rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--ahm-border); padding: 16px; gap: 12px; }
  .ahm-brand { display: flex; align-items: baseline; gap: 10px; }
  .ahm-brand__title { font-size: 26px; }
  .ahm-nav { margin-top: 0; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
  .ahm-nav__group { min-width: max-content; }
  .ahm-nav__link { white-space: nowrap; }
  .ahm-nav__subnav { padding-left: 0; }
  .ahm-nav__sublink { white-space: nowrap; }
  .ahm-grid--2, .ahm-grid--sources, .ahm-form-row, .ahm-filter-row { grid-template-columns: 1fr; }
  .ahm-dashboard-toolbar { display: grid; align-items: stretch; }
  .ahm-dashboard-actions { justify-content: flex-start; }
  .ahm-panel--source-form { position: static; }
  .ahm-row__runtime { display: grid; gap: 6px; }
  .ahm-main { padding: 16px; }
  .ahm-page-title { font-size: 30px; }
  .ahm-page-subtitle { display: none; }
  .ahm-news-head { display: none; }
  .ahm-news-row { grid-template-columns: 1fr; gap: 10px; }
  .ahm-news-col::before { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ahm-muted); margin-bottom: 4px; }
  .ahm-news-col--title::before { content: 'Заголовок'; }
  .ahm-news-row .ahm-news-col:nth-child(2)::before { content: 'Источник'; }
  .ahm-news-row .ahm-news-col:nth-child(3)::before { content: 'Гео'; }
  .ahm-news-row .ahm-news-col:nth-child(4)::before { content: 'Найдено'; }
  .ahm-news-row .ahm-news-col:nth-child(5)::before { content: 'Открыть'; }
  .ahm-row { grid-template-columns: 1fr; }
  .ahm-table--sources .ahm-source-card__head { align-items: flex-start; flex-direction: column; }
  .ahm-table--sources .ahm-source-card__title-line { flex-wrap: wrap; }
  .ahm-table--sources .ahm-source-card__summary h3 { white-space: normal; overflow: visible; text-overflow: clip; }
  .ahm-table--sources .ahm-row__actions[data-ahm-source-actions] { flex-wrap: wrap; white-space: normal; justify-content: flex-start; }
  .ahm-row__actions { justify-content: flex-start; }
  .ahm-pagination__summary { width: 100%; margin-left: 0; }
}


.ahm-inline-note { margin-bottom: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--ahm-border); background: rgba(255,255,255,.78); font-size: 14px; }
.ahm-list-header { display:flex; gap:16px; justify-content:space-between; align-items:flex-end; flex-wrap:wrap; margin-bottom: 14px; }
.ahm-filters--compact { width: min(100%, 560px); }
.ahm-filter-row--stack { grid-template-columns: minmax(220px, 1.6fr) minmax(130px, .8fr) 120px; }
.ahm-source-picker { position:relative; border:1px solid var(--ahm-border); border-radius:16px; padding:14px; background:rgba(255,255,255,.62); display:grid; gap:12px; }
.ahm-source-picker__top { display:grid; grid-template-columns:minmax(260px,1fr) auto; gap:12px; align-items:end; }
.ahm-source-picker__search { margin:0; }
.ahm-source-picker__stats { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.ahm-source-picker__counter { display:inline-flex; align-items:center; min-height:40px; padding:0 12px; border:1px solid var(--ahm-border); border-radius:12px; background:rgba(255,255,255,.72); font-size:14px; }
.ahm-source-picker__results { position:absolute; z-index:20; left:14px; right:14px; top:92px; max-height:260px; overflow:auto; display:grid; gap:6px; padding:8px; border:1px solid var(--ahm-border); border-radius:16px; background:#fff; box-shadow:0 18px 42px rgba(20,20,20,.12); }
.ahm-source-picker__results[hidden] { display:none !important; }
.ahm-source-picker__result { display:grid; gap:2px; width:100%; text-align:left; padding:10px 12px; border:1px solid transparent; border-radius:12px; background:transparent; color:var(--ahm-text); cursor:pointer; }
.ahm-source-picker__result:hover, .ahm-source-picker__result:focus { outline:none; background:rgba(20,20,20,.04); border-color:var(--ahm-border); }
.ahm-source-picker__result strong { font-size:14px; line-height:1.25; }
.ahm-source-picker__result small, .ahm-source-picker__no-results { color:var(--ahm-muted); font-size:13px; }
.ahm-source-picker__no-results { padding:10px 12px; }
.ahm-source-picker__selected { display:grid; gap:8px; padding:12px; border:1px dashed var(--ahm-border); border-radius:14px; background:rgba(255,255,255,.45); }
.ahm-source-picker__selected.is-empty { display:none; }
.ahm-source-picker__selected-title { font-size:13px; color:var(--ahm-muted); }
.ahm-source-picker__chips { display:flex; flex-wrap:wrap; gap:8px; }
.ahm-chip--picked { appearance:none; cursor:pointer; border:1px solid var(--ahm-border); background:rgba(255,255,255,.92); color:var(--ahm-text); gap:8px; }
.ahm-chip--picked b { font-size:15px; line-height:1; color:var(--ahm-muted); }
.ahm-chip--picked:hover { background:#fff; border-color:var(--ahm-border-strong); }
.ahm-check--stack { align-items:flex-start; }
@media (max-width: 1080px) {
  .ahm-filter-row--stack { grid-template-columns:1fr; }
  .ahm-list-header { align-items:stretch; }
}


.ahm-geo-menu { margin-top: 18px; display: grid; gap: 12px; }
.ahm-field--rail { font-size: 13px; }
.ahm-field--rail select { padding: 9px 11px; border-radius: 12px; background: rgba(255,255,255,.82); }
.ahm-geo-subnav { display: grid; gap: 6px; }
.ahm-geo-subnav__link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  text-decoration: none; color: var(--ahm-muted); border-radius: 12px; padding: 8px 10px; border: 1px solid transparent; font-size: 13px;
}
.ahm-geo-subnav__link:hover, .ahm-geo-subnav__link.is-active { background: rgba(255,255,255,.72); border-color: var(--ahm-border); color: var(--ahm-text); }
.ahm-geo-subnav__link strong {
  min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--ahm-accent); color: #fff; font-size: 12px; font-weight: 700; padding: 0 6px;
}
.ahm-geo-alert {
  margin-bottom: 14px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid rgba(159,91,45,.22); background: #fff4e4; color: #6e3b1d; font-size: 14px; font-weight: 600;
}
.ahm-toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 99999; max-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px; border-radius: 18px; background: var(--ahm-text); color: #fff;
  box-shadow: 0 18px 40px rgba(20,20,20,.22); transform: translateY(12px); opacity: 0; transition: .22s ease;
  font-size: 14px; line-height: 1.4;
}
.ahm-toast.is-visible { transform: translateY(0); opacity: 1; }

.ahm-filter-row--dashboard { grid-template-columns: minmax(260px, 2fr) minmax(145px, .8fr) minmax(160px, 1fr) minmax(160px, 1fr) 120px; }
.ahm-filter-row--sources-wide { grid-template-columns: minmax(240px, 1.6fr) minmax(130px, .75fr) minmax(160px, 1fr) minmax(160px, 1fr) 120px; align-items: end; }
.ahm-filters--wide { width: 100%; margin-bottom: 16px; }
.ahm-list-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.ahm-modal { position: fixed; inset: 0; z-index: 99990; display: grid; place-items: center; padding: 22px; box-sizing: border-box; }
.ahm-modal__backdrop { position: absolute; inset: 0; background: rgba(20,20,20,.34); backdrop-filter: blur(4px); }
.ahm-modal__card {
  position: relative; z-index: 1; width: min(980px, 100%); max-height: min(88vh, 920px); overflow: auto;
  background: var(--ahm-panel-strong); border: 1px solid var(--ahm-border); border-radius: 24px; box-shadow: 0 24px 70px rgba(20,20,20,.22); padding: 20px;
}
.ahm-modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.ahm-modal__head .ahm-section-title { margin-bottom: 4px; }
.ahm-form-section {
  display: grid; gap: 12px; padding: 14px; border: 1px solid var(--ahm-border); border-radius: 18px; background: rgba(255,255,255,.52);
}
.ahm-form-section h3 { margin: 0; font-size: 15px; }
.ahm-table--areas .ahm-row__meta span:last-child { font-weight: 600; color: var(--ahm-text); }

@media (max-width: 1080px) {
  .ahm-geo-menu { margin-top: 6px; }
  .ahm-geo-subnav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 4px; }
  .ahm-filter-row--dashboard, .ahm-filter-row--sources-wide { grid-template-columns: 1fr; }
  .ahm-modal { padding: 12px; align-items: start; }
  .ahm-modal__card { max-height: calc(100vh - 24px); border-radius: 18px; }
  .ahm-modal__head { display: grid; }
}

.ahm-form-section--geo { background: rgba(255,255,255,.64); }
.ahm-segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 5px;
  border: 1px solid var(--ahm-border);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
}
.ahm-segmented label { cursor: pointer; }
.ahm-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.ahm-segmented span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--ahm-muted);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}
.ahm-segmented input:checked + span {
  background: var(--ahm-text);
  color: #fff;
}
.ahm-geo-panel {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}
.ahm-geo-panel[hidden] { display: none !important; }
@media (max-width: 640px) {
  .ahm-segmented { grid-template-columns: 1fr; width: 100%; }
  .ahm-segmented span { width: 100%; }
}

.ahm-toast--error { background: #8a3822; color: #fff; }
.ahm-toast__text { display: block; }
.ahm-toast__action {
  margin-top: 10px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px;
  padding: 7px 11px; background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
}
.ahm-toast__action:hover { background: rgba(255,255,255,.20); }

.ahm-browser-time { white-space: nowrap; }

/* Standalone scaffold additions */
.ahm-eyebrow { margin: 0 0 8px; color: var(--ahm-accent); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.ahm-grid--cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ahm-feature-card { min-height: 170px; }
.ahm-feature-card .ahm-section-title { margin-top: 18px; }
.ahm-feature-card p { margin: 0; color: var(--ahm-muted); line-height: 1.55; }
.ahm-empty-state { min-height: 260px; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 24px; color: var(--ahm-muted); text-align: center; }
.ahm-empty-state strong { color: var(--ahm-text); font-family: Georgia, "Times New Roman", serif; font-size: 24px; }
.ahm-filter-row--placeholder { grid-template-columns: minmax(260px, 2fr) minmax(160px, 1fr) minmax(170px, 1fr); }
.ahm-form-note { margin: 16px 0 0; color: var(--ahm-muted); font-size: 13px; line-height: 1.45; }
button:disabled, input:disabled, select:disabled { opacity: .68; cursor: not-allowed; }
@media (max-width: 1050px) { .ahm-grid--cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .ahm-shell { grid-template-columns: 1fr; }
  .ahm-rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--ahm-border); padding: 16px; }
  .ahm-nav { margin-top: 14px; display: flex; flex-wrap: wrap; }
  .ahm-rail__footer { display: none; }
  .ahm-main { padding: 18px 14px; }
  .ahm-page-title { font-size: 32px; }
  .ahm-grid--cards, .ahm-filter-row--placeholder { grid-template-columns: 1fr; }
  .ahm-news-head { display: none; }
}


/* Nakat 6: auth, sessions and user management */
body.ahm-login-body { margin: 0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.ahm-login-body input, .ahm-login-body select, .ahm-login-body textarea, .ahm-login-body button { font: inherit; }
.ahm-guest-main { min-height: 100vh; }
.ahm-session-card {
  margin-top: auto; display: grid; gap: 7px; padding: 14px; border: 1px solid var(--ahm-border);
  border-radius: 16px; background: rgba(255,255,255,.64); font-size: 13px;
}
.ahm-session-card strong { font-size: 14px; }
.ahm-session-card span:not(.ahm-chip) { color: var(--ahm-muted); overflow-wrap: anywhere; }
.ahm-session-card form { margin-top: 4px; }
.ahm-rail .ahm-session-card + .ahm-rail__footer { margin-top: 14px; }
.ahm-form-stack { display: grid; gap: 14px; }
.ahm-form-error, .ahm-flash {
  padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(156,52,36,.22);
  background: #fff0ed; color: #7a2f20; margin-bottom: 16px; line-height: 1.45;
}
.ahm-flash { max-width: 1320px; box-sizing: border-box; }
.ahm-flash--success { background: #edf8ef; color: #285d33; border-color: rgba(40,93,51,.18); }
.ahm-flash--info { background: #eef4fb; color: #284e72; border-color: rgba(40,78,114,.16); }
.ahm-button--ghost { background: transparent; }
.ahm-button--danger { background: #842f24; color: #fff; border-color: #842f24; }
.ahm-panel--spaced { margin-top: 20px; }
.ahm-security-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--ahm-muted); line-height: 1.5; }
.ahm-user-list { display: grid; gap: 12px; }
.ahm-user-card {
  display: grid; grid-template-columns: minmax(220px, 1.2fr) auto minmax(220px, 1fr) auto;
  gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--ahm-border);
  border-radius: 16px; background: rgba(255,255,255,.66);
}
.ahm-user-card__identity, .ahm-user-card__details { display: grid; gap: 4px; min-width: 0; }
.ahm-user-card__identity span, .ahm-user-card__details { color: var(--ahm-muted); font-size: 13px; overflow-wrap: anywhere; }
.ahm-user-card__meta, .ahm-user-card__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ahm-user-card__actions { justify-content: flex-end; }
.ahm-user-card__actions form { margin: 0; }
.ahm-chip--success { background: #e6f4e9; color: #285d33; }
.ahm-chip--muted { background: #eceae5; color: #6a665e; }
@media (max-width: 1080px) {
  .ahm-user-card { grid-template-columns: 1fr; align-items: start; }
  .ahm-user-card__actions { justify-content: flex-start; }
}

/* Nakat 7: real news feed */
.ahm-page-header--news {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.ahm-news-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
  min-width: min(100%, 470px);
}
.ahm-stat-card {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--ahm-border);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
}
.ahm-stat-card span { color: var(--ahm-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.ahm-stat-card strong { font-size: 23px; line-height: 1.05; }
.ahm-stat-card--accent { background: #fff4e4; border-color: rgba(159,91,45,.22); }
.ahm-stat-card__date { font-size: 14px !important; line-height: 1.3 !important; }
.ahm-area-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 1px 12px;
  margin-bottom: 4px;
  scrollbar-width: thin;
}
.ahm-area-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--ahm-border);
  border-radius: 999px;
  background: rgba(255,255,255,.66);
  color: var(--ahm-text);
  text-decoration: none;
}
.ahm-area-pill strong {
  min-width: 23px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ahm-chip);
  font-size: 12px;
}
.ahm-area-pill:hover, .ahm-area-pill.is-active { background: #fff; border-color: var(--ahm-border-strong); }
.ahm-area-pill.has-unread strong, .ahm-area-pill.is-active strong { background: var(--ahm-accent); color: #fff; }
.ahm-news-filters {
  border: 1px solid var(--ahm-border);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
  background: rgba(255,255,255,.55);
}
.ahm-news-filter-grid {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(145px, 1fr));
  gap: 11px;
  align-items: end;
}
.ahm-news-filter--search { grid-column: span 2; }
.ahm-field--compact { max-width: 150px; }
.ahm-filter-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.ahm-filter-actions .ahm-filter-summary { margin-left: auto; }
.ahm-feed-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 2px 12px;
  color: var(--ahm-muted);
  font-size: 14px;
}
.ahm-feed-actions > div { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ahm-feed-actions form, .ahm-news-col--action form { margin: 0; }
.ahm-news-head, .ahm-news-row {
  grid-template-columns: minmax(360px, 2.8fr) minmax(130px, 1fr) minmax(190px, 1.35fr) minmax(160px, 1.05fr) minmax(96px, .65fr);
}
.ahm-news-row { position: relative; transition: background .15s ease; }
.ahm-news-row.is-unread { background: rgba(255,244,228,.48); box-shadow: inset 4px 0 0 var(--ahm-accent); }
.ahm-news-row.is-viewed { background: rgba(255,255,255,.38); }
.ahm-news-title-line { display: flex; gap: 8px; align-items: flex-start; }
.ahm-news-title-line .ahm-chip { flex: 0 0 auto; margin-top: 1px; }
.ahm-news-tags { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.ahm-news-tags .ahm-chip { font-size: 12px; padding: 4px 8px; }
.ahm-source-name { display: block; margin-bottom: 4px; }
.ahm-source-type { display: block; color: var(--ahm-muted); font-size: 11px; letter-spacing: .06em; }
.ahm-news-dates { display: grid; gap: 8px; }
.ahm-news-dates span { display: grid; gap: 2px; }
.ahm-news-dates small { color: var(--ahm-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.ahm-news-dates strong { font-size: 13px; font-weight: 600; }
.ahm-empty-state--table { min-height: 220px; }

@media (max-width: 1180px) {
  .ahm-news-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ahm-news-filter--search { grid-column: span 2; }
  .ahm-news-head, .ahm-news-row { grid-template-columns: minmax(250px, 2fr) repeat(4, minmax(110px, 1fr)); }
}
@media (max-width: 820px) {
  .ahm-news-stats { grid-template-columns: 1fr; width: 100%; }
  .ahm-news-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ahm-news-filter--search { grid-column: span 2; }
  .ahm-field--compact { max-width: none; }
  .ahm-filter-actions .ahm-filter-summary { width: 100%; margin-left: 0; }
}
@media (max-width: 680px) {
  .ahm-news-filter-grid { grid-template-columns: 1fr; }
  .ahm-news-filter--search { grid-column: auto; }
  .ahm-news-row .ahm-news-col:nth-child(3)::before { content: 'Гео и рубрика'; }
  .ahm-news-row .ahm-news-col:nth-child(4)::before { content: 'Даты'; }
  .ahm-news-row.is-unread { box-shadow: inset 3px 0 0 var(--ahm-accent); }
  .ahm-news-title-line { display: grid; }
}

/* Nakat 8: full administration console */
.ahm-admin-cards { margin-top: 18px; }
.ahm-admin-card { color: inherit; text-decoration: none; position: relative; transition: transform .15s ease, box-shadow .15s ease; }
.ahm-admin-card:hover { transform: translateY(-2px); box-shadow: var(--ahm-shadow); }
.ahm-admin-card__open { margin-top: auto; color: var(--ahm-accent); font-size: 13px; font-weight: 700; }
.ahm-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.ahm-compact-list { display: grid; gap: 9px; }
.ahm-compact-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--ahm-border); }
.ahm-compact-row:last-child { border-bottom: 0; }
.ahm-compact-row > div { display: grid; gap: 3px; min-width: 0; }
.ahm-compact-row span:not(.ahm-chip), .ahm-compact-row time { color: var(--ahm-muted); font-size: 12px; }
.ahm-grid--admin-split { grid-template-columns: minmax(0, 1.8fr) minmax(320px, .8fr); gap: 20px; align-items: start; }
.ahm-panel--source-form { position: sticky; top: 20px; }
.ahm-admin-filter-grid { grid-template-columns: minmax(240px, 2fr) minmax(160px, 1fr) auto; }
.ahm-inline-form { margin-top: 9px; }
.ahm-link-button { appearance: none; border: 0; padding: 0; background: transparent; color: var(--ahm-accent); cursor: pointer; font: inherit; }
.ahm-taxonomy-keywords { margin: 10px 0 0; color: var(--ahm-muted); font-size: 13px; line-height: 1.45; }
.ahm-admin-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ahm-inline-controls { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.ahm-inline-controls .ahm-field { min-width: 220px; }
.ahm-admin-table--queue { grid-template-columns: minmax(190px,1.4fr) 100px 80px minmax(145px,1fr) minmax(180px,1.2fr) minmax(115px,.8fr); }
.ahm-admin-table--queue small { display: block; color: var(--ahm-muted); margin-top: 4px; }
.ahm-status--success, .ahm-status--done { background: #e6f4e9; color: #285d33; }
.ahm-status--failed, .ahm-status--error, .ahm-status--critical { background: #fff0ed; color: #7a2f20; }
.ahm-status--running { background: #eef4fb; color: #284e72; }
.ahm-status--pending { background: #fff4e4; color: #6e3b1d; }
.ahm-grid--admin-observability { grid-template-columns: minmax(0,1.8fr) minmax(300px,.8fr); gap: 20px; align-items: start; }
.ahm-grid--settings { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.ahm-setting-row { padding: 12px 0; border-bottom: 1px solid var(--ahm-border); }
.ahm-setting-row:last-child { border-bottom: 0; }
.ahm-sticky-actions { position: sticky; bottom: 12px; z-index: 8; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px; border: 1px solid var(--ahm-border); border-radius: 16px; background: rgba(255,255,255,.94); box-shadow: var(--ahm-shadow); }
.ahm-sticky-actions span { color: var(--ahm-muted); font-size: 13px; }
.ahm-row code { font-size: 11px; color: var(--ahm-muted); overflow-wrap: anywhere; }
@media (max-width: 1180px) {
  .ahm-grid--admin-split, .ahm-grid--admin-observability { grid-template-columns: 1fr; }
  .ahm-panel--source-form { position: static; }
  .ahm-admin-table--queue { grid-template-columns: minmax(180px,1.5fr) 90px 70px minmax(130px,1fr) minmax(160px,1.2fr) 100px; }
}
@media (max-width: 820px) {
  .ahm-grid--settings { grid-template-columns: 1fr; }
  .ahm-admin-filter-grid { grid-template-columns: 1fr; }
  .ahm-admin-table--queue { grid-template-columns: 1fr; }
  .ahm-admin-table--queue > div::before { display: block; color: var(--ahm-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
  .ahm-admin-table--queue > div:nth-child(2)::before { content: 'Статус'; }
  .ahm-admin-table--queue > div:nth-child(3)::before { content: 'Попытка'; }
  .ahm-admin-table--queue > div:nth-child(4)::before { content: 'Время'; }
  .ahm-admin-table--queue > div:nth-child(5)::before { content: 'Результат'; }
  .ahm-admin-table--queue > div:nth-child(6)::before { content: 'Действия'; }
}
