:root {
  --navy: #0b2437;
  --navy-soft: #17384d;
  --lime: #a4e85a;
  --lime-dark: #76b82a;
  --blue: #cfe1f4;
  --sand: #e2d8cb;
  --surface: #ffffff;
  --canvas: #f2f5f1;
  --line: #dce2dd;
  --muted: #68747b;
  --danger: #c74747;
  --shadow: 0 20px 55px rgba(11, 36, 55, .1);
  font-family: Manrope, Arial, sans-serif;
  color: #101416;
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); font-synthesis: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }
body * { letter-spacing: 0 !important; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(164, 232, 90, .22), transparent 45%),
    linear-gradient(315deg, rgba(207, 225, 244, .7), transparent 48%),
    #f8faf7;
}

.auth-card {
  width: min(460px, 100%);
  padding: clamp(30px, 6vw, 54px);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 38px;
  height: 38px;
  position: relative;
  background: var(--navy);
  clip-path: polygon(0 0, 100% 0, 100% 36%, 58% 36%, 58% 100%, 0 100%);
}
.brand-mark span {
  position: absolute;
  width: 16px;
  height: 16px;
  right: 0;
  bottom: 0;
  background: var(--lime);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.auth-card .eyebrow { margin-top: 24px; color: var(--lime-dark); }
.auth-card h1 { margin: 0; font-size: clamp(30px, 6vw, 46px); letter-spacing: -.045em; line-height: 1.03; }
.auth-lead { margin: 18px 0 30px; color: var(--muted); line-height: 1.6; }

label {
  display: grid;
  gap: 8px;
  color: #324149;
  font-size: 13px;
  font-weight: 700;
}

input, textarea, select {
  width: 100%;
  border: 1px solid #ccd4cf;
  border-radius: 10px;
  background: #fff;
  color: #111;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input, select { min-height: 46px; padding: 0 14px; }
textarea { min-height: 112px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--lime-dark); box-shadow: 0 0 0 3px rgba(164,232,90,.22); }
.auth-card form { display: grid; gap: 18px; }

.primary-button, .secondary-button, .danger-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 0 20px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}
.primary-button { background: var(--lime); color: #0c1d12; }
.primary-button:hover { background: #95dc48; }
.secondary-button { border: 1px solid var(--line); background: #fff; color: var(--navy); }
.secondary-button:hover { border-color: var(--navy); }
.danger-button { background: #fff0f0; color: var(--danger); }
.form-error { min-height: 20px; margin: -6px 0 0; color: var(--danger); font-size: 13px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0,1fr); }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--navy);
  color: #fff;
}
.sidebar-brand { min-height: 91px; display: flex; align-items: center; gap: 14px; padding: 20px 22px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar-brand .brand-mark { background: #fff; }
.sidebar-brand strong { display: block; font-size: 15px; }
.sidebar-brand small { display: block; margin-top: 4px; color: #9fb2be; font-size: 11px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.sidebar-nav p { margin: 19px 12px 8px; color: #7390a1; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 9px;
  padding: 11px 12px;
  background: transparent;
  color: #d9e3e8;
  text-align: left;
  font-size: 14px;
}
.sidebar-nav button span { color: #7891a0; font-size: 10px; font-weight: 800; }
.sidebar-nav button:hover { background: rgba(255,255,255,.07); }
.sidebar-nav button.active { background: var(--lime); color: var(--navy); font-weight: 800; }
.sidebar-nav button.active span { color: var(--navy); }
.sidebar-user { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 10px; padding: 16px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 12px; }
.sidebar-user small { margin-top: 3px; color: #8ba2af; font-size: 10px; }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--lime); color: var(--navy); font-weight: 900; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; background: transparent; color: inherit; font-size: 20px; }

.workspace { min-width: 0; }
.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px clamp(20px, 4vw, 50px);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px);
}
.topbar h1 { margin: 0; font-size: 26px; letter-spacing: -.035em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.publish-state { display: inline-flex; align-items: center; gap: 8px; color: #65736b; font-size: 12px; font-weight: 700; }
.publish-state i { width: 8px; height: 8px; border-radius: 50%; background: #62bb34; box-shadow: 0 0 0 4px rgba(98,187,52,.13); }
.publish-state.busy i { background: #e3a726; animation: pulse 1s infinite; }
.publish-state.error i { background: var(--danger); }
@keyframes pulse { 50% { opacity: .4; } }
.menu-button { display: none; border: 0; background: transparent; font-size: 24px; }

.view { padding: clamp(22px, 4vw, 50px); }
.view-intro { max-width: 780px; margin: 0 0 30px; color: var(--muted); line-height: 1.6; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-head h2 { margin: 0; font-size: clamp(24px, 3vw, 38px); letter-spacing: -.04em; }
.section-head p { margin: 8px 0 0; color: var(--muted); }
.button-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.metric-card { min-height: 152px; display: flex; flex-direction: column; justify-content: space-between; padding: 22px; border: 1px solid var(--line); background: var(--surface); }
.metric-card:nth-child(1) { background: var(--lime); }
.metric-card:nth-child(2) { background: var(--blue); }
.metric-card:nth-child(3) { background: var(--sand); }
.metric-card strong { font-size: 40px; font-weight: 500; letter-spacing: -.05em; }
.metric-card span { color: #394a52; font-size: 12px; font-weight: 800; text-transform: uppercase; }

.visitor-metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; }
.visitor-metric {
  min-height: 156px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.visitor-metric--accent { background: var(--lime); border-color: var(--lime); }
.visitor-metric > span { color: #435159; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.visitor-metric strong { font-size: clamp(36px, 4vw, 54px); font-weight: 500; letter-spacing: -.06em; line-height: 1; }
.visitor-metric small { min-height: 30px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.visitor-metric--accent small { color: #33462a; }
.visitor-metric--online > span { display: flex; align-items: center; gap: 7px; }
.visitor-metric--online > span i { width: 8px; height: 8px; border-radius: 50%; background: #5fb82f; box-shadow: 0 0 0 4px rgba(95,184,47,.14); }
.analytics-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(280px,.75fr); gap: 18px; margin-top: 18px; }
.panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-title h2 { margin-bottom: 4px; }
.panel-title p { margin: 0; color: var(--muted); font-size: 12px; }
.panel-title > span { color: var(--lime-dark); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.analytics-chart { height: 250px; display: grid; grid-template-columns: repeat(14, minmax(22px,1fr)); align-items: end; gap: 8px; margin-top: 24px; padding-top: 24px; border-bottom: 1px solid var(--line); }
.chart-column { height: 100%; min-width: 0; display: grid; grid-template-rows: 22px 1fr 28px; align-items: end; gap: 5px; text-align: center; }
.chart-column strong { overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 700; }
.chart-column i { width: min(30px, 78%); min-height: 3px; justify-self: center; display: block; background: var(--blue); border-radius: 4px 4px 0 0; transition: height .25s ease; }
.chart-column:last-child i { background: var(--lime); }
.chart-column span { overflow: hidden; color: #69767d; font-size: 9px; white-space: nowrap; }
.popular-list { list-style: none; margin: 18px 0 0; padding: 0; }
.popular-list li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid #edf1ed; }
.popular-list li > div { min-width: 0; }
.popular-list strong, .popular-list small { display: block; }
.popular-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.popular-list li > div small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.popular-list li > span { flex: none; font-size: 18px; }
.popular-list li > span small { display: inline; color: var(--muted); font-size: 9px; }
.popular-list .popular-empty { justify-content: flex-start; color: var(--muted); font-size: 12px; line-height: 1.5; }
.section-divider { display: flex; align-items: center; gap: 12px; margin: 28px 0 14px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.section-divider::after { height: 1px; flex: 1; content: ''; background: var(--line); }

.dashboard-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; margin-top: 18px; }
.panel { border: 1px solid var(--line); background: var(--surface); padding: 24px; }
.panel h2 { margin: 0 0 18px; font-size: 20px; }
.quick-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.quick-card { min-height: 98px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); padding: 16px; background: #fafcf9; color: inherit; text-decoration: none; }
.quick-card:hover { border-color: var(--lime-dark); }
.quick-card span { color: var(--muted); font-size: 12px; }
.quick-card strong { font-size: 17px; }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid #eef1ee; color: #3f4b51; font-size: 13px; }
.activity-list i { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--lime-dark); }
.activity-list strong,
.activity-list span { display: block; }
.activity-list strong { color: var(--ink); font-weight: 600; }
.activity-list span { max-width: 58ch; margin-top: 3px; color: #56646b; line-height: 1.4; }
.activity-list small { display: block; margin-top: 4px; color: #879197; }

.editor-layout { display: grid; grid-template-columns: minmax(0,1fr) 260px; align-items: start; gap: 20px; }
.editor-main { display: grid; gap: 22px; }
.editor-aside { position: sticky; top: 20px; display: grid; gap: 12px; }
.save-card { padding: 18px; border: 1px solid var(--line); background: #fff; }
.save-card p { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.save-card .primary-button { width: 100%; }

.field-group { border: 1px solid var(--line); background: #fff; }
.field-group > .group-head { display: flex; justify-content: space-between; gap: 20px; padding: 17px 20px; border-bottom: 1px solid #edf0ed; }
.group-head h3 { margin: 0; font-size: 16px; }
.group-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.page-section { border-color: #cfd8d1; box-shadow: 0 10px 26px rgba(11,36,55,.04); }
.page-section > .group-head { padding: 23px 24px; background: #f7faf6; border-bottom-color: #dfe6e0; }
.page-section > .group-head h3 { font-size: 21px; font-weight: 600; }
.page-section > .group-head p { max-width: 760px; margin-top: 8px; font-size: 13px; line-height: 1.55; }
.page-section > .group-body { padding: 24px; }
.group-body { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px; padding: 20px; }
.group-body > .field-group, .group-body > .array-field, .group-body > .field-wide { grid-column: 1 / -1; }
.field { display: grid; gap: 8px; min-width: 0; }
.field > span { color: #3a4850; font-size: 12px; font-weight: 800; }
.field small { color: var(--muted); font-weight: 400; }
.field.boolean-field { grid-template-columns: 1fr auto; align-items: center; padding: 12px 0; }
.boolean-field input { width: 22px; min-height: 22px; accent-color: var(--lime-dark); }
.image-field { grid-column: 1 / -1; display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: center; }
.image-preview { width: 130px; height: 92px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); background: #f3f5f2; color: var(--muted); font-size: 11px; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-controls { display: grid; gap: 9px; }
.upload-button { width: max-content; min-height: 38px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; background: #fff; font-size: 12px; font-weight: 800; }
.array-field { border: 1px dashed #cfd6d1; padding: 14px; background: #fbfcfa; }
.array-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.array-head strong { font-size: 13px; }
.array-items { display: grid; gap: 12px; }
.array-item { position: relative; display: grid; gap: 10px; padding: 15px; border: 1px solid var(--line); background: #fff; }
.array-item .group-body { padding: 0; border: 0; }
.remove-button { border: 0; background: transparent; color: var(--danger); font-size: 12px; font-weight: 800; }

.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.content-card { display: grid; grid-template-columns: 150px 1fr; min-height: 190px; border: 1px solid var(--line); background: #fff; overflow: hidden; }
.content-card__image { background: #eef1ed; }
.content-card__image img { width: 100%; height: 100%; object-fit: cover; }
.content-card__body { min-width: 0; display: flex; flex-direction: column; padding: 18px; }
.content-card__meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status-pill { display: inline-flex; align-items: center; width: max-content; min-height: 22px; border-radius: 999px; padding: 0 8px; background: #e9f7dc; color: #397414; }
.status-pill.draft { background: #f2ece5; color: #796651; }
.content-card h3 { margin: 12px 0 8px; font-size: 18px; line-height: 1.25; }
.content-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.content-card .button-row { margin-top: auto; padding-top: 14px; }
.text-button { border: 0; padding: 0; background: transparent; color: var(--navy); font-size: 12px; font-weight: 800; text-decoration: none; }
.text-button.danger { color: var(--danger); }
.empty-state { grid-column: 1 / -1; padding: 60px 30px; border: 1px dashed #c7d0c9; background: rgba(255,255,255,.45); text-align: center; }
.empty-state strong { display: block; margin-bottom: 8px; font-size: 22px; }
.empty-state p { color: var(--muted); }

.editor-dialog { width: min(980px, calc(100vw - 30px)); max-height: calc(100vh - 30px); border: 0; padding: 0; box-shadow: 0 28px 90px rgba(10,30,43,.28); }
.editor-dialog::backdrop { background: rgba(4,18,28,.58); backdrop-filter: blur(4px); }
.dialog-head { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); background: #fff; }
.dialog-head h2 { margin: 0; font-size: 26px; }
.dialog-head .icon-button { border-color: var(--line); color: #111; }
.dialog-form { display: grid; gap: 18px; padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.switch-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.switch-row label { grid-template-columns: auto 1fr; align-items: center; }
.switch-row input { width: 20px; min-height: 20px; accent-color: var(--lime-dark); }
.markdown-toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--line); border-bottom: 0; background: #f5f7f4; }
.markdown-toolbar button { min-width: 34px; min-height: 32px; border: 1px solid #d4dad6; border-radius: 6px; background: #fff; font-size: 12px; font-weight: 800; }
.markdown-editor { min-height: 290px; border-radius: 0 0 10px 10px; }
.markdown-preview { min-height: 290px; padding: 22px; border: 1px solid var(--line); background: #fff; line-height: 1.7; }
.markdown-preview img { max-width: 100%; }

.rich-editor {
  width: 100%;
  overflow: hidden;
  border: 1px solid #ccd4cf;
  border-radius: 10px;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.rich-editor:focus-within {
  border-color: var(--lime-dark);
  box-shadow: 0 0 0 3px rgba(164,232,90,.22);
}
.rich-editor__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #f5f7f4;
}
.rich-editor__toolbar button {
  min-height: 34px;
  border: 1px solid #d4dad6;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: #243139;
  font-size: 11px;
  font-weight: 600;
}
.rich-editor__toolbar button:hover {
  border-color: var(--lime-dark);
  background: #fbfff7;
}
.rich-editor__surface {
  min-height: 132px;
  padding: 14px;
  overflow-wrap: anywhere;
  color: #111;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  outline: none;
  white-space: normal;
}
.rich-editor--compact .rich-editor__surface { min-height: 48px; padding: 10px 12px; }
.rich-editor--compact .rich-editor__toolbar { padding: 6px; }
.rich-editor--compact .rich-editor__toolbar button { min-height: 30px; padding: 0 8px; }
.rich-editor--block .rich-editor__surface { min-height: 340px; padding: 22px; }
.rich-editor__surface:empty::before {
  color: #9aa3a0;
  content: 'Введите текст';
  pointer-events: none;
}
.rich-editor__surface p { margin: 0 0 1em; }
.rich-editor__surface h2 { margin: 1.5em 0 .6em; font-size: 26px; font-weight: 500; line-height: 1.2; }
.rich-editor__surface h3 { margin: 1.25em 0 .5em; font-size: 20px; font-weight: 500; line-height: 1.3; }
.rich-editor__surface ul,
.rich-editor__surface ol { margin: .8em 0; padding-left: 1.4em; }
.rich-editor__surface blockquote { margin: 1em 0; border-left: 3px solid var(--lime); padding-left: 16px; color: var(--muted); }
.rich-editor__surface a { color: #225f99; text-decoration: underline; }
.rich-editor__surface img { display: block; max-width: 100%; height: auto; margin: 18px 0; }

.media-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }
.media-card { border: 1px solid var(--line); background: #fff; overflow: hidden; }
.media-card img { width: 100%; aspect-ratio: 1.25; display: block; object-fit: cover; background: #eef1ed; }
.media-card div { padding: 10px; }
.media-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.media-card small { color: var(--muted); font-size: 10px; }
.media-card .button-row { justify-content: space-between; margin-top: 8px; }

.user-list { display: grid; gap: 10px; }
.user-row { display: grid; grid-template-columns: 42px 1fr auto auto; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); background: #fff; }
.user-row strong, .user-row small { display: block; }
.user-row small { margin-top: 4px; color: var(--muted); }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; max-width: 380px; transform: translateY(20px); opacity: 0; pointer-events: none; border-radius: 10px; padding: 14px 18px; background: var(--navy); color: #fff; box-shadow: var(--shadow); transition: .25s; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #9d3434; }

.eyebrow,
.sidebar-nav p,
.sidebar-nav button,
.sidebar-nav button.active,
.publish-state,
.metric-card span,
.visitor-metric > span,
.panel-title > span,
.section-divider,
.field > span,
.array-head strong,
.upload-button,
.remove-button,
.content-card__meta,
.text-button,
.markdown-toolbar button {
  font-weight: 600;
}
.topbar h1,
.section-head h2,
.panel h2,
.quick-card strong,
.group-head h3 {
  font-weight: 600;
}

@media (max-width: 1100px) {
  .visitor-metric-grid { grid-template-columns: repeat(3,1fr); }
  .analytics-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: min(300px,86vw); transition: transform .25s; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .menu-button { display: block; }
  .topbar { position: sticky; top: 0; z-index: 10; min-height: 76px; padding: 12px 16px; }
  .topbar h1 { font-size: 20px; }
  .topbar .eyebrow, .publish-state { display: none; }
  .topbar-actions .secondary-button { min-width: 42px; width: 42px; padding: 0; overflow: hidden; color: transparent; }
  .topbar-actions .secondary-button::after { content: '↗'; color: var(--navy); }
  .view { padding: 22px 14px 40px; }
  .editor-layout, .dashboard-grid { grid-template-columns: 1fr; }
  .visitor-metric-grid { grid-template-columns: repeat(2,1fr); }
  .analytics-chart-panel { overflow-x: auto; }
  .analytics-chart { min-width: 620px; }
  .editor-aside { position: static; order: -1; }
  .save-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .save-card p { margin: 0; }
  .save-card .primary-button { width: auto; }
  .group-body, .form-grid { grid-template-columns: 1fr; }
  .image-field { grid-template-columns: 100px 1fr; }
  .image-preview { width: 100px; height: 78px; }
  .media-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 520px) {
  .visitor-metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .visitor-metric { min-height: 132px; padding: 16px; }
  .visitor-metric:first-child { grid-column: 1 / -1; }
  .visitor-metric strong { font-size: 38px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 120px; }
  .content-card { grid-template-columns: 1fr; }
  .content-card__image { height: 180px; }
  .quick-grid { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: 1fr; }
  .user-row { grid-template-columns: 38px 1fr auto; }
  .user-row > .status-pill { display: none; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .editor-dialog { width: 100vw; max-height: 100vh; height: 100vh; }
  .dialog-form { padding: 18px 14px 40px; }
}
