:root {
  --ink: #1f2625;
  --ink-soft: #58615e;
  --paper: #f7f3e9;
  --paper-deep: #eee7d7;
  --white: #fffdf7;
  --red: #b33a32;
  --red-dark: #8f2c27;
  --moss: #69776b;
  --gold: #c89d57;
  --line: rgba(31, 38, 37, 0.14);
  --line-strong: rgba(31, 38, 37, 0.28);
  --shadow: 0 20px 60px rgba(48, 40, 28, 0.12);
  --radius: 22px;
  --font-display: Georgia, "Times New Roman", "Yu Mincho", serif;
  --font-sans: Inter, "Segoe UI", "Yu Gothic UI", sans-serif;
}

.store-body.theme-sakura {
  --paper: #fff3f5;
  --paper-deep: #f7dfe5;
  --white: #fffafa;
  --red: #bd4c67;
  --red-dark: #94374e;
  --moss: #7c6b75;
  --gold: #c9909e;
}
.store-body.theme-forest {
  --paper: #f1f5ed;
  --paper-deep: #dbe7d5;
  --white: #fbfdf8;
  --red: #386b52;
  --red-dark: #28503e;
  --moss: #627866;
  --gold: #ad9961;
}
.store-body.theme-indigo {
  --paper: #f2f2fa;
  --paper-deep: #dedff0;
  --white: #fcfcff;
  --red: #5056a9;
  --red-dark: #3b407f;
  --moss: #68708d;
  --gold: #b29a65;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body, .store-header, .admin-header, .auth-card, .admin-panel, .product-dialog, .cart-panel, input, select, textarea {
  transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease;
}
html.theme-dark {
  --ink: #edf3ef;
  --ink-soft: #b3c0b8;
  --paper: #111917;
  --paper-deep: #17231f;
  --white: #1d2925;
  --red: #e46d62;
  --red-dark: #f4897f;
  --moss: #9ab09f;
  --gold: #dcb976;
  --line: rgba(237, 243, 239, 0.14);
  --line-strong: rgba(237, 243, 239, 0.28);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
}
html.theme-dark .store-header, html.theme-dark .admin-header { background: rgba(17, 25, 23, 0.94); }
html.theme-dark .hero, html.theme-dark .auth-aside { background-color: #17231f; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  line-height: 1.55;
}
.store-body:has(.product-view-dialog[open]) { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
  border-radius: 8px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.store-header,
.admin-header {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  padding: 14px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 233, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  letter-spacing: 0.16em;
}
.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--white);
  background: var(--red);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; }
