/* Arabic Calligraphy Generator – tool styles */
.acg-app {
  --acg-primary: #4f46e5;
  --acg-primary-hover: #4338ca;
  --acg-primary-light: rgba(79,70,229,0.08);
  --acg-primary-ring: rgba(79,70,229,0.25);
  --acg-bg: #f8f9fc;
  --acg-card: #ffffff;
  --acg-border: #dde1ea;
  --acg-border-light: rgba(221,225,234,0.7);
  --acg-text: #111827;
  --acg-text-muted: #4b5563;
  --acg-text-subtle: #6b7280;
  --acg-muted-bg: #f1f4f9;
  --acg-input-bg: #ffffff;
  --acg-destructive: #ef4444;
  --acg-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 2px 12px rgba(0,0,0,0.04);
  --acg-shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --acg-shadow-lg: 0 8px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
  --acg-radius: 14px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--acg-bg);
  color: var(--acg-text);
  line-height: 1.5;
  box-sizing: border-box;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 16px;
}.acg-app *,
.acg-app *::before,
.acg-app *::after {
  box-sizing: border-box;
}.acg-app .acg-header {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--acg-border-light);
}.acg-app .acg-header h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--acg-primary) 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 6px;
  line-height: 1.2;
}.acg-app .acg-header p {
  color: var(--acg-text-muted);
  font-size: 14px;
  margin: 0;
  line-height: 1.6;
}.acg-app .acg-header-divider {
  width: 48px;
  height: 3px;
  margin: 12px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--acg-primary), #7c3aed);
}.acg-app .acg-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {.acg-app .acg-layout {
    grid-template-columns: 1fr;
  }.acg-app .acg-controls-col { order: 2; }.acg-app .acg-preview-col { order: 1; }
}.acg-app .acg-card {
  border: 1px solid var(--acg-border);
  border-radius: var(--acg-radius);
  background: var(--acg-card);
  box-shadow: var(--acg-shadow);
  padding: 16px;
  margin-bottom: 16px;
  overflow: hidden;
}.acg-app .acg-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(to right, rgba(79,70,229,0.04), transparent);
  border-bottom: 1px solid var(--acg-border-light);
  margin: -16px -16px 16px;
}.acg-app .acg-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--acg-primary-light);
  border: 1px solid rgba(79,70,229,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--acg-primary);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}.acg-app .acg-card-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1px;
  color: var(--acg-text);
  margin: 0;
}.acg-app .acg-tabs-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background: var(--acg-muted-bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--acg-border-light);
}.acg-app .acg-tab-btn {
  padding: 8px 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
  background:  rgb(255 255 255 / 50%);
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1;
}.acg-app .acg-tab-btn svg {
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.18s;
}.acg-app .acg-tab-btn:hover {
  color: var(--acg-text);
}.acg-app .acg-tab-btn:hover svg {
  opacity: 1;
}.acg-app .acg-tab-btn.active {
  background: var(--acg-card);
  color: var(--acg-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08), 0 0 0 1px rgba(79,70,229,0.1);
  font-weight: 700;
}.acg-app .acg-tab-btn.active svg {
  opacity: 1;
}.acg-app .acg-tab-content {
  display: none;
}.acg-app .acg-tab-content.active {
  display: block;
}.acg-app .acg-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1px;
  margin-bottom: 8px;
  color: var(--acg-text);
}.acg-app .acg-label-sm {
  font-size: 11px;
  color: var(--acg-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
}.acg-app .acg-textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  border: 1px solid var(--acg-border);
  border-radius: 8px;
  font-size: 18px;
  direction: rtl;
  resize: vertical;
  background: var(--acg-input-bg);
  color: var(--acg-text);
  outline: none;
  transition: border-color 0.2s;
}.acg-app .acg-textarea:focus {
  border-color: var(--acg-primary);
  box-shadow: 0 0 0 2px var(--acg-primary-ring);
}.acg-app .acg-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--acg-border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--acg-input-bg);
  color: var(--acg-text);
  outline: none;
  transition: border-color 0.2s;
}.acg-app .acg-input:focus {
  border-color: var(--acg-primary);
  box-shadow: 0 0 0 2px var(--acg-primary-ring);
}.acg-app .acg-select {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--acg-border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--acg-input-bg);
  color: var(--acg-text);
  cursor: pointer;
  outline: none;
}.acg-app .acg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1px;
  border: 1px solid var(--acg-border);
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.18s;
  background: var(--acg-card);
  color: var(--acg-text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}.acg-app .acg-btn:hover {
  background: var(--acg-muted-bg);
  border-color: var(--acg-border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}.acg-app .acg-btn-primary {
  background: var(--acg-primary);
  color: #fff;
  border-color: var(--acg-primary);
  box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}.acg-app .acg-btn-primary:hover {
  background: var(--acg-primary-hover);
  border-color: var(--acg-primary-hover);
  box-shadow: 0 4px 12px rgba(79,70,229,0.35);
  transform: translateY(-1px);
}.acg-app .acg-btn-sm {
  padding: 4px 12px;
  font-size: 12px;
  height: 32px;
}.acg-app .acg-btn-block {
  width: 100%;
}.acg-app .acg-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 500;
  border-radius: 12px;
  background: var(--acg-muted-bg);
  color: var(--acg-text-muted);
}.acg-app .acg-badge-primary {
  background: var(--acg-primary-light);
  color: var(--acg-primary);
}.acg-app .acg-section {
  margin-bottom: 16px;
}.acg-app .acg-section:last-child {
  margin-bottom: 0;
}.acg-app .acg-divider {
  height: 1px;
  background: var(--acg-border-light);
  margin: 12px 0;
}.acg-app .acg-flex {
  display: flex;
}.acg-app .acg-flex-wrap {
  flex-wrap: wrap;
}.acg-app .acg-gap-1 { gap: 4px; }.acg-app .acg-gap-2 { gap: 8px; }.acg-app .acg-gap-3 { gap: 12px; }.acg-app .acg-items-center { align-items: center; }.acg-app .acg-justify-between { justify-content: space-between; }.acg-app .acg-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}.acg-app .acg-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid var(--acg-border-light);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  padding: 0;
}.acg-app .acg-color-swatch:hover {
  transform: scale(1.05);
}.acg-app .acg-color-swatch.selected {
  border-color: var(--acg-primary);
  box-shadow: 0 0 0 2px var(--acg-primary-ring);
  transform: scale(1.1);
}.acg-app .acg-color-picker-wrap {
  position: relative;
  width: 24px;
  height: 24px;
}.acg-app .acg-color-picker-wrap input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}.acg-app .acg-color-picker-display {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--acg-border-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: rgba(255,255,255,0.8);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}.acg-app .acg-bg-tabs {
  display: flex;
  gap: 2px;
  border-radius: 8px;
  background: var(--acg-muted-bg);
  padding: 2px;
  margin-bottom: 8px;
}.acg-app .acg-bg-tab-btn {
  flex: 1;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
  color: var(--acg-text-muted);
  text-transform: capitalize;
}.acg-app .acg-bg-tab-btn.active {
  background: var(--acg-card);
  color: var(--acg-text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  font-weight: 500;
}.acg-app .acg-font-card {
  width: 100%;
  text-align: left;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--acg-border-light);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--acg-card);
}.acg-app .acg-font-card:hover {
  border-color: var(--acg-border);
}.acg-app .acg-font-card.selected {
  border-color: var(--acg-primary);
  background: var(--acg-primary-light);
  box-shadow: 0 0 0 1px var(--acg-primary-ring);
}.acg-app .acg-font-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}.acg-app .acg-font-card-name {
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}.acg-app .acg-font-card-preview {
  font-size: 18px;
  text-align: right;
  direction: rtl;
  line-height: 1.6;
}.acg-app .acg-font-list {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}.acg-app .acg-font-list::-webkit-scrollbar {
  width: 4px;
}.acg-app .acg-font-list::-webkit-scrollbar-track {
  background: var(--acg-muted-bg);
  border-radius: 2px;
}.acg-app .acg-font-list::-webkit-scrollbar-thumb {
  background: var(--acg-border);
  border-radius: 2px;
}.acg-app .acg-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}.acg-app .acg-cat-pill {
  padding: 2px 10px;
  font-size: 10px;
  border-radius: 12px;
  border: 1px solid var(--acg-border-light);
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
  color: var(--acg-text-muted);
}.acg-app .acg-cat-pill:hover {
  color: var(--acg-text);
}.acg-app .acg-cat-pill.active {
  border-color: var(--acg-primary);
  background: var(--acg-primary-light);
  color: var(--acg-primary);
  font-weight: 500;
}.acg-app .acg-keyboard {
  border: 1px solid var(--acg-border);
  border-radius: 8px;
  background: var(--acg-card);
  padding: 8px;
}.acg-app .acg-keyboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}.acg-app .acg-keyboard-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--acg-text-muted);
}.acg-app .acg-keyboard-close {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--acg-text-muted);
  cursor: pointer;
  font-size: 14px;
}.acg-app .acg-keyboard-row {
  display: flex;
  gap: 3px;
  margin-bottom: 3px;
  justify-content: center;
}.acg-app .acg-key {
  flex: 1 1 0%;
  min-width: 0;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--acg-border);
  border-radius: 4px;
  background: var(--acg-input-bg);
  cursor: pointer;
  transition: all 0.1s;
  font-size: 14px;
  font-family: 'Noto Naskh Arabic', serif;
  color: var(--acg-text);
  padding: 0;
}.acg-app .acg-key:active {
  transform: scale(0.95);
  background: var(--acg-muted-bg);
}.acg-app .acg-key-wide {
  flex: 3 1 0%;
}.acg-app .acg-key-label {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 10px;
}.acg-app .acg-key-backspace {
  background: rgba(239,68,68,0.1);
  color: var(--acg-destructive);
  font-family: -apple-system, sans-serif;
  font-size: 12px;
}.acg-app .acg-key-backspace:active {
  background: rgba(239,68,68,0.2);
}.acg-app .acg-key-enter {
  background: var(--acg-muted-bg);
  color: var(--acg-text-muted);
  font-family: -apple-system, sans-serif;
  font-size: 12px;
}.acg-app .acg-converter {
  border: 1px solid var(--acg-border);
  border-radius: 8px;
  background: var(--acg-card);
  padding: 12px;
}.acg-app .acg-converter-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}.acg-app .acg-converter-desc {
  font-size: 12px;
  color: var(--acg-text-muted);
  margin-bottom: 8px;
  line-height: 1.5;
}.acg-app .acg-converter-row {
  display: flex;
  gap: 8px;
  position: relative;
}.acg-app .acg-converter-input-wrap {
  flex: 1;
  position: relative;
}.acg-app .acg-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--acg-card);
  border: 1px solid var(--acg-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 50;
  overflow: hidden;
}.acg-app .acg-autocomplete-item {
  width: 100%;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.1s;
  color: var(--acg-text);
}.acg-app .acg-autocomplete-item:hover,
.acg-app .acg-autocomplete-item.active {
  background: var(--acg-primary-light);
  color: var(--acg-primary);
}.acg-app .acg-autocomplete-hint {
  font-size: 10px;
  color: var(--acg-text-muted);
}.acg-app .acg-autocomplete-arabic {
  font-size: 16px;
  font-weight: 500;
  font-family: 'Noto Naskh Arabic', serif;
  direction: rtl;
}.acg-app .acg-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}.acg-app .acg-option-card {
  position: relative;
  border: 1px solid var(--acg-border-light);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--acg-card);
}.acg-app .acg-option-card:hover {
  border-color: var(--acg-border);
}.acg-app .acg-option-card.selected {
  border-color: var(--acg-primary);
  background: var(--acg-primary-light);
  box-shadow: 0 0 0 1px var(--acg-primary-ring);
}.acg-app .acg-option-arabic {
  font-size: 18px;
  font-weight: 500;
  font-family: 'Noto Naskh Arabic', serif;
  direction: rtl;
}.acg-app .acg-option-label {
  font-size: 10px;
  color: var(--acg-text-muted);
  margin-top: 4px;
}.acg-app .acg-selected-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--acg-primary);
  color: #fff;
}.acg-app .acg-selected-result {
  border-radius: 8px;
  background: var(--acg-muted-bg);
  border: 1px solid var(--acg-border-light);
  padding: 12px;
  text-align: center;
  margin-top: 12px;
}.acg-app .acg-selected-result-label {
  font-size: 10px;
  color: var(--acg-text-muted);
  margin-bottom: 4px;
}.acg-app .acg-selected-result-text {
  font-size: 24px;
  font-weight: 500;
  font-family: 'Noto Naskh Arabic', serif;
  direction: rtl;
}.acg-app .acg-selected-result-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}.acg-app .acg-preview-card {
  border-radius: var(--acg-radius);
  background: #ffffff;
  box-shadow: var(--acg-shadow-md);
  border: 1px solid var(--acg-border);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  margin-bottom: 16px;
  position: sticky;
  top: 16px;
  z-index: 10;
}.acg-app .acg-preview-inner {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(226,232,240,0.2);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}.acg-app .acg-preview-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}.acg-app .acg-preview-text {
  text-align: center;
  direction: rtl;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
  max-width: 100%;
}.acg-app .acg-hidden-canvas {
  display: none;
}.acg-app .acg-slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}.acg-app .acg-slider-label {
  font-size: 11px;
  color: var(--acg-text-muted);
}.acg-app .acg-slider-label span {
  color: var(--acg-text);
  font-weight: 500;
}.acg-app .acg-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--acg-muted-bg);
  outline: none;
  margin: 4px 0;
}.acg-app .acg-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--acg-primary);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}.acg-app .acg-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--acg-primary);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}.acg-app .acg-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
  background: var(--acg-muted-bg);
  padding: 0;
}.acg-app .acg-toggle.active {
  background: var(--acg-primary);
}.acg-app .acg-toggle-thumb {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  transform: translateX(3px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}.acg-app .acg-toggle.active .acg-toggle-thumb {
  transform: translateX(19px);
}.acg-app .acg-shadow-panel {
  border-radius: 8px;
  background: var(--acg-muted-bg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}.acg-app .acg-export-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--acg-border-light);
  background: linear-gradient(90deg, var(--acg-card), rgba(255,255,255,0.8));
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}.acg-app .acg-export-btn:hover {
  border-color: var(--acg-border);
  box-shadow: var(--acg-shadow);
}.acg-app .acg-export-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}.acg-app .acg-export-icon-png {
  background: rgba(59,130,246,0.1);
  color: #3b82f6;
}.acg-app .acg-export-icon-jpg {
  background: rgba(245,158,11,0.1);
  color: #f59e0b;
}.acg-app .acg-export-icon-svg {
  background: rgba(16,185,129,0.1);
  color: #10b981;
}.acg-app .acg-export-info {
  flex: 1;
  min-width: 0;
}.acg-app .acg-export-format {
  font-size: 14px;
  font-weight: 500;
}.acg-app .acg-export-desc {
  font-size: 11px;
  color: var(--acg-text-muted);
}.acg-app .acg-export-dl-icon {
  color: var(--acg-text-muted);
  font-size: 14px;
  flex-shrink: 0;
}.acg-app .acg-size-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}.acg-app .acg-size-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--acg-border-light);
  background: var(--acg-card);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  font-size: 12px;
}.acg-app .acg-size-btn:hover {
  border-color: var(--acg-border);
}.acg-app .acg-size-btn.selected {
  border-color: var(--acg-primary);
  background: var(--acg-primary-light);
  box-shadow: 0 0 0 1px var(--acg-primary-ring);
}.acg-app .acg-size-icon {
  flex-shrink: 0;
  color: var(--acg-text-muted);
}.acg-app .acg-size-btn.selected .acg-size-icon {
  color: var(--acg-primary);
}.acg-app .acg-size-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}.acg-app .acg-size-dim {
  font-size: 10px;
  color: var(--acg-text-muted);
}.acg-app .acg-preset-phrases {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  direction: rtl;
}.acg-app .acg-preset-btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--acg-border-light);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--acg-card);
  color: var(--acg-text-muted);
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
}.acg-app .acg-preset-btn:hover {
  border-color: rgba(99,102,241,0.3);
  background: var(--acg-primary-light);
  color: var(--acg-text);
}.acg-app .acg-preset-btn.active {
  border-color: var(--acg-primary);
  background: var(--acg-primary-light);
  color: var(--acg-primary);
  font-weight: 600;
  box-shadow: 0 0 8px -2px var(--acg-primary-ring);
}.acg-app .acg-quick-fonts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}.acg-app .acg-quick-font-btn {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid var(--acg-border-light);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--acg-card);
  color: var(--acg-text-muted);
  direction: rtl;
}.acg-app .acg-quick-font-btn:hover {
  border-color: rgba(99,102,241,0.3);
  background: var(--acg-primary-light);
}.acg-app .acg-quick-font-btn.active {
  border-color: var(--acg-primary);
  background: var(--acg-primary-light);
  color: var(--acg-primary);
  font-weight: 500;
  box-shadow: 0 0 8px -2px var(--acg-primary-ring);
}.acg-app .acg-summary-bar {
  padding: 10px;
  border-radius: 8px;
  background: var(--acg-muted-bg);
  border: 1px solid rgba(226,232,240,0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}.acg-app .acg-summary-item {
  display: flex;
  align-items: center;
  gap: 6px;
}.acg-app .acg-summary-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid var(--acg-border-light);
}.acg-app .acg-summary-label {
  font-size: 10px;
  color: var(--acg-text-muted);
}.acg-app .acg-img-upload-preview {
  position: relative;
  border-radius: 8px;
  border: 1px solid var(--acg-border-light);
  overflow: hidden;
}.acg-app .acg-img-upload-preview img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
}.acg-app .acg-img-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
}.acg-app .acg-mobile-actions {
  display: none;
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 900px) {.acg-app .acg-preview-card {
    min-height: 260px;
  }
}.acg-app .acg-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--acg-text);
  color: var(--acg-bg);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 10000;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.25s ease;
  pointer-events: none;
}.acg-app .acg-toast.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}.acg-app .acg-hidden {
  display: none !important;
}/* ── Floating export bar (top-right of canvas) ─────────────────────── */
.acg-app .acg-float-export {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 10;
}.acg-app .acg-float-btn {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}.acg-app .acg-float-btn-png {
  background: #3b82f6;
  color: #fff;
}.acg-app .acg-float-btn-jpg {
  background: #f59e0b;
  color: #fff;
}.acg-app .acg-float-btn-svg {
  background: #10b981;
  color: #fff;
}.acg-app .acg-float-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}.acg-app .acg-float-btn:active {
  transform: translateY(0);
}/* ── Locked category badge ──────────────────────────────────────────── */
.acg-app .acg-cat-locked-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  background: var(--acg-primary-light);
  color: var(--acg-primary);
  border: 1px solid rgba(99,102,241,0.2);
  margin-bottom: 8px;
}/* ── Mobile bottom bar & bottom sheet ──────────────────────────────── */
.acg-app .acg-mobile-bar {
  display: none;
}.acg-app .acg-sheet-handle,
.acg-app .acg-sheet-header-bar,
.acg-app .acg-sheet-title,
.acg-app .acg-sheet-close-btn {
  display: none;
}

