:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #20252b;
  --muted: #627080;
  --muted-2: #415061;
  --accent: #276955;
  --accent-2: #33856d;
  --accent-soft: #e7f2ee;
  --border: #d7dee6;
  --border-strong: #b9c4cf;
  --danger: #b42318;
  --warning: #876600;
  --success: #1f7a4d;
  --shadow: 0 14px 32px rgba(32, 37, 43, 0.10);
  --shadow-soft: 0 8px 18px rgba(32, 37, 43, 0.08);
  --radius-xl: 8px;
  --radius-lg: 6px;
  --radius-md: 4px;
  --transition: 160ms ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}
body::before,
.page-glow,
.glow-one,
.glow-two { display: none !important; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition); }
a:hover { color: var(--accent-2); }
img { max-width: 100%; display: block; }
strong { letter-spacing: -0.01em; }
.container { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(32, 37, 43, 0.07);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 78px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand strong { display: block; font-size: 1rem; line-height: 1.25; }
.brand small { color: var(--muted); }
.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
}
nav,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
nav a,
.nav-actions > a:not(.button) {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--muted-2);
  font-weight: 600;
}
nav a::after,
.nav-actions > a:not(.button)::after { display: none; }
nav a:hover,
.nav-actions > a:not(.button):hover {
  color: var(--text);
  background: var(--panel-soft);
  border-color: var(--border);
}

