:root {
  --leaf-950: #09140f;
  --leaf-900: #102119;
  --leaf-800: #1d3728;
  --leaf-700: #2c573d;
  --leaf-500: #5d936d;
  --leaf-300: #b8d8b7;
  --mint-100: #edf7ef;
  --mist: rgba(242, 250, 239, 0.82);
  --night-glass: rgba(9, 20, 15, 0.68);
  --paper: #fbfff9;
  --stone: #667264;
  --shadow: 0 26px 90px rgba(3, 10, 7, 0.34);
  --radius: 8px;
  --page-padding: clamp(16px, 4vw, 72px);
  --control-height: 44px;
  --control-padding: 0 14px;
  --control-font-size: 0.95rem;
  --control-font-weight: 700;
  --control-gap: 8px;
  --control-light: #d8f2c8;
  --control-dark: var(--leaf-800);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #edf7ef;
  background:
    linear-gradient(180deg, rgba(5, 16, 10, 0.72), rgba(10, 24, 16, 0.74) 45%, rgba(17, 36, 24, 0.62)),
    url("https://images.unsplash.com/photo-1448375240586-882707db888b?auto=format&fit=crop&w=2400&q=85")
      center / cover fixed;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    radial-gradient(circle at 18% 20%, rgba(184, 216, 183, 0.18), transparent 30%),
    radial-gradient(circle at 78% 10%, rgba(93, 147, 109, 0.16), transparent 26%),
    linear-gradient(135deg, rgba(3, 10, 7, 0.34), rgba(24, 63, 42, 0.18));
  pointer-events: none;
  animation: ambient-shift 16s ease-in-out infinite alternate;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: 100%;
  margin: 0;
  padding: 24px var(--page-padding) 56px;
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius);
  color: #edf7ef;
  background: rgba(9, 20, 15, 0.72);
  box-shadow: 0 14px 42px rgba(3, 10, 7, 0.24);
  backdrop-filter: blur(18px);
  animation: slide-in 700ms ease both;
}

.brand,
.nav-links,
.quick-filters,
.collection-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(140deg, #d8f2c8, var(--leaf-500));
  box-shadow: 0 10px 28px rgba(184, 216, 183, 0.24);
}

.nav-links {
  gap: 6px;
}

