:root {
  --paper: #efe4cf;
  --ink: #1c1612;
  --rust: #b8431f;
  --moss: #243f36;
  --line: #cbb89a;
  --card: #f6efe2;
  --shadow: 0 18px 40px rgba(28, 22, 18, 0.08);
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #f7edd8 0%, transparent 60%),
    linear-gradient(180deg, #f3e7d2 0%, var(--paper) 28%, #e7d8bc 100%);
  font-family: var(--sans);
  min-height: 100vh;
}
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.18;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(28, 22, 18, 0.04) 4px);
}

.ticker {
  overflow: hidden;
  background: var(--moss);
  color: #efe4cf;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.ticker-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  padding: 0.45rem 0;
  animation: ticker 28s linear infinite;
}
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.top {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.1rem 6vw;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(239, 228, 207, 0.9);
  backdrop-filter: blur(8px);
}
.brand {
  font-family: var(--serif);
  font-size: 1.7rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.03em;
}
.brand span {
  display: block;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rust);
}
nav { display: flex; gap: 1.1rem; flex: 1; }
nav a, .who a {
  color: var(--ink);
  text-decoration: none;
}
nav a { position: relative; }
nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: var(--rust);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1);
}
nav a:hover::after,
nav a[aria-current="page"]::after { transform: scaleX(1); }
nav a[aria-current="page"] { color: var(--rust); }
.cart-link b {
  display: inline-block;
  min-width: 1.3rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: var(--rust);
  color: #fff8ee;
  text-align: center;
  animation: pop 0.45s cubic-bezier(.2,.8,.2,1);
}
@keyframes pop {
  from { transform: scale(0.4); }
  to { transform: scale(1); }
}
.who { display: flex; align-items: center; gap: 0.8rem; }
.who a.pill { color: #f6efe2; }
.pill, .buy, button.pill {
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  background: var(--ink);
  color: #f6efe2;
  padding: 0.55rem 0.95rem;
  font: inherit;
  border-radius: 999px;
  transition: transform 0.25s ease, background 0.25s ease;
}
.pill:hover, .buy:hover { transform: translateY(-2px); background: var(--rust); }
.pill.big { margin-top: 1rem; padding: 0.8rem 1.3rem; }
.textish {
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  color: var(--moss);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.textish.danger { color: var(--rust); }
main { padding: 2.2rem 6vw 4rem; }

.hero h1, .page {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.03em;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 0.95;
  margin: 0.2rem 0 0.8rem;
}
.eyebrow {
  margin: 0;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--rust);
}
.lede { max-width: 38rem; font-size: 1.05rem; }
.done h1 { animation: stamp 0.7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes stamp {
  from { opacity: 0; transform: rotate(-6deg) scale(1.15); }
  to { opacity: 1; transform: none; }
}

.cats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.4rem 0; }
.cats a {
  color: var(--moss);
  text-decoration: none;
  border: 1px solid var(--moss);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  transition: background 0.25s ease, color 0.25s ease;
}
.cats a:hover { background: var(--moss); color: #efe4cf; }

.price { list-style: none; margin: 0; padding: 0; }
.cathead {
  margin-top: 1.6rem;
  padding: 0.4rem 0;
  font-family: var(--serif);
  font-size: 1.6rem;
  border-bottom: 2px solid var(--ink);
}
.lot {
  display: grid;
  grid-template-columns: 3.2rem 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
  animation: rise 0.55s ease both;
  animation-delay: calc(var(--i) * 40ms);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.lot strong { display: block; font-size: 1.05rem; }
.lot em { color: #6d5c48; font-style: normal; font-size: 0.88rem; }
.lot p { margin: 0.25rem 0 0; color: #4d4338; }
.mark {
  width: 3.2rem;
  height: 3.2rem;
  display: grid;
  place-items: center;
  background: var(--moss);
  color: #efe4cf;
  font-family: var(--serif);
  text-transform: uppercase;
}
.sum { font-variant-numeric: tabular-nums; white-space: nowrap; }
.buy { border-radius: 0; }
.buy:disabled { background: #b7aa96; cursor: not-allowed; transform: none; }
.qty { display: flex; gap: 0.4rem; align-items: center; }
.qty input, .sheet input, .sheet textarea, .sheet select, .slipcard select {
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 0.45rem 0.55rem;
  width: 6rem;
}
.total { font-family: var(--serif); font-size: 2rem; }
.warn {
  background: #f3d2c4;
  border-left: 4px solid var(--rust);
  padding: 0.7rem 0.9rem;
  animation: rise 0.35s ease both;
}
.empty { color: #6d5c48; }
.sheet {
  display: grid;
  gap: 0.7rem;
  max-width: 28rem;
  margin: 1rem 0 1.4rem;
  padding: 1rem;
  background: var(--card);
  box-shadow: var(--shadow);
}
.sheet.tight { max-width: none; }
.sheet h2 { margin: 0; font-family: var(--serif); font-weight: 500; }
.sheet label, .hint { display: grid; gap: 0.25rem; }
.sheet input, .sheet textarea { width: 100%; }

.gate {
  min-height: calc(100dvh - 8.2rem);
  display: flex;
  align-items: safe center;
  justify-content: safe center;
}
.gate-card {
  width: min(26rem, 100%);
  text-align: center;
}
.gate .page {
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  margin-bottom: 0.45rem;
}
.gate .lede {
  margin: 0 auto 0.8rem;
  text-align: center;
}
.gate .sheet {
  width: 100%;
  margin: 0;
  padding: 1.35rem 1.25rem 1.15rem;
  text-align: left;
  position: relative;
  overflow: hidden;
  animation: gate-in 0.72s cubic-bezier(.16,.84,.24,1) both;
}
.gate .sheet::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 3px;
  width: 100%;
  background: var(--rust);
  transform-origin: left;
  animation: draw 0.7s cubic-bezier(.2,.7,.2,1) 0.2s both;
}
@keyframes gate-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}
@keyframes draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.gate .eyebrow,
.gate .page,
.gate .lede {
  animation: rise 0.55s ease both;
}
.gate .page { animation-delay: 0.06s; }
.gate .lede { animation-delay: 0.12s; }
.gate label {
  animation: field-in 0.5s cubic-bezier(.16,.84,.24,1) both;
}
.gate label:nth-of-type(1) { animation-delay: 0.18s; }
.gate label:nth-of-type(2) { animation-delay: 0.28s; }
.gate label:nth-of-type(3) { animation-delay: 0.38s; }
.gate label:nth-of-type(4) { animation-delay: 0.48s; }
@keyframes field-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.gate .pill {
  justify-self: stretch;
  text-align: center;
  animation: field-in 0.5s cubic-bezier(.16,.84,.24,1) 0.56s both;
}
.gate input {
  transition: border-color 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
}
.gate input:focus {
  outline: none;
  border-color: var(--rust);
  background: #fffaf2;
  box-shadow: 0 0 0 4px rgba(184, 67, 31, 0.14);
}
.gate .hint { display: block; margin: 0.9rem 0 0; color: #6d5c48; }
.gate .hint a { color: var(--rust); }
.gate .warn { animation: nudge 0.45s ease both; }
@keyframes nudge {
  0% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}
.row { display: flex; gap: 1rem; align-items: center; }
.slip, .slips { padding-left: 1.1rem; }
.slips { list-style: none; padding: 0; }
.slips li, .slipcard {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  animation: rise 0.45s ease both;
}
.slipcard {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--card);
  box-shadow: var(--shadow);
}
.slipcard ul { margin: 0.4rem 0; }
.slipcard form { display: flex; gap: 0.6rem; align-items: center; }
.slipcard select { width: auto; }

/* —— кабинет —— */
body.is-admin main {
  position: relative;
}
body.is-admin main::before {
  content: "";
  position: absolute;
  inset: 0.4rem 4vw auto;
  height: 7rem;
  background:
    radial-gradient(ellipse at 12% 40%, rgba(184, 67, 31, 0.12), transparent 55%),
    radial-gradient(ellipse at 88% 20%, rgba(36, 63, 54, 0.14), transparent 50%);
  pointer-events: none;
  z-index: 0;
}
.admin { position: relative; z-index: 1; }
.admin-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1.4rem;
  animation: rise 0.5s ease both;
}
.admin-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 0.35rem;
}
.admin-lede { margin: 0; max-width: 34rem; }
.admin-add {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s ease;
}
.admin-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(28, 22, 18, 0.18);
}
.admin-add span {
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1);
}
.admin-add:hover span { transform: rotate(90deg); }
.admin-stat {
  display: grid;
  justify-items: end;
  padding: 0.7rem 1rem;
  background: var(--moss);
  color: #efe4cf;
  min-width: 5.5rem;
  animation: stamp 0.55s cubic-bezier(.2,.8,.2,1) both;
}
.admin-stat b {
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
}
.admin-stat span {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.8;
}
.admin-empty {
  padding: 2rem 0;
  border-top: 1px dashed var(--line);
  animation: rise 0.45s ease both;
}

.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  background: rgba(246, 239, 226, 0.72);
  box-shadow: var(--shadow);
  animation: rise 0.55s ease 0.05s both;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.admin-table th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6d5c48;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(36, 63, 54, 0.05);
  position: sticky;
  top: 0;
}
.admin-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table tbody tr {
  animation: rise 0.45s ease both;
  animation-delay: calc(var(--i) * 35ms);
  transition: background 0.25s ease, transform 0.25s ease;
}
.admin-table tbody tr.admin-row {
  cursor: pointer;
}
.admin-table tbody tr.admin-row:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: -2px;
}
.admin-table tbody tr:hover {
  background: rgba(184, 67, 31, 0.06);
}
.admin-table tbody tr:hover .icon-btn {
  border-color: rgba(36, 63, 54, 0.35);
}
.admin-table strong { display: block; }
.admin-table small {
  display: block;
  margin-top: 0.2rem;
  color: #6d5c48;
  max-width: 22rem;
}
.admin-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin-table .is-low {
  color: var(--rust);
  font-weight: 600;
  animation: pulse-low 1.8s ease-in-out infinite;
}
@keyframes pulse-low {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--moss);
  color: var(--moss);
  font-size: 0.82rem;
  transition: background 0.25s ease, color 0.25s ease;
}
.admin-table tbody tr:hover .tag {
  background: var(--moss);
  color: #efe4cf;
}
.admin-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
}
.admin-actions-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  vertical-align: middle;
}
.inline-form {
  display: inline-flex;
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: middle;
}