.page { padding: 32px 0 64px; }
section { margin-bottom: 26px; }
.hero,
.panel,
.card,
.stat,
.comment,
.login-hint,
.form-panel,
.hero-copy,
.spotlight-card,
.shortcut-card,
.page-intro,
.museum-viewer,
.reply-form,
.upload-box,
.note,
.flash,
.success {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero::before,
.panel::before,
.card::before,
.stat::before,
.comment::before,
.hero::after,
.spotlight-card::before { display: none !important; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.hero-copy { padding: 42px; }
.hero-copy h1,
.hero h1 {
  margin: 12px 0 16px;
  font-size: clamp(2.2rem, 4vw, 4.3rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  color: var(--text);
}
.hero p,
.lead,
.card p,
.panel p,
.prose li,
small,
.muted,
.card-meta,
.tag-list span,
.timeline,
.auth-lead,
.form-hint,
.request-note { color: var(--muted); }
.hero p,
.lead,
.card p,
.panel p,
.prose li { line-height: 1.75; }
.hero-actions,
.section-head,
.card-top,
.card-meta,
.footer-grid,
.filters,
.tag-list,
.comment-form,
.form-header,
.comment-form-actions,
.comment-tools {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.section-head,
.card-top,
.card-meta,
.footer-grid { justify-content: space-between; align-items: center; }
.form-header { flex-direction: column; align-items: flex-start; margin-bottom: 18px; }

.eyebrow,
.badge,
.badge.alt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: var(--radius-md);
  border: 1px solid #cbdcd5;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}
.button:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.button:active { transform: translateY(0); }
.button.ghost,
.button.secondary,
.button.ghost.danger-button {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}
.button.ghost:hover,
.button.secondary:hover { background: var(--panel-soft); color: var(--text); border-color: var(--border-strong); }
.button-wide { width: 100%; }
.button-inline { min-width: auto; }
.danger-button,
.button.ghost.danger-button { color: var(--danger); border-color: #f0c3bd; }

.stats-grid,
.grid.cards,
.form-grid,
.upload-grid { display: grid; gap: 18px; }
.stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.stat { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.stat strong { font-size: 2.05rem; letter-spacing: -0.03em; color: var(--text); }
.stat span { color: var(--muted); }
.card,
.panel,
.comment,
.login-hint,
.form-panel { transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition); }
.card,
.panel { padding: 24px; }
.card:hover,
.panel:hover,
.comment:hover,
.login-hint:hover,
.stat:hover,
.shortcut-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: 0 18px 38px rgba(32,37,43,.13); }
.card h2,
.card h3 { margin: 14px 0 10px; color: var(--text); }
.card h2 a,
.card h3 a,
.section-head a { color: var(--text); }
.card h2 a:hover,
.card h3 a:hover,
.section-head a:hover { color: var(--accent); }
.card small,
.login-hint p,
.note p { line-height: 1.6; }
.empty-card { min-height: 220px; display: grid; align-content: center; }

.hero-side { display: grid; gap: 18px; }
.spotlight-card { padding: 28px; min-height: 270px; }
.spotlight-card h2 { margin: 16px 0 12px; font-size: 1.9rem; line-height: 1.08; letter-spacing: -0.04em; color: var(--text); }
.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.mini-stat { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel-soft); box-shadow: none; }
.mini-stat strong { display: block; font-size: 1.6rem; color: var(--text); margin-bottom: 4px; }
.mini-stat span { color: var(--muted); font-size: .9rem; }
.shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.shortcut-card { min-height: 160px; padding: 22px; display: grid; align-content: start; gap: 10px; color: var(--text); }
.shortcut-card strong { font-size: 1.08rem; line-height: 1.25; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero-points span,
.section-link,
.section-head a,
.comment-link,
.link-button,
.pager-link,
.tag-list span,
.cms-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(32, 37, 43, .05);
}
.section-link:hover,
.section-head a:hover,
.comment-link:hover,
.link-button:hover,
.pager-link:hover,
.cms-nav-link:hover,
.cms-nav-link.active { background: var(--panel-soft); border-color: var(--border-strong); color: var(--text); }
.page-intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 26px; margin: 26px 0 18px; }
.page-intro h1,
.page-intro h2 { margin: 10px 0 8px; color: var(--text); }
.page-intro p { margin: 0; }
.page-intro.panel { padding: 26px 28px; }

.form-panel { max-width: 820px; margin: 0 auto; padding: 30px; }
.form-grid { grid-template-columns: 1fr; }
.full-width { grid-column: 1 / -1; }
label { display: grid; gap: 8px; color: var(--text); font-weight: 700; }
input,
textarea,
select {
  width: 100%;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  outline: none;
  font: inherit;
  box-shadow: inset 0 1px 2px rgba(32,37,43,.04);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input::placeholder,
textarea::placeholder { color: #8b98a6; }
input:focus,
textarea:focus,
select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(39, 105, 85, .12); background: #fff; }
textarea { resize: vertical; min-height: 120px; }
.filters { align-items: end; }
.filters label { flex: 1 1 200px; }
.filters .button { min-width: 170px; }

.article-detail .prose { margin-top: 22px; font-size: 1.02rem; line-height: 1.85; }
.prose ul { padding-left: 18px; }
.about-simple { max-width: 920px; padding: 12px 4px 4px; }
.about-simple h1 { margin: 10px 0 18px; color: var(--text); }
.about-simple p { margin: 0 0 16px; }
.about-center { max-width: 980px; }
.about-lead {
  max-width: 880px;
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--muted-2);
}
.about-facts-intro {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.about-facts-intro h2 {
  margin: 8px 0 18px;
  color: var(--text);
}
.about-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.about-fact {
  min-height: 100%;
  padding: 20px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.about-fact h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1.04rem;
}
.about-fact p {
  margin: 0;
  color: var(--muted-2);
  line-height: 1.75;
}

.comments { margin-top: 18px; }
.comments-thread { display: grid; gap: 14px; }
.comment { padding: 18px; background: #fff; }
.comment-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.comment small { display: block; margin-top: 5px; }
.comment p { margin: 12px 0 0; }
.comment-actions { margin-top: 14px; display: grid; gap: 12px; }
.inline-form { display: inline-flex; margin: 0; }
.link-button { cursor: pointer; font: inherit; }
.link-button.danger { color: var(--danger); border-color: #f0c3bd; background: #fff7f5; }
.link-button.danger:hover { color: var(--danger); background: #fff1ef; border-color: #e6aaa2; }
.comment-children { margin-top: 16px; padding-left: 18px; border-left: 2px solid #e2e8ee; display: grid; gap: 12px; }
.comment.depth-1,
.comment.depth-2,
.comment.depth-3,
.comment.depth-4,
.comment.depth-5 { background: #fcfdff; }
.comment-login-hint { margin: 0; }
.reply-box { display: inline-block; width: 100%; }
.reply-box summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; user-select: none; color: var(--accent); font-weight: 800; }
.reply-box summary::-webkit-details-marker { display: none; }
.reply-box summary::before { content: "↳"; color: var(--accent); font-size: 1rem; }
.reply-box[open] summary { margin-bottom: 12px; }
.reply-form { margin-top: 0; padding: 14px; background: var(--panel-soft); box-shadow: none; }
.comment-form { align-items: flex-end; margin-top: 18px; }
.comment-form textarea { flex: 1 1 380px; min-height: 110px; }
.reply-form textarea { min-height: 88px; }
.comment-form .button { min-width: 180px; }
.reply-form .button { min-width: 150px; }
.reply-form .comment-form-actions { width: 100%; }

.tag-list span { min-height: 34px; padding: 0 11px; color: var(--muted-2); font-size: .86rem; }
.museum-card .tag-list { margin: 16px 0 4px; }
.museum-detail { display: grid; gap: 24px; grid-template-columns: 1.15fr .95fr; align-items: start; }
.museum-viewer { min-height: 520px; overflow: hidden; background: #f7faf8; }
model-viewer { width: 100%; height: 520px; background: #f7faf8; }
.museum-info h1 { margin: 14px 0 10px; color: var(--text); }
.poster { width: 100%; max-height: 280px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--border); margin-top: 14px; box-shadow: var(--shadow-soft); }
.note { margin-top: 16px; padding: 16px 18px; background: #f6fbf8; color: var(--text); }
.timeline { padding-left: 18px; line-height: 1.9; }
.login-hint { margin-top: 10px; padding: 18px; }

.upload-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.file-picker { position: relative; gap: 12px; }
.upload-label { font-size: .94rem; font-weight: 800; }
.upload-box { position: relative; display: grid; gap: 12px; padding: 22px; min-height: 220px; border-style: dashed; cursor: pointer; transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition); }
.upload-box::after { content: "Нажмите для выбора файла"; position: absolute; right: 20px; bottom: 18px; padding: 8px 10px; border-radius: var(--radius-md); border: 1px solid var(--border); background: #fff; color: var(--muted-2); font-size: .82rem; font-weight: 700; }
.upload-icon { width: 56px; height: 56px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-md); background: var(--accent-soft); color: var(--accent); font-size: 1.6rem; }
.upload-box strong { font-size: 1.15rem; color: var(--text); }
.upload-box small { max-width: 36ch; line-height: 1.7; color: var(--muted); }
.upload-chip { display: inline-flex; width: fit-content; max-width: 100%; padding: 9px 12px; border-radius: var(--radius-md); border: 1px solid var(--border); background: #fff; color: var(--muted-2); font-size: .86rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-picker:hover .upload-box,
.file-picker:focus-within .upload-box,
.file-picker.is-dragover .upload-box,
.file-picker.is-filled .upload-box { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-soft); }
.file-picker.is-filled .upload-chip { color: var(--success); border-color: #b7ddcb; background: #f2fbf7; }

.site-footer { border-top: 1px solid var(--border); padding: 28px 0 46px; background: #fff; }
.footer-grid p { margin: 8px 0 0; }
.footer-grid-simple { align-items: flex-start; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 42px; padding: 0 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: #fff; color: var(--text); }
.footer-links a:hover { background: var(--panel-soft); }
.flash,
.success { padding: 14px 18px; margin-bottom: 18px; border-color: #b7ddcb; background: #f2fbf7; color: var(--success); }

.auth-shell { display: flex; justify-content: center; margin: 24px 0 8px; }
.auth-card { width: min(100%, 560px); padding: 32px !important; }
.auth-card h1 { margin: 12px 0 8px; color: var(--text); }
.auth-lead { margin: 0 0 22px; max-width: 44ch; }
.auth-form { gap: 16px; }
.auth-form label { gap: 8px; color: var(--text); font-weight: 700; }
.auth-form label span { font-size: .96rem; }
.auth-form input,
.auth-form select,
.auth-form textarea { min-height: 52px; background: #fbfcfd; }
.auth-form textarea { min-height: 120px; resize: vertical; }
.auth-form .button { margin-top: 6px; }
.auth-switch { margin: 18px 0 0; color: var(--muted); }
.auth-switch a { color: var(--accent); font-weight: 700; }
.form-hint { margin: -4px 0 0; font-size: .95rem; }

.pagination { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 24px 0 8px; }
.pager-link { min-width: 42px; padding: 0 14px; color: var(--text); }
.pager-link.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th,
.admin-table td { padding: 14px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.admin-table th { color: var(--text); background: var(--panel-soft); font-weight: 800; }
.admin-actions-cell { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.table-subline { margin-top: 4px; color: var(--muted); font-size: 12px; }

.status-badge,
.request-badge { display: inline-flex; align-items: center; min-height: 30px; gap: 6px; padding: 0 12px; border-radius: var(--radius-md); border: 1px solid var(--border); background: #fff; font-size: 12px; font-weight: 800; letter-spacing: .02em; color: var(--text); }
.status-badge.published,
.request-badge.approved { color: var(--success); background: #f2fbf7; border-color: #b7ddcb; }
.status-badge.draft,
.request-badge.pending { color: var(--warning); background: #fff9e8; border-color: #eadfb2; }
.request-badge.rejected { color: var(--danger); background: #fff7f5; border-color: #f0c3bd; }
.status-inline { margin-top: 14px; }
.request-note { margin-top: 8px; max-width: 28ch; }

.cms-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
.cms-sidebar { position: sticky; top: 96px; }
.cms-nav { display: grid; gap: 10px; margin: 22px 0; }
.cms-nav-link { display: block; padding: 12px 14px; min-height: auto; justify-content: flex-start; }
.cms-sidebar-actions { display: grid; gap: 10px; }
.cms-content { display: grid; gap: 20px; }
.cms-hero h1 { margin-bottom: 8px; }
.cms-stats .stat { min-height: 120px; }
.cms-timeline p { margin: 6px 0 0; }
.role-actions { display: grid; gap: 10px; min-width: 240px; }
.role-actions .inline-form { margin: 0; }
.role-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.role-form select { min-width: 150px; }
.cms-filters { align-items: end; }
.cms-filters label { min-width: 180px; }

@media (max-width: 1080px) {
  .cms-shell { grid-template-columns: 1fr; }
  .cms-sidebar { position: static; }
}
@media (max-width: 960px) {
  .nav { min-height: auto; padding: 14px 0; align-items: flex-start; flex-direction: column; }
  nav,
  .nav-actions { justify-content: flex-start; }
  .hero,
  .museum-detail,
  .footer-grid { grid-template-columns: 1fr; display: grid; }
  .stats-grid,
  .upload-grid { grid-template-columns: 1fr 1fr; }
  .shortcut-grid,
  .mini-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .container { width: min(100% - 20px, 1160px); }
  .page { padding-top: 22px; }
  .hero-copy,
  .spotlight-card,
  .shortcut-card,
  .page-intro,
  .panel,
  .card,
  .form-panel { padding: 18px; border-radius: var(--radius-xl); }
  .hero h1,
  .hero-copy h1 { max-width: 100%; font-size: clamp(2.1rem, 10vw, 3.3rem); }
  .stats-grid,
  .upload-grid,
  .grid.cards,
  .about-facts,
  .shortcut-grid,
  .mini-stats { grid-template-columns: 1fr; }
  .page-intro { display: grid; }
  .comment-form { flex-direction: column; align-items: stretch; }
  .comment-form .button,
  .comment-form .button-inline,
  .comment-form-actions .link-button,
  .comment-link { width: 100%; justify-content: center; }
  .comment-tools,
  .comment-form-actions { flex-direction: column; align-items: stretch; }
  .comment-head { align-items: flex-start; }
  .comment-children { padding-left: 12px; }
  .reply-box,
  .reply-box summary { width: 100%; }
  model-viewer,
  .museum-viewer { height: 380px; min-height: 380px; }
  .upload-box { min-height: 200px; padding: 18px; }
  .upload-box::after { left: 18px; right: auto; bottom: 16px; }
  .auth-card { width: 100%; padding: 22px !important; }
  .role-form { grid-template-columns: 1fr; }
}

/* === Адаптивная оптимизация под телефоны, планшеты и разные мониторы === */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

.container {
  width: min(1200px, calc(100% - clamp(20px, 4vw, 56px)));
}

.button,
nav a,
.nav-actions > a:not(.button),
.footer-links a,
.section-link,
.comment-link,
.link-button,
.pager-link,
.cms-nav-link {
  min-height: 44px;
}

.nav,
.footer-grid,
.section-head,
.card-top,
.card-meta,
.filters,
.comment-head,
.admin-actions-cell {
  min-width: 0;
}

.brand,
nav,
.nav-actions,
.footer-links,
.hero-actions,
.hero-points,
.tag-list,
.pagination,
.comment-tools,
.comment-form-actions {
  max-width: 100%;
}

.card,
.panel,
.form-panel,
.page-intro,
.comment,
.stat,
.shortcut-card,
.spotlight-card {
  min-width: 0;
}

.card h1,
.card h2,
.card h3,
.panel h1,
.panel h2,
.panel h3,
.page-intro h1,
.page-intro h2,
.about-simple h1,
.museum-info h1,
.cms-hero h1 {
  overflow-wrap: anywhere;
}

.grid.cards {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.stats-grid,
.cms-stats {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.museum-viewer,
model-viewer {
  height: clamp(320px, 56vh, 540px);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
}

.admin-table {
  min-width: 760px;
}

.admin-table th,
.admin-table td {
  white-space: normal;
}

input,
textarea,
select,
button {
  font-size: 16px;
}

@media (min-width: 1281px) {
  .page { padding: 38px 0 72px; }
  .grid.cards { gap: 22px; }
  .card,
  .panel { padding: 26px; }
}

@media (max-width: 1180px) {
  .nav { gap: 14px; }
  nav,
  .nav-actions { gap: 8px; }
  nav a,
  .nav-actions > a:not(.button) { padding: 0 12px; }
  .button { padding-inline: 16px; }
}

@media (max-width: 900px) {
  .site-header { position: sticky; }
  .nav {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
  }
  .brand { grid-column: 1 / 2; }
  nav {
    grid-column: 2 / 3;
    justify-content: flex-end;
  }
  .nav-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  nav,
  .nav-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 2px;
  }
  nav a,
  .nav-actions a,
  .nav-actions .button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .page-intro {
    align-items: flex-start;
  }
  .section-head {
    align-items: flex-start;
  }
  .museum-detail {
    gap: 18px;
  }
  .cms-sidebar.panel {
    padding: 20px;
  }
  .cms-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .cms-nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  :root {
    --shadow: 0 8px 20px rgba(32, 37, 43, 0.09);
    --shadow-soft: 0 5px 14px rgba(32, 37, 43, 0.07);
  }
  .container {
    width: min(100% - 18px, 1200px);
  }
  .site-header {
    position: static;
  }
  .nav {
    grid-template-columns: 1fr;
    padding: 10px 0;
  }
  .brand,
  nav,
  .nav-actions {
    grid-column: 1 / -1;
  }
  .brand-badge {
    width: 46px;
    height: 46px;
    font-size: .9rem;
  }
  nav,
  .nav-actions {
    justify-content: flex-start;
    width: 100%;
  }
  nav a,
  .nav-actions > a:not(.button),
  .nav-actions .button {
    min-height: 42px;
    padding-inline: 12px;
  }
  .page {
    padding: 16px 0 42px;
  }
  section {
    margin-bottom: 18px;
  }
  .page-intro,
  .panel,
  .card,
  .form-panel,
  .comment,
  .login-hint,
  .note,
  .stat,
  .shortcut-card,
  .spotlight-card {
    padding: 16px;
    border-radius: var(--radius-lg);
  }
  .page-intro h1,
  .page-intro h2,
  .panel h1,
  .panel h2,
  .card h2,
  .card h3,
  .museum-info h1,
  .about-simple h1 {
    line-height: 1.15;
  }
  .hero h1,
  .hero-copy h1,
  .about-simple h1,
  .museum-info h1,
  .cms-hero h1,
  .auth-card h1 {
    font-size: clamp(1.85rem, 9vw, 2.6rem);
  }
  .page-intro h2,
  .panel h2,
  .card h2 {
    font-size: clamp(1.35rem, 6vw, 1.8rem);
  }
  .grid.cards,
  .stats-grid,
  .cms-stats,
  .upload-grid,
  .shortcut-grid,
  .mini-stats {
    gap: 12px;
  }
  .hero-actions,
  .filters,
  .comment-form-actions,
  .admin-actions-cell,
  .footer-links,
  .section-head,
  .card-meta {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .button,
  .filters .button,
  .section-link,
  .section-head a,
  .footer-links a,
  .admin-actions-cell .comment-link,
  .admin-actions-cell .link-button,
  .admin-actions-cell .button,
  .inline-form,
  .inline-form button {
    width: 100%;
    justify-content: center;
  }
  .filters label,
  .cms-filters label {
    min-width: 0;
    flex-basis: auto;
  }
  .form-grid,
  .auth-form {
    gap: 14px;
  }
  input,
  textarea,
  select {
    min-height: 48px;
    padding: 12px 13px;
  }
  textarea {
    min-height: 116px;
  }
  .comment-form textarea,
  .reply-form textarea {
    flex-basis: auto;
    min-height: 96px;
  }
  .comment-children {
    margin-left: 0;
    padding-left: 10px;
  }
  .museum-viewer,
  model-viewer {
    height: clamp(280px, 58vh, 420px);
    min-height: 280px;
  }
  .poster {
    max-height: 220px;
  }
  .table-wrap {
    margin-inline: -4px;
    width: calc(100% + 8px);
  }
  .admin-table {
    min-width: 680px;
  }
  .pagination {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .pager-link {
    flex: 0 0 auto;
  }
  .auth-shell {
    margin-top: 8px;
  }
  .auth-card {
    padding: 18px !important;
  }
  .upload-box::after {
    position: static;
    width: fit-content;
  }
  .site-footer {
    padding: 22px 0 34px;
  }
}

@media (max-width: 420px) {
  .container {
    width: min(100% - 14px, 1200px);
  }
  .brand-badge {
    width: 42px;
    height: 42px;
    font-size: .82rem;
  }
  nav a,
  .nav-actions > a:not(.button),
  .nav-actions .button,
  .button,
  .section-link,
  .comment-link,
  .link-button,
  .footer-links a {
    min-height: 42px;
    padding-inline: 10px;
  }
  .page-intro,
  .panel,
  .card,
  .form-panel,
  .comment,
  .login-hint,
  .note,
  .stat {
    padding: 14px;
  }
  .eyebrow,
  .badge,
  .badge.alt,
  .status-badge,
  .request-badge {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .admin-table {
    min-width: 620px;
  }
}