.nav-links a,
.soft-link,
.suggest a,
.tool-card a {
  border-radius: var(--radius);
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.nav-links a {
  padding: 10px 12px;
  color: rgba(237, 247, 239, 0.82);
  font-size: 0.94rem;
}

.nav-links a:hover {
  color: #ffffff;
  background: rgba(184, 216, 183, 0.14);
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 14px 0 10px;
  border-radius: var(--radius);
  color: white;
  background: var(--leaf-800);
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.back-button:hover {
  transform: translateY(-2px);
  background: var(--leaf-700);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: clamp(24px, 4vw, 64px);
  min-height: calc(100vh - 124px);
  align-items: center;
  padding: 72px 0 54px;
}

.hero-simple {
  grid-template-columns: 1fr;
  min-height: auto;
  padding: 80px 0 48px;
  text-align: center;
}

.hero-simple .hero-copy {
  display: grid;
  gap: 18px;
  justify-items: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero-simple h1 {
  margin: 0;
  font-size: clamp(3.4rem, 9vw, 6rem);
}

.hero-simple .intro {
  margin: 0;
  max-width: 560px;
}

.hero-simple .search-panel {
  width: min(520px, 100%);
  grid-template-columns: 1fr auto;
}

.hero-simple .search-panel button {
  width: auto;
  height: auto;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--leaf-800);
  font-weight: 700;
  cursor: pointer;
}

.hero-simple .search-panel button:hover {
  background: var(--leaf-700);
}

.hero-simple .quick-filters {
  justify-content: center;
}

.hero-copy {
  max-width: 920px;
  animation: fade-up 800ms 120ms ease both;
}

.eyebrow,
.section-heading p {
  margin: 0 0 12px;
  color: #cde8c9;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: clamp(3.2rem, 8vw, 7.5rem);
  line-height: 1.04;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.intro {
  max-width: 760px;
  margin-bottom: 30px;
  color: rgba(237, 247, 239, 0.78);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.7;
}

.search-panel {
  display: grid;
  grid-template-columns: 1fr 52px;
  width: min(760px, 100%);
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  color: var(--leaf-950);
  background: rgba(242, 250, 239, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.search-panel:focus-within {
  outline: 3px solid rgba(93, 147, 109, 0.24);
}

.search-panel input {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 16px;
  color: var(--leaf-950);
  background: transparent;
}

.search-panel button {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 0;
  border-radius: var(--radius);
  color: white;
  background: linear-gradient(140deg, var(--leaf-800), var(--leaf-500));
  cursor: pointer;
}

.search-panel button:hover,
.tool-card a:hover,
.suggest a:hover,
.soft-link:hover {
  transform: translateY(-2px);
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.quick-filters {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.filter-button {
  min-height: var(--control-height);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  padding: 0 14px;
  color: rgba(237, 247, 239, 0.86);
  background: rgba(9, 20, 15, 0.44);
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.filter-button:hover,
.filter-button.is-active {
  color: white;
  background: linear-gradient(140deg, var(--leaf-700), var(--leaf-500));
}

.filter-button:hover {
  transform: translateY(-1px);
}

.mood-panel {
  position: relative;
  overflow: hidden;
  min-height: min(560px, 62vh);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: var(--radius);
  color: white;
  background:
    linear-gradient(180deg, rgba(16, 33, 25, 0.18), rgba(4, 12, 8, 0.82)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1200&q=85")
      center / cover;
  box-shadow: var(--shadow);
  animation: fade-up 900ms 260ms ease both, soft-breathe 7s ease-in-out infinite;
}

.mood-panel::after {
  position: absolute;
  inset: auto 28px 28px 28px;
  height: 1px;
  content: "";
  background: rgba(255, 255, 255, 0.38);
}

.mood-panel h2 {
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.mood-panel p,
.mood-panel a {
  position: relative;
  z-index: 1;
}

.mood-panel > p:first-of-type {
  margin-bottom: 120px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.mood-text {
  max-width: 340px;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.6;
}

.soft-link {
  display: inline-flex;
  margin-top: 10px;
  padding: 12px 14px;
  color: var(--leaf-950);
  background: rgba(255, 255, 255, 0.82);
}

.orbital {
  position: absolute;
  top: 36px;
  right: 34px;
  width: 96px;
  height: 96px;
  animation: float 6s ease-in-out infinite;
}

.orbital span {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  inset: 0;
}

.orbital span:nth-child(2) {
  inset: 18px;
}

.orbital span:nth-child(3) {
  inset: 36px;
  background: rgba(255, 255, 255, 0.34);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 8px 0 18px;
}

.section-heading h2,
.collections h2,
.suggest h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
  letter-spacing: 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
  scroll-margin-top: 96px;
}

.how-grid {
  scroll-margin-top: 96px;
}

.tool-card {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  color: #edf7ef;
  background: rgba(9, 20, 15, 0.66);
  box-shadow: 0 18px 50px rgba(3, 10, 7, 0.24);
  backdrop-filter: blur(18px);
  transition:
    transform 220ms ease,
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    opacity 180ms ease;
}

.tool-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, transparent, #d8f2c8, transparent);
  opacity: 0;
  transform: translateX(-35%);
  transition:
    opacity 220ms ease,
    transform 520ms ease;
}

.tool-card:hover {
  transform: translateY(-8px);
  border-color: rgba(184, 216, 183, 0.48);
  background: rgba(14, 32, 22, 0.82);
  box-shadow: 0 28px 80px rgba(3, 10, 7, 0.34);
}

.tool-card:hover::before {
  opacity: 1;
  transform: translateX(35%);
}

.tool-card.is-hidden {
  display: none;
}

.tool-card:hover .tool-icon {
  transform: rotate(-6deg) scale(1.06);
  background: rgba(184, 216, 183, 0.4);
}

.tool-icon {
  transition: transform 360ms cubic-bezier(0.18, 0.7, 0.18, 1), background 280ms ease;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 72px;
  padding-bottom: 56px;
}

.how-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 10px;
  padding: 28px 24px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  color: #edf7ef;
  background: rgba(9, 20, 15, 0.66);
  box-shadow: 0 18px 50px rgba(3, 10, 7, 0.24);
  backdrop-filter: blur(18px);
  transition: transform 320ms ease, border-color 320ms ease, background 320ms ease;
}

.how-card::before {
  position: absolute;
  inset: -2px auto auto -2px;
  width: 60%;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, #d8f2c8, transparent);
  opacity: 0;
  transform: translateX(-30%);
  transition: opacity 320ms ease, transform 520ms ease;
}

.how-card:hover {
  transform: translateY(-6px);
  border-color: rgba(184, 216, 183, 0.48);
  background: rgba(14, 32, 22, 0.84);
}

.how-card:hover::before {
  opacity: 1;
  transform: translateX(0);
}

.how-num {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--leaf-300);
}

.how-card h3 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: 0;
}

.how-card p {
  margin: 0;
  color: rgba(237, 247, 239, 0.74);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .how-grid {
    grid-template-columns: 1fr;
    margin-top: 40px;
  }

  .hero-simple {
    padding-top: 48px;
    text-align: left;
  }

  .hero-simple .hero-copy {
    justify-items: start;
  }

  .hero-simple .quick-filters {
    justify-content: flex-start;
  }
}

.tool-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 28px;
  border-radius: var(--radius);
  color: #edf7ef;
  background: rgba(184, 216, 183, 0.16);
}

.tool-card h3 {
  margin-bottom: 10px;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.tool-card p {
  min-height: 74px;
  color: rgba(237, 247, 239, 0.68);
  line-height: 1.6;
}

.tool-card a,
.suggest a {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-height);
  padding: 0 14px;
  color: var(--leaf-950);
  background: #d8f2c8;
}

.collections,
.suggest {
  margin-top: 16px;
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(3, 10, 7, 0.22);
  backdrop-filter: blur(18px);
}

.collections {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  color: white;
  background: rgba(9, 20, 15, 0.78);
}

.collections .eyebrow {
  color: var(--leaf-300);
}

.collection-row {
  flex-wrap: wrap;
  gap: 10px;
}

.collection-row span {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.08);
}

.suggest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  color: #edf7ef;
  background: rgba(9, 20, 15, 0.66);
}

.suggest p {
  max-width: 520px;
  margin: 8px 0 0;
  color: rgba(237, 247, 239, 0.68);
}

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

.tool-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: clamp(20px, 4vw, 52px);
  align-items: end;
  padding: 72px 0 30px;
}

.tool-hero h1 {
  margin-bottom: 16px;
  max-width: min(980px, 100%);
  font-size: clamp(2.9rem, 7vw, 5.8rem);
  line-height: 1.06;
}

.tool-title-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tool-title-row h1 {
  flex: 0 1 auto;
  margin-bottom: 0;
}

.help-icon-button {
  display: inline-grid;
  width: clamp(34px, 4vw, 42px);
  height: clamp(34px, 4vw, 42px);
  flex: 0 0 auto;
  margin-top: clamp(6px, 1.4vw, 14px);
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  color: var(--leaf-950);
  background: var(--control-light);
  cursor: pointer;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 12px 30px rgba(3, 10, 7, 0.18);
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.help-icon-button:hover {
  transform: translateY(-2px);
  background: #c7edb9;
  box-shadow: 0 16px 38px rgba(3, 10, 7, 0.22);
}

.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 10, 7, 0.62);
  backdrop-filter: blur(8px);
}

.help-overlay[hidden] {
  display: none;
}

.help-dialog {
  position: relative;
  width: min(520px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  padding: 26px;
  color: var(--leaf-950);
  background: rgba(251, 255, 249, 0.96);
  box-shadow: 0 28px 90px rgba(3, 10, 7, 0.34);
}

.help-dialog h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
}

.help-dialog ol {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--stone);
  line-height: 1.65;
}

.help-dialog li + li {
  margin-top: 8px;
}

.help-close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #edf7ef;
  background: var(--control-dark);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.symbol-search {
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: var(--radius);
  background: var(--mist);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.symbol-search:focus-within {
  outline: 3px solid rgba(93, 147, 109, 0.24);
}

.symbol-search input {
  width: 100%;
  min-height: 52px;
  border: 0;
  outline: 0;
  padding: 0 16px;
  color: var(--leaf-950);
  background: transparent;
}

.symbol-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.symbol-sidebar,
.symbols-board {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  background: rgba(251, 255, 249, 0.82);
  color: var(--leaf-950);
  box-shadow: 0 18px 45px rgba(16, 33, 25, 0.12);
  backdrop-filter: blur(18px);
}

.symbol-sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.category-button {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--leaf-800);
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.category-button:hover,
.category-button.is-active {
  color: white;
  background: var(--leaf-800);
}

.category-button:hover {
  transform: translateX(2px);
}

.symbols-board {
  padding: clamp(16px, 3vw, 28px);
}

.copy-status {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--leaf-800);
  background: rgba(184, 216, 183, 0.28);
}

.empty-state {
  display: none;
  margin: 18px 0 0;
  padding: 18px;
  border: 1px solid rgba(49, 93, 67, 0.14);
  border-radius: var(--radius);
  color: var(--stone);
  background: rgba(255, 255, 255, 0.42);
}

