:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --panel: #ffffff;
  --ink: #101418;
  --muted: #6f7782;
  --accent: #2f9e84;
  --accent-2: #f5b84d;
  --accent-soft: #e6f6f2;
  --line: #e3e7ef;
  --line-soft: rgba(15, 23, 42, 0.08);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --shadow-strong: 0 24px 60px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 16px 34px rgba(15, 23, 42, 0.08);
  --shadow-pop: 0 28px 70px rgba(15, 23, 42, 0.14);
  --glass: rgba(255, 255, 255, 0.7);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --card-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(246, 249, 255, 0.92) 55%, rgba(240, 248, 246, 0.9) 100%);
  --card-border: rgba(15, 23, 42, 0.08);
  --card-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
  --card-glow: 0 22px 38px rgba(47, 158, 132, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}


body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 520px at 10% -10%, rgba(47, 158, 132, 0.18), transparent 70%),
    radial-gradient(900px 520px at 90% 0%, rgba(245, 184, 77, 0.18), transparent 70%),
    radial-gradient(900px 620px at 80% 90%, rgba(75, 123, 236, 0.18), transparent 70%),
    linear-gradient(180deg, #f8fbff 0%, #f2f6ff 55%, #f9f7f2 100%);
  color: var(--ink);
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100dvh;
  overscroll-behavior-x: none;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='%23000000' fill-opacity='0.04'%3E%3Ccircle cx='18' cy='22' r='2'/%3E%3Ccircle cx='62' cy='88' r='1.5'/%3E%3Ccircle cx='120' cy='54' r='1.8'/%3E%3Ccircle cx='90' cy='18' r='1.2'/%3E%3Ccircle cx='36' cy='112' r='1.4'/%3E%3C/g%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: 0.2;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.app-shell::before,
.app-shell::after {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  z-index: -1;
  opacity: 0.5;
  filter: blur(6px);
}

.app-shell::before {
  top: -80px;
  right: -140px;
  background: radial-gradient(circle, rgba(47, 158, 132, 0.28), transparent 70%);
}

.app-shell::after {
  bottom: 20px;
  left: -100px;
  background: radial-gradient(circle, rgba(245, 184, 77, 0.28), transparent 70%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  padding: 14px 18px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent) 0%, #4dd2b4 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  font-family: "Bricolage Grotesque", sans-serif;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.brand-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.top-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.meta-chip.accent {
  background: linear-gradient(135deg, rgba(47, 158, 132, 0.18), rgba(47, 158, 132, 0.06));
  color: var(--accent);
  border-color: rgba(47, 158, 132, 0.35);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 24px;
  align-items: start;
}

.workspace.edit-mode {
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.85fr);
}

.workspace.edit-mode .preview {
  order: 1;
}

.workspace.edit-mode .controls {
  order: 2;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  min-height: 0;
}

.tool-page {
  display: block;
  flex: 1;
  min-height: 0;
}

.tool-page.hidden {
  display: none;
}

.hero {
  position: relative;
  padding: 28px;
  border-radius: 28px;
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-height: 0;
  max-width: 100%;
}

.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 158, 132, 0.25), transparent 70%);
}

.hero-copy {
  position: relative;
  padding: 18px 20px;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  max-width: 100%;
}

.hero-copy h1 {
  margin: 8px 0 12px;
  font-size: 2.2rem;
  line-height: 1.1;
  font-family: "Bricolage Grotesque", sans-serif;
  word-break: break-word;
}

.hero-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 580px;
  line-height: 1.6;
}

.eyebrow {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(47, 158, 132, 0.2);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.hero-grid {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  padding: 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  max-width: 100%;
}

.tool-card {
  position: relative;
  border: 1px solid transparent;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(243, 247, 255, 0.92)) padding-box,
    linear-gradient(135deg, rgba(47, 158, 132, 0.35), rgba(75, 123, 236, 0.25), rgba(245, 184, 77, 0.35)) border-box;
  border-radius: 24px;
  padding: 18px;
  display: grid;
  gap: 12px;
  grid-template-columns: auto 1fr;
  align-items: start;
  text-align: left;
  cursor: pointer;
  width: 100%;
  color: inherit;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  z-index: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
  min-width: 0;
}

.tool-card::before {
  content: "";
  position: absolute;
  inset: -20% -15% auto auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(47, 158, 132, 0.18), rgba(47, 158, 132, 0) 68%);
  opacity: 0.55;
  pointer-events: none;
  transform: rotate(25deg);
  z-index: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tool-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

.tool-card>* {
  position: relative;
  z-index: 1;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 48px rgba(47, 158, 132, 0.18);
}

.tool-card:hover::before {
  opacity: 0.8;
  transform: translateY(-6px) rotate(22deg);
}

.tool-card.active {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(236, 255, 248, 0.9)) padding-box,
    linear-gradient(135deg, rgba(47, 158, 132, 0.75), rgba(75, 123, 236, 0.4), rgba(245, 184, 77, 0.45)) border-box;
  box-shadow: 0 26px 50px rgba(47, 158, 132, 0.22);
}

