.cwf-page {
  min-height: 100vh;
}

.cwf-main {
  width: min(1120px, calc(100% - 28px));
  margin: 24px auto 36px;
  display: grid;
  gap: 16px;
}

.cwf-shell {
  border-radius: 22px;
  border: 1px solid rgba(54, 87, 154, 0.16);
  background:
    radial-gradient(circle at 92% 10%, rgba(159, 208, 255, 0.18), transparent 38%),
    radial-gradient(circle at 8% 92%, rgba(255, 176, 153, 0.12), transparent 42%),
    linear-gradient(160deg, rgba(252, 254, 255, 0.98), rgba(245, 250, 255, 0.96));
  box-shadow:
    0 18px 42px rgba(14, 30, 72, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  padding: 18px;
}

.cwf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cwf-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cwf-title {
  margin: 0;
  font-size: clamp(22px, 2.8vw, 30px);
  line-height: 1.2;
  color: #1b2a49;
}

.cwf-subtitle {
  margin: 4px 0 0;
  color: #4b5f86;
  font-size: 14px;
  line-height: 1.65;
}

.cwf-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid rgba(58, 90, 159, 0.25);
  background: linear-gradient(180deg, #f8faff, #eef3ff);
  color: #20345a;
  padding: 9px 14px;
  min-height: 40px;
  box-shadow: 0 8px 18px rgba(31, 58, 118, 0.12);
}

.cwf-back-btn::before {
  content: "←";
  font-size: 15px;
  line-height: 1;
}

.cwf-back-btn:hover {
  transform: translateY(-1px);
}

.cwf-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cwf-toolbar #authSlot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cwf-toolbar #authSlot .muted {
  margin-right: 4px;
}

.cwf-grid {
  display: grid;
  gap: 12px;
}

.cwf-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cwf-action-card {
  display: grid;
  gap: 8px;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(66, 101, 175, 0.2);
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.86), rgba(247, 251, 255, 0.8)),
    color-mix(in oklab, var(--glass-bg) 84%, transparent);
  color: #1b2a49;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(22, 46, 94, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cwf-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(24, 52, 102, 0.14);
}

.cwf-action-card.disabled {
  pointer-events: none;
  opacity: 0.58;
  filter: grayscale(0.25);
}

.cwf-action-card h3 {
  margin: 0;
  font-size: 20px;
}

.cwf-action-card p {
  margin: 0;
  color: #51658d;
  font-size: 14px;
  line-height: 1.65;
}

.cwf-card-wall {
  background:
    radial-gradient(circle at 96% 8%, rgba(122, 186, 255, 0.28), transparent 44%),
    linear-gradient(160deg, rgba(247, 252, 255, 0.96), rgba(231, 242, 255, 0.9));
}

.cwf-card-market {
  background:
    radial-gradient(circle at 96% 8%, rgba(255, 183, 137, 0.3), transparent 44%),
    linear-gradient(160deg, rgba(255, 249, 241, 0.96), rgba(255, 235, 222, 0.9));
}

.cwf-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
  margin-top: 8px;
}

.cwf-form-full {
  grid-column: 1 / -1;
}

.cwf-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #495f89;
}

.cwf-form input,
.cwf-form textarea,
.cwf-form select {
  width: 100%;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid rgba(66, 101, 175, 0.26);
  background: #ffffff;
  color: #16253f;
  padding: 11px 12px;
}

.cwf-form textarea {
  min-height: 120px;
  resize: vertical;
}

.cwf-form input:focus,
.cwf-form textarea:focus,
.cwf-form select:focus {
  border-color: rgba(45, 92, 197, 0.62);
  box-shadow: 0 0 0 4px rgba(45, 92, 197, 0.15);
}

.cwf-preview-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cwf-preview-grid:empty::before {
  content: attr(data-empty-text);
  color: #61759d;
  font-size: 12px;
}

.cwf-preview-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(68, 102, 173, 0.2);
  box-shadow: 0 8px 16px rgba(18, 40, 84, 0.1);
}

.cwf-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.cwf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid transparent;
  min-height: 42px;
  padding: 9px 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cwf-btn:hover {
  transform: translateY(-1px);
}