.empty-state.is-visible {
  display: block;
}

.symbol-section {
  padding: 20px 0;
  border-top: 1px solid rgba(49, 93, 67, 0.14);
}

.symbol-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.symbol-section h2 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.symbol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
}

.symbol-grid button {
  display: grid;
  min-height: 72px;
  place-items: center;
  border: 1px solid rgba(49, 93, 67, 0.16);
  border-radius: var(--radius);
  color: var(--leaf-950);
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.symbol-grid button:hover {
  transform: translateY(-3px);
  background: rgba(237, 247, 239, 0.96);
  box-shadow: 0 14px 30px rgba(16, 33, 25, 0.12);
}

.symbol-section[data-category="decor"] .symbol-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.symbol-section[data-category="decor"] .symbol-grid button {
  min-height: 94px;
  padding: 14px;
  overflow-wrap: anywhere;
  white-space: normal;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  line-height: 1.35;
}

.symbol-section.is-hidden,
.symbol-grid button.is-hidden {
  display: none;
}

.simple-tool-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 18px;
  align-items: center;
  min-height: 320px;
  padding: clamp(18px, 4vw, 36px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  background: rgba(251, 255, 249, 0.82);
  color: var(--leaf-950);
  box-shadow: 0 18px 45px rgba(16, 33, 25, 0.12);
  backdrop-filter: blur(18px);
}

.simple-tool-panel h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
}

.simple-tool-panel p {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--stone);
  line-height: 1.7;
}

.preview-circle {
  width: min(320px, 100%);
  aspect-ratio: 1;
  justify-self: end;
  border: 12px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(16, 33, 25, 0.05), rgba(16, 33, 25, 0.28)),
    url("https://images.unsplash.com/photo-1497250681960-ef046c08a56e?auto=format&fit=crop&w=800&q=85")
      center / cover;
  box-shadow: var(--shadow);
}

.cropper-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: stretch;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  color: var(--leaf-950);
  background: rgba(251, 255, 249, 0.86);
  box-shadow: 0 18px 50px rgba(3, 10, 7, 0.22);
  backdrop-filter: blur(18px);
}

.cropper-panel-editor {
  display: block;
  padding: clamp(18px, 3vw, 34px);
  background: rgba(239, 244, 239, 0.92);
}

.cropper-workspace {
  display: grid;
  grid-template-rows: auto minmax(360px, 62vh);
  gap: 12px;
  min-width: 0;
}

.cropper-panel-editor .cropper-workspace {
  grid-template-rows: auto minmax(420px, 64vh) auto;
  gap: 16px;
}

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

.cropper-panel-editor .cropper-toolbar {
  justify-content: center;
}

.crop-mode-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius);
  background: rgba(9, 20, 15, 0.14);
}

.crop-mode-switch button {
  min-height: var(--control-height);
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  padding: 0 12px;
  color: var(--leaf-800);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.crop-mode-switch button:hover {
  transform: translateY(-1px);
}

.crop-mode-switch button.is-active {
  color: #ffffff;
  background: var(--leaf-800);
}

#image-upload {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.upload-button,
.tool-action,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 14px;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    opacity 180ms ease;
}

.upload-button,
.download-button {
  color: var(--leaf-950);
  background: #d8f2c8;
}

.cropper-panel-editor .upload-button {
  color: #ffffff;
  background: #2d3742;
  font-weight: var(--control-font-weight);
  letter-spacing: 0;
  text-transform: none;
}

.tool-action {
  color: #edf7ef;
  background: var(--leaf-800);
}

.upload-button:hover,
.tool-action:hover,
.download-button:hover {
  transform: translateY(-2px);
}

.tool-action:disabled,
.download-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
}

