
.smm-app,
.smm-app * { box-sizing: border-box; }

.smm-app {
  --smm-panel: #ffffff;
  --smm-border: #ece7ef;
  --smm-text: #211b24;
  --smm-muted: #766f7b;
  --smm-primary: #d92f76;
  --smm-primary-dark: #8f1748;
  --smm-soft: #fff1f6;
  --smm-header-offset: 118px;
  max-width: 1320px;
  margin: 28px auto;
  color: var(--smm-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
body.admin-bar .smm-app { --smm-header-offset: 150px; }

.smm-header {
  margin-bottom: 22px;
  padding: 28px 24px;
  border-radius: 30px;
  border: 1px solid var(--smm-border);
  background:
    radial-gradient(circle at top left, rgba(217,47,118,.12), transparent 28%),
    linear-gradient(135deg, #fff, #fff7fb);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .05);
  text-align: center;
}
.smm-kicker {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--smm-soft);
  color: var(--smm-primary-dark);
  font-weight: 800;
  font-size: 13px;
}
.smm-header h2 {
  margin: 12px 0 8px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -.04em;
}
.smm-header p {
  max-width: 840px;
  margin: 0 auto;
  color: var(--smm-muted);
  line-height: 1.7;
}

.smm-workspace {
  position: sticky;
  top: var(--smm-header-offset);
  height: calc(100vh - var(--smm-header-offset) - 10px);
  min-height: 700px;
  display: grid;
  grid-template-columns: minmax(360px, 540px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

.smm-sidebar,
.smm-preview-wrap {
  background: var(--smm-panel);
  border: 1px solid var(--smm-border);
  border-radius: 28px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .06);
}

.smm-sidebar {
  padding: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}
.smm-sidebar::-webkit-scrollbar,
.smm-result-list::-webkit-scrollbar,
.smm-template-grid::-webkit-scrollbar,
.smm-sticker-grid::-webkit-scrollbar { width: 8px; }
.smm-sidebar::-webkit-scrollbar-thumb,
.smm-result-list::-webkit-scrollbar-thumb,
.smm-template-grid::-webkit-scrollbar-thumb,
.smm-sticker-grid::-webkit-scrollbar-thumb {
  background: rgba(217,47,118,.20);
  border-radius: 999px;
}
.smm-sidebar::-webkit-scrollbar-track,
.smm-result-list::-webkit-scrollbar-track,
.smm-template-grid::-webkit-scrollbar-track,
.smm-sticker-grid::-webkit-scrollbar-track {
  background: rgba(15,23,42,.04);
  border-radius: 999px;
}

.smm-card {
  border: 1px solid var(--smm-border);
  background: #fff;
  border-radius: 24px;
  padding: 18px;
  margin-bottom: 16px;
}
.smm-card:last-child { margin-bottom: 0; }
.smm-card h3,
.smm-preview-head h3 { margin: 0 0 12px; font-size: 15px; font-weight: 800; }
.smm-card-head { display:flex; justify-content:space-between; align-items:center; gap: 12px; margin-bottom: 10px; }
.smm-pill { display:inline-flex; padding:6px 10px; border-radius:999px; background:#fff2f7; color:#a81f5b; font-size:12px; font-weight:800; }
.smm-top-gap { margin-top: 12px; }

.smm-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.smm-form-grid .smm-wide { grid-column: 1 / -1; }
.smm-card label {
  display: grid;
  gap: 7px;
  color: #3d3340;
  font-size: 13px;
  font-weight: 700;
}
.smm-card label span { color: #9b93a1; font-weight: 600; }

.smm-card input[type="text"],
.smm-card input[type="file"],
.smm-card textarea,
.smm-card select,
.smm-search {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid #e8e0ea;
  outline: none;
  background: #fff;
  color: var(--smm-text);
  font-size: 14px;
  line-height: 1.4;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.smm-card textarea { resize: vertical; }
.smm-card input[type="text"]:focus,
.smm-card textarea:focus,
.smm-card select:focus,
.smm-search:focus {
  border-color: rgba(217,47,118,.55);
  box-shadow: 0 0 0 4px rgba(217,47,118,.10);
}
.smm-card input[type="file"] { padding: 10px; }

.smm-action-row,
.smm-preview-actions,
.smm-mini-icons,
.smm-template-filters,
.smm-sticker-filters,
.smm-checks { display: flex; flex-wrap: wrap; gap: 9px; }
.smm-action-row { margin-top: 14px; }

.smm-btn {
  appearance: none; border: 0; min-height: 44px; padding: 11px 16px; border-radius: 14px; cursor:pointer;
  font-weight: 800; font-size: 14px; transition: transform .15s ease, opacity .15s ease;
}
.smm-btn:hover { transform: translateY(-1px); }
.smm-primary { background: linear-gradient(135deg, #ea4892, #c82067); color:#fff; }
.smm-soft { background: #fff4f8; color:#9f1d58; border: 1px solid #f7cadb; }
.smm-dark { background: #1f2937; color: #fff; }

.smm-note { margin: 12px 0 0; color: #847987; font-size: 13px; }

.smm-results {
  margin-top: 16px;
  border: 1px solid #ece3ee;
  border-radius: 20px;
  overflow: hidden;
  background: #fcfbfd;
}
.smm-results-head {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 13px 15px; background: #fff7fb; border-bottom: 1px solid #ece3ee; font-size: 13px; color:#655d67;
}
.smm-result-list { max-height: 330px; overflow-y: auto; padding: 14px; display:grid; gap:12px; }
.smm-result-item { border: 1px solid #ece3ee; background: #fff; border-radius: 18px; padding: 14px; }
.smm-result-item p { margin: 0 0 10px; color:#312936; font-size: 14px; line-height: 1.64; }
.smm-result-actions { display:flex; flex-wrap:wrap; gap:8px; }
.smm-mini-btn,
.smm-mini-icons button {
  appearance:none; border:1px solid #e9dfe9; background:#fff; border-radius:12px; min-height:36px; padding:7px 11px;
  color:#5c5260; font-size:13px; font-weight:800; cursor:pointer;
}
.smm-mini-btn:hover,
.smm-mini-icons button:hover,
.smm-filter-btn:hover,
.smm-sticker-btn:hover { background:#fff6fa; border-color: rgba(217,47,118,.33); }

.smm-filter-btn,
.smm-sticker-filter-btn {
  appearance:none; border:1px solid #eadfea; background:#fff; border-radius:999px; min-height:38px; padding:8px 13px; cursor:pointer;
  color:#4f4552; font-size:12px; font-weight:800; letter-spacing: .03em; text-transform: uppercase;
}
.smm-filter-btn.is-active,
.smm-sticker-filter-btn.is-active { background:#1f2430; color:#fff; border-color:#1f2430; }

.smm-search { margin: 12px 0 14px; }
.smm-template-grid {
  max-height: 500px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-right: 4px;
}
.smm-template-card {
  appearance:none; text-align:left; border:1px solid #ece3ee; border-radius:20px; background:#fff; overflow:hidden; cursor:pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.smm-template-card:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(15,23,42,.08); }
.smm-template-card.is-active { border-color:#e33a85; box-shadow:0 0 0 3px rgba(227,58,133,.11); }
.smm-template-thumb {
  height: 100px;
  padding: 12px;
  display:flex;
  flex-direction: column;
  justify-content: space-between;
  color:#fff;
  font-size:12px;
  font-weight:800;
  letter-spacing:.03em;
  position: relative;
  overflow: hidden;
}
.smm-template-thumb:before {
  content:"";
  position:absolute;
  inset: 14px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 14px;
}
.smm-template-thumb span {
  position: relative;
  z-index: 1;
}
.smm-template-thumb small {
  position: relative;
  z-index: 1;
  opacity: .9;
  font-size: 10px;
  letter-spacing: .08em;
}
.smm-template-meta { padding: 10px 12px 12px; }
.smm-template-name { display:block; color:#241d25; font-size:13px; font-weight:800; }
.smm-template-sub { display:block; margin-top:4px; color:#847987; font-size:11px; font-weight:700; letter-spacing:.04em; text-transform: uppercase; }

.smm-sticker-grid {
  margin-top: 12px;
  max-height: 220px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.smm-sticker-btn {
  appearance:none; border:1px solid #ece3ee; background:#fff; border-radius:18px; padding:10px; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:86px;
}
.smm-sticker-btn.is-active { border-color:#e33a85; box-shadow:0 0 0 3px rgba(227,58,133,.11); }
.smm-sticker-icon { width:46px; height:46px; display:flex; align-items:center; justify-content:center; }
.smm-sticker-label { font-size:11px; color:#6a5e69; font-weight:800; text-align:center; }

.smm-range-grid { display:grid; gap: 12px; margin-top: 14px; }
.smm-range-grid label { display:grid; grid-template-columns: 84px 1fr 42px; align-items:center; gap:8px; color:#5d5461; font-size:13px; font-weight:700; }
.smm-form-grid input[type="range"] { width:100%; accent-color: var(--smm-primary); }
.smm-range-grid input[type="range"] { width:100%; accent-color: var(--smm-primary); }
.smm-form-grid output,
.smm-range-grid output { text-align:right; color:#7d7480; font-variant-numeric: tabular-nums; }
.smm-checks { margin-top: 14px; }
.smm-checks label { display:flex; align-items:center; gap:8px; margin:0; font-size:13px; }

.smm-preview-wrap { overflow: hidden; min-height: 0; }
.smm-preview-sticky {
  height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.smm-preview-head {
  display:flex; justify-content:space-between; align-items:flex-start; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.smm-preview-head p { margin: 6px 0 0; color:#817782; font-size: 14px; }
.smm-preview-actions { justify-content:flex-end; }

.smm-canvas-shell {
  flex: 1 1 auto;
  min-height: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, #fbf6f9, #f6f1f6);
}
.smm-canvas-shell canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 22px;
  background:#fff;
  box-shadow: 0 22px 46px rgba(15, 23, 42, .14);
}

@media (max-width: 1080px) {
  .smm-workspace {
    position: relative;
    top: auto;
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
  }
  .smm-preview-wrap { order: -1; }
  .smm-sidebar { max-height: none; overflow: visible; }
  .smm-preview-sticky { height: auto; }
  .smm-canvas-shell { min-height: 360px; }
}
@media (max-width: 680px) {
  .smm-header { padding: 22px 16px; }
  .smm-form-grid, .smm-template-grid { grid-template-columns: 1fr; }
  .smm-sticker-grid { grid-template-columns: repeat(3,1fr); }
  .smm-range-grid label { grid-template-columns: 80px 1fr 40px; }
}


/* V4 commercial-grade template controls */
.smm-advanced-design {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #eadfea;
}
.smm-advanced-design h3 {
  margin: 0 0 14px !important;
}
.smm-checks {
  align-items: center;
}
.smm-checks label {
  background: #fff8fb;
  border: 1px solid #f2d7e5;
  padding: 8px 10px;
  border-radius: 999px;
}
.smm-sticker-btn {
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.smm-sticker-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15,23,42,.07);
}
.smm-sticker-btn.is-active {
  background: linear-gradient(135deg, #fff, #fff3f8);
}
.smm-sticker-icon svg {
  width: 44px;
  height: 44px;
  display: block;
}
.smm-template-card.is-active .smm-template-name {
  color: #b31d60;
}
.smm-preview-actions .smm-btn {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 12px;
}
