* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  background: #faf8f5;
  color: #2b2730;
  overflow-x: clip;
}

body.sidebar-scroll-lock {
  overflow: hidden;
}

.app {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #fff;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  flex-shrink: 0;
  padding: 24px 24px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.palette-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: #8e8798;
}

.apply-mode-selector {
  display: flex;
  gap: 0;
  padding: 4px;
  background: #f7f5f9;
  border-radius: 12px;
  margin-bottom: 16px;
}

.mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #6f6678;
}

.mode-btn:hover {
  background: rgba(255, 255, 255, 0.5);
}

.mode-btn.active {
  background: #fff;
  box-shadow: 0 2px 8px rgba(93, 78, 109, 0.12);
  color: #5d4e6d;
}

.mode-icon {
  font-size: 1.15rem;
}

.mode-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.header-buttons {
  display: flex;
  gap: 8px;
}

.settings-icon-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  color: #5d4e6d;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.settings-icon-toggle:hover,
.settings-icon-toggle.active {
  background: #f4a5ae;
  border-color: #f4a5ae;
  color: #fff;
}

.sidebar-body {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 8px 24px 24px;
}

.gradient-color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gradient-color-item {
  display: grid;
  gap: 6px;
}

.gradient-color-side {
  font-size: 0.68rem;
  color: #8d8798;
  font-weight: 600;
}

.gradient-color-control {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e7e3ed;
  border-radius: 10px;
  background: #fff;
  padding: 6px 8px;
  cursor: pointer;
}

.gradient-color-control * {
  cursor: pointer;
}

.gradient-picker-trigger {
  width: 28px;
  height: 28px;
}

.gradient-color-control .pickr {
  line-height: 0;
}

.gradient-color-control .pickr .pcr-button {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: none;
}

.gradient-color-control .pickr .pcr-button::before,
.gradient-color-control .pickr .pcr-button::after {
  border-radius: 999px;
}

.gradient-color-hex {
  font-size: 0.72rem;
  color: #5a5266;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.text-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-color-gradient-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid #e0d8e8;
  background: #fff;
  color: #5d4e6d;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.18s;
}

.text-color-gradient-btn:hover {
  border-color: #d7aec9;
  background: #fdf5f7;
}

.text-color-gradient-btn.is-active {
  border-color: #f4a5ae;
  background: #f4a5ae;
  color: #fff;
}

.text-color-gradient-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.panel-floating {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 8px;
  margin: 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 18px;
  z-index: 20;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: transform 0.22s ease, opacity 0.22s ease, visibility 0.22s ease;
}

.panel-floating.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.panel-header {
  font-size: 0.83rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5d4e6d;
  margin-bottom: 14px;
}

.panel-description {
  margin: -8px 0 12px;
  font-size: 0.74rem;
  line-height: 1.5;
  color: #6f6777;
}

#ai-panel.panel-floating {
  max-height: calc(100vh - 190px);
}

.panel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.panel-tab-btn {
  border: 1px solid #e7e3ed;
  background: #fff;
  color: #6f6678;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.panel-tab-btn.active {
  background: #5d4e6d;
  border-color: #5d4e6d;
  color: #fff;
}

.panel-tab-content {
  display: none;
}

.panel-tab-content.is-active {
  display: block;
}

.settings-group {
  border: 1px solid #efeaf4;
  border-radius: 10px;
  padding: 12px;
  background: #fcfbfe;
}

.settings-group + .settings-group {
  margin-top: 10px;
}

.settings-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: #7c7490;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

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

.settings-group--other .settings-section {
  margin-bottom: 10px;
}

.settings-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.settings-label-row .settings-label {
  margin-bottom: 0;
}

.settings-label-row .meta-value {
  margin-top: 0;
}