.brand small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.top-nav { display: flex; align-items: center; gap: clamp(20px, 3vw, 42px); }
.top-nav a {
  position: relative;
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: none;
}
.top-nav a::after {
  position: absolute;
  right: 0;
  bottom: -6px;
  left: 0;
  height: 1px;
  background: var(--red);
  content: "";
  transform: scaleX(0);
  transition: transform 180ms ease;
}
.top-nav a:hover::after, .top-nav a:focus-visible::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
  font-size: 18px;
}
.theme-toggle:hover, .theme-toggle:focus-visible { border-color: var(--red); outline: none; }
.auth-theme-toggle { position: fixed; z-index: 20; top: 20px; right: 20px; }
.phone-link, .telegram-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.phone-link { color: var(--ink); border: 1px solid var(--line-strong); background: var(--white); }
.telegram-link { color: white; background: #229ed9; box-shadow: 0 8px 20px rgba(34, 158, 217, 0.22); }
.telegram-link:hover, .telegram-link:focus-visible { background: #1789c2; }
.telegram-icon { font-size: 15px; line-height: 1; transform: rotate(-16deg); }

.cart-button,
.text-button,
.icon-button,
.filter-chip {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.count-badge {
  display: grid;
  min-width: 23px;
  height: 23px;
  padding: 0 5px;
  place-items: center;
  color: white;
  background: var(--red);
  border-radius: 999px;
  font-size: 11px;
}

.hero {
  display: grid;
  width: 100%;
  min-height: 680px;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 56px;
  align-items: center;
  max-width: none;
  margin: 0 auto;
  padding: 74px clamp(24px, 7vw, 110px) 92px;
  overflow: hidden;
}
.hero-copy { position: relative; z-index: 2; max-width: 760px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.hero h1,
.section-heading h2,
.security-note h2,
.auth-intro h1,
.admin-welcome h1,
.panel-heading h2,
.password-gate h1,
.dialog-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.05;
}
.hero h1 {
  max-width: 760px;
  font-size: clamp(58px, 7vw, 112px);
  letter-spacing: -0.055em;
}
.hero h1 em { color: var(--red); font-weight: 500; }
.hero-lead {
  max-width: 600px;
  margin: 28px 0 34px;
  color: var(--ink-soft);
  font-size: clamp(16px, 1.4vw, 20px);
}

.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.primary-action {
  color: white;
  border: 1px solid var(--red);
  background: var(--red);
  box-shadow: 0 12px 28px rgba(179, 58, 50, 0.22);
}
.primary-action:hover:not(:disabled), .primary-action:focus-visible:not(:disabled) {
  background: var(--red-dark);
  transform: translateY(-1px);
}
.primary-action:disabled { cursor: not-allowed; opacity: 0.5; box-shadow: none; }
.secondary-action {
  border: 1px solid var(--line-strong);
  background: transparent;
}
.secondary-action:hover, .secondary-action:focus-visible { background: var(--paper-deep); }
.full-width { width: 100%; }

.hero-art {
  position: relative;
  min-height: 500px;
  border: 1px solid rgba(179, 58, 50, 0.16);
  background:
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(179, 58, 50, 0.05) 38px 39px),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(179, 58, 50, 0.05) 38px 39px),
    var(--paper-deep);
  border-radius: 240px 240px 20px 20px;
  box-shadow: var(--shadow);
}
.sun {
  position: absolute;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 20px 70px rgba(179, 58, 50, 0.2);
}
.hero-art .sun { top: 58px; right: 68px; }
.fan {
  position: absolute;
  display: grid;
  width: 210px;
  height: 280px;
  place-items: center;
  border: 1px solid rgba(31, 38, 37, 0.2);
  color: var(--ink);
  background: var(--white);
  border-radius: 120px 120px 18px 18px;
  font-family: var(--font-display);
  font-size: 78px;
  box-shadow: var(--shadow);
}
.fan-one { bottom: 34px; left: 46px; transform: rotate(-8deg); }
.fan-two { right: 34px; bottom: 22px; transform: rotate(10deg); }
.hero-art > p {
  position: absolute;
  z-index: 3;
  top: 92px;
  left: 58px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 25px;
  letter-spacing: 0.15em;
  writing-mode: vertical-rl;
}

.trust-strip {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, 1fr);
  max-width: none;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.trust-strip > div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1px 14px;
  padding: 24px clamp(20px, 4vw, 58px);
}
.trust-strip > div + div { border-left: 1px solid var(--line); }
.trust-strip span { grid-row: 1 / 3; color: var(--red); font-family: var(--font-display); font-size: 28px; }
.trust-strip strong { font-size: 13px; }
.trust-strip small { color: var(--ink-soft); font-size: 11px; }

.catalog-section {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 110px clamp(24px, 5vw, 96px);
}
.section-heading {
  display: flex;
  gap: 40px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 44px;
}
.section-heading h2, .security-note h2 { font-size: clamp(38px, 4vw, 64px); letter-spacing: -0.035em; }
.section-heading > p { max-width: 500px; margin: 0; color: var(--ink-soft); }

