:root {
  --bg: #100d0b;
  --bg-2: #1a1511;
  --panel: rgba(34, 27, 22, 0.86);
  --panel-solid: #221b16;
  --line: rgba(255, 214, 170, 0.14);
  --line-strong: rgba(255, 214, 170, 0.28);
  --text: #f7efe6;
  --muted: #c3b2a0;
  --accent: #ef8b3b;
  --accent-2: #f6c48d;
  --accent-deep: #c45d18;
  --danger: #ef6b61;
  --ok: #8dcc7c;
  --chip: rgba(255, 255, 255, 0.04);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  --radius: 22px;
  --chart-feeds: #f6c48d;
  --chart-views: #ef8b3b;
  --chart-likes: #ef7a8d;
  --chart-comments: #7eb8e8;
  --chart-visible: #8dcc7c;
  --chart-hidden: #c3b2a0;
  --chart-video: #ef8b3b;
  --chart-photo: #f6c48d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font: 15px/1.5 "Avenir Next", "SF Pro Display", "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(239, 139, 59, 0.28), transparent 58%),
    radial-gradient(700px 380px at 100% 0%, rgba(246, 196, 141, 0.12), transparent 48%),
    linear-gradient(180deg, #16110e 0%, var(--bg) 40%, #0c0a08 100%);
}

body {
  padding: 28px 20px 80px;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr);
  gap: 18px 28px;
  align-items: center;
  margin-top: 36px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(520px 160px at 0% 0%, rgba(239, 139, 59, 0.16), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.16)),
    var(--panel-solid);
  box-shadow: var(--shadow);
}

.footer-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.footer-mark {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 14px;
  font-size: 18px;
}

