:root {
  --bg: #f4f6f8;
  --border: #d9dee3;
  --text: #1c2733;
  --muted: #5b6770;
  --accent: #2f6fdb;
  --accent-dark: #2456ad;
  --ok: #1e8e5a;
  --warn-bg: #fff6e0;
  --warn-border: #e6c66a;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.site-header {
  padding: 12px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: none;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-align: left;
}

.brand-mark {
  display: block;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  object-fit: contain;
  object-position: center;
}
.site-header h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.tagline {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.account-menu {
  position: relative;
  z-index: 20;
  width: 210px;
  text-align: left;
}

.account-button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.account-button:hover,
.account-button[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(47, 111, 219, 0.12);
}

.account-avatar {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.account-button-text {
  min-width: 0;
  flex: 1;
}

.account-button-title,
.account-button-school {
  display: block;
}

.account-button-title {
  font-size: 12px;
  color: var(--muted);
}

.account-button-school {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chevron {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(28, 39, 51, 0.14);
}

.account-dropdown-label {
  font-size: 12px;
  color: var(--muted);
}

.account-dropdown-school {
  margin: 2px 0 12px;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 600;
}

main {
  width: 100%;
  margin: 0 auto;
  padding: 22px clamp(16px, 2.4vw, 38px) 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

main > [data-panel]:not([hidden]) {
  flex: 0 0 auto;
  width: 100%;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}

.card h2 { margin: 0 0 6px; font-size: 18px; }
.card h3 { margin: 18px 0 8px; font-size: 15px; }

.hint { color: var(--muted); font-size: 13px; margin: 6px 0 12px; }

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

input[type="text"], textarea, select {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

textarea { resize: vertical; }

button.primary,
button.danger,
.hermes-document-action,
.ministry-refresh,
.year-stage button {
  min-height: 36px;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
}

button.primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  padding: 8px 14px;
  cursor: pointer;
}

button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button.primary:disabled { opacity: 0.55; cursor: not-allowed; }
button.big { font-size: 16px; padding: 8px 18px; }
.account-profile-link { display: grid; gap: 2px; width: 100%; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #f8fbff; color: var(--text); text-align: left; cursor: pointer; }
.account-profile-link:hover { border-color: var(--accent); background: #eef5ff; }
.account-profile-link span { font-size: 12px; color: var(--muted); }
.today-profile-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 18px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 14px; background: #f8fbff; }
.today-profile-card h3 { margin: 3px 0 4px; }
.today-profile-card .hint { margin: 0; }
.today-profile-meta { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.school-access-status { margin: 0 0 12px; padding: 9px 11px; border-left: 3px solid var(--ok); border-radius: 5px; background: #f1faf5; color: #176b47; font-size: 13px; font-weight: 600; }
@media (max-width: 640px) { .today-profile-card { align-items: stretch; flex-direction: column; } .today-profile-meta { justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; } .today-profile-meta .secondary { max-width: 100%; overflow-wrap: anywhere; } }

.save-status { margin-left: 10px; font-size: 13px; color: var(--ok); }
.save-status.error { color: #c0392b; }
.school-profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 24px; align-items: start; }
.school-profile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.school-profile-fields label { display: grid; gap: 6px; }
.school-profile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.school-profile-actions .save-status { margin-left: 0; }
.school-staff-panel { border-left: 1px solid var(--border); padding-left: 20px; }
.school-staff-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 14px; }
.school-staff-heading h3 { margin: 0; font-size: 18px; }
.school-staff-heading .hint { margin: 4px 0 0; }
.school-staff-list { display: grid; gap: 8px; margin-top: 14px; }
.school-staff-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: #f8fbff; }
.school-staff-details { min-width: 0; }
.school-staff-details strong, .school-staff-details span { display: block; overflow-wrap: anywhere; }
.school-staff-details span { font-size: 13px; color: var(--muted); margin-top: 2px; }
.school-staff-details .school-staff-document-status { color: #176b47; }
.school-staff-controls { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.school-staff-controls .danger { min-width: auto; padding: 6px 8px; font-size: 12px; }
.school-staff-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.school-staff-form label { display: grid; gap: 5px; }
.school-staff-form .staff-checkbox { display: flex; align-items: center; gap: 7px; }
@media (max-width: 760px) {
  .school-profile-layout { grid-template-columns: 1fr; }
  .school-profile-fields { grid-template-columns: 1fr; }
  .school-staff-panel { border-left: 0; border-top: 1px solid var(--border); padding: 18px 0 0; }
  .school-staff-card { align-items: start; }
}

.drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  color: var(--muted);
  transition: border-color 0.15s;
}

.drop-zone.drag { border-color: var(--accent); background: #eef4ff; }
.drop-zone.has-file { border-style: solid; border-color: var(--ok); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

/* Поля шаблона справки */
.report-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  margin-top: 4px;
}

.report-fields label {
  margin-bottom: 10px;
}

.report-fields textarea {
  grid-column: 1 / -1;
}

button.primary.ghost {
  min-height: 36px;
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
}
button.primary.ghost:hover { border-color: var(--accent); background: #f4f7ff; }

[data-panel="report"] button.primary.ghost {
  margin: 0 0 12px;
}

.column-map-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.column-map-row .col-name { flex: 1; font-size: 14px; }
.column-map-row select { width: 240px; margin: 0; }
.column-map-row .col-role { width: 220px; font-size: 13px; color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 12px 0; }

table.results {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}

table.results th, table.results td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: center;
}

table.results th { background: #eef1f4; font-weight: 600; }
table.results tr.total-row td { font-weight: 700; background: #f7f9fb; }

.conclusion-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.conclusion-item input {
  flex: 1;
  margin-top: 0;
}

.privacy-note {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
}

/* Обратная связь: карточка в общем стиле сайта */
.feedback-card { margin: 18px 0 8px; }

.feedback-card h2 { margin: 0 0 6px; font-size: 18px; }

.feedback-poll { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; }

.feedback-poll-label { font-size: 14px; font-weight: 600; color: var(--text); }

.feedback-poll-btn {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.feedback-poll-btn:hover { border-color: var(--accent); background: #f4f7ff; }
.feedback-poll-btn.voted { border-color: var(--accent); background: #eef5ff; color: var(--accent); }
.feedback-poll-btn:disabled { cursor: default; }

.feedback-actions { display: flex; }

.feedback-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}

.feedback-link:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.feedback-poll-note { margin: 10px 0 0; font-size: 13px; color: var(--ok); }

@media (max-width: 640px) { .feedback-actions { flex-direction: column; } }

.warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  margin: 10px 0;
}

/* Вкладки */
.tabs {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  width: 100%;
  gap: 6px;
  margin: 0 auto;
  padding: 8px clamp(16px, 2.4vw, 38px) 0;
  background: var(--bg);
  overflow-x: auto;
}
.tabs button {
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
}
.tabs button:hover { color: var(--text); border-color: #aab8c8; }
.tabs button:focus-visible { outline: 3px solid rgba(47, 111, 219, 0.28); outline-offset: 2px; }
.tabs button.active {
  color: var(--accent-dark);
  border-color: var(--accent);
  border-bottom: 3px solid var(--accent);
  background: #f4f7ff;
}

/* Панели */
[data-panel] {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  padding: 0;
}

.panel-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-back {
  align-self: flex-start;
}

[data-panel="report"] .card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  padding: 18px 20px;
}

/* Hermes */
.hermes-panel {
  overflow: hidden;
  border: 0;
  background: transparent;
}

.hermes-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 26px;
  border-radius: 16px;
  background: linear-gradient(125deg, #173662, #2f6fdb 64%, #6e9df0);
  color: #fff;
}

.hermes-hero h2 {
  margin: 5px 0 6px;
  font-size: 26px;
}

.hermes-hero p {
  max-width: 560px;
  margin: 0;
  color: #dce9ff;
}



.hermes-status {
  min-height: 19px;
  margin: 10px 2px;
  color: var(--muted);
  font-size: 13px;
}

.hermes-status.error { color: #c0392b; }

.hermes-overview,
.hermes-workspace-grid {
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
  gap: 16px;
  margin-top: 16px;
}

.hermes-catalog-surface { margin-top: 16px; }
.hermes-document-preparation {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}
.hermes-selected-document { min-width: 0; }
.hermes-selected-document-card { gap: 10px; position: sticky; top: 16px; }
.hermes-selected-document-card .primary { width: 100%; }
.hermes-selected-assistant-status { margin: 0; min-height: 18px; }

.hermes-surface {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}

.hermes-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.hermes-section-heading > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hermes-section-heading h3 {
  margin: 0;
  font-size: 16px;
}

.hermes-section-number {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.hermes-badge,
.hermes-tag,
.hermes-current {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
}

.hermes-badge-accent { background: #e8f7ef; color: #167348; }
.hermes-badge-demo { background: #fff6e0; color: #826105; }

.hermes-profile {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.hermes-profile-item {
  padding: 10px;
  border-radius: 9px;
  background: #f7f9fc;
}

.hermes-profile dt,
.hermes-muted {
  color: var(--muted);
  font-size: 12px;
}

.hermes-profile dd {
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}


.school-document-status { min-height: 18px; margin: 0 0 8px; color: var(--ok); font-size: 12px; }
.school-document-status.error { color: #c0392b; }
.school-document-list { border-top: 1px solid var(--border); }
.school-document-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.school-document-search { display: grid; min-width: 0; flex: 1; gap: 4px; color: var(--muted); font-size: 12px; }
.school-document-search input { width: 100%; min-height: 34px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); font: inherit; }
.school-document-search input:focus { border-color: var(--accent); outline: 3px solid rgba(47,111,219,.16); }
.school-document-toolbar > .hermes-muted { flex: 0 0 auto; padding-bottom: 7px; white-space: nowrap; }
.school-document-more { width: 100%; min-height: 36px; margin-top: 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--accent-dark); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.school-document-more:hover, .school-document-more:focus-visible { border-color: var(--accent); background: #f4f7ff; }
.school-document-more:focus-visible { outline: 3px solid rgba(47,111,219,.2); outline-offset: 2px; }
.school-document-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 11px; align-items: center; min-height: 62px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.school-document-mark { display: grid; width: 38px; height: 42px; place-items: center; border: 1px solid #c7d8f4; border-radius: 5px; background: #f2f6fd; color: var(--accent-dark); font-size: 9px; font-weight: 800; }
.school-document-details { min-width: 0; }
.school-document-title { display: block; color: var(--text); font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.school-document-details time { display: block; margin-top: 3px; }
.school-document-actions { display: flex; align-items: center; gap: 5px; }
.school-document-download,
.school-document-delete { min-height: 32px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: none; }
.school-document-download { color: var(--accent-dark); }
.school-document-delete { color: #a22b22; }
.school-document-download:hover,
.school-document-download:focus-visible { border-color: var(--accent); background: #f4f7ff; }
.school-document-delete:hover,
.school-document-delete:focus-visible { border-color: #d99c97; background: #fff5f4; }
.school-document-download:focus-visible,
.school-document-delete:focus-visible { outline: 3px solid rgba(47,111,219,.2); outline-offset: 2px; }
.school-document-delete:disabled { opacity: .55; cursor: wait; }
.school-document-empty { display: grid; gap: 4px; padding: 26px 12px; text-align: center; }
.hermes-registry { margin-top: 16px; }
.hermes-overview .document-library { grid-column: 1 / -1; }
.hermes-overview > .hermes-registry { margin-top: 0; }
.hermes-registry-filters { display: grid; grid-template-columns: minmax(240px, 1.6fr) minmax(170px, .9fr) minmax(150px, .8fr) auto; align-items: end; gap: 10px; margin-top: 16px; }
.hermes-registry-filters label, .hermes-schema-form label { margin-bottom: 0; }
.hermes-registry-filters input[type="search"], .hermes-registry-filters select, .hermes-schema-form input, .hermes-schema-form textarea, .hermes-schema-form select { width: 100%; min-height: 38px; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; color: var(--text); background: #fff; }
.catalog-search { min-width: 0; }
.catalog-more-filters { position: relative; }
.catalog-more-filters summary, .catalog-reset { min-height: 38px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--accent-dark); font: inherit; font-weight: 700; cursor: pointer; list-style: none; white-space: nowrap; }
.catalog-more-filters summary::-webkit-details-marker { display: none; }
.catalog-more-filters summary::after { content: "▾"; margin-left: 7px; }
.catalog-more-filters[open] summary { border-color: var(--accent); background: #f4f7ff; }
.catalog-more-filters > div { position: absolute; z-index: 5; top: calc(100% + 6px); right: 0; display: grid; gap: 10px; width: min(320px, 86vw); padding: 12px; border: 1px solid #cbd6e4; border-radius: 8px; background: #fff; box-shadow: 0 8px 22px rgba(28, 39, 51, .14); }
.catalog-reset { color: var(--muted); }
.catalog-reset:hover, .catalog-more-filters summary:hover { border-color: var(--accent); color: var(--accent-dark); }
.catalog-active-filters { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; margin-top: 10px; }
.catalog-filter-chip { padding: 5px 8px; border: 1px solid #cbdcf8; border-radius: 999px; background: #f4f7ff; color: var(--accent-dark); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.catalog-filter-chip:hover { border-color: var(--accent); }
.document-shelves { display: none; }

.hermes-document-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hermes-document-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfe;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.hermes-document-card:hover { border-color: #aabbd0; box-shadow: 0 5px 16px rgba(28,39,51,.08); transform: translateY(-1px); }
.hermes-document-card h4 { margin: 0 0 7px; font-size: 14px; line-height: 1.35; }
.hermes-document-meta { margin: 0; color: var(--muted); font-size: 12px; }
.hermes-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.hermes-document-details { margin-top: 12px; border-top: 1px solid #e5eaf0; }
.hermes-document-details summary { padding: 9px 0 5px; color: var(--accent-dark); font-size: 12px; font-weight: 700; cursor: pointer; }
.hermes-document-facts { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 4px 8px; margin: 4px 0 0; font-size: 12px; }
.hermes-document-facts dt { color: var(--muted); }
.hermes-document-facts dd { margin: 0; color: var(--text); }
.hermes-document-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 12px; font-size: 11px; }
.hermes-document-action { padding: 7px 10px; border: 1px solid var(--border); background: #fff; color: var(--accent); cursor: pointer; }
.hermes-document-action:hover, .hermes-document-action:focus-visible { border-color: var(--accent); background: #f4f7ff; color: var(--accent-dark); }
.hermes-document-action:focus-visible { outline: 3px solid rgba(47,111,219,.25); outline-offset: 2px; }
.hermes-document-card .hermes-review { color: #826105; }
.hermes-document-card .hermes-muted { color: var(--muted); }
.template-source-panel { margin-top: 14px; padding: 16px; border: 1px solid #cfd8e6; border-radius: 8px; background: #f7f9fc; }
.template-source-panel > label { display: grid; gap: 5px; margin-top: 12px; }
.template-source-panel input[type="file"] { padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.template-source-panel .primary { margin-top: 10px; }
.template-source-list { display: grid; gap: 8px; margin-top: 12px; }
.template-source-file { padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.template-source-file strong { display: block; margin-bottom: 6px; }
.template-source-fragment { display: flex; align-items: flex-start; gap: 7px; padding: 5px 0; font-size: 13px; }
.template-source-fragment span { overflow-wrap: anywhere; }
.hermes-cycle {
  display: grid;
  gap: 2px;
}

.hermes-cycle-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.hermes-cycle-item:last-child { border-bottom: 0; }
.hermes-cycle-item strong,
.hermes-cycle-item .hermes-muted { display: block; }

.hermes-cycle-date {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.hermes-schema-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hermes-schema-form textarea { resize: vertical; }
.hermes-schema-form[data-schema-id="template_document"] { grid-template-columns: minmax(0, 1fr); }
.hermes-schema-form[data-schema-id="template_document"] textarea[data-hermes-field="body"] { min-height: 420px; line-height: 1.55; }
.hermes-schema-form[data-schema-id="template_document"] label { min-width: 0; }
.hermes-schema-form[data-schema-id="template_document"] .hermes-inline-clarify { justify-self: start; margin-top: -4px; }
.hermes-schema-form [aria-invalid="true"] { border-color: #c0392b; background: #fff8f7; }
.hermes-schema-form > button { grid-column: 1 / -1; justify-self: start; }
.hermes-control-plan {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.hermes-control-plan legend { padding: 0 5px; font-weight: 700; }
.hermes-control-plan-table,
.hermes-preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.hermes-control-plan-table th,
.hermes-control-plan-table td,
.hermes-preview-table th,
.hermes-preview-table td { padding: 6px; border: 1px solid var(--border); vertical-align: top; }
.hermes-control-plan-table th,
.hermes-preview-table th { background: #eef2f7; text-align: left; }
.hermes-control-plan-table input { min-width: 0; width: 100%; box-sizing: border-box; }
.hermes-control-plan > button { margin-top: 8px; }
.hermes-preview-table { margin: 10px 0 14px; table-layout: fixed; }
.hermes-preview-table th,
.hermes-preview-table td { overflow-wrap: anywhere; }

.hermes-wizard {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.hermes-wizard > .hermes-section-heading { grid-column: 1 / -1; margin-bottom: 2px; }
.hermes-wizard > label,
.hermes-wizard > .hermes-schema-form,
.hermes-wizard > .hermes-draft-validation,
.hermes-wizard > .hermes-wizard-actions,
.hermes-wizard > .save-status { grid-column: 1; }

.hermes-ai-assistant {
  grid-column: 1;
  padding: 12px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: #f7f9fc;
}

.hermes-ai-assistant label { margin: 0; }
.hermes-ai-assistant textarea { min-height: 82px; }
.hermes-ai-assistant button { margin-top: 8px; }
.hermes-ai-references { margin-top: 8px; font-size: 12px; }
.hermes-ai-references ul { margin: 5px 0 0; padding-left: 18px; }
.hermes-ai-references li + li { margin-top: 3px; }

.hermes-draft-preview {
  grid-column: 2;
  grid-row: 2 / span 4;
  min-width: 0;
  min-height: 180px;
  max-height: 680px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfe;
  overflow: auto;
  overflow-wrap: anywhere;
}

.hermes-draft-preview:empty::before {
  color: var(--muted);
  font-size: 13px;
  content: "Предварительный просмотр появится после проверки полей.";
}

.hermes-draft-preview h4 { margin: 0 0 12px; line-height: 1.35; }
.hermes-draft-preview p,
.hermes-draft-preview ul { margin: 0 0 12px; line-height: 1.55; }

.hermes-draft-validation ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

.hermes-draft-validation strong { color: #c0392b; }
.hermes-draft-validation .hermes-warning-heading,
.hermes-draft-validation .hermes-warning { color: #826105; }

.hermes-wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hermes-draft-versions {
  grid-column: 2;
  min-width: 0;
}

.hermes-draft-version {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.hermes-placeholder-dialog { width: min(560px, calc(100% - 32px)); max-width: 560px; padding: 0; border: 0; border-radius: 12px; box-shadow: 0 18px 60px rgba(22,37,63,.28); color: var(--text); }
.hermes-placeholder-dialog::backdrop { background: rgba(18,31,52,.48); }
.hermes-placeholder-dialog form { display: grid; gap: 14px; padding: 20px; }
.hermes-placeholder-dialog .hermes-section-heading { margin: 0; }
.hermes-placeholder-fields { display: grid; gap: 12px; max-height: min(55vh, 460px); overflow: auto; padding-right: 3px; }
.hermes-placeholder-field { display: grid; gap: 5px; }
.hermes-placeholder-field span { font-size: 13px; font-weight: 700; }
.hermes-placeholder-field small { color: var(--muted); font-size: 11px; }
.hermes-placeholder-field textarea { min-height: 64px; resize: vertical; }
.hermes-draft-version:last-child { border-bottom: 0; }

/* Рабочее пространство приказов */
.orders-workspace {
  display: grid;
  grid-template-columns: minmax(340px, 0.4fr) minmax(560px, 0.6fr);
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.orders-create,
.orders-sources { min-width: 0; }

.orders-create {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: #fff;
}

.orders-sources {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: var(--card);
}

.orders-create .orders-section-title {
  margin-top: 0 !important;
  padding-top: 0;
  border-top: 0;
}

.order-editor {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfc;
}

.order-editor-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.order-editor-header h3 {
  flex: 1;
  margin: 2px 0 0;
}

.order-back {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.order-back:hover {
  border-color: var(--accent);
  background: #eef4ff;
}

.order-editor-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.order-editor-actions .save-status {
  margin-left: 0;
}

/* Карточки приказов */
.order-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.order-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.order-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(47, 111, 219, 0.12);
}

.order-card-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.order-card-desc {
  font-size: 11px;
  color: var(--muted);
}

/* Форма приказа */
#order-form label {
  display: block;
  margin-bottom: 12px;
}

#order-form input[type="text"],
#order-form input[type="date"],
#order-form select,
#order-form textarea {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

/* Предпросмотр приказа */
.order-preview {
  margin: 16px 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbfc;
  max-height: 420px;
  overflow-y: auto;
}

.order-preview-line {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.45;
}

.orders-sources-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 16px;
  background: #f7f9fc;
  border-bottom: 1px solid #dce3ec;
}

.orders-sources-heading h3 { margin: 2px 0 0; font-size: 18px; }
.orders-sources-heading .hint { max-width: 760px; margin-bottom: 0; }

.orders-region-badge {
  flex: 0 0 auto;
  max-width: 360px;
  padding: 7px 10px;
  border-left: 3px solid #14876b;
  background: #eaf7f3;
  color: #126450;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.orders-region-select {
  min-width: 220px;
  margin: 0;
}

.orders-region-select select { margin-top: 3px; }

.orders-source-tabs {
  display: flex;
  gap: 0;
  padding: 0 22px;
  border-bottom: 1px solid #cfd8e6;
  background: #fff;
}

.orders-source-tabs button {
  display: grid;
  min-width: 190px;
  gap: 1px;
  padding: 13px 18px 11px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.orders-source-tabs button:hover { background: #f4f8fb; color: var(--text); }
.orders-source-tabs button.active { border-bottom-color: #14876b; color: #126450; }
.orders-source-tabs span { font-size: 14px; font-weight: 700; }
.orders-source-tabs small { font-size: 11px; color: inherit; }

.ministry-orders-card {
  margin: 0;
  padding: 18px 22px 20px;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.regional-orders-card { border-top: 4px solid #14876b; }
.federal-orders-card { border-top: 4px solid var(--accent); }

.catalog-level {
  color: #126450;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.federal-orders-card .catalog-level { color: var(--accent-dark); }

.ministry-orders-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.ministry-orders-header h3 { margin: 3px 0 0; font-size: 17px; }
.ministry-orders-header .hint { max-width: 760px; margin: 4px 0 0; }

.ministry-refresh {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ministry-refresh:hover { border-color: var(--accent); background: #eef4ff; }
.ministry-refresh:disabled { opacity: 0.55; cursor: wait; }

.ministry-orders-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px;
  gap: 12px;
  margin: 16px 0 8px;
  padding: 12px;
  background: #f7f9fc;
  border: 1px solid #e0e6ed;
  border-radius: 7px;
}

.ministry-orders-controls label { margin-bottom: 0; }
.ministry-orders-controls input[type="search"] {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.ministry-orders-status { min-height: 19px; margin: 8px 0; color: var(--muted); font-size: 12px; }
.ministry-orders-status.error { color: #c0392b; }

.regional-reader-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(360px, 0.58fr);
  gap: 12px;
  min-height: 540px;
}

.regional-reader-layout > .ministry-orders-list {
  max-height: 620px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  border: 1px solid var(--border);
}

.ministry-order-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: start;
  padding: 9px 8px;
  border-bottom: 1px solid #e7ebef;
  cursor: pointer;
  outline: none;
}

.ministry-order-row:last-child { border-bottom: 0; }
.ministry-order-row:nth-child(even) { background: #fafbfc; }
.ministry-order-row:hover { background: #f0f6f5; }
.ministry-order-row:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.ministry-order-row.selected { background: #eaf7f3; box-shadow: inset 3px 0 #14876b; }
.ministry-order-row.unavailable { cursor: default; opacity: 0.68; }
.ministry-order-unavailable { grid-column: 2; color: var(--muted); font-size: 11px; }

.regional-order-reader {
  min-width: 0;
  min-height: 540px;
  max-height: 620px;
  overflow: auto;
  padding: 16px;
  border: 1px solid #cfd8e6;
  background: #fff;
}

.regional-order-reader-empty {
  display: grid;
  min-height: 480px;
  place-content: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.regional-order-reader-empty strong { color: var(--text); font-size: 16px; }
.regional-order-reader-empty p { max-width: 360px; margin: 6px auto 0; }

.regional-order-reader-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.regional-order-reader-header h4 { margin: 4px 0; font-size: 15px; line-height: 1.35; }
.regional-order-reader-header span { color: #126450; font-size: 11px; font-weight: 800; }
.regional-order-reader-header time { color: var(--muted); font-size: 12px; }

.regional-order-download {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.regional-order-text { font-size: 13px; line-height: 1.55; }
.regional-order-text p { margin: 0 0 10px; white-space: pre-wrap; }
.regional-order-pdf { width: 100%; min-height: 500px; border: 0; background: #f4f6f8; }

.ministry-order-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ministry-order-title { color: var(--text); font-size: 13px; line-height: 1.45; text-decoration: none; overflow-wrap: anywhere; }

.orders-section-title {
  margin-top: 22px !important;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* Редактор разделов плана */
.plan-section-editor {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fafbfc;
}

.plan-section-editor input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  margin-bottom: 8px;
}

.plan-section-editor textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  resize: vertical;
}

button.danger {
  background: #c0392b;
  color: #fff;
  border: 1px solid #c0392b;
  padding: 7px 12px;
  cursor: pointer;
}
button.danger:hover { background: #a52f24; border-color: #a52f24; }

button.primary.ghost {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--border);
}
button.primary.ghost:hover {
  border-color: var(--accent);
  background: #f4f7ff;
}

/* История документов */
.history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--card);
}

.history-name {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.history-date {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.history-row a.primary.ghost {
  text-decoration: none;
  padding: 6px 12px;
  font-size: 13px;
}

.history-row button.danger {
  margin-top: 0;
}



.task-form { display: grid; grid-template-columns: 1.2fr 1fr 180px; gap: 10px; align-items: end; }
.task-form label { margin: 0; }
.task-form label:nth-child(4) { grid-column: 1 / -1; }
.task-form button { justify-self: start; }
.task-list { display: grid; gap: 8px; margin-top: 14px; }
.task-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #fafbfc; }
.task-row .hint { margin: 0; text-align: right; }


.today-panel { padding: 24px; }
.today-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.today-header h2 { margin: 4px 0 4px; font-size: 24px; }
.section-kicker, .today-label { color: var(--accent-dark); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.today-progress-block { display: grid; justify-items: end; gap: 6px; min-width: 190px; }
.today-progress { color: var(--muted); font-size: 13px; white-space: nowrap; }
.today-progress-track { width: 190px; height: 7px; overflow: hidden; border-radius: 999px; background: #dce3ec; }
.today-progress-track::before { display: block; width: var(--progress, 0%); height: 100%; background: #14876b; content: ""; transition: width .2s ease; }
.today-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 14px; margin-top: 20px; }
.today-next { padding: 18px; border: 1px solid var(--accent); border-radius: 8px; background: #f4f7ff; }
.today-next h3 { margin: 8px 0; font-size: 18px; }
.today-next p { margin: 0 0 10px; color: var(--muted); }
.today-action-note { display: block; margin: 0 0 14px; color: #35516f; font-size: 13px; line-height: 1.4; }
.today-lifecycle { display: grid; gap: 8px; margin-top: 12px; }
.today-phase { display: inline-flex; width: fit-content; padding: 4px 9px; border-radius: 999px; background: #e8f7ef; color: #167348; font-size: 12px; font-weight: 700; }
.today-lifecycle textarea { width: 100%; }
.today-next-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.today-checklist { display: grid; gap: 8px; }
.today-check { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #fafbfc; }
.today-check.active { border-color: var(--accent); background: #f4f7ff; }
.today-check-mark { display: grid; flex: 0 0 24px; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
.today-check strong, .today-check small { display: block; }
.today-check small { margin-top: 2px; color: var(--muted); }
.today-step-action,
.today-next-actions > button {
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.today-step-action { margin-left: auto; max-width: 100%; overflow-wrap: anywhere; }
.today-step-action:hover, .today-step-action:focus-visible,
.today-next-actions > button:hover, .today-next-actions > button:focus-visible { border-color: var(--accent-dark); background: var(--accent-dark); }
.today-shelves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.today-shelf { padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.today-shelf:hover, .today-shelf:focus-visible { border-color: var(--accent); background: #f4f7ff; }
.today-shelf:focus-visible { outline: 3px solid rgba(47, 111, 219, 0.28); outline-offset: 2px; }
.today-shelf strong, .today-shelf span { display: block; }
.today-shelf span { margin-top: 4px; color: var(--muted); font-size: 13px; }

.guided-panel { padding: 24px; }
.guided-panel[data-panel="library"] { padding-top: 18px; padding-bottom: 18px; gap: 12px; }
.guided-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.guided-heading h2 { margin: 4px 0 0; font-size: 24px; }
.program-review-panel { display: grid; gap: 14px; margin-top: 16px; padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: #fbfcfe; }
.program-review-panel h3 { margin: 4px 0 0; }
.program-review-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.program-review-form label { margin: 0; }
.program-review-form .program-review-comment { grid-column: span 2; }
.program-review-form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.program-review-list { display: grid; gap: 8px; }
.program-review-row { display: grid; grid-template-columns: minmax(170px, 1.2fr) minmax(120px, .8fr) minmax(90px, .6fr) minmax(150px, 1fr) minmax(130px, .8fr) auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.program-review-row strong, .program-review-row small { display: block; }
.program-review-row small { margin-top: 3px; color: var(--muted); }
.program-review-status { display: inline-flex; width: fit-content; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.program-review-status.pending { background: #eef2f7; color: #526273; }
.program-review-status.issues { background: #fff3d6; color: #826105; }
.program-review-status.approved { background: #e8f7ef; color: #167348; }
.program-review-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.program-review-actions button { min-height: 34px; padding: 7px 10px; }

.year-access { margin-top: 16px; padding: 10px 12px; border: 1px solid #cbdcf8; border-radius: 9px; background: #f4f7ff; color: var(--accent-dark); font-size: 13px; font-weight: 600; }
.year-months { display: flex; gap: 7px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.year-month { flex: 0 0 auto; min-height: 34px; padding: 6px 11px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.year-month:hover { border-color: var(--accent); color: var(--accent-dark); background: #f4f7ff; }
.year-month.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.year-route { display: grid; gap: 14px; margin-top: 16px; }
.year-month-group { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.year-month-group > h3 { margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--border); background: #f8fafc; font-size: 14px; }
.year-step-list { display: grid; }
.year-step { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid #e7ebef; background: #fff; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.year-step:last-child { border-bottom: 0; }
.year-step:hover { background: #f4f7ff; }
.year-step:focus-visible, .year-month:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.year-step time { color: var(--accent-dark); font-size: 12px; font-weight: 800; text-transform: lowercase; }
.year-step > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.year-step strong { overflow-wrap: anywhere; font-size: 14px; }
.year-step small { color: var(--muted); font-size: 12px; }
.year-step-open { color: var(--accent); font-size: 12px; font-weight: 800; }
.year-empty { margin: 0; padding: 16px 14px; color: var(--muted); font-size: 13px; }
.year-packages { margin-top: 16px; border-top: 1px solid var(--border); }
.year-packages summary { padding: 14px 2px 8px; color: var(--accent-dark); font-size: 13px; font-weight: 700; cursor: pointer; }
.year-package-list { display: grid; gap: 8px; }
.year-stage { display: grid; grid-template-columns: minmax(140px, .8fr) minmax(180px, 1.2fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fafbfc; }
.year-stage.active { border-color: var(--accent); background: #f4f7ff; }
.year-stage > span { color: var(--accent-dark); font-size: 13px; font-weight: 700; }
.year-stage h3 { margin: 0; font-size: 14px; }
.year-stage button { min-height: 36px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--text); font: inherit; cursor: pointer; white-space: nowrap; }
.direction-grid, .library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.direction-grid button, .library-grid button { min-height: 100px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.direction-grid button:hover, .library-grid button:hover { border-color: var(--accent); background: #f4f7ff; }
.direction-grid strong, .direction-grid span, .library-grid strong, .library-grid span { display: block; }
.direction-grid span, .library-grid span { margin-top: 5px; color: var(--muted); font-size: 13px; }
.library-reading { display: grid; gap: 24px; margin-top: 20px; }
.library-reading-section { border-top: 1px solid var(--border); padding-top: 20px; }
.library-reading-section:first-child { border-top: 0; padding-top: 0; }
.library-reading-section h3 { margin: 6px 0 0; font-size: 20px; }
.library-reading-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.library-reading-grid article, .library-normative-steps article { padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: #fafbfc; }
.library-reading-grid h4 { margin: 0 0 8px; font-size: 16px; }
.library-reading-grid p, .library-reading-grid ul, .library-normative-steps p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.library-reading-grid strong { display: block; margin: 12px 0 5px; font-size: 13px; }
.library-reading-grid ul { padding-left: 18px; }
.library-normative-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.library-normative-steps strong { display: block; margin-bottom: 7px; }
.library-controls { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.library-controls label { display: grid; min-width: min(100%, 260px); gap: 5px; font-size: 13px; font-weight: 700; }
.library-materials { display: grid; gap: 14px; margin-top: 18px; }
.library-material { padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.library-material h3 { margin: 6px 0 8px; font-size: 20px; }
.library-material > p { margin: 0; color: var(--muted); line-height: 1.45; }
.library-material-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 15px; }
.library-material-columns section { padding: 12px; border-left: 3px solid var(--accent); background: #f4f7ff; }
.library-material-columns section + section { border-left-color: #16876b; background: #f2fbf6; }
.library-material-columns strong { display: block; margin-bottom: 6px; }
.library-material-columns ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.library-material-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.library-material-actions button { min-height: 36px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--text); font: inherit; cursor: pointer; }
.library-material-actions button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.library-results-meta { margin-top: 8px; color: var(--muted); font-size: 13px; }
.library-material-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; color: var(--muted); font-size: 12px; }
.library-badge { color: var(--accent-dark); font-weight: 800; }
.library-material summary { margin-top: 16px; color: var(--accent-dark); font-weight: 700; cursor: pointer; }
.library-reading { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.library-reading h4 { margin: 0; font-size: 14px; }
.library-reading p, .library-reading li { color: var(--muted); font-size: 14px; line-height: 1.5; }
.library-reading p { margin: 0; }
.library-reading ol, .library-reading ul { margin: 0; padding-left: 20px; }
.library-disclaimer { margin-top: 0; }
 .guided-panel[data-panel="library"] { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.guided-panel[data-panel="library"] { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.guided-panel[data-panel="library"] > .guided-heading,
.guided-panel[data-panel="library"] > .hint,
.guided-panel[data-panel="library"] > .library-controls,
.guided-panel[data-panel="library"] > .orders-sources,
.guided-panel[data-panel="library"] > .library-materials,
.guided-panel[data-panel="library"] > .library-reading-section { grid-column: 1; }
.guided-panel[data-panel="library"] > .guided-heading { grid-row: 1; }
.guided-panel[data-panel="library"] > .hint { grid-row: 2; }
.guided-panel[data-panel="library"] > .library-controls { grid-row: 3; }
.guided-panel[data-panel="library"] > .orders-sources { grid-row: 4; margin-top: 0; }
.guided-panel[data-panel="library"] > .library-materials { grid-row: 5; margin-top: 0; }
.guided-panel[data-panel="library"] > .library-reading-section { grid-row: 6; }
.guided-panel[data-panel="library"] > .orders-sources .orders-sources-heading { padding: 20px 22px 16px; }
.guided-panel[data-panel="library"] > .orders-sources .orders-source-tabs { padding: 0 22px; }
.guided-panel[data-panel="library"] > .orders-sources .ministry-orders-card { padding: 18px 22px 20px; }
.guided-panel[data-panel="library"] > .orders-sources .regional-reader-layout { grid-template-columns: minmax(260px, .42fr) minmax(360px, .58fr); min-height: 540px; }
.guided-panel[data-panel="library"] > .orders-sources .regional-order-reader { min-height: 540px; }
.secondary { min-height: 36px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--accent-dark); font: inherit; font-weight: 700; cursor: pointer; }
.secondary:hover { border-color: var(--accent); background: #f4f7ff; }

@media (max-width: 820px) {
}

@media (max-width: 600px) {
}

@media (max-width: 820px) {
  .account-menu { width: min(100%, 260px); }
  .account-dropdown { width: 100%; }
}
@media (max-width: 1100px) {
  .orders-workspace { grid-template-columns: 1fr; }
  .orders-create { position: static; max-height: none; overflow: visible; }
}


@media (max-width: 900px) {
  .guided-panel[data-panel="library"] { display: block; }
  .guided-panel[data-panel="library"] > * { margin-top: 18px; }
  .guided-panel[data-panel="library"] > .guided-heading { margin-top: 0; }
  .guided-panel[data-panel="library"] > .library-materials,
  .guided-panel[data-panel="library"] > .orders-sources { margin-top: 18px; }
  .hermes-registry-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hermes-registry-filters .catalog-search { grid-column: 1 / -1; }
  .catalog-more-filters { justify-self: start; }

  .hermes-document-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .orders-workspace {
    grid-template-columns: 1fr;
  }

  .orders-sources {
    grid-template-columns: 1fr;
  }

  .ministry-orders-controls {
    grid-template-columns: minmax(0, 1fr) 130px;
  }

  .ministry-order-row {
    grid-template-columns: 110px minmax(0, 1fr);
  }
  .regional-reader-layout { grid-template-columns: 1fr; min-height: 0; }
  .regional-reader-layout > .ministry-orders-list { max-height: 48vh; }
  .regional-order-reader { min-height: 420px; max-height: none; }
  .regional-order-reader-empty { min-height: 360px; }
  .regional-order-reader-header { flex-direction: column; }
  .regional-order-download { width: 100%; text-align: center; }
  .regional-order-pdf { min-height: 440px; }
}

@media (max-width: 600px) {
  .site-header { padding: 10px 14px; }
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .brand-mark { flex-basis: 32px; width: 32px; height: 32px; }
  .site-header h1 { font-size: 18px; }
  .tagline { display: none; }
  .account-menu { width: 100%; }
  .public-flow,
  .public-access,
  .service-features { min-width: 0; width: 100%; }
  .public-flow,
  .public-access { grid-template-columns: 1fr; }
  .auth-access {
    padding: 18px 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }
  .service-features { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; }
  .tabs button { flex: 0 0 auto; }
  .hermes-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }
  .hermes-hero h2 { font-size: 22px; }
  .hermes-identity { min-width: 0; }
  .hermes-overview,
  .hermes-workspace-grid,
  .hermes-profile, .hermes-registry-filters, .hermes-document-grid { grid-template-columns: 1fr; }
  .hermes-document-preparation { grid-template-columns: 1fr; }
  .hermes-selected-document-card { position: static; }
  .hermes-registry-filters .catalog-search { grid-column: auto; }
  .catalog-more-filters, .catalog-reset { justify-self: start; }
  .school-document-row { grid-template-columns: 38px minmax(0, 1fr); }
  .school-document-actions { grid-column: 2; }
  .school-document-toolbar { align-items: stretch; flex-direction: column; }
  .school-document-toolbar > .hermes-muted { padding-bottom: 0; }
  .hermes-cycle-item { grid-template-columns: 1fr; gap: 3px; }
  .hermes-document-footer { align-items: flex-start; flex-direction: column; }
  .hermes-wizard,
  .hermes-schema-form { grid-template-columns: 1fr; }
  .hermes-wizard > *,
  .hermes-draft-preview,
  .hermes-draft-versions { grid-column: 1; grid-row: auto; }
  .hermes-wizard-actions { flex-direction: column; }
  .hermes-wizard-actions button { width: 100%; }
  .hermes-draft-version { align-items: flex-start; flex-direction: column; }
  .grid-2 { grid-template-columns: 1fr; }
  .orders-sources { grid-template-columns: 1fr; }
  .orders-sources-heading { flex-direction: column; }
  .orders-region-badge { max-width: 100%; }
  .orders-source-tabs { overflow-x: auto; padding: 0 14px; }
  .orders-source-tabs button { min-width: 154px; padding-inline: 12px; }
  .ministry-orders-card { padding: 16px 14px 18px; }
  .ministry-orders-list { max-height: 62vh; }
  .today-header { flex-direction: column; }
  .today-progress-block { justify-items: start; min-width: 0; width: 100%; }
  .today-progress-track { width: 100%; }
  .hermes-control-plan { overflow-x: auto; }
  .hermes-control-plan-table { min-width: 680px; }
  .today-action-note { font-size: 12px; }
  .ministry-order-row { grid-template-columns: 1fr; gap: 3px; padding: 10px 5px; }
  .ministry-order-date { white-space: normal; }
  .orders-sources-heading { padding: 16px 14px 14px; }
  .ministry-orders-header { flex-direction: column; }
  .ministry-refresh { width: 100%; }
  .ministry-orders-controls { grid-template-columns: 1fr; }
  .ministry-order-row { grid-template-columns: 1fr; gap: 4px; }
  .ministry-order-links { justify-content: flex-start; }
  .column-map-row { flex-direction: column; align-items: stretch; }
  .column-map-row select { width: 100%; }
  .today-header, .guided-heading { flex-direction: column; }
  .today-grid, .today-shelves, .direction-grid, .library-grid { grid-template-columns: minmax(0, 1fr); }
  .today-next, .today-check, .today-checklist { min-width: 0; }
  .program-review-form { grid-template-columns: 1fr; }
  .program-review-form .program-review-comment, .program-review-form-actions { grid-column: auto; }
  .program-review-row { grid-template-columns: 1fr; gap: 6px; }
  .program-review-actions { justify-content: flex-start; }
  .year-stage { grid-template-columns: 1fr; gap: 7px; }
  .year-step { grid-template-columns: 1fr auto; gap: 5px 10px; }
  .year-step time { grid-column: 1 / -1; }
  .year-stage button { justify-self: start; }
  .library-material-columns { grid-template-columns: 1fr; }
}
