.settings-view {
  display: grid;
  gap: 20px;
  width: 100%;
  min-width: 0;
  color: var(--ink);
}
.settings-view [hidden] { display: none !important; }
.set-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 5px;
}
.set-heading h1, .set-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.06;
}
.set-heading h1 { font-size: clamp(40px, 4vw, 58px); letter-spacing: -.038em; }
.set-heading p, .set-section-heading p, .set-row-copy p, .set-share-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.set-heading .btn { flex: 0 0 auto; }
.set-card {
  display: block;
  min-width: 0;
  margin: 0;
  padding: clamp(20px, 2.2vw, 30px);
  background: var(--surface, #fffdf9);
  border: 1px solid var(--line);
  border-radius: 15px;
}
.set-card h2 { font-size: clamp(28px, 2.4vw, 35px); letter-spacing: -.025em; }
.set-section-heading { margin-bottom: 20px; }
.set-choices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.set-choice { display: block; position: relative; cursor: pointer; }
.set-visually-hidden, .set-choice-input, .set-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}
.set-choice-body {
  display: flex;
  height: 100%;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow .15s, border-color .15s;
}
.set-choice:hover .set-choice-body { border-color: var(--accent); }
.set-choice-input:checked + .set-choice-body {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.set-choice-input:focus-visible + .set-choice-body,
.set-switch input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.set-choice-copy { padding: 14px 15px; }
.set-choice-title, .set-choice-desc { display: block; }
.set-choice-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 650;
  font-size: 14px;
  line-height: 1.35;
}
.set-choice-desc { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.set-tick {
  display: inline-grid;
  place-items: center;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.set-tick svg { display: none; }
.set-choice-input:checked + .set-choice-body .set-tick { color: #fff; background: var(--accent); border-color: var(--accent); }
.set-choice-input:checked + .set-choice-body .set-tick svg { display: block; }
.set-layout-preview {
  height: clamp(110px, 12vw, 155px);
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  grid-template-rows: repeat(2,minmax(0,1fr));
  gap: 5px;
  background: #f2ede5;
  border-bottom: 1px solid var(--line);
}
.set-tile { display: block; min-height: 0; overflow: hidden; background: #d5c3af; }
.set-tile img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; display: block; }
.set-layout-masonry { gap: 3px; grid-template-rows: repeat(5,minmax(0,1fr)); }
.set-layout-masonry .tile-0 { grid-area: 1/1/4/2; }
.set-layout-masonry .tile-1 { grid-area: 1/2/3/3; }
.set-layout-masonry .tile-2 { grid-area: 1/3/4/4; }
.set-layout-masonry .tile-3 { grid-area: 4/1/6/2; }
.set-layout-masonry .tile-4 { grid-area: 3/2/6/3; }
.set-layout-masonry .tile-5 { grid-area: 4/3/6/4; }
.set-layout-story { grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: 1.25fr 1fr; gap: 4px; }
.set-layout-story .tile-0 { grid-column: 1/-1; }
.set-layout-story .tile-0 img { object-position: 50% 43%; }
.set-layout-story .tile-3, .set-layout-story .tile-4, .set-layout-story .tile-5 { display: none; }
.set-theme-preview {
  display: flex;
  gap: 6px;
  align-items: center;
  height: 67px;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
  background: var(--sample);
}
.set-palette-airy { --sample: #faf9f6; --ink-1: #fff; --ink-2: #ddd9d1; --ink-3: #544c45; }
.set-palette-cream { --sample: #f2e7d8; --ink-1: #fffaed; --ink-2: #c9ae90; --ink-3: #70513a; }
.set-palette-moody { --sample: #302d2a; --ink-1: #494541; --ink-2: #aa9885; --ink-3: #f1ece2; }
.set-theme-preview i { height: 26px; width: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px #92837244; background: var(--ink-1); }
.set-theme-preview i:nth-child(2) { background: var(--ink-2); }
.set-theme-preview i:nth-child(3) { background: var(--ink-3); }
.set-field { display: grid; gap: 8px; margin: 0 0 18px; max-width: 790px; font-size: 14px; font-weight: 600; }
.set-field input, .set-field textarea, .set-field select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--surface, #fffdf9);
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  font-weight: 400;
  line-height: 1.45;
}
.set-field textarea { resize: vertical; min-height: 82px; }
.set-field select { max-width: 350px; }
.set-field > span { font-weight: 400; color: var(--muted); font-size: 12px; }
.set-field :is(input, textarea, select):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.set-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.set-actions .btn:disabled { opacity: .55; cursor: default; }
.set-setting-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 21px 0;
  border-top: 1px solid var(--line);
}
.set-setting-row:last-child { padding-bottom: 0; }
.set-row-copy { flex: 1 1 auto; }
.set-row-copy h3 { font-family: var(--sans); margin: 0; color: var(--ink); font-size: 15px; font-weight: 650; }
.set-row-copy p { font-size: 13px; margin-top: 4px; }
.set-icon { display: grid; place-items: center; width: 41px; height: 41px; flex: 0 0 41px; border-radius: 50%; background: #f2ece3; color: #806650; }
.set-nested-row { margin-left: 56px; }
.set-switch { display: flex; align-items: center; flex: 0 0 47px; min-height: 44px; position: relative; cursor: pointer; }
.set-switch > span {
  display: block;
  position: relative;
  width: 45px;
  height: 26px;
  border: 1px solid #a99d92;
  border-radius: 20px;
  background: #b5aba1;
  transition: background .15s;
}
.set-switch > span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  transition: transform .15s;
}
.set-switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.set-switch input:checked + span::after { transform: translateX(18px); }
.set-share-card, .set-share-copy { display: flex; align-items: center; gap: 15px; }
.set-share-card { justify-content: space-between; }
.set-share-card .btn { flex-shrink: 0; }
.set-share-card h2 { font-size: 27px; }
.set-share-copy p { font-size: 13px; margin-top: 5px; }
.ca-header, .ca-refresh, .ca-review summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ca-header { flex-wrap: wrap; }
.ca-header .set-section-heading { margin: 0; }
.ca-review { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 12px; }
.ca-review summary { list-style: none; cursor: pointer; min-height: 40px; font-size: 14px; font-weight: 600; }
.ca-review summary::-webkit-details-marker { display: none; }
.ca-review[open] summary .ic { transform: rotate(180deg); }
.ca-refresh { flex-wrap: wrap; margin: 8px 0; }
.ca-refresh p, .ca-prompt { margin: 0; font-size: 13px; color: var(--muted); }
.ca-refresh .btn { min-height: 34px; font-size: 12px; }
.ca-results { margin: 18px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); }
.ca-results h3 { margin: 0; font: 400 24px/1.15 var(--serif); }
.ca-prompt { margin: 5px 0 12px; overflow-wrap: anywhere; }
.ca-votes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px,100%), 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.ca-votes li { padding: 9px; border: 1px solid var(--line); border-radius: 7px; }
.ca-votes li > span { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; }
.ca-photo { display: flex; align-items: center; gap: 9px; margin: 0; min-width: 0; }
.ca-photo img { width: 49px; height: 55px; object-fit: cover; flex: none; border-radius: 3px; }
.ca-photo figcaption { overflow-wrap: anywhere; font-size: 12px; line-height: 1.4; }
.ca-memory { display: grid; grid-template-columns: minmax(100px,1fr) minmax(0,3fr); align-items: start; gap: 18px; padding: 10px 0; }
.ca-memory blockquote { border-left: 2px solid var(--line); padding-left: 13px; margin: 0 0 10px; overflow-wrap: anywhere; }
.ca-memory blockquote p { margin: 0 0 4px; white-space: pre-wrap; }
.ca-memory cite { font-size: 12px; color: var(--muted); font-style: normal; }
.ca-strip { margin: 13px 0; }
.ca-strip > figcaption { font-size: 13px; margin-bottom: 5px; font-weight: 600; }
.ca-strip ol { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin: 0; padding: 6px; max-width: 470px; color: #fffaf3; background: #39332d; list-style: none; border-radius: 3px; }
.ca-strip .ca-photo { display: block; }
.ca-strip .ca-photo img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.ca-strip .ca-photo figcaption { padding-top: 4px; }
[data-code-form] .set-field { max-width: 400px; }
@media(max-width: 750px) {
  .settings-view { gap: 15px; }
  .set-card { padding: 19px; }
  .set-choices { gap: 8px; }
  .set-choice-copy { padding: 10px; }
  .set-choice-title { font-size: 13px; }
  .set-choice-desc { font-size: 11px; }
}
@media(max-width: 590px) {
  .ca-memory { grid-template-columns: 1fr; gap: 10px; }
  .set-heading { align-items: flex-start; flex-wrap: wrap; gap: 14px; }
  .set-choices { grid-template-columns: 1fr; }
  .set-choice-body { flex-direction: row; align-items: stretch; }
  .set-layout-preview, .set-theme-preview {
    flex: 0 0 105px;
    height: 82px;
    border-bottom: none;
    border-right: 1px solid var(--line);
  }
  .set-layout-preview { padding: 6px; gap: 3px; }
  .set-theme-preview { height: 64px; padding: 0 9px; justify-content: center; }
  .set-theme-preview i { width: 22px; height: 22px; }
  .set-choice-copy { flex: 1; align-content: center; padding: 9px 12px; }
  .set-choice-title { font-size: 14px; }
  .set-choice-desc { font-size: 12px; }
  .set-setting-row { gap: 10px; }
  .set-setting-row .set-icon { display: none; }
  .set-nested-row { margin-left: 0; }
  .set-share-card { flex-wrap: wrap; }
  .set-share-copy { align-items: flex-start; }
  .set-field :is(input, textarea, select) { font-size: 16px; }
}
@media(prefers-reduced-motion: reduce) {
  .set-choice-body, .set-switch > span, .set-switch > span::after { transition: none; }
}