.icon-btn {
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--line);
  background: #fffaf2;
  color: var(--ink);
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}
.icon-btn svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
  transition: transform 0.25s ease;
}
.icon-btn svg.icon-stroke {
  fill: none;
  stroke: currentColor;
}
.icon-btn:hover {
  transform: translateY(-2px);
  border-color: var(--moss);
  background: var(--moss);
  color: #efe4cf;
  box-shadow: 0 8px 18px rgba(36, 63, 54, 0.22);
}
.icon-btn:hover svg { transform: scale(1.08); }
.icon-btn.danger:hover {
  border-color: var(--rust);
  background: var(--rust);
  color: #fff8ee;
  box-shadow: 0 8px 18px rgba(184, 67, 31, 0.28);
}
.icon-btn.danger:hover svg { transform: rotate(-8deg) scale(1.08); }
.icon-btn:active,
.pill.is-pressed {
  transform: scale(0.96);
}

.people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}
.people li {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.95rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise 0.45s ease both;
  animation-delay: calc(var(--i) * 45ms);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.people li:hover {
  transform: translateX(4px);
  border-color: var(--moss);
  box-shadow: 0 16px 32px rgba(28, 22, 18, 0.1);
}
.people strong { display: block; }
.people span { color: #6d5c48; }
.people em { color: #8a7762; font-style: normal; font-size: 0.88rem; }
.avatar {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  background: var(--moss);
  color: #efe4cf;
  font-family: var(--serif);
  font-size: 1.35rem;
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1);
}
.people li:hover .avatar { transform: scale(1.06) rotate(-3deg); }

.order-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1rem;
}
.order-card {
  display: grid;
  gap: 0.7rem;
  padding: 1rem 1.05rem 1.05rem;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise 0.5s ease both;
  animation-delay: calc(var(--i) * 40ms);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}
.order-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--rust), var(--moss));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
}
.order-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px rgba(28, 22, 18, 0.12);
  border-color: rgba(36, 63, 54, 0.35);
}
.order-card:hover::before { transform: scaleY(1); }
.order-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: start;
}
.order-card header > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.order-card header strong {
  font-family: var(--serif);
  font-size: 1.35rem;
}
.order-card header em {
  font-style: normal;
  color: #8a7762;
  font-size: 0.85rem;
}
.buyer { margin: 0; color: #4d4338; }
.order-card ul {
  list-style: none;
  margin: 0;
  padding: 0.55rem 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}
.order-card li {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.28rem 0;
  font-size: 0.92rem;
}
.order-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
}
.status-form {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}
.status-form select {
  width: auto;
  min-width: 8rem;
}
.pill.soft {
  background: var(--moss);
}
.pill.danger-pill {
  background: var(--rust);
}
.status {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 0.25s ease;
}
.order-card:hover .status { transform: scale(1.04); }
.status-new { background: #f3d2c4; color: #7a2d14; }
.status-assembling { background: #e5d7a8; color: #5a4a18; }
.status-shipped { background: #cfe0d7; color: #1d3d31; }
.status-done { background: #d7e3cf; color: #2a4224; }
.status-cancelled { background: #e4ddd3; color: #5c5348; }

.modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(34rem, calc(100vw - 1.5rem));
  color: inherit;
}
.modal::backdrop {
  background: rgba(28, 22, 18, 0.48);
  backdrop-filter: blur(5px);
  animation: fade 0.25s ease both;
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal[open] { animation: modal-in 0.38s cubic-bezier(.16,.84,.24,1) both; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(22px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.modal-card {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 1.15rem 1.15rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 28px 60px rgba(28, 22, 18, 0.22);
  position: relative;
  overflow: hidden;
}
.modal-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--rust), var(--moss));
  transform-origin: left;
  animation: draw 0.55s ease both;
}
.confirm-modal { max-width: min(24rem, calc(100vw - 1.5rem)); }
.confirm-card .confirm-text {
  margin: 0;
  color: #4d4338;
  line-height: 1.45;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}
.modal-head h2 {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.8rem;
  letter-spacing: -0.03em;
}
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.modal-grid.single { grid-template-columns: 1fr; }
.modal-grid label { display: grid; gap: 0.25rem; }
.modal-grid .span-2 { grid-column: 1 / -1; }
.modal-grid input,
.modal-grid textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fffaf2;
  border: 1px solid var(--line);
  padding: 0.5rem 0.6rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.modal-grid input:focus,
.modal-grid textarea:focus {
  outline: none;
  border-color: var(--rust);
  box-shadow: 0 0 0 4px rgba(184, 67, 31, 0.12);
  transform: translateY(-1px);
}
.modal-grid textarea { min-height: 5rem; resize: vertical; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  align-items: center;
  padding-top: 0.2rem;
}

@media (max-width: 800px) {
  .admin-head { flex-direction: column; align-items: stretch; }
  .admin-stat { justify-items: start; width: fit-content; }
  .modal-grid { grid-template-columns: 1fr; }
  .people li { grid-template-columns: 2.6rem 1fr; }
  .people em { grid-column: 2; }
}

@media (max-width: 800px) {
  .top { flex-wrap: wrap; }
  nav { order: 3; width: 100%; }
  .lot { grid-template-columns: 3.2rem 1fr; }
  .sum, .lot form { grid-column: 2; }
  main:has(.gate) { padding-top: 0.6rem; padding-bottom: 0.8rem; }
  .gate .lede { margin-bottom: 0.4rem; }
  .gate .sheet { padding: 0.95rem 0.9rem 0.85rem; gap: 0.55rem; }
  .gate .hint { margin-top: 0.55rem; }
}

/* —— служебный вход (admin-хост) —— */
body.admin-gate {
  min-height: 100dvh;
  margin: 0;
  color: #efe4cf;
  background: #15241f;
  overflow-x: hidden;
  font-family: var(--sans);
}
body.admin-gate::before { display: none; }
.admin-gate-scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.admin-gate-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: admin-drift 12s ease-in-out infinite alternate;
}
.admin-gate-glow-a {
  width: 42rem;
  height: 42rem;
  left: -12rem;
  top: -10rem;
  background: radial-gradient(circle, rgba(184, 67, 31, 0.45), transparent 68%);
}
.admin-gate-glow-b {
  width: 36rem;
  height: 36rem;
  right: -10rem;
  bottom: -8rem;
  background: radial-gradient(circle, rgba(90, 140, 110, 0.4), transparent 68%);
  animation-delay: -4s;
}
@keyframes admin-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(3%, -2%) scale(1.06); }
}
.admin-gate-grid {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(239, 228, 207, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239, 228, 207, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  animation: admin-grid 28s linear infinite;
}
@keyframes admin-grid {
  from { transform: translateY(0); }
  to { transform: translateY(48px); }
}
.admin-gate-beam {
  position: absolute;
  inset: -20% -10%;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(239, 228, 207, 0.07) 48%,
    transparent 62%
  );
  animation: admin-sweep 7.5s ease-in-out infinite;
}
@keyframes admin-sweep {
  0%, 100% { transform: translateX(-12%) rotate(0.5deg); opacity: 0.35; }
  50% { transform: translateX(12%) rotate(-0.5deg); opacity: 0.7; }
}

.admin-gate-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1.4rem;
  padding: 2rem 1.2rem 2.4rem;
}
.admin-gate-brand {
  text-align: center;
  animation: rise 0.7s cubic-bezier(.16,.84,.24,1) both;
}
.admin-gate-mark {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 9vw, 4.6rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: #efe4cf;
}
.admin-gate-tag {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #c9b79a;
  animation: rise 0.7s ease 0.08s both;
}

