:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --ink: #18201c;
  --muted: #627067;
  --line: #d9dfd8;
  --panel: #ffffff;
  --soft: #ecf1ec;
  --accent: #f36f21;
  --accent-ink: #3b1604;
  --green: #2e7251;
  --danger: #bd332c;
  --shadow: 0 18px 45px rgba(31, 44, 36, 0.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);
}

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

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.35rem;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  background: #e8eee8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tab {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.tab.is-active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 6px rgba(31, 44, 36, 0.08);
}

.app {
  min-height: 420px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.panel + .panel {
  margin-top: 16px;
}

.support {
  color: var(--muted);
  line-height: 1.45;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 750;
}

label span,
.field-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfd8d0;
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 10px 12px;
  outline: 0;
}

textarea {
  min-height: 220px;
  line-height: 1.45;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 114, 81, 0.14);
}

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

.segment {
  min-height: 46px;
  border: 1px solid #cfd8d0;
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font-weight: 800;
}

.segment.is-active {
  border-color: var(--accent);
  background: #fff0e6;
  color: var(--accent-ink);
}

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 7px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  vertical-align: -1px;
}

.swatch.orange {
  background: #ff6c18;
}

.swatch.black {
  background: #111;
}

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

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--ink);
  color: #fff;
  font-weight: 850;
  text-decoration: none;
}

.button.primary {
  background: var(--accent);
  color: #1d0b03;
}

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

.button.danger {
  background: var(--danger);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.notice {
  border: 1px solid #f0c79c;
  border-radius: 8px;
  background: #fff8ef;
  color: #643a13;
  padding: 12px 14px;
  line-height: 1.4;
}

.notice.error {
  border-color: #e9aaa5;
  background: #fff2f1;
  color: #7d1b17;
}

.result-frame {
  display: grid;
  place-items: center;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9eee8;
}

.result-frame img {
  width: 100%;
  height: 100%;
  max-height: 760px;
  object-fit: contain;
}

.empty-state {
  display: grid;
  min-height: 320px;
  place-items: center;
  border: 1px dashed #bfcac1;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.thumb-card,
.task-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.thumb-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--soft);
}

.thumb-card .meta,
.task-card .meta {
  padding: 12px;
}

.meta p {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.task-card {
  padding: 14px;
}

.task-card.is-active {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 114, 81, 0.12);
}

.mini-grid,
.example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.example-grid {
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 14px;
}

.mini-image {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.example-card {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 10px;
}

.example-image-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.mini-image img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.example-image-wrap img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.mini-image button,
.delete-example {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 28px;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(189, 51, 44, 0.95);
  color: #fff;
  font-weight: 900;
}

.example-card label {
  gap: 5px;
}

.example-card input,
.example-card select {
  min-height: 38px;
}

.example-card .button {
  min-height: 38px;
  width: 100%;
  padding: 0 10px;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-row label {
  display: inline-flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px;
  font-weight: 800;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.small {
  color: var(--muted);
  font-size: 0.88rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: var(--soft);
  padding: 7px 10px;
  color: var(--muted);
  font-weight: 800;
}

.status.ok::before,
.status.warn::before {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.status.ok::before {
  background: var(--green);
}

.status.warn::before {
  background: var(--accent);
}

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

@media (max-width: 840px) {
  .shell {
    width: min(100vw - 20px, 720px);
    padding-top: 18px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .tab {
    padding: 0 7px;
  }

  .layout,
  .two {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 16px;
  }

  .result-frame {
    min-height: 360px;
  }
}
