/* Full-page settings prototype; header geometry follows Quiz Answers. */
.widget-settings {
  --ws-surface: var(--theme-page-background, #f7f5ef);
  --ws-ink: #344b3c;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: 100%;
  height: var(--widget-viewport-height, 100dvh);
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--ws-ink);
  background: var(--ws-surface);
  overflow: hidden;
}
.widget-settings[open] { display: flex; flex-direction: column; }
.widget-settings *, .widget-settings *::before, .widget-settings *::after { box-sizing: border-box; }
.widget-settings::backdrop { background: rgba(18,24,17,.38); }
html.widget-settings-open { overflow: hidden; }
.widget-settings-header {
  display: flex;
  align-items: center;
  flex: none;
  gap: 16px;
  width: min(100% - 40px, 720px);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 0 6px;
}
.widget-settings-header h2 { margin: 0; font: 600 22px/1.25 var(--font-ui, sans-serif); letter-spacing: -.03em; }
.widget-settings-back { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 9px; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; }
.widget-settings-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.widget-settings-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 0;
  min-height: 0;
  width: min(100% - 40px, 720px);
  margin: 0 auto;
  padding: 8px 0 20px;
  gap: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.widget-settings-preview {
  position: relative;
  flex: none;
  width: min(100%, 390px, max(260px, calc((var(--widget-viewport-height, 100dvh) - 420px) * 1.187845)));
  aspect-ratio: 430 / 362;
  container-type: inline-size;
  overflow: hidden;
  isolation: isolate;
  -webkit-mask-image: linear-gradient(#000 0%, #000 80%, transparent 100%);
  mask-image: linear-gradient(#000 0%, #000 80%, transparent 100%);
}
.ws-preview-phone {
  position: absolute;
  top: 0;
  width: 100%;
  aspect-ratio: 430 / 932;
  border: 1px solid #c1c4b6;
  border-radius: 14cqw;
  background: #fffdf8;
  box-shadow: inset 0 0 0 3px #f7f5ef;
}
.ws-preview-screen { position: absolute; inset: 2.3cqw; overflow: hidden; isolation: isolate; border-radius: 11.6cqw; background: #ece9dd; }
.ws-preview-sun { position: absolute; top: 32cqw; right: -8cqw; width: 46cqw; height: 46cqw; border-radius: 50%; background: #e2d7ba; }
.ws-preview-hill { position: absolute; top: 76cqw; left: -44cqw; width: 135cqw; height: 120cqw; border-radius: 50%; transform: rotate(-25deg); background: #d2d7c4; }
.ws-preview-island { position: absolute; top: 3.5cqw; left: 50%; transform: translateX(-50%); width: 25cqw; height: 6.5cqw; border-radius: 8cqw; background: #384034; }
.ws-preview-status { position: absolute; top: 5.2cqw; left: 7cqw; right: 7cqw; display: flex; align-items: center; justify-content: space-between; color: #344b3c; font-size: clamp(11px, 3.3cqw, 14px); font-weight: 600; }
.ws-preview-signals { display: flex; gap: 1cqw; align-items: center; }
.ws-preview-signals svg { width: 4cqw; height: 4cqw; stroke-width: 1.6; }
/* A 430pt iPhone screen has a 364×170pt medium widget, per Apple HIG. */
.ws-preview-widget { position: absolute; top: 22cqw; left: 7.6744186%; right: 7.6744186%; }
.ws-preview-card { position: relative; width: 100%; aspect-ratio: 364 / 170; overflow: hidden; border-radius: var(--ws-card-radius, 18px); background: #f7f5ef; color: #242821; font-family: var(--ws-style-font, Georgia, serif); font-size: var(--ws-verse-size, 18px); font-weight: var(--ws-style-weight, 400); font-synthesis: none; letter-spacing: normal; }
.ws-preview-card-space { position: absolute; inset: var(--ws-card-inset, 13px); display: flex; align-items: center; justify-content: center; }
.ws-preview-card-content { flex: 0 0 100%; min-width: 0; text-align: center; overflow-wrap: anywhere; }
.ws-preview-card-body { margin: 0; font: inherit; line-height: 1.4; }
.ws-preview-card-reference { margin: 1em 0 0; font-size: .68em; font-weight: inherit; line-height: 1.4; overflow-wrap: normal; }
.ws-preview-card-reference > span { display: inline-block; white-space: nowrap; }
.ws-preview-app-label { display: block; margin-top: 4px; color: #344b3c; text-align: center; font-size: clamp(11px, 3.2cqw, 14px); line-height: 1.25; }
.ws-preview-apps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4cqw; margin: 12px 0 0; filter: blur(4px); opacity: .48; }
.ws-preview-apps > span { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 4cqw; color: #6e7b62; background: #fffdf8; }
.ws-preview-apps svg { width: 8cqw; height: 8cqw; stroke-width: 1.6; }
.widget-settings-options { flex: none; width: 100%; overflow: hidden; border: 1px solid #ddddd3; border-radius: 18px; background: #eeece4; }
.widget-setting-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 12px 16px; border: 0; border-bottom: 1px solid #ddddd3; color: inherit; background: transparent; text-align: start; font: 400 16px/1.4 var(--font-ui, sans-serif); cursor: default; }
.widget-setting-row:last-child { border-bottom: 0; }
.widget-setting-row[aria-controls="widget-styles"] { cursor: pointer; }
.widget-setting-value { margin-inline-start: auto; color: #73796b; font-size: 15px; }
.widget-setting-chevron { margin-inline-start: auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.widget-setting-value + .widget-setting-chevron { margin-inline-start: 0; }
.widget-setting-switch { position: relative; width: 44px; height: 27px; margin-inline-start: auto; border-radius: 20px; background: #b9bcaf; }
.widget-setting-switch::before { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fffdf8; }
.widget-settings-footer { flex: none; width: min(100% - 40px, 720px); margin: 0 auto; padding: 16px 0 max(22px, env(safe-area-inset-bottom)); }
.widget-settings-footer .widget-add-button { min-height: 50px; margin: 0 auto; cursor: default; }
.widget-settings button:focus-visible { outline: 2px solid var(--ws-ink); outline-offset: 3px; }
.widget-style-tags { display: flex; flex: none; gap: 10px; width: min(100% - 40px, 720px); margin: 0 auto; padding: 6px 0 18px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.widget-style-tags::-webkit-scrollbar { display: none; }
.widget-style-tags button { flex: none; min-height: 36px; padding: 8px 18px; border: 1px solid transparent; border-radius: 999px; background: var(--theme-base-chip-background, #eeefe7); color: var(--theme-base-subcategory-tabs-button-color, #666b61); font: 500 .82rem/1.3 var(--font-ui, sans-serif); cursor: pointer; }
.widget-style-tags button[aria-pressed="true"] { border-color: currentColor; background: var(--theme-base-panel, #fffdf8); color: inherit; }
.widget-style-content { flex: 1 1 0; min-height: 0; width: min(100% - 40px, 720px); margin: 0 auto; padding: 8px 3px max(30px, env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.widget-style-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; }
.widget-style-option { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 0; border: 0; border-radius: 16px; background: transparent; color: inherit; text-align: center; cursor: pointer; }
.widget-style-option[hidden], .widget-style-empty[hidden] { display: none; }
.widget-style-swatch { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; border: 1px solid #ddddd3; border-radius: 16px; font-family: var(--ws-style-font, Georgia, serif); font-size: clamp(32px, 11vw, 68px); font-weight: var(--ws-style-weight, 400); line-height: 1; letter-spacing: normal; font-synthesis: none; }
.widget-style-option[aria-pressed="true"] .widget-style-swatch { border-color: var(--ws-ink); box-shadow: 0 0 0 1px var(--ws-ink); }
.widget-style-label { font-size: .8125rem; font-weight: 500; line-height: 1.3; }
.widget-style-check { position: absolute; top: 7px; right: 7px; display: none; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: #344b3c; color: #fffdf8; }
.widget-style-check svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.widget-style-option[aria-pressed="true"] .widget-style-check { display: grid; }
.widget-style-empty { margin: 48px 0; color: var(--theme-base-subcategory-tabs-button-color, #666b61); text-align: center; font: 400 15px/1.5 var(--font-ui, sans-serif); }
:root[data-theme="dark"] .widget-settings { --ws-ink: #f3ede3; }
:root[data-theme="dark"] .widget-settings-options { background: #2a2f28; border-color: #45493f; }
:root[data-theme="dark"] .widget-setting-row { border-color: #45493f; }
:root[data-theme="dark"] .widget-setting-value { color: #b5b7ae; }
:root[data-theme="dark"] .widget-setting-switch { background: #606657; }
@media (min-width: 680px) {
  .widget-settings-header { padding-top: 22px; padding-bottom: 14px; }
  .widget-settings-header h2 { font-size: 23px; }
  .widget-settings-back { width: 40px; height: 40px; border: 1px solid #ddd8c9; border-radius: 50%; }
  .widget-settings-preview { width: min(100%, 390px); }
}