.admin-gate-panel {
  width: min(26.5rem, 100%);
  padding: 1.35rem 1.25rem 1.25rem;
  background: rgba(246, 239, 226, 0.96);
  color: var(--ink);
  border: 1px solid rgba(203, 184, 154, 0.55);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(239, 228, 207, 0.08) inset;
  position: relative;
  overflow: hidden;
  animation: admin-panel-in 0.75s cubic-bezier(.16,.84,.24,1) 0.12s both;
}
@keyframes admin-panel-in {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.admin-gate-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--rust), #3f6a56, var(--moss));
  transform-origin: left;
  animation: draw 0.8s cubic-bezier(.2,.7,.2,1) 0.35s both;
}
.admin-gate-head { margin-bottom: 1rem; }
.admin-gate-head .eyebrow {
  margin: 0;
  color: var(--rust);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.admin-gate-head h1 {
  margin: 0.25rem 0 0.4rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 2.55rem);
  letter-spacing: -0.03em;
}
.admin-gate-lede {
  margin: 0;
  color: #6d5c48;
  line-height: 1.45;
}
.admin-gate-form {
  display: grid;
  gap: 0.85rem;
}
.admin-gate-form label {
  display: grid;
  gap: 0.3rem;
  animation: field-in 0.5s cubic-bezier(.16,.84,.24,1) both;
}
.admin-gate-form label:nth-of-type(1) { animation-delay: 0.28s; }
.admin-gate-form label:nth-of-type(2) { animation-delay: 0.38s; }
.admin-gate-form label span {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6d5c48;
}
.admin-gate-form input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fffaf2;
  border: 1px solid var(--line);
  padding: 0.7rem 0.75rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.admin-gate-form input:focus {
  outline: none;
  border-color: var(--rust);
  box-shadow: 0 0 0 4px rgba(184, 67, 31, 0.14);
  transform: translateY(-1px);
}
.admin-gate-submit {
  width: 100%;
  text-align: center;
  margin-top: 0.2rem;
  animation: field-in 0.5s cubic-bezier(.16,.84,.24,1) 0.48s both;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.admin-gate-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(28, 22, 18, 0.22);
}
.admin-gate-panel .warn {
  margin: 0 0 0.9rem;
  animation: nudge 0.45s ease both;
}
.admin-gate-foot {
  margin: 0;
  color: rgba(239, 228, 207, 0.55);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: rise 0.6s ease 0.4s both;
}

body.is-admin-host .top {
  background: rgba(21, 36, 31, 0.92);
  border-bottom-color: rgba(203, 184, 154, 0.28);
  color: #efe4cf;
}
body.is-admin-host .brand,
body.is-admin-host nav a,
body.is-admin-host .who,
body.is-admin-host .who a,
body.is-admin-host .textish {
  color: #efe4cf;
}
body.is-admin-host .brand span { color: #e0a080; }
body.is-admin-host nav a::after { background: #e0a080; }
body.is-admin-host nav a[aria-current="page"] { color: #e0a080; }
body.is-admin-host .pill { background: var(--rust); color: #fff8ee; }

@media (max-width: 800px) {
  .admin-gate-shell { padding: 1.4rem 1rem 1.8rem; gap: 1.1rem; }
  .admin-gate-panel { padding: 1.1rem 1rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
