* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: #e6e0d4;
  color: #1c1916;
  font-family: Inter, "Noto Sans", "Liberation Sans", sans-serif;
  font-synthesis: none;
  color-scheme: light;
}

main {
  display: grid;
  grid-template-columns: minmax(300px, 560px) minmax(280px, 1fr);
  gap: 36px;
  align-items: start;
  min-height: 100vh;
  padding: 32px 40px 56px;
}

h1 {
  margin: 0;
  font-family: "Libre Baskerville", "Noto Serif", "Liberation Serif", Georgia, serif;
  font-size: 42px;
  font-weight: 400;
  line-height: 1.1;
}

.lede {
  margin: 12px 0 22px;
  max-width: 40em;
  font-size: 16px;
  line-height: 1.45;
  color: #3f3a34;
}

.panel, .field, .sliders { display: grid; gap: 12px; }

.field { margin-top: 4px; }

.label, .mini, figcaption, .sheet-label, .group-label {
  margin: 0;
  color: #5e574e;
}

.label { font-size: 13px; }

.mini, .sheet-label, figcaption, .group-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sheet-label { margin-bottom: 14px; }

figcaption { margin-top: 8px; }

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #3f3a34;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #c9c0b2;
  border-radius: 6px;
  background: #fffcf7;
  color: #1c1916;
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
}

input[type="range"] { padding: 0; accent-color: #1c1916; }

input[type="color"] {
  padding: 4px;
  width: 46px;
  height: 42px;
}

.color-line {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 8px;
  align-items: center;
}

.hint, .fine, #status {
  margin: 0;
  max-width: 46em;
  font-size: 13px;
  line-height: 1.4;
  color: #5e574e;
}

#status { min-height: 1.2em; font-size: 14px; color: #1c1916; }

input.error { border-color: #8a2e24; }

#status.error { color: #8a2e24; }

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

button {
  justify-self: start;
  border: 1px solid #1c1916;
  border-radius: 6px;
  background: transparent;
  color: #1c1916;
  font: inherit;
  font-size: 15px;
  padding: 10px 14px;
  cursor: pointer;
}

button:hover:not(:disabled) { background: #f3ece1; }

button:disabled { cursor: default; opacity: 0.45; }

.segment {
  display: grid;
  gap: 1px;
  background: #1c1916;
  border: 1px solid #1c1916;
  border-radius: 6px;
  overflow: hidden;
}

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

.segment button {
  width: 100%;
  justify-self: stretch;
  border: 0;
  border-radius: 0;
  background: #f4f0e6;
  padding: 10px 6px;
  font-size: 14px;
}

.segment button[aria-pressed="true"],
.chips button[aria-pressed="true"],
.palettes button[aria-pressed="true"],
.icon-btn[aria-pressed="true"],
#background-clear[aria-pressed="true"] {
  background: #1c1916;
  color: #fffcf7;
}

.segment button[aria-pressed="true"]:hover,
.chips button[aria-pressed="true"]:hover,
.palettes button[aria-pressed="true"]:hover,
.icon-btn[aria-pressed="true"]:hover,
#background-clear[aria-pressed="true"]:hover {
  background: #1c1916;
  color: #fffcf7;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chips button { padding: 6px 10px; font-size: 13px; }

.icon-grid {
  max-height: 300px;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 8px;
  border: 1px solid #c9c0b2;
  border-radius: 6px;
  background: #fffcf7;
}

.icon-group { display: grid; gap: 6px; }

.icon-row { display: flex; flex-wrap: wrap; gap: 4px; }

.icon-btn {
  width: 40px;
  height: 40px;
  padding: 7px;
  border-color: transparent;
  background: transparent;
}

.icon-btn svg { width: 100%; height: 100%; display: block; }

.icon-btn.mono {
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 0;
}

.palettes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.palettes button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  font-size: 13px;
}

.swatches { display: flex; gap: 3px; }

.swatches i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(28, 25, 22, 0.25);
  display: block;
}

.swatches i.clear {
  background-color: #fffcf7;
  background-image:
    linear-gradient(45deg, #d5cdbf 25%, transparent 25%),
    linear-gradient(-45deg, #d5cdbf 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d5cdbf 75%),
    linear-gradient(-45deg, transparent 75%, #d5cdbf 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
}

:focus-visible { outline: 2px solid #1c1916; outline-offset: 2px; }

.stage { display: grid; gap: 22px; justify-items: center; }

.stage-card { width: min(100%, 640px); }

.plates, .mocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.plate {
  min-height: 210px;
  display: grid;
  place-items: center;
  padding: 22px 16px;
  border-radius: 8px;
}

.plate.light { background: #fffcf7; }

.plate.dark { background: #221f1c; }

.plate > svg, .site-head > svg, .card > svg {
  width: min(100%, 420px);
  height: auto;
  display: block;
}

.site-head > svg, .card > svg { width: min(100%, 240px); }

.browser, .card {
  border: 1px solid #c9c0b2;
  border-radius: 8px;
  overflow: hidden;
  background: #fffcf7;
}

.chrome {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 0;
  background: #efe8dc;
  border-bottom: 1px solid #ddd4c6;
}

.dots { display: flex; gap: 4px; padding: 0 4px 8px; }

.dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9c0b2;
  display: block;
}

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 8px 8px 0 0;
  background: #fffcf7;
  color: #1c1916;
  font-size: 12px;
}

.tab span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab img { width: 16px; height: 16px; display: block; }

.page { padding: 16px 14px 18px; }

.site-head {
  display: flex;
  align-items: center;
  min-height: 64px;
}

.site-lines { display: grid; gap: 8px; margin-top: 14px; }

.site-lines span {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: #e6e0d4;
}

.site-lines span:nth-child(1) { width: 86%; }
.site-lines span:nth-child(2) { width: 64%; }
.site-lines span:nth-child(3) { width: 74%; }

.card {
  min-height: 168px;
  display: grid;
  place-items: center;
  padding: 16px;
  aspect-ratio: 1.7;
}

figure { margin: 0; }

[hidden] { display: none !important; }

noscript {
  display: block;
  padding: 16px 20px;
  background: #fff4e8;
}

.variations-band {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

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

.variation-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.variation {
  flex: 0 0 156px;
  height: 112px;
  padding: 8px;
  background: #fffcf7;
  display: grid;
  align-items: center;
}

.variation > svg {
  width: 100%;
  height: 88px;
  display: block;
}

.variation[aria-pressed="true"] {
  background: #fffcf7;
  box-shadow: inset 0 0 0 2px #1c1916;
}

.sizes {
  margin: 0;
  padding-left: 18px;
  color: #5e574e;
  font-size: 13px;
  line-height: 1.5;
}

#icon-matches:empty { display: none; }

@media (min-width: 861px) {
  .stage { position: sticky; top: 24px; }
}

@media (max-width: 860px) {
  main { grid-template-columns: 1fr; padding: 24px 18px 40px; }
  h1 { font-size: 34px; }
  .plates, .mocks { grid-template-columns: 1fr; }
  .palettes { grid-template-columns: 1fr; }
}