.footer-kicker {
  margin: 0 0 3px;
  color: var(--accent-2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
}

.footer-product {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.footer-tagline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.footer-legal {
  display: grid;
  gap: 4px;
  justify-items: end;
  text-align: right;
}

.footer-owner,
.footer-copy {
  margin: 0;
}

.footer-owner {
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 650;
}

.footer-copy {
  color: var(--muted);
  font-size: 12px;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px 24px 96px;
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(239, 139, 59, 0.28), transparent 58%),
    radial-gradient(700px 380px at 100% 0%, rgba(246, 196, 141, 0.12), transparent 48%),
    linear-gradient(180deg, #16110e 0%, var(--bg) 40%, #0c0a08 100%);
}

.login-legal {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 22px;
  display: grid;
  gap: 4px;
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.login-legal span:first-child {
  color: var(--accent-2);
  font-weight: 650;
}

.login-card {
  width: min(420px, 100%);
}

.login-card h1 {
  margin: 4px 0 8px;
  font-size: 26px;
}

.login-gate.is-loading .login-card {
  display: none;
}

.auth-loading {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.auth-spinner {
  width: 46px;
  height: 46px;
  border: 3px solid rgba(246, 196, 141, 0.18);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  border-radius: 50%;
  animation: auth-spin 0.75s linear infinite;
}

.auth-loading .hint {
  margin: 0;
  text-align: center;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-email {
  margin: 0;
  max-width: 220px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tab-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 650;
}

.tab-btn.active {
  color: #1a120b;
  background: linear-gradient(180deg, #f3a25a, var(--accent));
  border-color: transparent;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--accent-2), var(--accent) 55%, var(--accent-deep));
  color: #1a120b;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(239, 139, 59, 0.28);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent-2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

/* Desktop: 2 cột bằng nhau — không dùng flex + width:0 (gây co cột list). */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  width: 100%;
}

.layout.layout--list-only {
  grid-template-columns: minmax(0, 1fr);
}

.layout.layout--list-only .form-column {
  display: none;
}

.layout.layout--list-only .form-column:has(#feedFormDenied:not(.hidden)) {
  display: grid;
}

.form-column,
.list-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.form-column {
  display: grid;
  gap: 12px;
  align-content: start;
}

.form-column > .panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.scope-banner {
  grid-column: 1 / -1;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(239, 139, 59, 0.28);
  border-radius: 14px;
  background: rgba(239, 139, 59, 0.1);
  color: var(--accent-2);
}

.list-panel {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 12px;
  max-height: calc(100dvh - 32px);
  min-height: 0;
  overflow: hidden;
}

.list-panel > .row-between,
.list-panel > .hint,
.list-panel > .banner,
.list-panel > .search-field,
.list-panel > .feed-filters,
.list-panel > .feed-toolbar,
.list-panel > #listLoading,
.list-panel > #listEmpty,
.list-panel > #listError {
  flex-shrink: 0;
}

.search-field {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
}

.store-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(160px, 0.8fr);
  gap: 10px;
  align-items: end;
  margin: 10px 0 0;
}

.store-toolbar .search-field,
.store-toolbar label {
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.store-toolbar .field-label {
  margin-bottom: 0;
  font-size: 11px;
}

.store-toolbar select,
.store-toolbar input {
  padding: 8px 10px;
  border-radius: 12px;
}

.store-group {
  display: flex;
  align-items: baseline;
  padding: 8px 4px 0;
  border: 0;
  background: none;
  cursor: default;
}

.store-group h3 {
  margin: 0;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 750;
}

.list-panel .search-field .field-label,
.list-panel .feed-filters .field-label {
  margin-bottom: 0;
  font-size: 11px;
}

.list-panel .search-field input,
.list-panel .feed-filters select {
  padding: 8px 10px;
  border-radius: 12px;
}

.list-panel .feed-filters select {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.list-panel > .row-between {
  margin-bottom: 2px;
}

.list-panel .panel-head,
.list-panel > .row-between + .search-field {
  margin-top: 12px;
}

.feed-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 0;
}

.feed-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  flex-wrap: nowrap;
  margin: 10px 0 0;
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
}

.check-label:hover,
.feed-check:hover input[type="checkbox"] {
  border-color: rgba(239, 139, 59, 0.55);
}

.check-label:has(input[type="checkbox"]:checked) {
  border-color: rgba(239, 139, 59, 0.55);
  background: rgba(239, 139, 59, 0.14);
  color: var(--accent-2);
}

.feed-check {
  display: grid;
  place-items: center;
  align-self: start;
  margin: 0;
  cursor: pointer;
}

.check-label input[type="checkbox"],
.feed-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  flex: 0 0 20px;
  border: 1.5px solid rgba(246, 196, 141, 0.38);
  border-radius: 7px;
  background: rgba(10, 8, 7, 0.72);
  box-shadow: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.check-label input[type="checkbox"]:checked,
.feed-check input[type="checkbox"]:checked,
.check-label input[type="checkbox"]:indeterminate {
  background: linear-gradient(180deg, #f3a25a, var(--accent));
  border-color: transparent;
}

.check-label input[type="checkbox"]:checked::after,
.feed-check input[type="checkbox"]:checked::after {
  content: "";
  width: 5px;
  height: 9px;
  margin-top: -1px;
  border: solid #1a120b;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.check-label input[type="checkbox"]:indeterminate::after {
  content: "";
  width: 8px;
  height: 2px;
  border: 0;
  border-radius: 1px;
  background: #1a120b;
  transform: none;
}

.check-label input[type="checkbox"]:focus-visible,
.feed-check input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(239, 139, 59, 0.28);
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.bulk-actions .hint {
  margin: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}

.bulk-actions .ghost,
.bulk-actions .danger {
  flex: 0 0 auto;
  white-space: nowrap;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel-head {
  margin-bottom: 18px;
}

.panel-head .hint,
.list-panel .hint {
  margin: 6px 0 0;
}

.row-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(239, 139, 59, 0.16);
  border: 1px solid rgba(239, 139, 59, 0.35);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
}

.current-media {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.current-media img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
  background: #000;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  pointer-events: auto;
  cursor: default;
}

.item-actions .edit,
.item-actions .danger,
.item-actions .ghost {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.feed-item .item-actions,
.store-card .item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.feed-item .item-actions .edit,
.feed-item .item-actions .danger,
.feed-item .item-actions .ghost,
.store-card .item-actions .edit,
.store-card .item-actions .danger,
.store-card .item-actions .ghost {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  padding: 6px 10px;
}

.edit {
  background: transparent;
  color: var(--accent-2);
  border: 1px solid rgba(246, 196, 141, 0.35);
}

.feed-item.is-editing {
  border-color: rgba(239, 139, 59, 0.55);
  box-shadow: 0 0 0 1px rgba(239, 139, 59, 0.2);
}

.settings-panel {
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}

.is-perm-hidden {
  display: none !important;
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin: 8px 0 14px;
}

.perm-check {
  width: 100%;
  justify-content: flex-start;
}

.create-user-box {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.create-user-box h3 {
  margin: 0;
  font-size: 15px;
}

.admin-row .perm-grid {
  grid-column: 1 / -1;
}

.users-table-wrap {
  margin-top: 8px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th,
.users-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}

.users-table th {
  color: var(--muted);
  font-weight: 650;
  white-space: nowrap;
}

.users-table tr.is-locked td {
  opacity: 0.72;
}

.users-col-email {
  font-weight: 600;
  word-break: break-word;
}

.users-col-note {
  max-width: 240px;
  color: var(--muted);
  word-break: break-word;
}

.users-col-note.is-empty {
  font-style: italic;
  opacity: 0.7;
}

.users-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}

.users-action {
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.status-pill.is-on {
  background: rgba(64, 180, 120, 0.16);
  color: #7dffb5;
}

.status-pill.is-off {
  background: rgba(220, 80, 80, 0.16);
  color: #ff9a9a;
}

.user-detail-card {
  width: min(640px, 100%);
  max-width: min(640px, 94vw);
  max-height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.user-detail-card .modal-head {
  flex: 0 0 auto;
  margin: 0;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.user-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px 18px 8px;
  display: grid;
  gap: 4px;
  align-content: start;
}

.user-detail-body > label {
  margin-bottom: 10px;
}

.user-detail-footer {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  background: rgba(10, 8, 7, 0.92);
}

.user-detail-card .perm-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 6px 0 4px;
  max-height: none;
  overflow: visible;
}

.user-detail-card .perm-check {
  margin: 0;
  min-width: 0;
}

.user-detail-card .area-scope-picker {
  margin-bottom: 10px;
}

.user-detail-card .area-scope-search {
  max-width: none;
}

.user-detail-card .area-scope-results {
  max-height: 120px;
}

@media (max-width: 560px) {
  .user-detail-card .perm-grid {
    grid-template-columns: 1fr;
  }

  .user-detail-footer {
    flex-wrap: wrap;
  }

  .user-detail-footer .primary,
  .user-detail-footer .ghost {
    flex: 1 1 auto;
  }
}

@media (max-width: 720px) {
  .users-table th:nth-child(2),
  .users-table td:nth-child(2),
  .users-table th:nth-child(6),
  .users-table td:nth-child(6) {
    display: none;
  }

  .users-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .users-action {
    width: 100%;
  }
}

.audit-box {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.audit-box h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.audit-list {
  margin-top: 10px;
}

.audit-row {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "main";
}

.area-scope-picker {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
}

.area-scope-search {
  margin: 4px 0;
  max-width: 420px;
}

.area-scope-search.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.area-scope-selected,
.area-scope-results {
  margin: 0;
  max-height: 180px;
  overflow: auto;
}

.area-scope-results:empty,
.area-scope-selected:empty {
  display: none;
}

.area-scope-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.area-scope-actions.is-empty {
  display: none;
}

.area-scope-actions .ghost {
  padding: 6px 12px;
  font-size: 12px;
}

.area-scope-results .chip-item.is-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.area-scope-results .chip-item input {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.area-scope-bulk-row {
  list-style: none;
  width: 100%;
  margin-top: 4px;
}

.area-scope-bulk-row .ghost {
  padding: 6px 12px;
  font-size: 12px;
}


label,
fieldset {
  display: block;
  margin: 0 0 16px;
}

.field-label,
legend {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
  color: var(--text);
}

input,
select,
textarea {
  width: 100%;
  background: rgba(10, 8, 7, 0.72);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
}

.password-toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.password-toggle.is-visible {
  color: var(--accent);
}

.password-toggle.is-visible::before {
  box-shadow: inset 0 0 0 1px currentColor;
}

.password-toggle.is-visible::after {
  width: 18px;
  height: 2px;
  border-radius: 1px;
  transform: translate(-50%, -50%) rotate(-28deg);
}

.password-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  padding: 0;
  margin: 0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(239, 139, 59, 0.18);
}

textarea {
  resize: vertical;
  min-height: 72px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.type-row {
  border: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 12px 12px;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.chip:hover {
  border-color: var(--line-strong);
}

.chip:has(input:checked) {
  background: linear-gradient(180deg, rgba(239, 139, 59, 0.22), rgba(239, 139, 59, 0.08));
  border-color: rgba(239, 139, 59, 0.55);
}

.chip span {
  color: var(--text);
  font-weight: 650;
}

.chip input {
  width: auto;
  accent-color: var(--accent);
}

.stack {
  display: grid;
  gap: 4px;
}

.file-field {
  display: grid;
  gap: 4px;
}

.file-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.file-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-cta {
  color: var(--accent-2);
  font-weight: 700;
  font-size: 13px;
}

.file-name {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
}

.file-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.file-preview.hidden {
  display: none;
}

.file-preview.is-single,
.file-preview.is-video,
.file-preview.is-audio {
  grid-template-columns: minmax(160px, 280px);
}

.file-preview-item {
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
}

.file-preview-item img,
.file-preview-item video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #111;
}

.file-preview.is-video .file-preview-item video {
  aspect-ratio: 16 / 9;
  max-height: 240px;
}

.file-preview-item audio {
  display: block;
  width: calc(100% - 16px);
  margin: 12px 8px 4px;
}

.file-preview-item figcaption,
.file-preview-status {
  margin: 0;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-status {
  padding-bottom: 0;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.row-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.row-between > div {
  min-width: 0;
  flex: 1 1 auto;
}

.row-between > button {
  flex: 0 0 auto;
  white-space: nowrap;
  align-self: center;
}

.primary,
.ghost,
.danger,
.edit {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.14s ease, background 0.14s ease;
}

.primary:hover,
.ghost:hover,
.danger:hover,
.edit:hover {
  transform: translateY(-1px);
}

.feed-item:hover:not(.is-dragging):not(.is-placeholder) {
  transform: translateY(-1px);
}

.primary {
  background: linear-gradient(180deg, #f3a25a, var(--accent) 48%, var(--accent-deep));
  color: #1a120b;
  font-weight: 750;
  box-shadow: 0 10px 22px rgba(239, 139, 59, 0.28);
}

.primary:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
}

.hint,
.field-error {
  color: var(--muted);
  font-size: 12px;
}

.field-error {
  display: none;
  margin: 0;
  color: var(--danger);
  line-height: 1.35;
}

.field-error:not(:empty),
.field-error.is-visible {
  display: block;
  margin-top: 6px;
}

input.is-invalid,
textarea.is-invalid,
select.is-invalid,
.store-combobox.has-error #feedStoreSearch {
  border-color: rgba(239, 107, 97, 0.55);
  box-shadow: 0 0 0 1px rgba(239, 107, 97, 0.18);
}

.banner {
  border-radius: 14px;
  padding: 11px 14px;
  margin: 0 0 16px;
}

.banner.error {
  background: rgba(239, 107, 97, 0.12);
  color: #ffc7c1;
  border: 1px solid rgba(239, 107, 97, 0.28);
}

.banner.ok {
  background: rgba(141, 204, 124, 0.12);
  color: #d4f0cb;
  border: 1px solid rgba(141, 204, 124, 0.28);
}

.snack {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  min-width: min(320px, calc(100% - 32px));
  max-width: 420px;
  margin: 0;
  padding: 12px 16px;
  border-radius: 14px;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  font-size: 14px;
  font-weight: 650;
  background: #2a3a28;
  color: #d4f0cb;
  border: 1px solid rgba(141, 204, 124, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.snack.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.snack.is-error {
  background: #3a2422;
  color: #ffc7c1;
  border-color: rgba(239, 107, 97, 0.35);
}

.progress {
  margin: 8px 0 16px;
}

.progress-bar {
  height: 8px;
  border-radius: 99px;
  background: #2c241c;
  overflow: hidden;
  position: relative;
}

.progress-bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p, 0%);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.feed-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  align-content: start;
  grid-auto-rows: min-content;
}

.list-panel .feed-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 6px 8px 0;
  margin-top: 12px;
  scrollbar-gutter: stable;
}

.feed-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  grid-template-areas:
    "thumb main"
    "actions actions";
  gap: 10px 12px;
  align-items: start;
  align-content: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: max-content;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  cursor: grab;
  text-align: left;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}

.feed-item.has-check {
  grid-template-columns: 22px 72px minmax(0, 1fr);
  grid-template-areas:
    "check thumb main"
    ". actions actions";
}

.feed-item.is-selected {
  border-color: rgba(239, 139, 59, 0.42);
  background: rgba(239, 139, 59, 0.06);
}

.feed-check {
  grid-area: check;
  display: grid;
  place-items: center;
  align-self: start;
  padding-top: 28px;
  margin: 0;
}

.feed-item .thumb {
  grid-area: thumb;
}

.item-main {
  grid-area: main;
  min-width: 0;
}

.feed-item .item-actions {
  grid-area: actions;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.feed-item.is-hidden {
  opacity: 0.78;
}

.feed-item .item-actions .is-busy {
  opacity: 0.65;
}

.store-card .item-actions .is-busy {
  opacity: 0.65;
  cursor: wait;
}

.visibility-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(195, 178, 160, 0.18);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
  -webkit-user-drag: none;
  user-select: none;
}

.feed-item .thumb,
.feed-item .thumb img {
  pointer-events: none;
}

.feed-item.is-dragging {
  opacity: 1;
  cursor: grabbing;
  border-color: var(--accent);
  background: var(--panel-solid);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.55);
  transform: scale(1.03);
  z-index: 200;
}

.feed-item.is-placeholder {
  border-style: dashed;
  background: rgba(239, 139, 59, 0.12);
  box-shadow: none;
  min-height: 118px;
  padding: 0;
  pointer-events: none;
}

body.is-reordering,
body.is-reordering * {
  cursor: grabbing !important;
  user-select: none;
}

.confirm-card {
  width: min(480px, 100%);
}

.confirm-items {
  margin: 0 0 16px;
  padding: 10px 12px 10px 28px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.confirm-items li + li {
  margin-top: 6px;
}

.confirm-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.confirm-card #confirmMessage {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.confirm-card .actions {
  margin-top: 8px;
}

#confirmOk.is-danger {
  background: linear-gradient(180deg, #f08a82, #d4544c);
  color: #fff;
  box-shadow: 0 10px 22px rgba(212, 84, 76, 0.28);
}

.feed-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

.thumb img,
.thumb .thumb-empty {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.play-badge {
  position: absolute;
  inset: auto 8px 8px auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
}

.play-badge::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent #fff;
}

.priority-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(239, 139, 59, 0.92);
  color: #1a120b;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.feed-item p {
  margin: 0;
}

.feed-item .title {
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-item .meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.engagement {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.count-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.count-chip .icon-heart {
  width: 9px;
  height: 9px;
  margin: 3px 0 3px 5px;
  background: var(--accent-2);
}

.count-chip .icon-heart::before,
.count-chip .icon-heart::after {
  width: 9px;
  height: 9px;
  background: var(--accent-2);
}

.count-chip .icon-heart::before {
  left: -5px;
  top: 0;
}

.count-chip .icon-heart::after {
  left: 0;
  top: -5px;
}

.count-chip .icon-comment {
  width: 14px;
  height: 13px;
  border: 2px solid var(--muted);
  border-radius: 5px 5px 7px 2px;
}

.count-chip .icon-view {
  width: 14px;
  height: 9px;
  border-color: var(--muted);
}

.count-chip .icon-view::after {
  background: var(--muted);
}

.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(239, 107, 97, 0.35);
}

.ghost.is-hide {
  color: var(--muted);
  border-color: rgba(195, 178, 160, 0.42);
  background: rgba(195, 178, 160, 0.1);
}

.ghost.is-show {
  color: var(--ok);
  border-color: rgba(141, 204, 124, 0.42);
  background: rgba(141, 204, 124, 0.12);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 5, 0.72);
  border: 0;
  padding: 0;
  cursor: pointer;
}

.modal-card {
  position: relative;
  width: min(560px, 100%);
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  padding: 18px 18px 20px;
  box-shadow: var(--shadow);
}

.modal-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-head h2 {
  font-size: 18px;
}

.modal-head .meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.preview-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.phone-wrap {
  display: grid;
  place-items: center;
  min-width: 0;
  flex: 1;
}

.nav-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.42);
  cursor: pointer;
  position: relative;
}

.nav-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.nav-prev::before,
.nav-next::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
}

.nav-prev::before {
  transform: translate(-40%, -50%) rotate(-135deg);
}

.nav-next::before {
  transform: translate(-60%, -50%) rotate(45deg);
}

.preview-position {
  margin: 12px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.phone {
  position: relative;
  width: min(320px, 100%);
  aspect-ratio: 9 / 16;
  border-radius: 28px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.phone video,
.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.phone audio {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 54px;
  width: calc(100% - 20px);
}

.preview-stats {
  position: absolute;
  right: 10px;
  bottom: 78px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.preview-stat {
  margin: 0;
  padding: 0;
  min-width: 44px;
  border: 0;
  background: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
}

button.preview-stat {
  cursor: pointer;
}

.icon-heart,
.icon-comment,
.icon-view {
  display: block;
  width: 22px;
  height: 22px;
}

.icon-heart {
  position: relative;
  width: 14px;
  height: 14px;
  margin: 4px 0 6px;
  background: #fff;
  transform: rotate(45deg);
}

.icon-heart::before,
.icon-heart::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
}

.icon-heart::before {
  left: -7px;
  top: 0;
}

.icon-heart::after {
  left: 0;
  top: -7px;
}

.icon-comment {
  border: 2px solid #fff;
  border-radius: 6px 6px 8px 2px;
  box-sizing: border-box;
}

.icon-view {
  width: 16px;
  height: 10px;
  margin: 6px 0 4px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-sizing: border-box;
  position: relative;
}

.icon-view::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.photo-nav {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.photo-nav .ghost {
  padding: 7px 12px;
  background: rgba(0, 0, 0, 0.45);
}

#photoIndex {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.store-form {
  margin: 16px 0 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
}

.store-form h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.filter-field {
  max-width: 420px;
  margin-top: 12px;
}

.store-list,
.admin-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.store-card,
.admin-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-areas:
    "avatar main"
    "actions actions"
    "videos videos";
  gap: 10px 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.store-card .store-avatar,
.store-card .admin-avatar {
  grid-area: avatar;
}

.store-card .item-main {
  grid-area: main;
}

.store-card .item-actions {
  grid-area: actions;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.store-card {
  cursor: pointer;
  grid-template-areas:
    "avatar main"
    "actions actions"
    "videos videos";
}

.store-card .store-videos {
  grid-area: videos;
  margin-top: 2px;
  padding-top: 12px;
}

.store-card.is-active {
  border-color: rgba(239, 139, 59, 0.55);
}

.store-avatar,
.admin-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: #2a231c;
}

.store-videos {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.admin-row {
  grid-template-columns: 1fr auto;
  grid-template-areas: none;
  align-items: start;
}

.admin-row .title {
  font-weight: 700;
}

.admin-row .meta,
.store-card .meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  word-break: break-all;
}

.admin-row p,
.store-card p {
  margin: 0;
}

.admin-text {
  margin-top: 8px;
  white-space: pre-wrap;
}

.reply-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(246, 196, 141, 0.16);
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .form-column,
  .list-panel {
    width: 100%;
    max-width: 100%;
  }

  .feed-filters,
  .store-toolbar,
  .grid-2,
  .type-row,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .list-panel {
    position: static;
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
  }

  .list-panel .feed-list {
    flex: none;
    min-height: 0;
    max-height: min(70vh, 640px);
    overflow-y: auto;
  }

  .feed-toolbar {
    flex-wrap: wrap;
  }

  .feed-item.has-check {
    grid-template-columns: 22px 64px minmax(0, 1fr);
  }

  .feed-check {
    padding-top: 22px;
  }

  .thumb {
    width: 64px;
    height: 64px;
  }

  .preview-shell {
    gap: 8px;
  }

  .nav-icon {
    width: 40px;
    height: 40px;
  }

  .stats-grid,
  .stats-cards,
  .stats-charts,
  .chart-donuts,
  .attach-foot {
    grid-template-columns: 1fr;
  }

  .stats-chart-wide {
    grid-column: auto;
  }

  .h-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label value"
      "track track";
  }

  .h-bar-label { grid-area: label; }
  .h-bar-track { grid-area: track; }
  .h-bar-value { grid-area: value; }

  .chart-cols {
    min-height: 180px;
    gap: 10px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    padding: 18px 18px 16px;
  }

  .footer-legal {
    justify-items: start;
    text-align: left;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }
}

.stats-panel h2 {
  margin: 0;
}

.stats-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
  color: var(--muted);
}