.catalog-toolbar {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.68);
  border-radius: var(--radius);
}
.search-field input,
.sort-field select,
.stack-form input,
.stack-form select,
.product-form input,
.product-form select,
.product-form textarea {
  width: 100%;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  outline: 0;
  background: var(--white);
  border-radius: 12px;
  transition: border 140ms ease, box-shadow 140ms ease;
}
.search-field input { height: 46px; padding: 0 16px; }
.sort-field { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 12px; }
.sort-field select { min-width: 210px; height: 42px; padding: 0 34px 0 12px; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(179, 58, 50, 0.12); }
.filter-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.filter-chip {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
}
.filter-chip[aria-pressed="true"] { color: white; border-color: var(--ink); background: var(--ink); }
.status-line { min-height: 26px; margin: 24px 0 14px; color: var(--ink-soft); font-size: 12px; }

.product-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 22px;
}
.product-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--radius);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-card:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.product-visual {
  position: relative;
  display: grid;
  min-height: 250px;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 30%, rgba(179, 58, 50, 0.16) 0 18%, transparent 18.4%),
    linear-gradient(145deg, var(--paper-deep), #f8efe4);
}
.product-visual img { width: 100%; height: 250px; padding: 12px; object-fit: contain; }
.product-kanji { color: rgba(31, 38, 37, 0.62); font-family: var(--font-display); font-size: 78px; }
.featured-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 6px 9px;
  color: white;
  background: var(--red);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.product-content { padding: 20px; }