.crop-stage {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  border: 1px solid rgba(49, 93, 67, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(45deg, rgba(49, 93, 67, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(49, 93, 67, 0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(49, 93, 67, 0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(49, 93, 67, 0.08) 75%);
  background-color: rgba(237, 247, 239, 0.72);
  background-position:
    0 0,
    0 12px,
    12px -12px,
    -12px 0;
  background-size: 24px 24px;
}

.cropper-panel-editor .crop-stage {
  width: min(100%, 980px);
  min-height: 420px;
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  background-color: #9b9b9b;
  background-image:
    linear-gradient(45deg, #7c7c7c 25%, transparent 25%),
    linear-gradient(-45deg, #7c7c7c 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #7c7c7c 75%),
    linear-gradient(-45deg, transparent 75%, #7c7c7c 75%);
}

.crop-stage.is-dragging {
  outline: 3px solid rgba(93, 147, 109, 0.28);
}

.crop-stage[data-mode="image"] {
  cursor: grab;
}

.crop-stage[data-mode="image"]:active {
  cursor: grabbing;
}

.crop-stage img {
  position: absolute;
  display: block;
  max-width: none;
  user-select: none;
  pointer-events: none;
}

.crop-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--leaf-800);
  font-weight: 700;
}

.crop-placeholder svg {
  width: 46px;
  height: 46px;
}

.crop-stage:not(.is-empty) .crop-placeholder {
  display: none;
}

.crop-frame {
  position: absolute;
  display: none;
  border: 2px solid #147514;
  border-radius: 0;
  box-shadow:
    0 16px 40px rgba(3, 10, 7, 0.24),
    inset 0 0 0 1px rgba(3, 10, 7, 0.18);
  cursor: grab;
  touch-action: none;
}

.crop-stage:not(.is-empty) .crop-frame {
  display: block;
}

.crop-frame:active {
  cursor: grabbing;
}

.crop-frame.is-fixed {
  cursor: default;
  pointer-events: none;
}

.crop-frame.is-fixed .crop-handle {
  display: none;
}

.crop-frame::before {
  position: absolute;
  inset: 0;
  content: "";
  border: 2px solid #ff315e;
  border-radius: 50%;
  pointer-events: none;
}

.crop-frame::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, transparent calc(33.333% - 0.5px), rgba(255, 255, 255, 0.46) calc(33.333% - 0.5px), rgba(255, 255, 255, 0.46) calc(33.333% + 0.5px), transparent calc(33.333% + 0.5px)),
    linear-gradient(90deg, transparent calc(66.666% - 0.5px), rgba(255, 255, 255, 0.46) calc(66.666% - 0.5px), rgba(255, 255, 255, 0.46) calc(66.666% + 0.5px), transparent calc(66.666% + 0.5px)),
    linear-gradient(0deg, transparent calc(33.333% - 0.5px), rgba(255, 255, 255, 0.46) calc(33.333% - 0.5px), rgba(255, 255, 255, 0.46) calc(33.333% + 0.5px), transparent calc(33.333% + 0.5px)),
    linear-gradient(0deg, transparent calc(66.666% - 0.5px), rgba(255, 255, 255, 0.46) calc(66.666% - 0.5px), rgba(255, 255, 255, 0.46) calc(66.666% + 0.5px), transparent calc(66.666% + 0.5px));
  pointer-events: none;
}

.crop-handle {
  position: absolute;
  z-index: 2;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(8, 63, 8, 0.68);
  background: #1abb1a;
}

.crop-handle-nw {
  top: -5px;
  left: -5px;
  cursor: nwse-resize;
}

.crop-handle-n {
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.crop-handle-ne {
  top: -5px;
  right: -5px;
  cursor: nesw-resize;
}

.crop-handle-e {
  top: 50%;
  right: -5px;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.crop-handle-se {
  right: -5px;
  bottom: -5px;
  cursor: nwse-resize;
}

.crop-handle-s {
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.crop-handle-sw {
  bottom: -5px;
  left: -5px;
  cursor: nesw-resize;
}

.crop-handle-w {
  top: 50%;
  left: -5px;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.crop-center-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.crop-center-mark::before,
.crop-center-mark::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "";
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(3, 10, 7, 0.28);
  transform: translate(-50%, -50%);
}

.crop-center-mark::before {
  width: 26px;
  height: 2px;
}

.crop-center-mark::after {
  width: 2px;
  height: 26px;
}

.cropper-controls {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 16px;
  align-content: start;
  min-width: 0;
}

.cropper-panel-editor .cropper-controls {
  display: grid;
  grid-template-columns: minmax(180px, 320px) minmax(180px, 320px) auto auto;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.crop-preview-wrap {
  display: grid;
  place-items: center;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(184, 216, 183, 0.24);
}

#crop-preview {
  width: min(100%, 280px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #edf7ef;
  box-shadow: 0 18px 45px rgba(16, 33, 25, 0.18);
}

.range-control {
  display: grid;
  gap: 10px;
  color: var(--leaf-800);
  font-weight: 800;
}

.range-control input {
  width: 100%;
  accent-color: var(--leaf-700);
}

.download-button {
  width: 100%;
}

.crop-output-canvas {
  display: none;
}

.crop-circle-button {
  width: auto;
  min-height: var(--control-height);
  padding: 0 22px;
  color: #ffffff;
  background: #e63c4d;
  font-size: var(--control-font-size);
  font-weight: var(--control-font-weight);
  letter-spacing: 0;
  text-transform: none;
}

.crop-circle-button:hover {
  background: #cf3040;
}

.swatch-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(54px, 1fr));
  gap: 10px;
}

.swatch-row span {
  min-height: 160px;
  border-radius: var(--radius);
  background: var(--swatch);
  box-shadow: 0 14px 30px rgba(16, 33, 25, 0.12);
}

.palette-panel {
  display: grid;
  gap: 16px;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  color: var(--leaf-950);
  background: rgba(251, 255, 249, 0.88);
  box-shadow: 0 18px 50px rgba(3, 10, 7, 0.22);
  backdrop-filter: blur(18px);
}

.palette-controls {
  display: grid;
  grid-template-columns: minmax(190px, 260px) minmax(280px, 1fr) auto auto;
  gap: 12px;
  align-items: stretch;
}

.color-picker-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(49, 93, 67, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
}

.color-picker-card span {
  grid-column: 1 / -1;
  color: var(--stone);
  font-weight: 800;
}

.color-picker-card input {
  width: 52px;
  height: 42px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.color-picker-card strong {
  font-size: 1.08rem;
}

.palette-mode-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius);
  background: rgba(9, 20, 15, 0.12);
}

.palette-mode-group button,
.palette-presets button {
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  color: var(--leaf-800);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.palette-mode-group button {
  min-height: var(--control-height);
  padding: 0 10px;
}

.palette-mode-group button:hover,
.palette-presets button:hover {
  transform: translateY(-1px);
}

.palette-mode-group button.is-active {
  color: #ffffff;
  background: var(--leaf-800);
}

.palette-status {
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--leaf-800);
  background: rgba(184, 216, 183, 0.28);
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 430px;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(16, 33, 25, 0.18);
}

.palette-swatch {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  border: 0;
  padding: 18px;
  color: var(--palette-text);
  background: var(--palette-color);
  cursor: pointer;
  text-align: left;
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.palette-swatch:hover {
  filter: brightness(1.04);
  transform: translateY(-4px);
}

.palette-swatch span {
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 900;
}

.palette-swatch small {
  opacity: 0.78;
  font-weight: 800;
}

.palette-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.palette-presets button {
  min-height: var(--control-height);
  padding: 0 14px;
  background: rgba(184, 216, 183, 0.24);
}

.back-button,
.filter-button,
.soft-link,
.suggest a,
.tool-card a,
.category-button,
.upload-button,
.tool-action,
.download-button,
.crop-mode-switch button,
.palette-mode-group button,
.palette-presets button,
.text-clear-button {
  min-height: var(--control-height);
  border-radius: var(--radius);
  padding: var(--control-padding);
  font-size: var(--control-font-size);
  font-weight: var(--control-font-weight);
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

.back-button,
.soft-link,
.suggest a,
.tool-card a,
.upload-button,
.tool-action,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--control-gap);
}

.back-button,
.tool-action,
.category-button.is-active,
.crop-mode-switch button.is-active,
.palette-mode-group button.is-active {
  color: #edf7ef;
  background: var(--control-dark);
}

.upload-button,
.download-button,
.tool-card a,
.suggest a,
.soft-link {
  color: var(--leaf-950);
  background: var(--control-light);
}

.crop-circle-button {
  width: auto;
  color: var(--leaf-950);
  background: var(--control-light);
}

.cropper-panel-editor .upload-button {
  color: var(--leaf-950);
  background: var(--control-light);
  font-weight: var(--control-font-weight);
  letter-spacing: 0;
  text-transform: none;
}

.back-button:hover,
.filter-button:hover,
.soft-link:hover,
.suggest a:hover,
.tool-card a:hover,
.category-button:hover,
.upload-button:hover,
.tool-action:hover,
.download-button:hover,
.crop-mode-switch button:hover,
.palette-mode-group button:hover,
.palette-presets button:hover,
.text-clear-button:hover,
.crop-circle-button:hover {
  transform: translateY(-2px);
}

.crop-circle-button:hover {
  background: #c7edb9;
}

.draft-textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid rgba(49, 93, 67, 0.16);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--leaf-950);
  background: rgba(255, 255, 255, 0.58);
  outline: 0;
}

.draft-textarea:focus {
  outline: 3px solid rgba(93, 147, 109, 0.24);
}

.text-cleaner-panel {
  display: grid;
  gap: 14px;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  color: var(--leaf-950);
  background: rgba(251, 255, 249, 0.88);
  box-shadow: 0 18px 50px rgba(3, 10, 7, 0.22);
  backdrop-filter: blur(18px);
}

.text-cleaner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.text-clear-button {
  min-height: var(--control-height);
  border: 1px solid rgba(49, 93, 67, 0.18);
  border-radius: var(--radius);
  padding: var(--control-padding);
  color: var(--leaf-800);
  background: rgba(255, 255, 255, 0.52);
  cursor: pointer;
  font-size: var(--control-font-size);
  font-weight: var(--control-font-weight);
  line-height: 1;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.text-clear-button:hover {
  transform: translateY(-2px);
  background: rgba(237, 247, 239, 0.96);
}

.text-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.text-stats span,
.text-cleaner-status {
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--leaf-800);
  background: rgba(184, 216, 183, 0.26);
}

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

.text-editor-card {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.text-editor-card span {
  color: var(--leaf-800);
  font-weight: 800;
}

.text-editor-card textarea {
  width: 100%;
  min-height: 420px;
  resize: vertical;
  border: 1px solid rgba(49, 93, 67, 0.16);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--leaf-950);
  background: rgba(255, 255, 255, 0.62);
  outline: 0;
  line-height: 1.6;
}

.text-editor-card textarea:focus {
  outline: 3px solid rgba(93, 147, 109, 0.24);
}

.text-cleaner-status {
  margin: 0;
}

.editor-panel {
  display: grid;
  gap: 12px;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  color: var(--leaf-950);
  background: rgba(251, 255, 249, 0.92);
  box-shadow: 0 18px 50px rgba(3, 10, 7, 0.22);
  backdrop-filter: blur(18px);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(49, 93, 67, 0.16);
  border-radius: var(--radius);
  background: rgba(237, 247, 239, 0.78);
}

.toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(49, 93, 67, 0.1);
}

.toolbar-group-end {
  margin-left: auto;
  background: transparent;
  border: 0;
}

.tb-btn {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 8px;
  color: var(--leaf-800);
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease, color 160ms ease;
}

.tb-btn:hover {
  background: rgba(184, 216, 183, 0.46);
  color: var(--leaf-950);
  transform: translateY(-1px);
}

.tb-btn.is-active {
  background: var(--leaf-800);
  color: #edf7ef;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.tb-btn.is-active:hover {
  background: var(--leaf-700);
  color: #ffffff;
}

.tb-select {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 8px;
  color: var(--leaf-800);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.tb-color {
  --swatch: #1d3728;
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
}

.tb-color-apply {
  display: inline-grid;
  grid-template-rows: 1fr 4px;
  align-items: center;
  justify-items: center;
  min-width: 30px;
  min-height: 36px;
  padding: 4px 8px 3px;
  border: 0;
  background: transparent;
  color: var(--leaf-800);
  cursor: pointer;
  font-weight: 800;
  transition: background 160ms ease, transform 160ms ease;
}

.tb-color-apply:hover {
  background: rgba(184, 216, 183, 0.46);
  transform: translateY(-1px);
}

.tb-color-letter {
  font-size: 0.95rem;
  line-height: 1;
}

.tb-color-bar {
  display: block;
  width: 18px;
  height: 4px;
  border-radius: 1px;
  background: var(--swatch);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.tb-color-pick {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  cursor: pointer;
  background: rgba(184, 216, 183, 0.24);
  border-left: 1px solid rgba(49, 93, 67, 0.16);
}

.tb-color-pick::before {
  content: "▾";
  font-size: 10px;
  color: var(--leaf-800);
}

.tb-color-pick:hover {
  background: rgba(184, 216, 183, 0.6);
}

.tb-color-pick input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.editor-hint {
  color: var(--stone) !important;
  background: transparent !important;
  font-style: italic;
}

.editor-surface {
  min-height: 480px;
  padding: 22px clamp(18px, 3vw, 36px);
  border: 1px solid rgba(49, 93, 67, 0.18);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--leaf-950);
  outline: 0;
  line-height: 1.7;
  font-size: 1.02rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 24px rgba(16, 33, 25, 0.06);
  overflow-wrap: anywhere;
}

.editor-surface:focus {
  outline: 3px solid rgba(93, 147, 109, 0.28);
}

.editor-surface h1,
.editor-surface h2,
.editor-surface h3 {
  margin: 0.6em 0 0.3em;
  line-height: 1.2;
  letter-spacing: 0;
}

.editor-surface h1 { font-size: 2rem; }
.editor-surface h2 { font-size: 1.55rem; }
.editor-surface h3 { font-size: 1.25rem; }

.editor-surface p {
  margin: 0 0 0.8em;
}

.editor-surface blockquote {
  margin: 0.6em 0;
  padding: 8px 14px;
  border-left: 4px solid var(--leaf-500);
  color: var(--leaf-800);
  background: rgba(184, 216, 183, 0.22);
  border-radius: 4px;
}

.editor-surface pre {
  margin: 0.6em 0;
  padding: 12px 14px;
  border-radius: 6px;
  background: #0f1a14;
  color: #d8f2c8;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92rem;
  white-space: pre-wrap;
}

.editor-surface ul,
.editor-surface ol {
  margin: 0 0 0.8em;
  padding-left: 1.6em;
}

.ctx-menu {
  position: fixed;
  z-index: 200;
  display: none;
  min-width: 220px;
  padding: 6px;
  border: 1px solid rgba(49, 93, 67, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 50px rgba(3, 10, 7, 0.28), 0 4px 14px rgba(3, 10, 7, 0.14);
  backdrop-filter: blur(14px);
  animation: ctx-pop 140ms ease both;
}

.ctx-menu.is-open {
  display: block;
}

@keyframes ctx-pop {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ctx-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--leaf-950);
  text-align: left;
  cursor: pointer;
  font-size: 0.92rem;
}

.ctx-item:hover {
  background: rgba(184, 216, 183, 0.42);
}

.ctx-item kbd {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(9, 20, 15, 0.08);
  color: var(--stone);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.74rem;
}

.ctx-glyph {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(184, 216, 183, 0.36);
  color: var(--leaf-800);
  font-weight: 800;
  font-size: 0.82rem;
}

.ctx-sep {
  height: 1px;
  margin: 4px 6px;
  background: rgba(49, 93, 67, 0.16);
}

.ctx-swatch {
  justify-self: end;
  display: inline-block;
  width: 22px;
  height: 14px;
  border-radius: 3px;
  background: #1d3728;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.editor-surface.is-empty::before {
  content: attr(data-placeholder);
  display: block;
  color: #9aa39a;
  font-style: italic;
  pointer-events: none;
  position: absolute;
}

.editor-surface {
  position: relative;
}

.resize-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 980px);
  min-height: 420px;
  margin: 0 auto;
  overflow: hidden;
  background-color: #9b9b9b;
  background-image:
    linear-gradient(45deg, #7c7c7c 25%, transparent 25%),
    linear-gradient(-45deg, #7c7c7c 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #7c7c7c 75%),
    linear-gradient(-45deg, transparent 75%, #7c7c7c 75%);
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.resize-frame {
  position: relative;
  display: none;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(3, 10, 7, 0.34), 0 0 0 1px rgba(0, 0, 0, 0.18);
  transition: width 120ms ease, height 120ms ease;
  max-width: 100%;
  max-height: 100%;
}

.resize-stage:not(.is-empty) .resize-frame {
  display: block;
}

.resize-frame img {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  pointer-events: none;
}

.resize-dim-label {
  position: absolute;
  bottom: -34px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(9, 20, 15, 0.86);
  color: #edf7ef;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
}

.resize-stage {
  padding: 28px 28px 56px;
}

.resize-stage.is-dragging {
  outline: 3px solid rgba(93, 147, 109, 0.4);
}

.resize-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--leaf-800);
  font-weight: 700;
  background: rgba(237, 247, 239, 0.62);
}

.resize-stage:not(.is-empty) .resize-placeholder {
  display: none;
}

.resize-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius);
  background: rgba(9, 20, 15, 0.08);
}