.settings-label {
  display: block;
  font-size: 0.73rem;
  font-weight: 600;
  color: #766f80;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-input,
.palette-count-select,
.mini-select {
  width: 100%;
  border: 1px solid #e7e3ed;
  background: #fff;
  color: #332f3a;
  border-radius: 8px;
  padding: 9px 10px;
  outline: none;
  font-size: 0.86rem;
}

.settings-input:focus,
.palette-count-select:focus,
.mini-select:focus,
textarea:focus {
  border-color: #d7aec9;
  box-shadow: 0 0 0 2px rgba(244, 165, 174, 0.16);
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 10px;
  align-items: center;
}

.settings-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 20px;
  background: linear-gradient(90deg, #e4d2df, #cfc8e6);
  outline: none;
}

.settings-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #5d4e6d;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(93, 78, 109, 0.26);
  cursor: pointer;
}

.settings-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #5d4e6d;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(93, 78, 109, 0.26);
  cursor: pointer;
}

.meta-value {
  margin-top: 6px;
  font-size: 0.75rem;
  color: #8f8798;
  text-align: right;
}

.toggle-group {
  display: flex;
  gap: 8px;
}

.toggle-group.triple .toggle-btn {
  font-size: 0.68rem;
}

.toggle-group.quad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.toggle-group.quad .toggle-btn {
  font-size: 0.72rem;
}

.toggle-btn {
  flex: 1;
  border: 1px solid #e7e3ed;
  background: #fff;
  color: #6f6678;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn:hover {
  border-color: #d7aec9;
  color: #8b6380;
}

.toggle-btn.active {
  background: #f4a5ae;
  border-color: #f4a5ae;
  color: #fff;
}

.step-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.step-badge {
  background: #5d4e6d;
  color: #fff;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 700;
}

.step-text,
.prompt-label,
.result-label {
  font-size: 0.72rem;
  color: #6f6777;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.input-area {
  border: 1px solid #e7e3ed;
  background: #fbfafd;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 10px;
}

textarea {
  width: 100%;
  min-height: 56px;
  border: 0;
  background: transparent;
  resize: vertical;
  outline: none;
  font-family: "Inter", sans-serif;
  color: #413c48;
}