.stats-status.is-empty {
  justify-content: center;
  min-height: 180px;
  padding: 28px 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

.stats-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(246, 196, 141, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: auth-spin 0.75s linear infinite;
  flex: 0 0 auto;
}

.stats-body {
  margin-top: 6px;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
    var(--chip);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.stat-icon {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex: 0 0 auto;
  color: var(--chart-views);
  background: rgba(239, 139, 59, 0.16);
  box-shadow: inset 0 0 0 1px rgba(239, 139, 59, 0.22);
}

.stat-icon::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 4px;
  background: currentColor;
}

.stat-icon.is-likes { color: var(--chart-likes); background: rgba(239, 122, 141, 0.16); box-shadow: inset 0 0 0 1px rgba(239, 122, 141, 0.28); }
.stat-icon.is-comments { color: var(--chart-comments); background: rgba(126, 184, 232, 0.16); box-shadow: inset 0 0 0 1px rgba(126, 184, 232, 0.28); }
.stat-icon.is-visible { color: var(--chart-visible); background: rgba(141, 204, 124, 0.16); box-shadow: inset 0 0 0 1px rgba(141, 204, 124, 0.28); }
.stat-icon.is-hidden { color: var(--chart-hidden); background: rgba(195, 178, 160, 0.14); box-shadow: inset 0 0 0 1px rgba(195, 178, 160, 0.28); }
.stat-icon.is-feeds { color: var(--chart-feeds); background: rgba(246, 196, 141, 0.16); box-shadow: inset 0 0 0 1px rgba(246, 196, 141, 0.28); }

.stat-copy {
  min-width: 0;
}

.stat-card .stat-value {
  display: block;
  font-size: 24px;
  font-weight: 780;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-card .stat-label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.stats-charts {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 14px;
  margin: 0 0 18px;
}

.stats-chart-card,
.stats-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
}

.stats-chart-wide {
  grid-column: 1 / -1;
}

.stats-chart-card h3,
.stats-block h3 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
}

