/* Notification preferences and refill reminder forms. */
.fn-settings {
  --fn-border: #b9ad98;
  --fn-muted: #665a46;
  --fn-surface: #fff9ef;
  color: var(--fm-ink, #171616);
  min-width: 0;
  font: 400 15px/1.55 var(--fm-sans, Arial, sans-serif);
}
.fn-settings *, .fn-settings *::before, .fn-settings *::after { box-sizing: border-box; }
.fn-settings :is(h1, h2, h3, p) { margin: 0; }
.fn-settings :is(h1, h2, h3) {
  font-family: var(--fm-heavy, "Arial Black", Arial, sans-serif);
  font-weight: 1000;
  letter-spacing: -.065em;
}
.fn-settings [hidden] { display: none !important; }
.fn-settings :is(button, input, select) { font: inherit; color: inherit; }
.fn-settings a { color: inherit; }
.fn-settings :is(button, a, input, select):focus-visible {
  outline: 3px solid #792c81;
  outline-offset: 3px;
}
.fn-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 330px);
  align-items: end;
  gap: 32px;
  padding: 33px clamp(22px, 3.2vw, 45px) 35px;
  margin: 0 0 26px;
  background: var(--fm-olive, #d9ed84);
  border-bottom: 1px solid var(--fm-ink, #171616);
}
.fn-hero h1 { font-size: clamp(48px, 5.4vw, 80px); line-height: .96; }
.fn-hero h1 em { font-style: italic; }
.fn-hero > p { max-width: 34ch; font-size: 15px; line-height: 1.55; }
.fn-form, .fn-pair, .fn-panel, .fn-refills, .fn-refill, .fn-switch-copy { min-width: 0; }
.fn-pair, .fn-refill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.fn-panel, .fn-refill {
  border: 1px solid var(--fm-ink, #171616);
  background: var(--fn-surface);
}
.fn-panel { padding: 24px clamp(18px, 2vw, 30px) 16px; }
.fn-panel > header { border-bottom: 1px solid var(--fn-border); padding-bottom: 18px; }
.fn-panel-emails { border-top: 5px solid var(--fm-coral, #fb5d46); }
.fn-panel-topics { border-top: 5px solid var(--fm-ink, #171616); }
.fn-panel h2, .fn-section-heading h2 { font-size: clamp(27px, 2.5vw, 38px); line-height: 1.07; }
.fn-panel > header > p, .fn-section-heading p { font-size: 14px; line-height: 1.55; color: var(--fn-muted); margin-top: 9px; }
.fn-switch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  min-height: 52px;
  cursor: pointer;
}
.fn-options .fn-switch + .fn-switch { border-top: 1px solid #dbcebb; }
.fn-switch-copy { display: grid; gap: 3px; }
.fn-switch-copy strong { font-size: 15px; line-height: 1.4; }
.fn-switch-copy small { font-size: 12px; line-height: 1.55; color: var(--fn-muted); }
.fn-switch-ui { position: relative; width: 44px; height: 28px; flex: none; }
.fn-switch-ui > input {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.fn-track {
  display: block;
  height: 28px;
  width: 44px;
  border: 1px solid #857c6d;
  border-radius: 20px;
  background: #e7dfd1;
}
.fn-track::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 5px;
  left: 5px;
  border-radius: 50%;
  background: #fff9ef;
  border: 1px solid #837766;
  transition: transform .13s ease;
}
.fn-switch-ui input:checked + .fn-track { background: var(--fm-olive, #d9ed84); border-color: var(--fm-ink, #171616); }
.fn-switch-ui input:checked + .fn-track::before { transform: translateX(16px); background: var(--fm-ink, #171616); border-color: var(--fm-ink, #171616); }
.fn-switch-ui input:focus-visible + .fn-track { outline: 3px solid #792c81; outline-offset: 3px; }
.fn-refills { margin: 40px 0 22px; }
.fn-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 19px; }
.fn-section-heading p { max-width: 59ch; }
.fn-section-heading > a, .fn-product-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: underline !important;
  text-underline-offset: 4px;
}
.fn-section-heading > a { flex: none; white-space: nowrap; min-height: 34px; }
.fn-refill { padding: clamp(17px, 1.8vw, 25px); box-shadow: 3px 3px 0 #d7ccb8; }
.fn-refill-head { display: grid; grid-template-columns: clamp(82px, 8vw, 128px) minmax(0, 1fr); gap: 20px; align-items: center; border-bottom: 1px solid var(--fn-border); padding: 0 0 17px; }
.fn-refill-photo { display: block; width: 100%; aspect-ratio: 1; border: 1px solid var(--fn-border); background: #ecebdd; }
.fn-refill-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fn-refill-copy { min-width: 0; }
.fn-refill-copy h3 { font-size: clamp(21px, 2.1vw, 30px); line-height: 1.05; }
.fn-refill-copy h3 a { text-decoration: none; }
.fn-refill-copy > p { font-size: 12px; line-height: 1.5; color: var(--fn-muted); margin-top: 6px; }
.fn-product-link { margin-top: 8px; }
.fn-refill > .fn-switch { padding: 13px 0; }
.fn-schedule {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 7px 15px;
  padding: 15px 0;
  border: 0;
  border-top: 1px dashed var(--fn-border);
  margin: 0;
  min-width: 0;
}
.fn-schedule > legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  clip: rect(0,0,0,0);
  overflow: hidden;
}
.fn-schedule > label { display: grid; gap: 5px; min-width: 0; font-size: 12px; font-weight: 650; line-height: 1.5; }
.fn-schedule input, .fn-schedule select {
  width: 100%;
  min-width: 0;
  height: 43px;
  padding: 8px 9px;
  border: 1px solid #a99a82;
  border-radius: 0;
  background: #fffdf8;
  font: 500 14px/1.4 var(--fm-sans, Arial, sans-serif);
}
.fn-schedule input[aria-invalid="true"] { border: 2px solid #a82f25; }
.fn-schedule :is(input, select):disabled { background: #f1ebdf; color: #675f53; }
.fn-schedule .fn-today {
  justify-self: start;
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.fn-schedule .fn-today:disabled { color: #7c7262; cursor: default; }
.fn-next {
  padding: 10px 12px;
  background: #edeedc;
  color: #465036;
  font: 550 10px/1.6 var(--fm-mono, monospace);
}
.fn-error, .fn-result {
  border-left: 3px solid var(--fm-ink, #171616);
  padding: 10px 13px;
  font-size: 13px;
  line-height: 1.5;
}
.fn-settings .fn-error { margin: 4px 0 12px; border-color: #a82f25; color: #80291e; background: #fff0e2; }
.fn-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 28px 0 0;
  padding: 17px 20px;
  border: 1px solid #a79a85;
  background: var(--fn-surface);
}
.fn-actions b { display: block; font-size: 15px; }
.fn-actions small { display: block; font-size: 11px; line-height: 1.5; margin-top: 3px; color: var(--fn-muted); }
.fn-action-buttons { display: flex; align-items: center; gap: 16px; }
.fn-action-buttons button { cursor: pointer; }
.fn-action-buttons .fn-discard {
  padding: 9px 4px;
  border: 0; background: transparent;
  font-size: 12px; font-weight: 650;
  text-decoration: underline; text-underline-offset: 3px;
}
.fn-action-buttons .fn-save {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid var(--fm-ink, #171616);
  background: var(--fm-ink, #171616);
  color: var(--fn-surface);
  font-size: 13px;
  font-weight: 700;
}
.fn-action-buttons button:disabled { opacity: .55; cursor: default; }
.fn-form.is-dirty .fn-actions {
  position: sticky;
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 8;
  background: var(--fm-olive, #d9ed84);
  border-color: var(--fm-ink, #171616);
  box-shadow: 3px 3px 0 var(--fm-ink, #171616);
}
.fn-settings .fn-result { margin: 12px 0 0; background: #e6edc9; }
.fn-result.is-error { border-color: #a82f25; background: #fff0e2; color: #80291e; }
@media (max-width: 920px) {
  .fn-hero { grid-template-columns: minmax(0, 1fr) minmax(190px, 255px); gap: 26px; }
  .fn-pair, .fn-refill-grid { gap: 16px; }
  .fn-refill-head { grid-template-columns: 78px minmax(0, 1fr); gap: 14px; }
  .fn-refill-copy h3 { font-size: 23px; }
}
@media (max-width: 720px) {
  .fn-hero { grid-template-columns: 1fr; gap: 15px; padding: 24px 21px 27px; }
  .fn-hero h1 { font-size: clamp(43px, 10vw, 62px); }
  .fn-hero > p { max-width: 42ch; font-size: 14px; }
  .fn-pair, .fn-refill-grid { grid-template-columns: 1fr; gap: 16px; }
  .fn-panel { padding: 20px 19px 11px; }
  .fn-panel > header { padding-bottom: 14px; }
  .fn-panel h2, .fn-section-heading h2 { font-size: 29px; }
  .fn-switch { padding: 13px 0; gap: 14px; }
  .fn-switch-copy small { font-size: 13px; }
  .fn-refills { margin-top: 30px; }
  .fn-section-heading { align-items: start; flex-direction: column; gap: 7px; margin-bottom: 15px; }
  .fn-section-heading > a { min-height: 33px; }
  .fn-refill { padding: 17px; }
  .fn-schedule input, .fn-schedule select { font-size: 16px; }
  .fn-next { font-size: 11px; }
  .fn-actions { padding: 13px 15px; flex-wrap: wrap; gap: 10px; }
  .fn-actions b { font-size: 13px; }
  .fn-actions small { font-size: 10px; }
  .fn-action-buttons { justify-content: space-between; width: 100%; gap: 12px; }
  .fn-action-buttons .fn-discard { min-height: 40px; }
  .fn-action-buttons .fn-save { min-height: 42px; }
}
@media (max-width: 360px) {
  .fn-hero { padding: 22px 17px; }
  .fn-hero h1 { font-size: 39px; }
  .fn-refill { padding: 14px; }
  .fn-refill-head { grid-template-columns: 65px minmax(0, 1fr); gap: 11px; }
  .fn-schedule { grid-template-columns: 1fr; }
  .fn-schedule > label:nth-of-type(2) { grid-row: 3; }
}
@media (prefers-reduced-motion: reduce) {
  .fn-track::before { transition: none; }
}