.cwf-btn.secondary {
  background: linear-gradient(180deg, #f8faff, #eef3ff);
  color: #213864;
  border-color: rgba(58, 92, 168, 0.26);
  box-shadow: 0 6px 14px rgba(28, 59, 121, 0.1);
}

.cwf-btn.primary-wall {
  background: linear-gradient(135deg, #3d6fe3, #5c91ff);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(49, 94, 200, 0.26);
}

.cwf-btn.primary-market {
  background: linear-gradient(135deg, #e86f4f, #f59a5b);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(207, 97, 66, 0.26);
}

.cwf-btn.danger {
  background: linear-gradient(135deg, #dc5c5c, #e97777);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(199, 63, 88, 0.24);
}

.cwf-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(231, 238, 252, 0.72);
  border: 1px solid rgba(78, 109, 177, 0.16);
}

.cwf-tab {
  min-width: 122px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #2f4268;
  min-height: 38px;
}

.cwf-tab.active {
  background: linear-gradient(135deg, #3d6fe3, #5c91ff);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(45, 92, 197, 0.24);
}

.cwf-manage-list {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.cwf-manage-item {
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(67, 99, 169, 0.16);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 35, 82, 0.09);
  display: grid;
  gap: 8px;
}

.cwf-manage-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.cwf-manage-item h3 {
  margin: 0;
  color: #1a2946;
  font-size: 17px;
  line-height: 1.38;
}

.cwf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.cwf-badge.published {
  color: #167a4a;
  background: rgba(22, 122, 74, 0.14);
}

.cwf-badge.offline,
.cwf-badge.deleted {
  color: #8a3947;
  background: rgba(180, 56, 83, 0.14);
}

.cwf-badge.sold {
  color: #8b5c00;
  background: rgba(235, 176, 19, 0.2);
}

.cwf-manage-summary {
  margin: 0;
  color: #2f4268;
  line-height: 1.72;
  font-size: 14px;
}

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

.cwf-meta-grid span {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.cwf-meta-grid em {
  font-style: normal;
  color: #6a7ea5;
  font-size: 12px;
  white-space: nowrap;
}

.cwf-meta-grid strong {
  color: #23365b;
  font-size: 13px;
  overflow-wrap: anywhere;
}

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

.cwf-empty {
  border: 1px dashed rgba(67, 99, 169, 0.26);
  border-radius: 14px;
  min-height: 140px;
  display: grid;
  place-items: center;
  color: #5d7199;
  text-align: center;
  padding: 16px;
}

.cwf-detail-body {
  display: grid;
  gap: 10px;
}

.cwf-detail-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.cwf-detail-images img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(67, 99, 169, 0.18);
}

.cwf-section {
  border-radius: 14px;
  border: 1px solid rgba(67, 99, 169, 0.16);
  background: #ffffff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

[data-theme="dark"] .cwf-shell {
  border-color: rgba(138, 174, 248, 0.24);
  background:
    radial-gradient(circle at 92% 10%, rgba(111, 166, 255, 0.2), transparent 38%),
    radial-gradient(circle at 8% 92%, rgba(255, 160, 122, 0.14), transparent 42%),
    linear-gradient(160deg, rgba(15, 30, 62, 0.98), rgba(13, 24, 50, 0.96));
}

[data-theme="dark"] .cwf-title {
  color: #e4eeff;
}

[data-theme="dark"] .cwf-subtitle {
  color: #9eb3da;
}

[data-theme="dark"] .cwf-back-btn,
[data-theme="dark"] .cwf-btn.secondary {
  background: linear-gradient(180deg, #223a6f, #1b3262);
  color: #deebff;
  border-color: rgba(145, 180, 255, 0.28);
}

[data-theme="dark"] .cwf-action-card,
[data-theme="dark"] .cwf-manage-item,
[data-theme="dark"] .cwf-section {
  background: #172a52;
  border-color: rgba(142, 179, 255, 0.24);
  color: #d7e5ff;
}

[data-theme="dark"] .cwf-action-card p,
[data-theme="dark"] .cwf-manage-summary,
[data-theme="dark"] .cwf-meta-grid strong {
  color: #c4d5f5;
}

[data-theme="dark"] .cwf-meta-grid em,
[data-theme="dark"] .cwf-empty {
  color: #9db3dd;
}

[data-theme="dark"] .cwf-form input,
[data-theme="dark"] .cwf-form textarea,
[data-theme="dark"] .cwf-form select {
  background: #1a2f5d;
  color: #eef4ff;
  border-color: rgba(140, 176, 255, 0.36);
}

[data-theme="dark"] .cwf-form ::placeholder {
  color: #9db3dd;
}

[data-theme="dark"] .cwf-tabs {
  background: rgba(33, 55, 99, 0.7);
  border-color: rgba(145, 180, 255, 0.22);
}

[data-theme="dark"] .cwf-tab {
  color: #bfd1f3;
}

[data-theme="dark"] .cwf-empty {
  border-color: rgba(145, 180, 255, 0.3);
}

@media (max-width: 900px) {
  .cwf-grid.two {
    grid-template-columns: 1fr;
  }

  .cwf-form {
    grid-template-columns: 1fr;
  }

  .cwf-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .cwf-main {
    width: calc(100% - 20px);
    margin-top: 14px;
  }

  .cwf-shell {
    border-radius: 18px;
    padding: 14px;
  }

  .cwf-head {
    gap: 8px;
  }

  .cwf-toolbar {
    width: 100%;
    justify-content: space-between;
  }

  .cwf-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cwf-actions .cwf-btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .cwf-title {
    font-size: 24px;
  }

  .cwf-tabs {
    width: 100%;
  }

  .cwf-tab {
    min-width: 0;
  }

  .cwf-meta-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .cwf-actions {
    grid-template-columns: 1fr;
  }
}
