:root {
  --bg: #f6f1ea;
  --bg-2: #fffdf9;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e0d6;
  --brand: #c2410c;
  --brand-2: #9a3412;
  --accent: #0f766e;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --shadow: 0 10px 30px rgba(28, 25, 23, .08);
  --radius: 18px;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--brand-2); text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { width: min(1240px, calc(100% - 24px)); margin-inline: auto; }
.topbar, .appbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 241, 234, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.appbar-inner, .topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 64px;
}
.brand { font-weight: 700; font-size: 1.2rem; color: var(--ink); display: flex; gap: 8px; align-items: center; }
.brand small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.nav a, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; padding: .45rem .9rem; font-weight: 600; border: 0; cursor: pointer;
  font-family: inherit; font-size: .95rem;
}
.nav a { color: var(--ink); background: transparent; }
.nav a.active, .nav a:hover { background: #fff; }
.btn { background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.btn:hover { background: var(--brand-2); }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: none; }
.btn.ok { background: var(--accent); }
.btn.danger { background: var(--danger); }
.btn.warn { background: var(--warn); }
.btn.block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }

.hero {
  padding: 48px 0 28px;
}
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.25; margin: 0 0 12px; }
.hero p { color: var(--muted); font-size: 1.05rem; margin: 0 0 22px; }
.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin: 0 0 10px; font-size: 1.1rem; }
.muted { color: var(--muted); }
.stat { font-size: 1.8rem; font-weight: 800; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: right; padding: .7rem .4rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; }
.badge {
  display: inline-block; border-radius: 999px; padding: .15rem .6rem; font-size: .8rem; font-weight: 700;
}
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #ffedd5; color: #9a3412; }
.badge.off { background: #e7e5e4; color: #44403c; }

form .row { display: grid; gap: 12px; margin-bottom: 12px; }
form .row.two { grid-template-columns: 1fr 1fr; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: .7rem .8rem; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; font-family: inherit; font-size: 1rem;
}
textarea { min-height: 90px; resize: vertical; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.error { color: var(--danger); font-size: .9rem; }
.flash {
  padding: 12px 14px; border-radius: 12px; margin: 14px 0; background: #dcfce7; color: #166534;
}
.flash.err { background: #fee2e2; color: #991b1b; }

.login-card { width: min(420px, calc(100% - 24px)); margin: 48px auto; }

.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.item-card { overflow: hidden; padding: 0; }
.item-card img, .thumb {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #eee8de;
}
.item-card .pad { padding: 12px; }
.item-card .price { font-weight: 800; color: var(--brand-2); }
.item-card.unavailable { opacity: .55; }
.item-card.unavailable .thumb { filter: grayscale(.8); }

/* Portal — items grouped by category */
.portal-items { margin-top: 8px; margin-bottom: 24px; }
.portal-items__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
}
.portal-items__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #1e293b;
}
.portal-items__total {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .2rem .7rem;
  font-size: .78rem;
  font-weight: 800;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.portal-cat-section {
  margin-bottom: 22px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e7e0d6;
}
.portal-cat-section:last-child { border-bottom: 0; }
.portal-cat-section__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1ebe3;
}
.portal-cat-section__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e293b;
}
.portal-cat-section__count {
  flex-shrink: 0;
  font-size: .75rem;
  font-weight: 700;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: .15rem .65rem;
}
.portal-item-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.portal-item-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
  transition: box-shadow .15s ease, transform .15s ease;
  display: flex;
  flex-direction: column;
}
.portal-item-card:hover {
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}
.portal-item-card.unavailable { opacity: .72; }
.portal-item-card.unavailable .thumb,
.portal-item-card.unavailable .portal-item-card__placeholder { filter: grayscale(.7); }
.portal-item-card__media {
  position: relative;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
  background: #f1f5f9;
}
.portal-item-card__media .thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0;
}
.portal-item-card__placeholder {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: #f5f0e8;
}
.portal-avail-form {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  margin: 0;
}
.portal-avail-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  border-radius: 999px;
  padding: .28rem .7rem;
  font-size: .72rem;
  font-weight: 800;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .22);
  transition: background .15s ease, transform .12s ease;
}
.portal-avail-btn:hover { transform: translateY(-1px); }
.portal-avail-btn:disabled { opacity: .7; cursor: wait; }
.portal-avail-btn.is-on { background: #10b981; }
.portal-avail-btn.is-on:hover { background: #059669; }
.portal-avail-btn.is-off { background: #ef4444; }
.portal-avail-btn.is-off:hover { background: #dc2626; }
.portal-item-card__body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.portal-item-card__name {
  font-size: .9rem;
  line-height: 1.35;
  color: #1e293b;
}
.portal-item-card__offer {
  display: inline-block;
  align-self: flex-start;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  font-size: .68rem;
  padding: 2px 8px;
  font-weight: 800;
}
.portal-item-card__price { margin: 2px 0 4px; font-size: .9rem; }
.portal-item-card__was {
  text-decoration: line-through;
  color: #a8a29e;
  font-size: .78rem;
  margin-left: 4px;
}
.portal-item-card__now { color: #dc2626; font-weight: 800; }
.portal-item-card__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}
.portal-item-card__actions form { margin: 0; }
.portal-item-card__edit {
  flex: 1;
  font-size: .78rem !important;
  padding: 5px 8px !important;
  text-align: center;
}
.portal-item-card__delete {
  font-size: .78rem !important;
  padding: 5px 8px !important;
}

.menu-head {
  margin-top: 16px;
  padding: 20px 16px 16px;
  background: linear-gradient(180deg, #fffdf9, #f8f2ea);
  text-align: center;
}
.menu-head__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.menu-head__logo-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}
.menu-head__logo {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 6px 18px rgba(28, 25, 23, .16);
  display: block;
  margin: 0 auto;
  flex-shrink: 0;
}
.menu-head__copy {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}
.menu-head__title {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.35;
  font-weight: 800;
}
.menu-head__meta {
  margin: 0;
  font-size: .86rem;
  line-height: 1.45;
}
.menu-head__note {
  margin: 0;
  font-size: .8rem;
  line-height: 1.45;
}
.menu-head__contacts,
.menu-head__socials,
.menu-head__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 4px 0 0;
}
.menu-head__map {
  margin-top: 2px;
  display: flex;
  justify-content: center;
  width: 100%;
}
.menu-head__stats {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #efe7dc;
}

/* Public menu — continuous offers marquee */
.offers-marquee {
  margin: 14px 0;
  padding: 12px 0 14px;
  background: linear-gradient(180deg, #fff8f0, #fff);
  overflow: hidden;
}
.offers-marquee__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 12px 10px;
}
.offers-marquee__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}
.offers-marquee__count { font-size: .78rem; }
.offers-marquee__viewport {
  overflow: hidden;
  width: 100%;
  cursor: grab;
  touch-action: pan-y;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  user-select: none;
  -webkit-user-select: none;
}
.offers-marquee__viewport.is-dragging {
  cursor: grabbing;
}
.offers-marquee__track {
  display: flex;
  gap: 12px;
  width: max-content;
  padding-inline: 12px;
  will-change: transform;
  animation: none;
}
.offer-box {
  flex: 0 0 148px;
  border: none;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  padding: 0;
  cursor: grab;
  text-align: right;
  font-family: inherit;
  color: inherit;
  pointer-events: auto;
}
.offer-box__media {
  position: relative;
  pointer-events: none;
}
.offer-box__media img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.offer-box__placeholder {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f0e8;
  font-size: 2rem;
}
.offer-box__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  font-size: .68rem;
  padding: 3px 8px;
  font-weight: 800;
}
.offer-box__body {
  padding: 8px 9px 10px;
  pointer-events: none;
}
.offer-box__name {
  display: block;
  font-size: .82rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.offer-box__prices {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
}
.offer-box__was {
  text-decoration: line-through;
  color: #a8a29e;
  font-size: .72rem;
  font-weight: 600;
}
.offer-box__now {
  color: #dc2626;
  font-size: .88rem;
  font-weight: 800;
}
@media (prefers-reduced-motion: reduce) {
  .offers-marquee__viewport {
    overflow-x: auto;
    cursor: default;
    -webkit-overflow-scrolling: touch;
  }
  .offers-marquee__track {
    max-width: none;
  }
}

@media (min-width: 768px) {
  .menu-head {
    padding: 26px 28px 20px;
  }
  .menu-head__logo {
    width: 148px;
    height: 148px;
  }
  .menu-head__title {
    font-size: 1.85rem;
  }
  .menu-head__meta {
    font-size: .92rem;
  }
}

@media (max-width: 520px) {
  .menu-head__logo {
    width: 136px;
    height: 136px;
  }
  .menu-head__title {
    font-size: 1.28rem;
  }
}

/* Public menu — sticky search + category chips (CSS only, no jump) */
.menu-toolbar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  margin: 0 0 14px;
  padding: 10px 0 12px;
  background: var(--bg);
  border-bottom: 1px solid rgba(28, 25, 23, .08);
  box-shadow: 0 4px 14px rgba(28, 25, 23, .06);
  box-sizing: border-box;
  width: 100%;
}
.menu-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(28, 25, 23, .04);
}
.menu-search__icon {
  flex: 0 0 auto;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--muted);
  opacity: .85;
}
.menu-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
}
.menu-search input::placeholder { color: #a8a29e; font-weight: 500; }
.menu-search__clear {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #f0ebe4;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.menu-search-empty {
  text-align: center;
  padding: 28px 16px;
  margin: 0 0 14px;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 700;
}
.chips-wrap {
  position: relative;
  margin: 0 -2px;
}
.chips-wrap::before,
.chips-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  z-index: 2;
  pointer-events: none;
}
.chips-wrap::before {
  right: 0;
  background: linear-gradient(270deg, rgba(246,241,234,.98), transparent);
}
.chips-wrap::after {
  left: 0;
  background: linear-gradient(90deg, rgba(246,241,234,.98), transparent);
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 10px 6px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  position: relative;
  touch-action: pan-x;
}
.chips::-webkit-scrollbar { display: none; height: 0; }
.chips.is-dragging { cursor: grabbing; scroll-behavior: auto; }
.chips.is-dragging .chip { pointer-events: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid rgba(28, 25, 23, .12);
  background: #fff;
  border-radius: 999px;
  padding: .48rem 1rem;
  font-weight: 700;
  font-size: .9rem;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(28, 25, 23, .04);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.chip:hover { border-color: rgba(194, 65, 12, .35); }
.chip.active {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
  box-shadow: none;
}
#menu-chips .chip-light {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(194,65,12,.28), rgba(251,146,60,.55), rgba(194,65,12,.28));
  box-shadow: 0 0 18px rgba(251,146,60,.55);
  pointer-events: none;
  opacity: 0;
  transition: left .35s cubic-bezier(.2,.8,.2,1), top .35s ease, width .35s ease, opacity .2s ease;
  z-index: 0;
}
#menu-chips .chip { position: relative; z-index: 1; }
.sizes { display: flex; flex-direction: column; gap: 6px; font-size: .92rem; margin-top: 8px; }
.size-row { display: flex; justify-content: space-between; gap: 8px; background: #f6f1ea; border-radius: 10px; padding: 6px 8px; }
.soldout { display: inline-block; margin-top: 6px; font-size: .8rem; color: var(--danger); font-weight: 700; }

.unavailable-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.unavailable-page .card { max-width: 460px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inline { display: inline; }
footer { padding: 28px 0; color: var(--muted); font-size: .85rem; text-align: center; }

/* Portal — categories card */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.categories-card {
  margin-bottom: 16px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(28, 25, 23, .06);
  background: #fffdf9;
}
.categories-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.categories-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.01em;
}
.categories-card__count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .2rem .7rem;
  font-size: .78rem;
  font-weight: 800;
  background: #f5f0e8;
  color: #57534e;
  border: 1px solid #ebe4d8;
}
.categories-card__composer {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(28, 25, 23, .05);
}
.categories-card__composer input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: .75rem .9rem;
}
.categories-card__composer input:focus {
  outline: none;
  background: #fffaf5;
}
.categories-card__composer:focus-within {
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(194, 65, 12, .15);
}
.categories-card__add {
  flex: 0 0 auto;
  white-space: nowrap;
  border-radius: 0;
  box-shadow: none;
  padding-inline: 1.1rem;
}
.categories-card__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  max-height: 180px;
  overflow-y: auto;
  padding: 2px;
  -webkit-overflow-scrolling: touch;
}
.category-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border-radius: 999px;
  padding: .42rem .9rem;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.2;
  font-family: inherit;
  color: #44403c;
  background: linear-gradient(180deg, #fff, #f8f4ee);
  border: 1px solid #e8e0d4;
  box-shadow: 0 1px 2px rgba(28, 25, 23, .04);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease, color .15s ease;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.category-pill:hover {
  border-color: #d6cbb8;
  box-shadow: 0 2px 8px rgba(28, 25, 23, .08);
  transform: translateY(-1px);
}
.category-pill.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  box-shadow: 0 4px 12px rgba(28, 25, 23, .18);
}
.categories-card__empty {
  margin: 0;
  padding: 14px 12px;
  text-align: center;
  font-size: .88rem;
  background: #faf7f2;
  border: 1px dashed #e7e0d6;
  border-radius: 12px;
}