.chart-empty {
  margin: 18px 0 8px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.chart-cols {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 18px;
  min-height: 210px;
  padding: 4px 6px 0;
}

.chart-cols.is-timeline {
  justify-content: flex-start;
  overflow-x: auto;
  gap: 12px;
}

.chart-col {
  display: grid;
  justify-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.chart-cols.is-timeline .chart-col {
  flex: 0 0 56px;
}

.chart-col-value {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-2);
}

.chart-col-track {
  width: 42px;
  height: 160px;
  display: flex;
  align-items: flex-end;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.chart-cols.is-timeline .chart-col-track {
  width: 28px;
  height: 140px;
}

.chart-col-fill {
  width: 100%;
  border-radius: 14px 14px 8px 8px;
  background: linear-gradient(180deg, var(--accent-2), var(--chart-views));
  transform-origin: bottom;
  animation: chart-rise 0.55s ease;
}

.chart-col.is-likes .chart-col-fill {
  background: linear-gradient(180deg, #ffb3bf, var(--chart-likes));
}

.chart-col.is-comments .chart-col-fill {
  background: linear-gradient(180deg, #b7d9f5, var(--chart-comments));
}

.chart-col.is-feeds .chart-col-fill {
  background: linear-gradient(180deg, #ffe1b8, var(--chart-feeds));
}

.chart-col-label {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  line-height: 1.3;
}

.chart-donuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.donut-block {
  min-width: 0;
}

.donut-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.donut-figure {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 0 auto 12px;
}

.donut-svg {
  width: 100%;
  height: 100%;
}

.donut-track {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 14;
}

.donut-slice {
  stroke-width: 14;
  stroke-linecap: butt;
  animation: chart-draw 0.7s ease;
}

.donut-slice.is-video,
.donut-slice.is-views { stroke: var(--chart-video); }
.donut-slice.is-photo { stroke: var(--chart-photo); }
.donut-slice.is-visible { stroke: var(--chart-visible); }
.donut-slice.is-hidden { stroke: var(--chart-hidden); }
.donut-slice.is-likes { stroke: var(--chart-likes); }
.donut-slice.is-comments { stroke: var(--chart-comments); }

.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}

.donut-center strong {
  font-size: 20px;
  font-weight: 780;
  line-height: 1.1;
}

.donut-center span {
  color: var(--muted);
  font-size: 11px;
}

.donut-legend {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.donut-legend li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.donut-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.donut-swatch.is-video,
.donut-swatch.is-views { background: var(--chart-video); }
.donut-swatch.is-photo { background: var(--chart-photo); }
.donut-swatch.is-visible { background: var(--chart-visible); }
.donut-swatch.is-hidden { background: var(--chart-hidden); }
.donut-swatch.is-likes { background: var(--chart-likes); }
.donut-swatch.is-comments { background: var(--chart-comments); }

.donut-meta {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-bars {
  display: grid;
  gap: 10px;
}

.h-bar {
  display: grid;
  grid-template-columns: minmax(88px, 0.9fr) minmax(0, 2.2fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.h-bar.is-clickable {
  appearance: none;
  cursor: pointer;
}

.h-bar.is-clickable:hover .h-bar-label {
  color: var(--accent-2);
}

.h-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.h-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.h-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-2));
  transform-origin: left center;
  animation: chart-grow 0.55s ease;
}

.h-bar.is-top-1 .h-bar-fill {
  background: linear-gradient(90deg, #c45d18, #f6c48d);
}

.h-bar.is-top-2 .h-bar-fill {
  background: linear-gradient(90deg, #8a7460, #efe6d8);
}

.h-bar.is-top-3 .h-bar-fill {
  background: linear-gradient(90deg, #a35a2a, #e8b48a);
}

.h-bar-value {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.table-wrap {
  overflow: auto;
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
}

.rank-table th,
.rank-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

.rank-table th {
  color: var(--muted);
  font-weight: 650;
}

.rank-table td:first-child,
.rank-table th:first-child,
.rank-table td:last-child,
.rank-table th:last-child {
  white-space: nowrap;
}

.rank-table button {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.rank-table button:hover {
  color: var(--accent-2);
}

.rank-index {
  width: 42px;
}

.rank-medal,
.rank-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.rank-medal.is-1 {
  background: linear-gradient(180deg, #f6d58d, #ef8b3b);
  color: #1a120b;
}

.rank-medal.is-2 {
  background: linear-gradient(180deg, #efe6d8, #b9a894);
  color: #1a120b;
}

.rank-medal.is-3 {
  background: linear-gradient(180deg, #e8b48a, #c45d18);
  color: #1a120b;
}

.rank-num {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.rank-value {
  width: 92px;
}

.rank-value span:first-child {
  display: block;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rank-bar {
  display: block;
  margin-top: 6px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.rank-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-2));
}

.rank-empty {
  color: var(--muted);
  text-align: center;
}

@keyframes chart-rise {
  from { transform: scaleY(0.12); opacity: 0.4; }
  to { transform: scaleY(1); opacity: 1; }
}

@keyframes chart-grow {
  from { transform: scaleX(0.08); }
  to { transform: scaleX(1); }
}

@keyframes chart-draw {
  from { opacity: 0; }
  to { opacity: 1; }
}

.area-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.store-combobox {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  position: relative;
}

.store-combobox .field-label {
  margin-bottom: 0;
}

.store-combobox .picker-list {
  max-height: 280px;
}

.store-combobox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.store-combobox-actions .ghost {
  width: auto;
}

.store-picker-group {
  padding: 8px 12px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.store-manual {
  display: grid;
  gap: 0;
}

.area-target {
  display: grid;
  gap: 8px;
}

.area-target .search-field {
  margin: 0;
}

.area-target .search-field .field-label {
  margin-bottom: 6px;
}

.attach-box {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
}

.attach-box-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.attach-box-top > div {
  min-width: 0;
}

.attach-summary {
  margin: 4px 0 0;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.attach-box .check-label {
  width: fit-content;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.attach-box .field-error + .field-error:not(:empty),
.attach-box .field-error + .field-error.is-visible {
  margin-top: 4px;
}

.attach-modal {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(520px, 100%);
  max-height: min(88vh, 760px);
  padding: 18px 18px 16px;
  overflow: hidden;
}

.attach-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.attach-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.attach-lead {
  margin: 8px 0 0;
}

.attach-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  margin: 14px 0 0;
  overflow: auto;
  padding-right: 2px;
}

.attach-section {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.16);
}

.attach-section .search-field,
.attach-section label {
  margin: 0;
}

.attach-section input[type="search"] {
  padding: 10px 12px;
  border-radius: 12px;
}

.attach-section input[type="search"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.attach-switch {
  width: 100%;
  margin: 0;
  justify-content: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
}

.attach-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.attach-foot .primary,
.attach-foot .ghost {
  width: 100%;
  justify-content: center;
}

.icon-btn {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.icon-btn::before,
.icon-btn::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 1.5px;
  background: var(--text);
}

.icon-btn::before {
  transform: rotate(45deg);
}

.icon-btn::after {
  transform: rotate(-45deg);
}

.picked-chip {
  margin: 0;
  width: fit-content;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(239, 139, 59, 0.18);
  border: 1px solid rgba(239, 139, 59, 0.4);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
}

.picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 168px;
  overflow: auto;
}

.picker-chips li {
  display: inline-flex;
  width: auto;
  max-width: 100%;
}

.chip-item {
  width: auto;
  max-width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.14s ease;
}

.chip-item:hover {
  border-color: var(--line-strong);
  background: rgba(239, 139, 59, 0.1);
}

.chip-item:active {
  transform: scale(0.98);
}

.chip-item.is-active {
  border-color: rgba(239, 139, 59, 0.7);
  background: linear-gradient(180deg, rgba(243, 162, 90, 0.95), var(--accent));
  color: #1a120b;
  font-weight: 800;
}

.chip-item.is-suggested:not(.is-active) {
  border-color: rgba(141, 204, 124, 0.55);
  box-shadow: inset 0 0 0 1px rgba(141, 204, 124, 0.2);
}

.row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.publish-at-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(88px, 0.7fr) minmax(88px, 0.7fr);
  gap: 10px;
  align-items: end;
}

#publishAtField {
  grid-column: 1 / -1;
}

.row-2:has(#publishAtField.hidden) > label:first-child {
  grid-column: 1 / -1;
}

.publish-part {
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.publish-part-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.publish-at-summary {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(239, 139, 59, 0.28);
  background: rgba(239, 139, 59, 0.1);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.publish-at-summary.is-empty {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-weight: 500;
}

#publishDate {
  color-scheme: dark;
  min-width: 0;
}

#publishHour,
#publishMinute {
  min-width: 88px;
  padding-left: 12px;
  padding-right: 28px;
  text-align: left;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: 0.02em;
}

@media (max-width: 720px) {
  .row-2 {
    grid-template-columns: 1fr;
  }

  .publish-at-controls {
    grid-template-columns: 1fr 1fr;
  }

  .publish-part:first-child {
    grid-column: 1 / -1;
  }
}

.template-box {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.template-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.template-row select {
  flex: 1 1 160px;
  min-width: 0;
}

.engagement-rate {
  color: var(--ok) !important;
  font-weight: 650;
}

.bulk-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}

.store-api-picker,
.food-picker {
  display: grid;
  gap: 8px;
}

.store-api-picker {
  margin-top: 4px;
}

.attach-section .picker-list {
  max-height: 168px;
}

.picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
}

.picker-list li + li {
  border-top: 1px solid var(--line);
}

.picker-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.picker-item:hover {
  background: rgba(239, 139, 59, 0.1);
}

.picker-item.is-active {
  background: rgba(239, 139, 59, 0.18);
}

.picker-item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 10px;
  background: #000;
  flex-shrink: 0;
}

.picker-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.picker-meta strong {
  font-size: 13px;
  font-weight: 650;
}

.picker-meta small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
