:root {
  --navy: #07162f;
  --navy-2: #0c2348;
  --blue: #2b72bd;
  --ice: #eaf5ff;
  --bg: #f3f7fb;
  --paper: #fff;
  --ink: #0b1830;
  --muted: #68778a;
  --line: #d9e3ed;
  --danger: #a53131;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Avenir Next", Avenir, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
}
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { outline-offset: 3px; }
[hidden] { display: none !important; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 2rem; background: var(--navy); }
.login-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.65) 0 1px, transparent 1.5px);
  background-size: 97px 83px;
  opacity: .22;
}
.login-card {
  position: relative;
  width: min(100%, 460px);
  padding: 2.6rem;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0,0,0,.35);
}
.admin-brand { display: inline-flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; font-size: .77rem; letter-spacing: .14em; }
.admin-brand > span { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid currentColor; border-radius: 50%; color: var(--blue); font-weight: 800; letter-spacing: -.08em; }
.kicker { margin: 2.5rem 0 .5rem; color: var(--blue); font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.login-card h1 { margin: 0; font: 400 2.5rem/1.1 Georgia, serif; }
.login-copy { margin: 1rem 0 2rem; color: var(--muted); }
.auth-roadmap { margin: -1.2rem 0 1.6rem; padding-left: .8rem; color: #708195; border-left: 2px solid #b8d8f5; font-size: .74rem; line-height: 1.5; }
label { display: grid; gap: .5rem; margin-bottom: 1.2rem; color: #3b4d61; font-size: .82rem; font-weight: 700; }
input, textarea, select {
  width: 100%;
  min-height: 45px;
  padding: .78rem .85rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfdbe7;
  border-radius: 0;
}
textarea { line-height: 1.5; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,114,189,.12); }
.form-error { min-height: 1.4rem; margin: -.5rem 0 .6rem; color: var(--danger); font-size: .8rem; }
.primary-button, .secondary-button, .danger-button, .icon-button, .add-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.primary-button { padding: .72rem 1.15rem; color: #fff; background: var(--navy); }
.primary-button:hover { background: var(--blue); }
.secondary-button { padding: .7rem 1rem; color: #294157; background: #fff; border-color: #cdd9e4; }
.secondary-button:hover { border-color: var(--blue); color: var(--blue); }
.danger-button { padding: .7rem 1rem; color: var(--danger); background: transparent; border-color: #e5c2c2; }
.danger-button:hover { color: #fff; background: var(--danger); }
.icon-button { width: 42px; color: #516176; background: transparent; border-color: #d1dce6; }
.back-link { display: block; margin-top: 1.5rem; color: var(--muted); font-size: .8rem; }

.workspace { min-height: 100vh; display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; color: #eaf5ff; background: var(--navy); }
.sidebar-head { padding: 1.7rem 1.5rem 1.4rem; border-bottom: 1px solid rgba(222,239,255,.13); }
.sidebar-head .admin-brand { color: #fff; }
.sidebar-head p { margin: 1.8rem 0 0; color: rgba(222,239,255,.5); font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.block-list { flex: 1; overflow-y: auto; padding: .85rem; }
.block-item {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  padding: .9rem .75rem;
  color: rgba(235,246,255,.72);
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
}
.block-item:hover { background: rgba(255,255,255,.055); }
.block-item.is-active { color: #fff; background: rgba(102,174,238,.13); border-color: rgba(137,198,252,.25); }
.block-item-index { color: rgba(201,225,247,.42); font: .63rem/1 ui-monospace, monospace; }
.block-item-copy { min-width: 0; }
.block-item-copy strong, .block-item-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block-item-copy strong { font-size: .8rem; }
.block-item-copy small { margin-top: .22rem; color: rgba(208,230,249,.43); font-size: .68rem; }
.visibility-dot { width: 7px; height: 7px; border-radius: 50%; background: #6aaeee; }
.visibility-dot.is-hidden { background: #56647a; }
.add-button { margin: .8rem; padding: .8rem 1rem; color: #fff; background: rgba(255,255,255,.06); border-color: rgba(212,234,255,.2); }
.add-button:hover { background: rgba(112,182,244,.18); }
.add-button span { margin-right: .45rem; font-size: 1.2rem; }

.editor-area { min-width: 0; }
.editor-topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1rem 2rem;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.editor-topbar .kicker { margin: 0 0 .25rem; }
.editor-topbar h1 { margin: 0; font: 400 1.65rem/1.2 Georgia, serif; }
.topbar-actions { display: flex; align-items: center; gap: .65rem; }
.save-state { margin-right: .5rem; color: #67788a; font-size: .75rem; }
.save-state.is-dirty { color: #9a6817; }
.save-state.is-saving { color: var(--blue); }
.editor-scroll { padding: 2rem; }
.block-editor { max-width: 940px; margin: 0 auto; padding: 2.2rem; background: #fff; border: 1px solid var(--line); }
.editor-empty { min-height: 480px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.editor-empty > span { color: #aec3d6; font-size: 2.6rem; }
.editor-empty h2 { margin: .8rem 0 .2rem; color: var(--ink); font: 400 2rem/1.2 Georgia, serif; }
.editor-empty p { margin: 0; }
.field-grid { display: grid; gap: 1rem; }
.two-columns { grid-template-columns: 1fr 1fr; }
label small { color: #7d8da0; font-size: .72rem; font-weight: 400; }
.media-panel { margin: 1.8rem 0; padding: 1.25rem; background: #f6f9fc; border: 1px solid var(--line); }
.media-head { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.2rem; color: #3b4d61; font-size: .82rem; font-weight: 700; }
.media-head small { display: block; margin-top: .2rem; color: #7d8da0; font-size: .7rem; font-weight: 400; }
.upload-button { position: relative; margin: 0; white-space: nowrap; }
.upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.media-preview { min-height: 190px; display: grid; place-items: center; color: #8b9aac; background: #e9f0f6; border: 1px dashed #bccbd9; font-size: .78rem; overflow: hidden; }
.media-preview img, .media-preview video { display: block; width: 100%; max-height: 420px; object-fit: contain; background: #07162f; }
.toggle-row { display: flex; align-items: center; gap: .7rem; cursor: pointer; }
.toggle-row > input { position: absolute; width: 1px; min-height: 1px; opacity: 0; }
.toggle { position: relative; width: 42px; height: 24px; border-radius: 15px; background: #bbc7d2; transition: .2s ease; }
.toggle::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s ease; }
.toggle-row input:checked + .toggle { background: var(--blue); }
.toggle-row input:checked + .toggle::after { transform: translateX(18px); }
.toggle-row input:focus-visible + .toggle { outline: 2px solid var(--blue); outline-offset: 3px; }
.block-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.block-actions > div { display: flex; flex-wrap: wrap; gap: .55rem; }
.toast { position: fixed; z-index: 20; right: 1.2rem; bottom: 1.2rem; padding: .8rem 1rem; color: #fff; background: var(--navy); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 230px minmax(0, 1fr); }
  .editor-topbar { align-items: flex-start; padding: 1rem; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .save-state { width: 100%; text-align: right; }
  .editor-scroll { padding: 1rem; }
  .block-editor { padding: 1.3rem; }
}
@media (max-width: 680px) {
  .workspace { display: block; }
  .sidebar { position: relative; height: auto; }
  .block-list { display: flex; overflow-x: auto; }
  .block-item { min-width: 210px; }
  .editor-topbar { position: relative; display: block; }
  .topbar-actions { margin-top: 1rem; justify-content: flex-start; }
  .save-state { width: 100%; text-align: left; }
  .two-columns { grid-template-columns: 1fr; }
  .media-head, .block-actions { align-items: stretch; flex-direction: column; }
}