/* Portal — floating ads card */
.ads-card {
  margin-bottom: 16px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(28, 25, 23, .06);
  background: #fffdf9;
}
.ads-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.ads-card__intro { min-width: 0; flex: 1; }
.ads-card__title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
}
.ads-card__subtitle {
  margin: 0;
  font-size: .82rem;
  line-height: 1.45;
}
.ads-card__count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .25rem .75rem;
  font-size: .75rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.ads-card__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.ad-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e7e0d6;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(28, 25, 23, .04);
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.ad-row:hover {
  border-color: #d6cbb8;
  box-shadow: 0 4px 14px rgba(28, 25, 23, .08);
}
.ad-row.is-off { opacity: .78; background: #fafafa; }
.ad-row__media {
  position: relative;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-row__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}
.ad-row__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #94a3b8;
  background: #f1f5f9;
}
.ad-row__media:not(.is-fallback) .ad-row__fallback { opacity: 0; }
.ad-row__media.is-fallback .ad-row__fallback,
.ad-row__media:not(:has(img)) .ad-row__fallback { opacity: 1; }
.ad-row__body {
  flex: 1 1 auto;
  min-width: 0;
}
.ad-row__title {
  display: block;
  font-size: .92rem;
  line-height: 1.35;
  margin: 0 0 2px;
}
.ad-row__text {
  margin: 0 0 6px;
  font-size: .8rem;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ad-row__status {
  display: inline-flex;
  border-radius: 999px;
  padding: .1rem .55rem;
  font-size: .7rem;
  font-weight: 800;
}
.ad-row__status.ok { background: #dcfce7; color: #166534; }
.ad-row__status.off { background: #e7e5e4; color: #57534e; }
.ad-row__actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ad-row__actions form { margin: 0; }
.ad-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 10px;
  padding: .4rem .7rem;
  font-size: .78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.ad-action--toggle {
  background: #fff;
  color: #57534e;
  border-color: #e7e0d6;
}
.ad-action--toggle:hover { background: #f8fafc; border-color: #cbd5e1; }
.ad-action--danger {
  background: #fff;
  color: #dc2626;
  border-color: #fecaca;
}
.ad-action--danger:hover { background: #fef2f2; }
.ads-card__empty {
  margin: 0 0 12px;
  padding: 14px 12px;
  text-align: center;
  font-size: .88rem;
  background: #faf7f2;
  border: 1px dashed #e7e0d6;
  border-radius: 12px;
}
.ads-card__add {
  margin-top: 4px;
  border: 1px dashed #d6cbb8;
  border-radius: 12px;
  background: #fffaf3;
  padding: 0;
}
.ads-card__add summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  color: var(--accent);
  font-weight: 800;
  font-size: .9rem;
  text-align: center;
}
.ads-card__add summary::-webkit-details-marker { display: none; }
.ads-card__add[open] {
  border-style: solid;
  background: #fff;
}
.ads-card__form { padding: 0 14px 14px; }
.ads-card__limit {
  margin: 8px 0 0;
  font-size: .82rem;
  text-align: center;
}

#size-fields[hidden], #single-price[hidden] { display: none !important; }
.size-editor { display: grid; gap: 8px; }
.size-editor .size-line { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 8px; align-items: center; }

@media (max-width: 720px) {
  .categories-card { padding: 16px; }
  .categories-card__composer {
    flex-direction: column;
    border-radius: 14px;
  }
  .categories-card__composer input {
    border-bottom: 1px solid var(--line);
  }
  .categories-card__add {
    width: 100%;
    border-radius: 0 0 13px 13px;
    padding: .8rem 1rem;
  }
  .categories-card__pills { max-height: 200px; gap: 7px; }
  .ads-card { padding: 16px; }
  .ad-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
  }
  .ad-row__actions {
    width: 100%;
    justify-content: stretch;
  }
  .ad-row__actions form { flex: 1; }
  .ad-action { width: 100%; }
  .portal-item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  form .row.two { grid-template-columns: 1fr; }
  .size-editor .size-line { grid-template-columns: 1fr; }
  .appbar-inner { flex-wrap: wrap; padding-bottom: 10px; }
  .wrap { width: min(100%, calc(100% - 16px)); }
  .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 14px; border-radius: 14px; }
  .chips { padding-top: 2px; }
}

@media (max-width: 520px) {
  .item-grid { grid-template-columns: 1fr; }
  .portal-item-grid { grid-template-columns: 1fr; }
}