.resize-presets button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--leaf-800);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.resize-presets button:hover {
  background: rgba(184, 216, 183, 0.6);
  transform: translateY(-1px);
}

.resize-presets button.is-active {
  background: var(--leaf-800);
  color: #edf7ef;
  box-shadow: 0 6px 14px rgba(29, 55, 40, 0.28);
}

.resize-presets button.is-active:hover {
  background: var(--leaf-700);
}

.resize-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(49, 93, 67, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.6);
}

.resize-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.resize-field span {
  color: var(--stone);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.resize-field input[type="number"],
.resize-field select {
  min-height: var(--control-height);
  border: 1px solid rgba(49, 93, 67, 0.2);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--leaf-950);
  background: #ffffff;
  font-weight: 700;
}

.resize-field input[type="number"]:focus,
.resize-field select:focus {
  outline: 3px solid rgba(93, 147, 109, 0.28);
}

.resize-field input[type="range"] {
  width: 100%;
  accent-color: var(--leaf-700);
}

.slider-pair {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
  align-items: center;
}

.slider-pair input[type="range"] {
  width: 100%;
  accent-color: var(--leaf-700);
}

.slider-pair input[type="number"] {
  min-height: var(--control-height);
  border: 1px solid rgba(49, 93, 67, 0.2);
  border-radius: var(--radius);
  padding: 0 8px;
  color: var(--leaf-950);
  background: #ffffff;
  font-weight: 700;
  text-align: right;
}