.product-category { margin: 0 0 8px; color: var(--red); font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.product-content h3 { min-height: 52px; margin: 0; font-family: var(--font-display); font-size: 23px; font-weight: 500; line-height: 1.15; }
.product-description { display: -webkit-box; min-height: 66px; margin: 12px 0 18px; overflow: hidden; color: var(--ink-soft); font-size: 12px; white-space: pre-line; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.product-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.product-price { display: block; font-family: var(--font-display); font-size: 25px; }
.add-button {
  min-width: 104px;
  height: 39px;
  padding: 0 14px;
  color: white;
  border: 0;
  background: var(--ink);
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}
.add-button:disabled { cursor: not-allowed; opacity: 0.45; }
.empty-state { grid-column: 1 / -1; padding: 60px 20px; color: var(--ink-soft); border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; }

@media (min-width: 761px) {
  .product-card:only-child {
    display: grid;
    grid-template-columns: minmax(320px, 480px) minmax(0, 1fr);
  }
  .product-card:only-child .product-visual { height: 100%; min-height: 380px; }
  .product-card:only-child .product-visual img { height: 100%; min-height: 380px; max-height: 520px; padding: 24px; }
  .product-card:only-child .product-content { display: flex; min-width: 0; flex-direction: column; padding: clamp(26px, 4vw, 52px); }
  .product-card:only-child .product-content h3 { min-height: 0; font-size: clamp(30px, 3vw, 46px); }
  .product-card:only-child .product-description { min-height: 0; max-width: 1000px; font-size: 14px; line-height: 1.6; -webkit-line-clamp: 7; }
  .product-card:only-child .product-bottom { margin-top: auto; }
}

.security-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 36px;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto 110px;
  padding: 54px clamp(28px, 6vw, 74px);
  color: var(--white);
  background: var(--ink);
  border-radius: 32px;
}
.security-note .eyebrow { color: #e89f97; }
.security-note p:last-child { max-width: 760px; margin-bottom: 0; color: rgba(255, 253, 247, 0.72); }
.security-seal { display: grid; width: 108px; height: 108px; place-items: center; border: 1px solid rgba(255,255,255,0.28); border-radius: 50%; font-family: var(--font-display); font-size: 50px; }

.cart-panel {
  position: fixed;
  z-index: 110;
  top: 0;
  right: 0;
  display: flex;
  width: min(470px, 100%);
  height: 100dvh;
  flex-direction: column;
  padding: 28px;
  background: var(--white);
  box-shadow: -30px 0 80px rgba(31, 38, 37, 0.2);
  transform: translateX(105%);
  transition: transform 220ms ease;
}
.cart-panel.open { transform: translateX(0); }
.cart-header { display: flex; align-items: start; justify-content: space-between; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.cart-header h2 { margin: 0; font-family: var(--font-display); font-size: 38px; font-weight: 500; }
.icon-button { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 25px; }
.cart-items { flex: 1; overflow-y: auto; padding: 18px 0; }
.cart-empty { padding: 50px 18px; color: var(--ink-soft); text-align: center; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-line h3 { margin: 0 0 5px; font-family: var(--font-display); font-size: 18px; font-weight: 500; }
.cart-line p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.quantity-control { display: flex; align-items: center; gap: 6px; }
.quantity-control button { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); background: transparent; border-radius: 50%; cursor: pointer; }
.quantity-control strong { min-width: 24px; text-align: center; }
.remove-line { align-self: start; color: var(--red); border: 0; background: transparent; cursor: pointer; font-size: 11px; }
.cart-summary { padding-top: 20px; border-top: 1px solid var(--line); }
.cart-summary > p:first-child { display: flex; align-items: baseline; justify-content: space-between; }
.cart-summary strong { font-family: var(--font-display); font-size: 29px; }
.fine-print { color: var(--ink-soft); font-size: 10px; }
.fine-print.success { color: #2b7651; font-weight: 700; }
.cart-backdrop { position: fixed; z-index: 100; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(24, 28, 27, 0.5); cursor: default; }

.store-footer { display: flex; gap: 30px; align-items: center; justify-content: space-between; padding: 34px clamp(24px, 7vw, 110px); border-top: 1px solid var(--line); }
.footer-info { display: grid; justify-items: end; gap: 12px; max-width: 650px; }
.footer-info > p { margin: 0; color: var(--ink-soft); font-size: 11px; text-align: right; }
.footer-contacts { display: flex; flex-wrap: wrap; justify-content: end; gap: 9px; }

.auth-body { min-height: 100dvh; background: var(--paper-deep); }
.auth-shell { display: grid; min-height: 100dvh; grid-template-columns: minmax(0, 1fr) minmax(380px, 0.72fr); }
.auth-card { display: flex; width: min(590px, calc(100% - 40px)); flex-direction: column; justify-content: center; margin: 0 auto; padding: 60px 40px; }
.auth-brand { align-self: flex-start; margin-bottom: 72px; }
.auth-intro h1 { font-size: clamp(42px, 6vw, 70px); letter-spacing: -0.04em; }
.auth-intro > p:last-child { max-width: 520px; margin: 18px 0 34px; color: var(--ink-soft); }
.stack-form { display: grid; gap: 18px; }
.stack-form label, .product-form label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 700; letter-spacing: 0.03em; }
.stack-form input, .stack-form select, .product-form input, .product-form select { height: 48px; padding: 0 13px; }
.product-form textarea { min-height: 120px; padding: 12px 13px; resize: vertical; }
.form-status { min-height: 22px; margin: 0; color: var(--red); font-size: 11px; }
.form-status.success { color: #2b7651; }
.auth-footnote { display: flex; gap: 13px; align-items: start; margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--ink-soft); }
.auth-footnote span { color: var(--red); font-size: 25px; }
.auth-footnote p { margin: 0; font-size: 11px; }
.auth-aside { position: relative; display: flex; overflow: hidden; flex-direction: column; align-items: center; justify-content: center; color: var(--white); background: var(--ink); }
.auth-aside .sun { top: 18%; left: 22%; width: min(28vw, 330px); height: min(28vw, 330px); }
.auth-aside p { position: relative; z-index: 2; margin: 0; font-family: var(--font-display); font-size: clamp(55px, 7vw, 110px); letter-spacing: 0.12em; writing-mode: vertical-rl; }
.auth-aside small { position: relative; z-index: 2; margin-top: 26px; color: rgba(255,255,255,0.58); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; }

.admin-body { min-height: 100dvh; background: #f1ede4; }
.admin-header { background: rgba(255, 253, 247, 0.95); }
.admin-session { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 11px; }
.session-dot { width: 8px; height: 8px; background: #39845b; border-radius: 50%; box-shadow: 0 0 0 4px rgba(57,132,91,0.12); }
.text-button { padding: 6px 0; color: var(--red); font-weight: 800; }
.admin-shell { max-width: 1500px; margin: 0 auto; padding: 58px clamp(20px, 5vw, 72px) 100px; }
.admin-welcome { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.admin-welcome h1 { font-size: clamp(42px, 5vw, 74px); letter-spacing: -0.04em; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.stats-grid article { min-height: 126px; padding: 20px; border: 1px solid var(--line); background: var(--white); border-radius: 18px; }
.stats-grid span { display: block; color: var(--ink-soft); font-size: 10px; }
.stats-grid strong { display: block; margin-top: 14px; font-family: var(--font-display); font-size: 38px; font-weight: 500; }
.admin-panel { margin-top: 22px; padding: 26px; border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(48,40,28,0.05); }
.panel-heading { display: flex; gap: 20px; align-items: center; justify-content: space-between; }
.panel-heading h2 { font-size: 34px; }
.backup-panel { overflow: hidden; }
.backup-description { max-width: 820px; margin: 12px 0 0; color: var(--muted); line-height: 1.65; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.backup-status { margin-top: 14px; }
.admin-search { width: min(330px, 100%); }
.table-wrap { overflow-x: auto; }
.product-table { width: 100%; border-collapse: collapse; }
.product-table th { padding: 12px 10px; color: var(--ink-soft); border-bottom: 1px solid var(--line-strong); font-size: 9px; letter-spacing: 0.08em; text-align: left; text-transform: uppercase; }
.product-table td { padding: 15px 10px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: middle; }
.product-table tbody tr:last-child td { border-bottom: 0; }
.table-product { display: grid; grid-template-columns: 44px minmax(150px, 1fr); gap: 12px; align-items: center; }
.table-product-visual { display: grid; width: 44px; height: 44px; place-items: center; overflow: hidden; color: var(--red); background: var(--paper-deep); border-radius: 10px; font-family: var(--font-display); font-size: 18px; }
.table-product-visual img { width: 100%; height: 100%; object-fit: cover; }
.table-product strong, .table-product small { display: block; }
.table-product small { color: var(--ink-soft); }
.row-actions { display: flex; justify-content: flex-end; gap: 7px; }
.row-action { padding: 7px 9px; border: 1px solid var(--line); background: transparent; border-radius: 8px; cursor: pointer; font-size: 10px; }
.row-action.danger { color: var(--red); }
.audit-list { display: grid; gap: 8px; margin-top: 20px; }
.audit-record { display: grid; grid-template-columns: 160px 1fr auto; gap: 18px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.audit-record time, .audit-record small { color: var(--ink-soft); font-size: 10px; }
.audit-record strong { font-size: 12px; }
.security-panel { display: flex; gap: 24px; align-items: center; justify-content: space-between; }
.security-panel h2 { margin: 0; font-family: var(--font-display); font-size: 32px; font-weight: 500; }
.security-panel p:last-child { margin-bottom: 0; color: var(--ink-soft); font-size: 12px; }
.settings-form { display: grid; gap: 18px; }
.settings-form .form-grid { margin-top: 4px; }
.avatar-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.avatar-controls > label { display: grid; flex: 1 1 280px; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 700; letter-spacing: 0.03em; }
.avatar-controls input[type="file"] { max-width: 310px; padding: 8px; font-size: 11px; }
.avatar-controls .form-status { flex: 1 1 180px; }

.password-gate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 0.76fr); gap: 60px; padding: clamp(30px, 6vw, 72px); color: var(--white); background: var(--ink); border-radius: 32px; box-shadow: var(--shadow); }
.password-gate .eyebrow { color: #eeaaa3; }
.password-gate h1 { font-size: clamp(44px, 5vw, 72px); letter-spacing: -0.045em; }
.password-gate p, .password-gate li { color: rgba(255,255,255,0.7); }
.password-gate ul { padding-left: 20px; }
.security-form { align-content: start; padding: 26px; color: var(--ink); background: var(--white); border-radius: 20px; }

.product-dialog {
  width: min(800px, calc(100% - 28px));
  max-height: calc(100dvh - 30px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  border: 0;
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 30px 100px rgba(18,22,21,0.34);
}
.product-dialog::backdrop { background: rgba(24,28,27,0.58); backdrop-filter: blur(4px); }
.product-form, .password-dialog-form { padding: 28px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.dialog-heading h2 { font-size: 36px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.span-two { grid-column: span 2; }
.image-dropzone {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 22px;
  place-items: center;
  text-align: center;
  color: var(--ink-soft);
  border: 2px dashed var(--line-strong);
  border-radius: 16px;
  background: color-mix(in srgb, var(--white) 80%, transparent);
  cursor: pointer;
}
.image-dropzone:focus-visible, .image-dropzone.is-dragging { outline: none; border-color: var(--red); background: var(--paper-deep); }
.image-dropzone strong { color: var(--ink); }
.upload-picker { cursor: pointer; }
.product-upload-summary { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--paper-deep) 62%, var(--white)); }
.product-upload-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: var(--ink); }
.product-image-count { color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.product-image-preview { display: flex; min-height: 96px; flex-wrap: wrap; gap: 12px; align-items: center; }
.product-image-empty { width: 100%; margin: 0; color: var(--ink-soft); font-size: 14px; }
.admin-image-thumb { position: relative; width: 128px; }
.product-image-preview img { display: block; width: 128px; height: 104px; object-fit: cover; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: var(--shadow); }
.admin-image-thumb.is-pending img { opacity: .58; }
.admin-image-thumb.has-error img { border-color: var(--red); opacity: .7; }
.image-upload-state { position: absolute; right: 6px; bottom: 6px; left: 6px; overflow: hidden; padding: 5px 7px; color: var(--white); border-radius: 7px; background: rgba(23, 31, 29, .78); font-size: 10px; font-weight: 700; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.image-upload-state.failed { background: var(--red); }
.remove-image { position: absolute; top: -8px; right: -8px; display: grid; width: 26px; height: 26px; place-items: center; color: white; border: 0; border-radius: 50%; background: var(--red); cursor: pointer; font-size: 18px; line-height: 1; }
.retry-image { width: 100%; margin-top: 7px; padding: 5px 7px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 7px; background: var(--white); cursor: pointer; font-size: 11px; font-weight: 700; }
.product-view-dialog { width: min(1120px, calc(100% - 28px)); height: min(600px, 85dvh); max-height: min(600px, 85dvh); padding: 0; overflow: hidden; color: var(--ink); border: 1px solid var(--line); border-radius: 24px; background: var(--white); box-shadow: 0 30px 100px rgba(18,22,21,.34); }
.product-view-dialog::backdrop { background: rgba(24,28,27,.65); backdrop-filter: blur(4px); }
.product-view-shell { position: relative; display: grid; height: 100%; min-height: 0; overflow: hidden; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-view-close { position: absolute; z-index: 5; top: 18px; right: 18px; display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--white); box-shadow: var(--shadow); font-size: 26px; }
.product-gallery { position: relative; display: grid; height: 100%; min-height: 0; align-self: stretch; gap: 12px; overflow: hidden; padding: 24px; background: var(--paper-deep); grid-template-rows: minmax(0, 1fr) auto; }
.gallery-stage-wrap { position: relative; width: 100%; height: 100%; min-height: 0; }
.product-view-stage { display: grid; width: 100%; height: 100%; min-height: 0; place-items: center; overflow: hidden; padding: 12px; border-radius: 18px; background: var(--white); }
.product-view-stage img { display: block; width: auto; max-width: 100%; height: auto; max-height: 100%; object-fit: contain; object-position: center; }
.gallery-arrow { position: absolute; top: 50%; display: grid; width: 48px; height: 48px; place-items: center; color: var(--ink); border: 1px solid var(--line); border-radius: 50%; background: var(--white); box-shadow: var(--shadow); cursor: pointer; font-size: 36px; line-height: 1; transform: translateY(-50%); transition: transform 150ms ease, background-color 150ms ease; }
.gallery-arrow:hover, .gallery-arrow:focus-visible { background: var(--paper); transform: translateY(-50%) scale(1.05); }
.gallery-arrow.previous { left: 14px; }.gallery-arrow.next { right: 14px; }
.gallery-thumbnails { display: flex; gap: 10px; min-width: 0; align-items: center; overflow-x: auto; padding: 2px 0 4px; scroll-snap-type: x proximity; }
.gallery-thumbnail { flex: 0 0 64px; width: 64px; aspect-ratio: 1 / 1; padding: 3px; overflow: hidden; border: 2px solid transparent; border-radius: 10px; background: var(--white); cursor: pointer; scroll-snap-align: start; }
.gallery-thumbnail.selected { border-color: var(--red); }.gallery-thumbnail img { width: 100%; height: 100%; object-fit: contain; }
.product-view-info { display: flex; height: 100%; min-height: 0; flex-direction: column; gap: 14px; overflow: hidden; padding: 32px; }
.product-view-info h2 { margin: 0; padding-right: 48px; font-family: var(--font-display); font-size: clamp(30px, 3vw, 42px); line-height: 1.05; }
.product-view-price { margin: 0; color: var(--red); font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.product-view-scroll { display: grid; min-height: 0; flex: 1 1 auto; align-content: start; gap: 14px; overflow-y: auto; padding-right: 8px; scroll-behavior: smooth; overscroll-behavior: contain; scrollbar-gutter: stable; }
.product-view-section { padding-top: 14px; border-top: 1px solid var(--line); }
.product-view-section h3 { margin: 0 0 9px; font-size: 14px; line-height: 1.3; }
.product-copy { color: var(--ink-soft); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.product-copy-paragraph { margin: 0; }
.product-copy-paragraph + .product-copy-paragraph { margin-top: 9px; }
.product-copy-list { display: grid; gap: 7px; margin: 0; padding-left: 20px; }
.product-copy-list + .product-copy-paragraph, .product-copy-paragraph + .product-copy-list { margin-top: 9px; }
.product-copy-list li::marker { color: var(--red); }
#product-view-add { width: 100%; min-height: 52px; flex: 0 0 auto; margin-top: 2px; padding: 12px 22px; border-radius: 16px; transition: transform 150ms ease, background-color 150ms ease, box-shadow 150ms ease; }
#product-view-add:active:not(:disabled) { transform: translateY(1px) scale(.995); }
@media (max-width: 760px) {
  .product-view-dialog { width: min(100% - 16px, 620px); height: min(600px, 85dvh); max-height: min(600px, 85dvh); overflow: hidden; }
  .product-view-shell { display: flex; height: 100%; min-height: 0; flex-direction: column; overflow: hidden; }
  .product-gallery { height: 42%; min-height: 0; flex: 0 0 42%; gap: 8px; overflow: hidden; padding: 10px; }
  .product-view-stage { height: 100%; min-height: 0; padding: 8px; }
  .gallery-arrow { width: 42px; height: 42px; font-size: 30px; }
  .gallery-arrow.previous { left: 10px; }
  .gallery-arrow.next { right: 10px; }
  .gallery-thumbnails { min-height: 50px; }
  .gallery-thumbnail { flex-basis: 50px; width: 50px; }
  .product-view-info { height: auto; min-height: 0; flex: 1 1 auto; gap: 9px; overflow: hidden; padding: 16px; }
  .product-view-info .product-category { font-size: 9px; }
  .product-view-info h2 { padding-right: 38px; font-size: 23px; line-height: 1.05; }
  .product-view-price { font-size: 22px; }
  .product-view-scroll { gap: 10px; padding-right: 6px; scrollbar-gutter: auto; }
  .product-view-section { padding-top: 10px; }
  .product-view-section h3 { margin-bottom: 6px; font-size: 12px; }
  .product-copy { font-size: 13px; line-height: 1.52; }
  .product-copy-list { gap: 5px; padding-left: 18px; }
  #product-view-add { min-height: 50px; }
}
.checkbox-label { display: flex !important; flex-direction: row; align-items: center; padding-top: 26px; }
.checkbox-label input { width: 18px; height: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.narrow-dialog { width: min(520px, calc(100% - 28px)); }
.password-dialog-form { gap: 14px; }

@media (max-width: 1100px) {
  .top-nav { display: none; }
  .header-actions { gap: 7px; }
  .phone-link, .telegram-link { padding: 0 10px; }
  .hero { min-height: auto; grid-template-columns: 1fr 380px; padding-top: 55px; }
  .hero-art { min-height: 440px; }
  .fan { width: 180px; height: 240px; }
  .fan-two { right: 20px; }
  .product-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
  .catalog-toolbar { grid-template-columns: 1fr; }
  .sort-field { justify-content: space-between; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .store-header, .admin-header { min-height: 68px; padding: 10px 16px; }
  .store-header { gap: 8px; flex-wrap: wrap; }
  .store-header .brand { max-width: 100%; letter-spacing: 0.06em; }
  .store-header .brand strong { font-size: 10px; }
  .header-actions { width: 100%; justify-content: flex-end; margin-left: 0; gap: 5px; }
  .header-actions .phone-link, .header-actions .telegram-link { min-height: 36px; padding: 0 9px; font-size: 10px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand small { display: none; }
  .hero { display: block; padding: 54px 22px 70px; }
  .hero h1 { font-size: clamp(52px, 16vw, 78px); }
  .hero-art { min-height: 390px; margin-top: 50px; }
  .hero-art .sun { width: 160px; height: 160px; top: 44px; right: 34px; }
  .fan { width: 160px; height: 220px; font-size: 60px; }
  .fan-one { left: 20px; }
  .fan-two { right: 16px; }
  .trust-strip { grid-template-columns: 1fr; }
  .trust-strip > div + div { border-top: 1px solid var(--line); border-left: 0; }
  .catalog-section { padding: 80px 18px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 18px; }
  .product-grid { grid-template-columns: 1fr; }
  .security-note { grid-template-columns: 1fr; margin: 0 18px 80px; padding: 34px 26px; }
  .security-seal { width: 78px; height: 78px; font-size: 38px; }
  .store-footer { display: block; padding: 28px 20px; }
  .footer-info { justify-items: start; margin-top: 18px; }
  .footer-info > p { text-align: left; }
  .footer-contacts { justify-content: start; }
  .auth-shell { display: block; }
  .auth-card { width: min(100%, 560px); min-height: 100dvh; padding: 38px 24px; }
  .auth-brand { margin-bottom: 56px; }
  .auth-aside { display: none; }
  .admin-session > span:not(.session-dot) { display: none; }
  .admin-shell { padding: 38px 14px 70px; }
  .admin-welcome { align-items: start; flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid article { min-height: 105px; }
  .admin-panel { padding: 18px 14px; }
  .panel-heading { align-items: start; flex-direction: column; }
  .admin-search { width: 100%; }
  .audit-record { grid-template-columns: 1fr; gap: 4px; }
  .security-panel { align-items: start; flex-direction: column; }
  .password-gate { grid-template-columns: 1fr; gap: 28px; padding: 28px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .checkbox-label { padding-top: 0; }
}

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