@media (max-width: 900px) {.acg-app .acg-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }.acg-app .acg-controls-col {
    order: 2;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
	  height: 90%;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--acg-card);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.18);
    z-index: 1000;
    padding: 0 12px 80px;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  }.acg-app .acg-controls-col.acg-sheet-open {
    transform: translateY(0);
  }.acg-app .acg-controls-col .acg-card {
    border: none;
    box-shadow: none;
    margin-bottom: 0;
  }.acg-app .acg-preview-col {
    order: 1;
    padding-bottom: 80px;
  }.acg-app .acg-sheet-handle {
    display: block;
    width: 40px;
    height: 4px;
    background: var(--acg-border);
    border-radius: 2px;
    margin: 10px auto 4px;
    flex-shrink: 0;
  }.acg-app .acg-sheet-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px 10px;
    border-bottom: 1px solid var(--acg-border-light);
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    background: var(--acg-card);
    z-index: 2;
  }.acg-app .acg-sheet-title {
    display: inline-block;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.2px;
    color: var(--acg-text);
  }.acg-app .acg-sheet-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--acg-muted-bg);
    color: var(--acg-text-muted);
    font-size: 16px;
    cursor: pointer;
  }.acg-app .acg-mobile-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--acg-card);
    border-top: 1px solid var(--acg-border-light);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    z-index: 999;
    padding: 0 8px;
    gap: 4px;
    align-items: stretch;
	padding: 0;
    gap: 0;
  }.acg-app .acg-mobile-bar-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.15s;
    color: var(--acg-text-muted);
    padding: 6px 0;
    margin: 6px 2px;
	border-right: 1px solid #0000004f;
    border-radius: 0;
    margin: 0;
    padding: 0;
  }.acg-app .acg-mobile-bar-btn.active {
    background: var(--acg-primary-light);
    color: var(--acg-primary);
  }.acg-app .acg-mobile-bar-icon {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
  }.acg-app .acg-mobile-bar-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
  }.acg-app .acg-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 999;
    animation: acg-fade-in 0.2s ease;
  }

  @keyframes acg-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }.acg-app .acg-preview-card {
    min-height: 220px;
  }.acg-app .acg-float-export {
    top: 8px;
    right: 8px;
  }.acg-app .acg-float-btn {
    padding: 4px 8px;
    font-size: 10px;
  }.acg-app .acg-mobile-actions {
    display: none !important;
  }.acg-app .acg-toast {
    bottom: 80px;
  }.acg-app .acg-mobile-input-bar {
    display: flex;
  }
}
.acg-app .acg-mobile-text-panel {
  display: none;
}
@media (max-width: 900px) {
  .acg-app .acg-mobile-text-panel {
    display: block;
  }
}
.acg-app .acg-text-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.acg-app .acg-text-action-row {
  display: flex;
  align-items: center;
  gap: 2px;
}
.acg-app .acg-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--acg-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
}
.acg-app .acg-action-btn:hover {
  background: var(--acg-bg-alt);
  color: var(--acg-text);
}
.acg-app .acg-action-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.acg-app .acg-action-btn:disabled:hover {
  background: transparent;
  color: var(--acg-text-muted);
}
.acg-app .acg-action-clear:hover {
  color: #ef4444;
  background: #fef2f2;
}
.acg-app .acg-mic-btn.listening {
  background: #ef4444;
  color: #fff;
  animation: acg-pulse 1s ease-in-out infinite;
}
@keyframes acg-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.acg-app .acg-mobile-input-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  background: rgba(255,255,255,0.97);
  border-top: 1px solid var(--acg-border);
  padding: 10px 12px;
  gap: 8px;
  align-items: stretch;
  box-shadow: 0 -4px 20px -4px rgba(0,0,0,0.10);
}
.acg-app .acg-mobile-textarea {
  flex: 1;
  min-height: 52px;
  max-height: 120px;
  resize: none;
}
.acg-app .acg-mobile-input-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
.acg-app .acg-mobile-input-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--acg-border-light);
  background: #fff;
  cursor: pointer;
  color: var(--acg-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
}
.acg-app .acg-mobile-input-btn:hover {
  border-color: var(--acg-primary);
  color: var(--acg-primary);
}
.acg-app .acg-mobile-input-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.acg-app .acg-mobile-input-btn.acg-action-clear:hover {
  color: #ef4444;
  border-color: #fca5a5;
}
.acg-app .acg-mobile-input-btn.acg-mic-btn.listening {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
  animation: acg-pulse 1s ease-in-out infinite;
}
