.main-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
  width: 100%;
  box-sizing: border-box;
}

.page-header {
  margin-bottom: 1rem;
  text-align: center;
}
.page-title-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.page-title {
  font-size: clamp(1.4rem, 2.4vw, 1.95rem);
  font-weight: 900;
  color: var(--heading);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem 0;
}
.page-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  background: rgba(5, 150, 105, 0.1);
  color: var(--accent);
  border: 1px solid rgba(5, 150, 105, 0.25);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.page-subtitle {
  font-size: 0.9rem;
  color: var(--dim);
  font-weight: 500;
  line-height: 1.5;
  max-width: 760px;
  margin: 0 auto;
}

.tool-panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  box-shadow: 0 3px 14px rgba(15, 23, 42, 0.04);
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-sizing: border-box;
}

.input-row {
  width: 100%;
}
.input-box-wrap {
  position: relative;
  width: 100%;
}
.text-input-field {
  width: 100%;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--heading);
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem 2.5rem;
  resize: vertical;
  min-height: 68px;
  line-height: 1.45;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.text-input-field:focus {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.input-meta-actions {
  position: absolute;
  bottom: 0.45rem;
  left: 0.65rem;
  right: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.input-counters {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 600;
  background: rgba(241, 245, 249, 0.9);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  pointer-events: auto;
}
.dot-sep {
  margin: 0 0.25rem;
  color: #cbd5e1;
}
.btn-group-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  pointer-events: auto;
}
.mini-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.55rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--dim);
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.mini-action-btn:hover {
  background: #f1f5f9;
  color: var(--heading);
  border-color: #94a3b8;
}

.controls-strip {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
  align-items: center;
  background: #f8fafc;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}
@media (max-width: 680px) {
  .controls-strip {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
}
.strip-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.strip-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--heading);
  white-space: nowrap;
}

.strip-scope .mode-toggle-group {
  display: flex;
  background: #e2e8f0;
  padding: 0.2rem;
  border-radius: 6px;
  gap: 0.15rem;
  flex: 1;
}
.mode-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.45rem;
  background: transparent;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.mode-btn:hover {
  color: var(--heading);
}
.mode-btn.active {
  background: #ffffff;
  color: var(--accent);
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.strip-size {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.strip-size .size-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.size-val {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  background: rgba(5, 150, 105, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.range-slider {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  height: 5px;
  background: #cbd5e1;
  border-radius: 999px;
}

.presets-strip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.presets-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}
.presets-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.preset-chip {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.preset-chip:hover {
  background: rgba(5, 150, 105, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.filter-and-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.45rem;
  border-top: 1px solid #f1f5f9;
}
.category-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 0.2rem;
  max-width: 100%;
}
.category-tabs-bar::-webkit-scrollbar {
  height: 3px;
}
.category-tabs-bar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.cat-tab {
  padding: 0.35rem 0.75rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.cat-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.cat-tab.active {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.search-and-count {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap svg {
  position: absolute;
  right: 0.65rem;
  color: #94a3b8;
  pointer-events: none;
}
.style-search-input {
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.35rem 1.9rem 0.35rem 0.65rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  outline: none;
  width: 140px;
  transition: all 0.2s ease;
}
.style-search-input:focus {
  width: 190px;
  background: #ffffff;
  border-color: var(--accent);
}
.count-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  white-space: nowrap;
}
.count-badge span {
  color: var(--heading);
  font-weight: 800;
}

.decorator-grid-wrap {
  width: 100%;
}
.decorator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 600px) {
  .decorator-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

.decorator-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.decorator-card:hover {
  border-color: #6ee7b7;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.1);
  transform: translateY(-2px);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #f8fafc;
}
.card-title-group {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  overflow: hidden;
}
.card-style-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--heading);
  white-space: nowrap;
}
.card-style-en {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
}
.card-cat-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(5, 150, 105, 0.08);
  color: var(--accent);
  border: 1px solid rgba(5, 150, 105, 0.15);
  white-space: nowrap;
}

.card-preview-body {
  padding: 0.65rem 0.35rem;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.15s ease;
  user-select: all;
  -webkit-user-select: all;
}
.card-preview-body:hover {
  background-color: #f8fafc;
}
.card-preview-text {
  color: #0f172a;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.45;
  direction: rtl;
  max-width: 100%;
}

.card-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.55rem;
  border-top: 1px solid #f1f5f9;
}
.card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.card-btn-copy {
  flex: 1.4;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border: 1px solid #059669;
  box-shadow: 0 1px 4px rgba(5, 150, 105, 0.2);
}
.card-btn-copy:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}
.card-btn-copy.copied {
  background: #0f172a !important;
  color: #34d399 !important;
  border-color: #0f172a !important;
}

.card-btn-download {
  flex: 1;
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #cbd5e1;
}
.card-btn-download:hover {
  background: #f1f5f9;
  color: var(--heading);
  border-color: #94a3b8;
}

.copy-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: #0f172a;
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.copy-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.copy-toast svg {
  color: #34d399;
}

.styles-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.style-card-info {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem;
}
.style-card-info h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 0.35rem;
}
.style-card-info p {
  font-size: 0.85rem;
  color: var(--dim);
  margin: 0;
  line-height: 1.55;
}
.style-card-info em {
  font-style: normal;
  font-weight: 800;
  color: var(--accent);
}