.palette-count-row {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 8px;
  align-items: center;
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.btn,
.btn-copy {
  border: 1px solid #e7e3ed;
  background: #fff;
  border-radius: 8px;
  color: #5d4e6d;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.btn {
  width: 100%;
  padding: 9px 12px;
  margin-top: 10px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
}

.btn-row .btn {
  margin-top: 0;
}

.btn-google {
  color: #1a73e8;
  border-color: rgba(26, 115, 232, 0.32);
  background: #fff;
}

.btn-google:hover {
  background: #1a73e8;
  border-color: #1a73e8;
  color: #fff;
}

.prompt-section-json {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #ece8f1;
}

.btn:hover,
.btn-copy:hover {
  background: #5d4e6d;
  border-color: #5d4e6d;
  color: #fff;
}

.prompt-result {
  margin: 14px 0;
  padding: 10px;
  border: 1px solid #e7e3ed;
  background: #fbfafd;
  border-radius: 8px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.btn-copy {
  padding: 5px 9px;
  font-size: 0.72rem;
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.prompt-text {
  margin: 0;
  max-height: 120px;
  overflow-y: auto;
  font-size: 0.72rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: #4a4353;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.gradient-list {
  display: grid;
  gap: 6px;
  padding-top: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  flex: 1;
}

.gradient-item {
  width: calc(100% - 10px);
  margin: 0 auto;
  height: 54px;
  border-radius: 8px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 5px;
  background: #fff;
  position: relative;
  overflow: hidden;
}

.gradient-item-inner {
  width: 100%;
  height: 100%;
  border-radius: 4px;
}

.gradient-item.active .gradient-item-inner {
  width: 100%;
}

.gradient-item:hover {
  border-color: #d7aec9;
  transform: scale(1.02);
}

.gradient-item.active {
  border: 2px solid #5d4e6d;
  padding: 3.5px;
}

.gradient-item.just-added {
  animation: gradient-added-pop 0.72s ease-out;
}

@keyframes gradient-added-pop {
  0% {
    transform: scale(0.94);
    box-shadow: 0 0 0 0 rgba(244, 165, 174, 0.55);
  }
  60% {
    transform: scale(1.04);
    box-shadow: 0 0 0 8px rgba(244, 165, 174, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(244, 165, 174, 0);
  }
}

/* ===== Download Section ===== */
.download-section {
  padding: 14px 20px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: #faf8f5;
}

.download-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #8a7f94;
  margin-bottom: 10px;
}

.download-btn-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.download-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 16px;
  border: 1.5px solid #e0d8e8;
  border-radius: 10px;
  background: #fff;
  color: #5d4e6d;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
  text-align: left;
}

.download-btn-main {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
}

.download-btn-desc {
  font-size: 0.74rem;
  font-weight: 400;
  opacity: 0.7;
  padding-left: 2px;
}

.download-btn:hover {
  background: #f4a5ae;
  border-color: #f4a5ae;
  color: #fff;
  transform: translateY(-1px);
}

.download-btn:active {
  transform: translateY(0);
}

.download-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.preview-canvas-wrap {
  width: 100%;
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 12px;
  background-color: #f5f1f8;
  background-image:
    linear-gradient(45deg, #ddd8e4 25%, transparent 25%),
    linear-gradient(-45deg, #ddd8e4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ddd8e4 75%),
    linear-gradient(-45deg, transparent 75%, #ddd8e4 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}

.sidebar-footer {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.footer-btn {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #5d4e6d;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.footer-btn:hover {
  background: #f7f5f9;
  border-color: #d7aec9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(93, 78, 109, 0.15);
}

.footer-btn.active {
  background: #f4a5ae;
  border-color: #f4a5ae;
  color: #fff;
}

.footer-btn i {
  font-size: 0.95rem;
}

.main-content {
  padding: 28px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 18px;
  position: sticky;
  top: 0;
  z-index: 8;
  background: #faf8f5;
  padding: 10px 0 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.content-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.content-title-texts {
  min-width: 0;
}

.sidebar-toggle-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  flex: 0 0 40px;
  padding: 0;
  line-height: 1;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px solid #e7e3ed;
  background: #fff;
  color: #5d4e6d;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
  background: #5d4e6d;
  border-color: #5d4e6d;
  color: #fff;
}

.sidebar-toggle-btn:focus-visible {
  outline: 2px solid #5d4e6d;
  outline-offset: 2px;
}

.sidebar-overlay {
  display: none;
}

.content-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.font-search-wrap {
  min-width: 240px;
  position: relative;
}

.font-filter-wrap {
  min-width: 120px;
}

.font-filter-select {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #e7e3ed;
  background: #fff;
  color: #3a3443;
  padding: 0 10px;
  font-size: 0.84rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.font-filter-select:focus {
  border-color: #d7aec9;
  box-shadow: 0 0 0 2px rgba(244, 165, 174, 0.16);
}

.font-search-input {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #e7e3ed;
  background: #fff;
  color: #3a3443;
  padding: 0 12px;
  font-size: 0.86rem;
  outline: none;
}

.font-search-input:focus {
  border-color: #d7aec9;
  box-shadow: 0 0 0 2px rgba(244, 165, 174, 0.16);
}

.font-search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #e7e3ed;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  z-index: 20;
  display: none;
}

.font-search-suggestions.open {
  display: block;
}

.font-suggestion-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 9px 11px;
  font-size: 0.84rem;
  color: #3a3443;
  cursor: pointer;
}

.font-suggestion-item:hover,
.font-suggestion-item.is-active {
  background: #f7f1f8;
  color: #5d4e6d;
}

.content-title {
  font-size: 1.3rem;
  color: #312d37;
  margin-bottom: 4px;
}

.content-subtitle {
  font-size: 0.85rem;
  color: #817989;
}

.layout-switch {
  display: inline-flex;
  border: 1px solid #e7e3ed;
  border-radius: 10px;
  overflow: hidden;
}

.layout-btn {
  border: 0;
  background: #fff;
  color: #6e6477;
  cursor: pointer;
  padding: 8px 12px;
  font-weight: 700;
  min-width: 52px;
}

.layout-btn.active {
  background: #5d4e6d;
  color: #fff;
}

.font-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

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

.font-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.font-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
}

.font-card.active {
  border-color: #5d4e6d;
}

.font-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  gap: 8px;
}

.font-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #433c4b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-meta {
  font-size: 0.68rem;
  color: #9b93a4;
  text-transform: uppercase;
}

.sample-heading {
  line-height: 1.3;
  font-weight: 700;
  word-break: break-word;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  position: relative;
}

.workspace-layout.has-code-open {
  grid-template-columns: minmax(0, 1fr) 370px;
}

.code-panel {
  width: 370px;
  position: sticky;
  top: 82px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform: translateX(0);
  opacity: 1;
}

.code-panel.is-hidden {
  position: absolute;
  right: 0;
  top: 0;
  transform: translateX(24px);
  opacity: 0;
  pointer-events: none;
}

.panel-toggle-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #e7e3ed;
  background: #ffffff;
  color: #5d4e6d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.panel-toggle-btn:hover {
  background: #5d4e6d;
  color: #fff;
  border-color: #5d4e6d;
}

.panel-toggle-btn.is-active {
  background: #f4a5ae;
  border-color: #f4a5ae;
  color: #fff;
}

.panel-mode-content.is-hidden {
  display: none;
}

.code-panel-head {
  margin-bottom: 10px;
}

.code-panel-head h3 {
  font-size: 0.95rem;
  color: #3f3748;
}

.code-panel-head p {
  font-size: 0.8rem;
  color: #8b8394;
  margin-top: 4px;
}

.code-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.code-tab-btn {
  border: 1px solid #e7e3ed;
  background: #fff;
  color: #6f6678;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.code-tab-btn.active {
  background: #5d4e6d;
  border-color: #5d4e6d;
  color: #fff;
}

.code-font-section.is-hidden {
  display: none;
}

.code-section {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.code-header h3 {
  font-size: 0.9rem;
  color: #3f3748;
}

.code-block {
  background: #241f2b;
  color: #f5f1f9;
  border-radius: 8px;
  padding: 14px;
  min-height: 88px;
  margin: 0;
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

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

  .code-panel {
    position: static;
    width: 100%;
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .code-panel.is-hidden {
    display: none;
    position: static;
    transform: none;
    opacity: 1;
  }

  .panel-toggle-btn {
    width: 38px;
    height: 38px;
  }

  .font-grid.cols-3,
  .font-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .content-header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .font-search-wrap {
    flex: 1;
    min-width: 180px;
  }

  .font-filter-wrap {
    min-width: 110px;
  }

  .layout-switch {
    display: none;
  }
}

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

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(340px, 88vw);
    height: 100vh;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 0;
    z-index: 120;
    transform: translateX(-105%);
    transition: transform 0.24s ease;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  }

  .app.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(20, 15, 28, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 110;
  }

  .app.sidebar-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar-toggle-btn {
    display: inline-flex;
  }

  .font-grid.cols-2,
  .font-grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .content-header {
    align-items: center;
  }
}

/* ===== Footer ===== */
.preview-footer {
  background: #2b2730;
  color: #fff;
  padding: 60px 40px 30px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 50px;
  margin-bottom: 40px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.footer-logo {
  width: 50px;
  height: 50px;
  background: rgba(244, 165, 174, 0.18);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #f4a5ae;
}

.footer-brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.footer-description {
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 24px;
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.social-link {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.25s ease, transform 0.25s ease;
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
}

.footer-heading {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: #fff;
}

.footer-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.25s ease;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.footer-bottom a:hover {
  color: #fff;
}

@media (max-width: 640px) {
  .preview-footer {
    padding: 48px 20px 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}