.slider-pair input[type="number"]:focus {
  outline: 3px solid rgba(93, 147, 109, 0.28);
}

.slider-pair input[type="range"]:disabled,
.slider-pair input[type="number"]:disabled {
  opacity: 0.5;
}

.resize-lock {
  min-height: var(--control-height);
  border: 1px solid rgba(49, 93, 67, 0.2);
  border-radius: var(--radius);
  padding: 0 14px;
  color: var(--leaf-800);
  background: #ffffff;
  cursor: pointer;
  font-weight: 800;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.resize-lock:hover {
  transform: translateY(-1px);
}

.resize-lock.is-locked {
  color: #ffffff;
  background: var(--leaf-800);
  border-color: var(--leaf-800);
}

.resize-info {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--leaf-800);
  background: rgba(184, 216, 183, 0.28);
  font-weight: 700;
}

.convert-ico-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(49, 93, 67, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.6);
  color: var(--leaf-800);
  font-weight: 700;
  font-size: 0.86rem;
}

.convert-ico-sizes legend {
  padding: 0 4px;
  color: var(--stone);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.convert-ico-sizes label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid rgba(49, 93, 67, 0.22);
  border-radius: 999px;
  background: #ffffff;
  color: var(--leaf-800);
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.convert-ico-sizes label:hover {
  transform: translateY(-1px);
  border-color: rgba(49, 93, 67, 0.4);
}

.convert-ico-sizes input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.convert-ico-sizes label:has(input:checked) {
  background: var(--leaf-800);
  border-color: var(--leaf-800);
  color: #edf7ef;
  box-shadow: 0 6px 14px rgba(29, 55, 40, 0.28);
}

.convert-ico-sizes label:has(input:focus-visible) {
  outline: 3px solid rgba(93, 147, 109, 0.36);
  outline-offset: 2px;
}

.convert-ico-sizes:disabled,
.convert-ico-sizes[disabled] {
  opacity: 0.5;
}

#convert-upload,
#resize-upload,
#compress-upload {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.compress-stage {
  padding: 24px;
}

.compress-preview-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  width: 100%;
  height: 100%;
}

.compress-preview {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 30px rgba(3, 10, 7, 0.18);
}

.compress-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--leaf-800);
  color: #edf7ef;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  justify-self: start;
}

.compress-preview[data-side="after"] .compress-tag {
  background: #2c573d;
}

.compress-preview img {
  display: block;
  width: 100%;
  max-height: 48vh;
  object-fit: contain;
  background:
    linear-gradient(45deg, #e6ebe5 25%, transparent 25%),
    linear-gradient(-45deg, #e6ebe5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e6ebe5 75%),
    linear-gradient(-45deg, transparent 75%, #e6ebe5 75%);
  background-color: #f4f7f4;
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  border-radius: 4px;
}

.compress-preview img:not([src]) {
  visibility: hidden;
}

.compress-preview figcaption {
  color: var(--leaf-800);
  font-weight: 700;
  font-size: 0.88rem;
}

.compress-controls {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto;
}

.qr-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  color: var(--leaf-950);
  background: rgba(251, 255, 249, 0.92);
  box-shadow: 0 18px 50px rgba(3, 10, 7, 0.22);
  backdrop-filter: blur(18px);
}

.qr-controls {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.qr-mode-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius);
  background: rgba(9, 20, 15, 0.1);
}

.qr-mode-switch button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--leaf-800);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.qr-mode-switch button:hover {
  transform: translateY(-1px);
}

.qr-mode-switch button.is-active {
  color: #ffffff;
  background: var(--leaf-800);
}

.qr-fields {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(49, 93, 67, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.6);
  animation: fade-up 320ms ease;
}

.qr-fields.is-hidden {
  display: none;
}

.qr-fields textarea,
.qr-fields input[type="text"],
.qr-fields input[type="email"],
.qr-fields input[type="tel"],
.qr-fields select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(49, 93, 67, 0.2);
  border-radius: var(--radius);
  color: var(--leaf-950);
  background: #ffffff;
  outline: 0;
  font-family: inherit;
  font-weight: 600;
  resize: vertical;
}