.tool-card:focus-visible {
  outline: 3px solid rgba(47, 158, 132, 0.35);
  outline-offset: 2px;
}

.tool-card h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.tool-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.35;
}

.tool-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  font-family: "Bricolage Grotesque", sans-serif;
  background: linear-gradient(135deg, #2f9e84 0%, #4dd2b4 100%);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.tool-card-icon::after {
  content: "";
  position: absolute;
  inset: -30% 30% auto auto;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0) 60%);
  opacity: 0.55;
  pointer-events: none;
}

.tool-card-icon.warm {
  background: linear-gradient(135deg, #f5b84d 0%, #f39b47 100%);
}

.tool-card-icon.cool {
  background: linear-gradient(135deg, #4b7bec 0%, #6aa4ff 100%);
}

.tool-heading {
  display: grid;
  gap: 10px;
}

.tool-heading h2 {
  margin: 4px 0 6px;
  font-size: 1.4rem;
}


.panel {
  background: var(--glass-strong);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-pop);
  backdrop-filter: blur(10px);
  animation: panelFade 0.5s ease;
}

@keyframes panelFade {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.section {
  display: grid;
  gap: 12px;
}

.label {
  font-weight: 600;
  font-size: 0.9rem;
}

input[type="file"],
input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-family: inherit;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input[type="file"] {
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(47, 158, 132, 0.55);
  box-shadow: 0 0 0 3px rgba(47, 158, 132, 0.12);
}

textarea {
  resize: vertical;
}

.tool-switch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.tool-btn {
  border: 1px solid var(--line);
  background: #f9fbff;
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.tool-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.tool-btn.active {
  background: linear-gradient(140deg, rgba(47, 158, 132, 0.18), rgba(77, 210, 180, 0.25));
  border-color: rgba(47, 158, 132, 0.4);
  box-shadow: var(--shadow-strong);
}

.tool-btn.secondary-active {
  background: linear-gradient(140deg, rgba(75, 123, 236, 0.14), rgba(106, 164, 255, 0.22));
  border-color: rgba(75, 123, 236, 0.4);
}

.tool-title {
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--ink);
}

.tool-desc {
  font-size: 0.78rem;
  color: var(--muted);
}

.segmented {
  display: inline-flex;
  background: #f0f3f8;
  border-radius: 999px;
  padding: 4px;
  gap: 6px;
  border: 1px solid var(--line);
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 8px 18px;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease;
}

.seg-btn.active {
  background: linear-gradient(135deg, var(--accent) 0%, #36c2a3 100%);
  color: #fff;
}

.grid {
  display: grid;
  gap: 14px;
}

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

.range {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range span {
  min-width: 64px;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.85rem;
}

input[type="range"] {
  width: 100%;
}

.file-input-row {
  display: grid;
  grid-template-columns: 0.85fr 0.15fr;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.file-input {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.08);
  min-height: 44px;
  min-width: 0;
  width: 100%;
}

.file-input input[type="file"] {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e8edf4;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.file-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

.file-name-inline {
  font-size: 0.85rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.icon-btn {
  width: 100%;
  min-height: 44px;
  padding: 0;
  border-radius: 14px;
  background: #eef2f7;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 700;
}

.icon-btn:not(:disabled):hover {
  background: #e1e8f0;
  color: var(--ink);
}

.actions {
  display: grid;
  gap: 10px;
}

button:not(.tool-card) {
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  background: #e8edf4;
  color: var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button.back-btn {
  justify-self: start;
  padding: 8px 16px;
  border-radius: 999px;
  background: #eef2f7;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

button.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #36c2a3 100%);
  color: #fff;
  box-shadow: 0 10px 18px rgba(47, 158, 132, 0.3);
}

button:not(.tool-card):hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
}

button:not(.tool-card):disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.tool-section {
  display: grid;
  gap: 20px;
}

.file-list {
  display: grid;
  gap: 10px;
}

.thumb-list {
  display: grid;
  gap: 12px;
}

.thumb-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.08);
  cursor: grab;
}

.thumb-item.drag-over {
  border-color: rgba(47, 158, 132, 0.6);
  box-shadow: 0 0 0 3px rgba(47, 158, 132, 0.15);
}

.thumb-preview {
  width: 72px;
  height: 96px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumb-preview.insert-preview {
  font-weight: 700;
  font-size: 0.85rem;
  color: #1f2a44;
  background: linear-gradient(135deg, rgba(47, 158, 132, 0.18), rgba(75, 123, 236, 0.18));
  border: 1px dashed rgba(47, 158, 132, 0.4);
}

.thumb-meta {
  display: grid;
  gap: 4px;
}

.thumb-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.thumb-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.thumb-actions {
  display: inline-flex;
  gap: 6px;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.08);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.file-row.drag-over {
  border-color: rgba(47, 158, 132, 0.6);
  box-shadow: 0 0 0 3px rgba(47, 158, 132, 0.15);
}

.file-name {
  font-size: 0.9rem;
  color: var(--ink);
  word-break: break-all;
}

.file-actions {
  display: inline-flex;
  gap: 6px;
}

.mini {
  padding: 6px 10px;
  font-size: 0.72rem;
  border-radius: 10px;
}

.note {
  font-size: 0.85rem;
  color: var(--muted);
}

.hint-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f2f7f6;
  color: var(--muted);
  font-size: 0.82rem;
  border: 1px dashed rgba(47, 158, 132, 0.3);
}

.status {
  border-radius: 12px;
  border: 1px dashed #e0d6c7;
  background: #f5f4ef;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 10px 12px;
}

.preview {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.preview-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.preview-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.page-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.preview-wrap {
  position: relative;
  min-height: 540px;
  margin: 0 auto;
  width: 100%;
  max-width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: auto;
  background:
    repeating-linear-gradient(45deg,
      rgba(255, 255, 255, 0.7) 0px,
      rgba(255, 255, 255, 0.7) 12px,
      rgba(240, 244, 250, 0.95) 12px,
      rgba(240, 244, 250, 0.95) 24px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.preview-wrap canvas {
  display: block;
  max-width: none;
}

.overlay {
  position: absolute;
  left: 0;
  top: 0;
}

.edit-canvas {
  z-index: 18;
}

.edit-text-layer {
  inset: 0;
  z-index: 19;
  pointer-events: none;
}

.edit-text-layer.active {
  pointer-events: auto;
}

.edit-text-hit {
  position: absolute;
  border: 1px dashed rgba(47, 158, 132, 0.75);
  background: rgba(47, 158, 132, 0.14);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.edit-text-hit:hover {
  background: rgba(47, 158, 132, 0.22);
}

.edit-text-hit.selected {
  border-color: rgba(245, 184, 77, 0.95);
  background: rgba(245, 184, 77, 0.22);
}

.edit-top-toolbar {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(248, 250, 255, 0.92);
}

.edit-top-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.edit-top-group.compact input[type="text"] {
  width: 220px;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
}

.edit-top-btn {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 10px;
  padding: 7px 12px;
  background: #fff;
  color: #1f2937;
  font-weight: 600;
  font-size: 0.82rem;
}

.edit-top-btn.danger {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.25);
}

.edit-top-btn.secondary-active {
  background: linear-gradient(140deg, rgba(75, 123, 236, 0.14), rgba(106, 164, 255, 0.22));
  border-color: rgba(75, 123, 236, 0.4);
}

.edit-top-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: #fff;
  font-size: 0.75rem;
  color: #4b5563;
}

.edit-top-chip input[type="color"] {
  width: 28px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
}

.edit-top-chip.range-chip {
  padding-right: 10px;
}

.edit-top-chip.range-chip input[type="range"] {
  width: 100px;
}

.edit-top-chip.range-chip em {
  font-style: normal;
  font-size: 0.72rem;
  color: #6b7280;
}

.watermark {
  width: 160px;
  height: 60px;
  top: 60px;
  left: 60px;
  cursor: grab;
  touch-action: none;
  border: 1px dashed rgba(47, 158, 132, 0.45);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.watermark:active {
  cursor: grabbing;
}

.sign {
  top: 60px;
  left: 60px;
  cursor: grab;
  touch-action: none;
  border: 1px dashed rgba(15, 23, 42, 0.35);
  border-radius: 10px;
  background: transparent;
}

.sign:active {
  cursor: grabbing;
}

.sign-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.wm-text {
  transform-origin: left bottom;
  color: #6f6f6f;
  opacity: 0.2;
  display: inline-block;
  white-space: pre;
  text-align: center;
  line-height: 1.2;
}

.wm-image {
  display: block;
  transform-origin: left bottom;
}

#patternCanvas {
  width: 100%;
  height: 100%;
  cursor: default;
}


.hidden {
  display: none;
}

.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
}

@media (max-width: 980px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .workspace {
    min-width: 0;
    grid-template-columns: 1fr;
  }
}

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

  .hero-copy h1 {
    font-size: 1.7rem;
  }
}

.footer {
  margin-top: auto;
  margin-bottom: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer span:last-child {
  font-weight: 600;
  color: var(--ink);
}

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

  .workspace.edit-mode {
    grid-template-columns: 1fr;
  }

  .controls {
    order: 1;
  }

  .preview {
    order: 2;
  }

  .preview-wrap {
    min-height: 420px;
  }
}

@media (max-width: 900px) {
  .hero {
    padding: 22px;
    min-height: auto;
  }

  .hero-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    padding: 12px;
  }

  .tool-card {
    padding: 14px;
    gap: 10px;
  }

  .tool-card h3 {
    font-size: 0.95rem;
  }

  .tool-card p {
    font-size: 0.78rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .tool-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 0.95rem;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .page-controls {
    flex-wrap: wrap;
  }

  .edit-top-group.compact input[type="text"] {
    width: 100%;
  }

  .hero {
    padding: 18px;
  }

  .hero-copy {
    padding: 16px;
  }

  .hero-copy h1 {
    font-size: 1.6rem;
  }

  .hero::after {
    right: -20px;
    top: -60px;
    width: 160px;
    height: 160px;
  }
}

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

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .hero-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    padding: 10px;
  }
}

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

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