:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --ink: #1d252c;
  --muted: #65717c;
  --line: #d9e0e4;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-2: #b45309;
  --accent-3: #2563eb;
  --danger: #b42318;
  --ok: #047857;
  --shadow: 0 12px 30px rgba(27, 38, 49, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

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

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 64px;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  color: var(--ink);
  font-size: 18px;
  font-weight: 760;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a,
.tool-link,
button,
select,
input,
textarea {
  border-radius: 6px;
}

.nav a {
  color: var(--muted);
  font-size: 14px;
  padding: 8px 10px;
}

.workspace {
  display: grid;
  gap: 20px;
  grid-template-columns: 250px minmax(0, 1fr);
  margin: 24px auto;
  max-width: 1240px;
  padding: 0 24px;
}

.sidebar {
  align-self: start;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  padding: 14px;
  position: sticky;
  top: 88px;
}

.side-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .08em;
  padding: 4px 8px 8px;
  text-transform: uppercase;
}

.tool-link {
  color: #34414b;
  display: block;
  font-size: 14px;
  padding: 10px 11px;
}

.tool-link:hover,
.tool-link.active {
  background: #e7f4f2;
  color: #075e58;
}

.tool-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-height: 650px;
  padding: 24px;
}

.tool-heading {
  align-items: start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: .08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
  margin: 0;
}

h2 {
  font-size: 19px;
  margin: 0 0 14px;
}

.tool-heading p:not(.eyebrow) {
  color: var(--muted);
  margin: 10px 0 0;
}

.tool-select-label {
  color: var(--muted);
  display: grid;
  flex: 0 0 230px;
  font-size: 12px;
  gap: 6px;
}

select,
input,
textarea,
button {
  font: inherit;
}

select,
input,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

select,
input {
  min-height: 40px;
  padding: 0 10px;
}

textarea {
  line-height: 1.5;
  min-height: 300px;
  padding: 12px;
  resize: vertical;
  width: 100%;
}

button {
  background: #24313b;
  border: 1px solid #24313b;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 40px;
  padding: 0 13px;
}

button.secondary {
  background: #fff;
  border-color: var(--line);
  color: #26343e;
}

button.accent {
  background: var(--accent);
  border-color: var(--accent);
}

.tool-mount {
  margin-top: 24px;
}

.text-grid,
.image-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.control-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 12px 0;
}

.control-row label {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 14px;
  gap: 8px;
}

.panel-lite {
  background: #fbfcfc;
  border: 1px solid var(--line);
  padding: 14px;
}

.status {
  border-left: 3px solid var(--accent-3);
  color: var(--muted);
  font-size: 14px;
  margin-top: 12px;
  min-height: 26px;
  padding: 4px 0 4px 10px;
}

.status.error {
  border-left-color: var(--danger);
  color: var(--danger);
}

.status.ok {
  border-left-color: var(--ok);
  color: var(--ok);
}

.preview {
  align-items: center;
  background:
    linear-gradient(45deg, #edf1f3 25%, transparent 25%),
    linear-gradient(-45deg, #edf1f3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf1f3 75%),
    linear-gradient(-45deg, transparent 75%, #edf1f3 75%);
  background-color: #fff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  border: 1px solid var(--line);
  display: flex;
  justify-content: center;
  min-height: 330px;
  overflow: auto;
}

.preview img,
.preview canvas {
  max-height: 310px;
  max-width: 100%;
}

.dropzone {
  align-items: center;
  border: 1px dashed #9aa8b2;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  justify-content: center;
  min-height: 120px;
  padding: 18px;
  text-align: center;
}

.dropzone.dragging {
  background: #e7f4f2;
  border-color: var(--accent);
  color: #075e58;
}

.metrics {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 6px;
  margin-top: 12px;
}

.result-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.result-item {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 8px;
}

.result-item span {
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-item button {
  min-height: 32px;
}

.seo-section {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
  margin: 0 auto 36px;
  max-width: 1240px;
  padding: 0 24px;
}

.seo-section > div {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 20px;
}

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

.feature-list {
  color: var(--muted);
  display: grid;
  gap: 10px;
  line-height: 1.45;
  list-style: none;
  margin: 0;
  padding: 0;
}

.feature-list li {
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

details {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

details:first-of-type {
  border-top: 0;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

details p {
  color: var(--muted);
  margin: 8px 0 0;
}

@media (max-width: 880px) {
  .workspace,
  .seo-section,
  .text-grid,
  .image-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .tool-heading {
    display: grid;
  }

  .tool-select-label {
    flex-basis: auto;
  }

  .result-item {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 0 16px;
  }
}