.qr-fields textarea {
  min-height: 80px;
  line-height: 1.5;
}

.qr-fields textarea:focus,
.qr-fields input:focus,
.qr-fields select:focus {
  outline: 3px solid rgba(93, 147, 109, 0.28);
}

.qr-style-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(49, 93, 67, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.6);
}

.qr-style-grid input[type="color"] {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid rgba(49, 93, 67, 0.2);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.qr-style-grid select {
  min-height: var(--control-height);
  padding: 0 10px;
  border: 1px solid rgba(49, 93, 67, 0.2);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 700;
  color: var(--leaf-950);
}

.qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.qr-preview {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(184, 216, 183, 0.2);
  border: 1px solid rgba(49, 93, 67, 0.14);
}

.qr-preview-frame {
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: var(--radius);
  background:
    linear-gradient(45deg, rgba(49, 93, 67, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(49, 93, 67, 0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(49, 93, 67, 0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(49, 93, 67, 0.08) 75%);
  background-color: #ffffff;
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  box-shadow: inset 0 0 0 1px rgba(49, 93, 67, 0.12);
  min-height: 280px;
  transition: background-color 200ms ease;
}

.qr-preview-frame canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  animation: qr-pop 320ms cubic-bezier(0.18, 0.7, 0.18, 1);
}

@keyframes qr-pop {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.qr-preview-meta {
  margin: 0;
  color: var(--leaf-800);
  font-weight: 700;
  font-size: 0.88rem;
  text-align: center;
}

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

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

@media (max-width: 900px) {
  .compress-preview-row {
    grid-template-columns: 1fr;
  }
}

.blocks-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.blocks-sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  background: rgba(251, 255, 249, 0.92);
  color: var(--leaf-950);
  box-shadow: 0 18px 45px rgba(16, 33, 25, 0.12);
  backdrop-filter: blur(18px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.blocks-search input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(49, 93, 67, 0.18);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--leaf-950);
  background: #ffffff;
  outline: 0;
}

.blocks-search input:focus {
  outline: 3px solid rgba(93, 147, 109, 0.28);
}

.blocks-categories {
  display: grid;
  gap: 12px;
}

.blocks-group {
  display: grid;
  gap: 4px;
}

.blocks-group h3 {
  margin: 6px 6px 2px;
  color: var(--leaf-800);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.blocks-item {
  display: block;
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--leaf-800);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.blocks-item:hover {
  background: rgba(184, 216, 183, 0.5);
  transform: translateX(2px);
}

.blocks-item.is-active {
  background: var(--leaf-800);
  color: #ffffff;
}

.blocks-empty {
  margin: 0;
  padding: 8px 10px;
  color: var(--stone);
}

.blocks-main {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  background: rgba(251, 255, 249, 0.92);
  box-shadow: 0 18px 50px rgba(3, 10, 7, 0.22);
  backdrop-filter: blur(18px);
  color: var(--leaf-950);
}

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

.blocks-title {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0;
}

.blocks-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blocks-preview {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: clamp(20px, 4vw, 48px);
  border: 1px solid rgba(49, 93, 67, 0.16);
  border-radius: var(--radius);
  background: #ffffff;
  background-image:
    linear-gradient(45deg, rgba(49, 93, 67, 0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(49, 93, 67, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(49, 93, 67, 0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(49, 93, 67, 0.05) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  transition: background 200ms ease;
}

.blocks-preview[data-bg="dark"] {
  background: #102119;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%);
}

.blocks-preview-empty {
  color: var(--stone);
  font-weight: 700;
}

.blocks-code-wrap {
  display: grid;
  gap: 6px;
}

.blocks-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--leaf-800);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.blocks-status {
  color: var(--stone);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0;
}

.blocks-code {
  margin: 0;
  padding: 16px;
  border-radius: var(--radius);
  background: #0f1a14;
  color: #d8f2c8;
  overflow-x: auto;
  max-height: 320px;
  overflow-y: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

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

  .blocks-sidebar {
    position: static;
    max-height: none;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(12px) rotate(8deg);
  }
}

@keyframes ambient-shift {
  from {
    opacity: 0.82;
    transform: scale(1);
  }
  to {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes soft-breathe {
  0%,
  100% {
    box-shadow: 0 26px 90px rgba(3, 10, 7, 0.34);
  }
  50% {
    box-shadow: 0 32px 110px rgba(93, 147, 109, 0.22);
  }
}

.js-ready .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 720ms ease,
    transform 720ms cubic-bezier(0.2, 0.7, 0.18, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.js-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 1100px) {
  .tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .page-shell {
    padding-inline: clamp(12px, 3vw, 24px);
  }

  .topbar,
  .collections,
  .suggest {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 52px;
  }

  .mood-panel {
    min-height: 360px;
  }

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

  .tool-hero,
  .symbol-layout,
  .simple-tool-panel,
  .cropper-panel {
    grid-template-columns: 1fr;
  }

  .symbol-sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
  }

  .category-button {
    text-align: center;
  }

  .preview-circle {
    justify-self: start;
  }

  .cropper-workspace {
    grid-template-rows: auto minmax(320px, 54vh);
  }

  .cropper-controls {
    grid-template-columns: minmax(180px, 280px) minmax(180px, 1fr);
    align-items: center;
  }

  .download-button {
    grid-column: 1 / -1;
  }

  .palette-controls {
    grid-template-columns: 1fr 1fr;
  }

  .palette-mode-group {
    grid-column: 1 / -1;
  }

  .palette-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .palette-swatch {
    min-height: 120px;
  }

  .text-editor-grid {
    grid-template-columns: 1fr;
  }

  .resize-controls {
    grid-template-columns: 1fr 1fr;
  }

  .resize-controls .download-button,
  .resize-controls .tool-action {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  body {
    background-attachment: scroll;
  }

  .page-shell {
    width: 100%;
    padding-inline: 9px;
    padding-top: 10px;
  }

  .topbar {
    top: 8px;
  }

  .brand {
    font-size: 0.96rem;
  }

  .nav-links a {
    padding: 9px 8px;
    font-size: 0.86rem;
  }

  h1 {
    font-size: clamp(2.55rem, 14vw, 4rem);
    line-height: 1.08;
  }

  .tool-hero h1 {
    font-size: clamp(2.45rem, 13vw, 3.8rem);
    line-height: 1.08;
  }

  .tool-title-row {
    gap: 10px;
  }

  .help-icon-button {
    margin-top: 8px;
  }

  .search-panel {
    grid-template-columns: 1fr 46px;
    padding: 6px;
  }

  .search-panel button {
    width: 46px;
    height: 46px;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: auto;
  }

  .tool-card p {
    min-height: auto;
  }

  .tool-hero {
    padding-top: 46px;
  }

  .symbol-grid {
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  }

  .symbol-grid button {
    min-height: 58px;
    font-size: 1.55rem;
  }

  .symbol-section[data-category="decor"] .symbol-grid {
    grid-template-columns: 1fr;
  }

  .symbol-section[data-category="decor"] .symbol-grid button {
    min-height: 84px;
    font-size: 1rem;
  }

  .cropper-panel {
    padding: 12px;
  }

  .cropper-toolbar,
  .upload-button,
  .crop-mode-switch,
  .tool-action {
    width: 100%;
  }

  .cropper-workspace {
    grid-template-rows: auto minmax(280px, 52vh);
  }

  .cropper-controls {
    grid-template-columns: 1fr;
  }

  .palette-panel {
    padding: 12px;
  }

  .palette-controls,
  .palette-mode-group {
    grid-template-columns: 1fr;
  }

  .palette-controls .tool-action,
  .palette-controls .download-button {
    width: 100%;
  }

  .text-cleaner-panel {
    padding: 12px;
  }

  .text-cleaner-actions > * {
    width: 100%;
  }

  .text-editor-card textarea {
    min-height: 260px;
  }
}

/* Discord Embed tool */
.discord-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 18px;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  color: var(--leaf-950);
  background: rgba(251, 255, 249, 0.92);
  box-shadow: 0 18px 50px rgba(3, 10, 7, 0.22);
  backdrop-filter: blur(18px);
}

.discord-form {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.discord-section {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(49, 93, 67, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.6);
}

.discord-section legend {
  padding: 0 6px;
  color: var(--stone);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.discord-fields-legend {
  display: flex;
  align-items: center;
  gap: 10px;
}

.discord-add-field {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.84rem;
}

.discord-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.discord-section input[type="text"],
.discord-section input[type="password"],
.discord-section input[type="url"],
.discord-section input[type="email"],
.discord-section textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(49, 93, 67, 0.2);
  border-radius: var(--radius);
  background: #fff;
  color: var(--leaf-950);
  outline: 0;
  font-family: inherit;
  font-weight: 600;
  resize: vertical;
}

.discord-section textarea { min-height: 64px; line-height: 1.5; }

.discord-section input:focus,
.discord-section textarea:focus {
  outline: 3px solid rgba(93, 147, 109, 0.28);
}

.discord-section input[type="color"] {
  min-height: var(--control-height);
  width: 100%;
  border: 1px solid rgba(49, 93, 67, 0.2);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  padding: 0;
}

.discord-fields {
  display: grid;
  gap: 10px;
}

.discord-field {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(49, 93, 67, 0.14);
  border-radius: var(--radius);
  background: rgba(237, 247, 239, 0.5);
}

.discord-field-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 8px;
}

.discord-field-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.discord-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--leaf-800);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}

.discord-file-pick {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--leaf-800);
  font-weight: 800;
}

.discord-file-pick input {
  width: 100%;
  min-height: var(--control-height);
  border: 1px dashed rgba(49, 93, 67, 0.26);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--leaf-800);
  background: rgba(237, 247, 239, 0.66);
  cursor: pointer;
}

.discord-file-pick input::file-selector-button {
  min-height: 30px;
  margin-right: 10px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: #edf7ef;
  background: var(--leaf-800);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.discord-inline-toggle input { accent-color: var(--leaf-700); }

.discord-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#d-status[data-kind="ok"] {
  background: rgba(93, 147, 109, 0.22);
  color: var(--leaf-800);
}

#d-status[data-kind="err"] {
  background: rgba(220, 80, 80, 0.18);
  color: #8a1f1f;
}

/* Discord preview mock */
.discord-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: start;
  position: sticky;
  top: 96px;
}

.discord-preview-head {
  color: var(--stone);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.discord-mock {
  padding: 16px;
  border-radius: 8px;
  background: #313338;
  color: #dbdee1;
  font-family: "gg sans", "Whitney", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.92rem;
  line-height: 1.4;
}

.discord-msg {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: start;
}

.discord-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e1f22;
}

.discord-body { min-width: 0; }

.discord-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.discord-meta strong { color: #f2f3f5; font-size: 1rem; font-weight: 600; }
.discord-bot {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  background: #5865f2;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.discord-time { color: #949ba4; font-size: 0.74rem; }

.discord-content {
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 4px;
}

.discord-content code,
.discord-desc code,
.discord-field-cell code {
  padding: 1px 4px;
  border-radius: 3px;
  background: #2b2d31;
  color: #dbdee1;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.86em;
}

.discord-content pre,
.discord-desc pre,
.discord-field-cell pre {
  padding: 8px 10px;
  border-radius: 4px;
  background: #2b2d31;
  color: #dbdee1;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.84em;
  white-space: pre-wrap;
  margin: 4px 0;
}

.discord-content a,
.discord-desc a,
.discord-field-cell a {
  color: #00a8fc;
  text-decoration: none;
}

.discord-content a:hover,
.discord-desc a:hover,
.discord-field-cell a:hover { text-decoration: underline; }

.discord-embed {
  position: relative;
  display: grid;
  grid-template-columns: 4px 1fr;
  gap: 0;
  margin-top: 4px;
  border-radius: 4px;
  background: #2b2d31;
  overflow: hidden;
  max-width: 520px;
}

.discord-side {
  background: #5d936d;
}

.discord-embed-inner {
  display: grid;
  gap: 8px;
  padding: 12px 16px 16px;
  position: relative;
}

.discord-author {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f2f3f5;
  font-size: 0.86rem;
  font-weight: 600;
}

.discord-author img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.discord-title {
  display: block;
  color: #f2f3f5;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  word-break: break-word;
}

.discord-title.is-link { color: #00a8fc; }
.discord-title.is-link:hover { text-decoration: underline; }

.discord-desc {
  white-space: pre-wrap;
  word-break: break-word;
  color: #dbdee1;
}

.discord-fields-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 4px;
}

.discord-fields-grid:has(.is-inline) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.discord-field-cell:not(.is-inline) {
  grid-column: 1 / -1;
}

.discord-field-cell strong {
  display: block;
  color: #f2f3f5;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.discord-field-cell div {
  color: #dbdee1;
  font-size: 0.88rem;
  word-break: break-word;
}

.discord-image {
  margin-top: 6px;
  max-width: 100%;
  border-radius: 4px;
  display: block;
}

.discord-thumb {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.discord-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: #949ba4;
  font-size: 0.78rem;
}

.discord-footer img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.discord-footer-sep { color: #4e5058; }

@media (max-width: 1100px) {
  .discord-panel {
    grid-template-columns: 1fr;
  }

  .discord-preview {
    position: static;
  }
}

@media (max-width: 620px) {
  .discord-row,
  .discord-field-row {
    grid-template-columns: 1fr;
  }
}
