:root {
  --c-primary: rgb(191, 80, 96);
  --c-primary-dark: rgb(140, 59, 70);
  --c-ink: rgb(34, 40, 49);
  --c-ink-soft: rgb(90, 98, 110);
  --c-rule: rgb(226, 228, 232);
  --c-bg: #fff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--c-ink);
  background: var(--c-bg);
  line-height: 1.6;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }

a { color: var(--c-primary); }
a:hover { color: var(--c-primary-dark); }

.site-header { border-bottom: 1px solid var(--c-rule); }
.site-header .container { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { flex-shrink: 0; display: inline-flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.15rem; color: var(--c-ink); text-decoration: none; }
.brand:hover { color: var(--c-ink); }
/* The Philterd wordmark from philterd.ai, sized to the header. */
.brand-logo { display: block; height: 28px; width: auto; }
.brand-divider { width: 1px; height: 22px; background: var(--c-rule); }
.brand-name { white-space: nowrap; }

/* main.container, not main: .container's padding is more specific than a bare
   element selector and would otherwise zero the vertical space. */
main.container { padding-top: 48px; padding-bottom: 64px; min-height: 60vh; }
.lead { font-size: 1.15rem; color: var(--c-ink-soft); }

.site-footer { border-top: 1px solid var(--c-rule); font-size: .85rem; color: var(--c-ink-soft); }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 16px; }
.site-footer .copyright { margin-left: auto; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: .95rem; white-space: nowrap; }
.site-nav a:not(.button) { color: var(--c-ink); text-decoration: none; }
.site-nav a:not(.button):hover { color: var(--c-primary); text-decoration: underline; }
.site-nav .link-button { color: var(--c-ink); }
.site-nav .link-button:hover { color: var(--c-primary); }
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--c-primary); cursor: pointer; }
.link-button:hover { color: var(--c-primary-dark); text-decoration: underline; }

.button {
  display: inline-block;
  padding: 10px 18px;
  border: 0;
  border-radius: 6px;
  background: var(--c-primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--c-primary-dark); color: #fff; }

.form-page { max-width: 420px; }
.form { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; }
.form label { font-weight: 600; margin-top: 10px; }
.form input {
  padding: 10px 12px;
  border: 1px solid var(--c-rule);
  border-radius: 6px;
  font: inherit;
}
.form input:focus { outline: 2px solid var(--c-primary); outline-offset: 1px; border-color: transparent; }
.form .button { margin-top: 18px; align-self: flex-start; }
.form-footer { font-size: .95rem; color: var(--c-ink-soft); }
.hint { margin: 0; font-size: .85rem; color: var(--c-ink-soft); }

.alert { padding: 10px 14px; border-radius: 6px; }
.alert-error { background: rgb(253, 236, 238); color: rgb(140, 30, 45); border: 1px solid rgb(245, 200, 206); }

.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; }
.details dt { font-weight: 600; }
.details dd { margin: 0; }

/* Home page: Philter One on the left, sign-up and sign-in on the right. One
   column on narrow screens, with the information first. */
/* Grid areas let phones show the intro, then sign-in, then the diagram and
   example, while desktops keep sign-in beside both. */
.home {
  display: grid;
  grid-template-columns: 1fr 360px;
  grid-template-areas: "info card" "more card";
  column-gap: 48px;
  align-items: start;
}
.home-info { grid-area: info; }
.home-card { grid-area: card; }
.home-more { grid-area: more; }
.home-info h1 { margin-top: 0; }
.home-more .hint { text-align: center; }
.home-hero { display: grid; grid-template-columns: 1fr 200px; gap: 20px; align-items: center; }
.home-info .notice { margin-bottom: 0; }
.home-hero h1 { margin: 0 0 6px; }
.tagline { margin: 0 0 12px; font-size: 1.4rem; font-weight: 700; line-height: 1.3; color: var(--c-primary-dark); }
.device-image { display: block; width: 100%; height: auto; }
.card-sub { margin: 0 0 16px; font-size: .95rem; color: var(--c-ink-soft); }
@media (max-width: 560px) {
  .home-hero { grid-template-columns: 1fr; gap: 12px; }
  .device-image { width: 220px; margin: 0 auto; }
}
.home-card { padding: 24px; border: 1px solid var(--c-rule); border-top: 4px solid var(--c-primary); border-radius: 8px; }
.home-card h2 { margin: 0 0 4px; font-size: 1.25rem; }
.home-card .form .button { align-self: stretch; }
.home-alt { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--c-rule); }
.home-alt p { margin: 0 0 8px; color: var(--c-ink-soft); }
.button-secondary { background: #fff; color: var(--c-primary); border: 1px solid var(--c-primary); }
.button-secondary:hover { background: var(--c-primary); color: #fff; }

@media (max-width: 760px) {
  .home { grid-template-columns: 1fr; grid-template-areas: "info" "more" "card"; row-gap: 24px; }
  .brand-logo { height: 24px; }
  main.container { padding-top: 28px; padding-bottom: 40px; }
}

.site-nav .button-secondary { padding: 7px 14px; font-size: .9rem; }
.optional { font-weight: 400; color: var(--c-ink-soft); }
.form textarea {
  padding: 10px 12px;
  border: 1px solid var(--c-rule);
  border-radius: 6px;
  font: inherit;
  resize: vertical;
}
.form textarea:focus { outline: 2px solid var(--c-primary); outline-offset: 1px; border-color: transparent; }
.honeypot { display: none; }

/* The "See a demo" dialog. */
.dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 28px;
  border: 0;
  border-top: 4px solid var(--c-primary);
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  color: var(--c-ink);
}
.dialog::backdrop { background: rgba(34, 40, 49, .55); }
.dialog h2 { margin: 0 0 4px; }
.dialog .form .button { align-self: stretch; }
.dialog-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--c-ink-soft);
  cursor: pointer;
}
.dialog-close:hover { color: var(--c-ink); }

/* "How it works" diagram on the home page. Styled here rather than with
   inline styles, which the Content Security Policy blocks. */
.diagram { display: block; width: 100%; height: auto; margin: 28px 0 8px; }
.diagram text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.d-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; fill: var(--c-ink-soft); }
.d-boundary { fill: rgb(250, 250, 251); stroke: var(--c-ink-soft); stroke-width: 1.5; stroke-dasharray: 6 5; }
.d-paper { fill: #fff; stroke: var(--c-ink); stroke-width: 1.5; }
.d-text-line { stroke: var(--c-rule); stroke-width: 3; stroke-linecap: round; }
.d-redaction { fill: var(--c-ink); }
.d-box { fill: var(--c-primary); }
.d-box-text { font-size: 11px; font-weight: 700; fill: #fff; text-anchor: middle; }
.d-led { fill: rgb(120, 220, 150); }
.d-person { fill: var(--c-ink); }
.d-check-bg { fill: var(--c-primary); stroke: rgb(250, 250, 251); stroke-width: 2; }
.d-check { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.d-arrow { stroke: var(--c-ink-soft); stroke-width: 1.5; }
.d-arrowhead { fill: var(--c-ink-soft); }
.d-step { font-size: 12.5px; fill: var(--c-ink); text-anchor: middle; }
.d-step-left { font-size: 15px; fill: var(--c-ink); }
.diagram-tall { display: none; }
@media (max-width: 560px) {
  .diagram-wide { display: none; }
  .diagram-tall { display: block; max-width: 340px; margin-left: auto; margin-right: auto; }
}


/* Account page notice when details are missing. */
.notice { margin: 20px 0 28px; padding: 18px 20px; border-radius: 8px; }
.notice h2 { margin: 0 0 6px; font-size: 1.1rem; }
.notice p { margin: 0 0 10px; }
.notice p:last-child { margin-bottom: 0; }
.notice-info { background: rgb(252, 243, 245); border: 1px solid rgb(240, 212, 217); border-left: 5px solid var(--c-primary); }
.notice-important { background: rgb(255, 247, 230); border: 1px solid rgb(240, 200, 120); border-left: 5px solid rgb(214, 140, 20); }

/* Account details form. */
.details-page { max-width: 560px; }
/* "Back to ..." at the top of pages reached from the account page. */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* The negative margin lines the arrow up with the page title below. */
  margin: 0 0 2px -8px;
  padding: 6px 12px 6px 8px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
}
.back-link::before { content: "\2190"; font-size: 1.1em; line-height: 1; }
.back-link:hover { background: rgb(250, 238, 240); text-decoration: none; }
.back-link:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.back-link + h1 { margin-top: 6px; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.details-form fieldset { margin: 0 0 20px; padding: 0; border: 0; display: flex; flex-direction: column; gap: 6px; }
.details-form legend { margin-bottom: 4px; padding: 0; font-size: 1.1rem; font-weight: 700; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row > div { display: flex; flex-direction: column; gap: 6px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 400 !important; margin-top: 0 !important; }
.checkbox input { width: 18px; height: 18px; }
.alert-success { background: rgb(234, 247, 238); color: rgb(25, 100, 50); border: 1px solid rgb(190, 225, 200); }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert p { margin: 0; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Account page: a dashboard of cards. Devices is the main card; details and
   sign-in sit beside it, and everything stacks on phones, Devices first. */
.account-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.account-head h1 { margin: 0 0 8px; }
.account-greeting { margin: 0; color: var(--c-ink-soft); font-size: 1.05rem; }

.dashboard { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; margin-top: 20px; }
.dashboard-side { display: flex; flex-direction: column; gap: 24px; }
.card { padding: 20px 22px; background: #fff; border: 1px solid var(--c-rule); border-radius: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.card h2 { margin: 0 0 12px; font-size: 1.1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.button-compact { padding: 5px 12px; font-size: .88rem; }
.card-list { margin: 0; }
.card-list dt { margin-top: 10px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--c-ink-soft); }
.card-list dt:first-child { margin-top: 0; }
.card-list dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.card-muted { margin: 0; color: var(--c-ink-soft); }

.card-devices { min-height: 260px; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 12px 16px; }
.empty-icon { width: 72px; height: 72px; margin-bottom: 8px; }
.empty-box { fill: rgb(250, 238, 240); stroke: var(--c-primary); stroke-width: 2; }
.empty-slot { fill: var(--c-primary); opacity: .45; }
.empty-led { fill: rgb(120, 200, 140); }
.empty-title { margin: 0 0 4px; font-weight: 600; }
.empty-text { margin: 0; max-width: 340px; color: var(--c-ink-soft); }

@media (max-width: 760px) {
  .dashboard { grid-template-columns: 1fr; }
}

/* Account details page: a column of cards. */
.settings { max-width: 640px; }
.settings h1 { margin-bottom: 4px; }
.settings-intro { margin: 0 0 20px; color: var(--c-ink-soft); }
.settings-card { margin-bottom: 24px; scroll-margin-top: 20px; }
.settings-card > .card-muted { margin-bottom: 8px; }
.settings-card .form { margin-bottom: 0; }
.settings-card .details-form fieldset { padding-top: 12px; border-top: 1px solid var(--c-rule); }
.settings-card .details-form fieldset:first-of-type { border-top: 0; padding-top: 0; }
.pill { padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.pill-on { background: rgb(226, 245, 232); color: rgb(25, 100, 50); }
.pill-off { background: rgb(238, 239, 242); color: var(--c-ink-soft); }

.setup-steps { margin: 0; padding-left: 22px; }
.setup-steps > li { margin-bottom: 18px; }
.setup-steps > li:last-child { margin-bottom: 0; }
.setup-steps p { margin: 0 0 8px; }
.qr { display: block; margin: 6px 0 12px; border: 1px solid var(--c-rule); border-radius: 6px; image-rendering: pixelated; }
.setup-key { font-size: 1rem; letter-spacing: .04em; }
.recovery-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; margin: 12px 0 18px; padding: 14px 18px; list-style: none; background: rgb(248, 248, 250); border: 1px solid var(--c-rule); border-radius: 6px; }
.recovery-codes code { font-size: 1rem; }
.empty-action { margin: 18px 0 0; justify-content: center; }

/* Buy page. */
.buy-section h2 { margin: 0 0 4px; font-size: 1.1rem; }
.buy-section + .buy-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--c-rule); }
.ship-to { margin: 10px 0 0; padding: 14px 16px; background: rgb(248, 248, 250); border: 1px solid var(--c-rule); border-radius: 6px; font-style: normal; line-height: 1.55; }
.quantity { max-width: 120px; padding: 9px 10px; border: 1px solid var(--c-rule); border-radius: 6px; font: inherit; background: #fff; }
.buy-actions { margin-top: 22px; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button:disabled:hover { background: var(--c-primary); }
.buy-actions .hint { margin-top: 10px; }

/* Cookie notice, shown to first-time visitors when analytics is on. */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  background: var(--c-ink);
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}
.cookie-banner-text { flex: 1 1 360px; margin: 0; font-size: .9rem; line-height: 1.5; }
.cookie-banner-text a { color: #fff; }
.cookie-banner-actions { display: flex; gap: 8px; }
.cookie-banner .button { padding: 8px 14px; font-size: .9rem; }
.button-ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .5); }
.button-ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* A value shown but not editable, such as the account email. */
.field-readonly { margin: 4px 0 0; overflow-wrap: anywhere; }
.field-readonly-label { display: block; font-weight: 600; margin-bottom: 2px; }

/* Documentation: a sidebar of pages beside the article; on phones the
   sidebar becomes a collapsible "Contents" menu above it. */
.docs { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start; }
.docs-nav { position: sticky; top: 20px; }
.docs-nav summary { display: none; }
.docs-nav ul { margin: 0; padding: 0; list-style: none; }
.docs-nav li a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--c-ink); text-decoration: none; }
.docs-nav li a:hover { background: rgb(248, 248, 250); }
.docs-nav li a[aria-current="page"] { background: rgb(250, 238, 240); color: var(--c-primary-dark); font-weight: 600; }
.docs-body { max-width: 720px; min-width: 0; }
.docs-body h1 { margin-top: 0; }
.docs-body h2 { margin: 32px 0 8px; font-size: 1.3rem; }
.docs-body h3 { margin: 18px 0 4px; font-size: 1.05rem; }
.docs-index { padding: 0; list-style: none; }
.docs-index li { margin: 0 0 14px; padding: 14px 16px; border: 1px solid var(--c-rule); border-radius: 8px; }
.docs-index li a { font-weight: 700; font-size: 1.05rem; }
.docs-index li p { margin: 4px 0 0; color: var(--c-ink-soft); }

/* Numbered steps: each step's heading carries the number. */
.doc-steps { list-style: none; counter-reset: step; margin: 12px 0; padding: 0; }
.doc-steps > li { counter-increment: step; position: relative; margin: 0 0 14px; padding-left: 44px; }
.doc-steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; background: var(--c-primary); color: #fff; font-weight: 700;
}
.doc-steps > li > h3 { margin: 3px 0 2px; }
.doc-steps > li > p { margin: 0; }

/* Notes and warnings. */
.doc-callout { margin: 18px 0; padding: 12px 16px; border-radius: 8px; border-left: 4px solid; }
.doc-note { background: rgb(238, 244, 252); border-color: rgb(60, 120, 200); }
.doc-warning { background: rgb(255, 247, 230); border-color: rgb(214, 140, 20); }
.doc-figure { margin: 18px 0; }
.doc-figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--c-rule); border-radius: 6px; }
.doc-figure figcaption { margin-top: 6px; font-size: .9rem; color: var(--c-ink-soft); }

.docs-pager { display: flex; justify-content: space-between; gap: 12px; margin: 36px 0 12px; padding-top: 18px; border-top: 1px solid var(--c-rule); }
.docs-pager a { display: flex; flex-direction: column; padding: 10px 14px; border: 1px solid var(--c-rule); border-radius: 8px; text-decoration: none; font-weight: 600; }
.docs-pager a span { font-size: .8rem; font-weight: 400; color: var(--c-ink-soft); }
.docs-next { margin-left: auto; text-align: right; }
.docs-help { color: var(--c-ink-soft); font-size: .95rem; }

@media (max-width: 760px) {
  .docs { grid-template-columns: 1fr; gap: 16px; }
  .docs-nav { position: static; }
  .docs-nav summary { display: block; cursor: pointer; font-weight: 600; padding: 8px 0; }
  .docs-nav summary::after { content: " \25BE"; color: var(--c-ink-soft); }
  .docs-nav-toggle[open] summary::after { content: " \25B4"; }
  .docs-nav-toggle:not([open]) ul { display: none; }
}

/* Phones: keep the header on one line now that it carries the logo. */
@media (max-width: 760px) {
  .brand { gap: 8px; font-size: 1.05rem; }
  .brand-divider { height: 18px; }
  .site-nav { gap: 12px; }
  .site-nav .button-secondary { white-space: nowrap; padding: 6px 10px; }
}
@media (max-width: 440px) {
  /* Help and FAQ are only in the header, so tighten rather than hide. */
  .brand { gap: 6px; font-size: .95rem; }
  .brand-logo { height: 20px; }
  .brand-divider { height: 16px; }
  .site-nav { gap: 10px; font-size: .9rem; }
  .site-nav .button-secondary { padding: 5px 8px; font-size: .82rem; }
}
@media (max-width: 380px) {
  .brand { font-size: .88rem; }
  .brand-logo { height: 18px; }
  .site-nav { gap: 8px; font-size: .85rem; }
  .site-nav .button-secondary { padding: 4px 7px; font-size: .78rem; }
}
@media (max-width: 340px) {
  /* Only on the smallest phones; the page heading still names Philter One. */
  .brand-divider, .brand-name { display: none; }
}

/* A long email address shortens with an ellipsis rather than pushing the
   header onto two lines; the full address is in the link's title. */
.site-nav .account-email { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-email-short { display: none; }
.signup-short { display: none; }
/* Phones: the full sign-up label pushes the header past the screen edge. */
@media (max-width: 480px) {
  .signup-full { display: none; }
  .signup-short { display: inline; }
}
.site-nav .link-button { white-space: nowrap; }
/* Phones: "Account" in place of the email address, which won't fit. */
@media (max-width: 760px) {
  .account-email-full { display: none; }
  .account-email-short { display: inline; }
}

/* Activation code entry and the account page's device list. */
.activation-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; }
.form-actions { margin-top: 14px; }
.device-list { margin: 0 0 16px; padding: 0; list-style: none; }
.device-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--c-rule); }
.device-list li:first-child { padding-top: 0; }
.device-serial { font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.device-meta { color: var(--c-ink-soft); font-size: .9rem; }
.activate-help { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--c-rule); }

/* Messages and what they mean, on help pages. */
.doc-messages dt { margin-top: 16px; font-weight: 700; }
.doc-messages dt::before { content: "\201C"; }
.doc-messages dt::after { content: "\201D"; }
.doc-messages dd { margin: 4px 0 0; }
.docs-body code { padding: 1px 5px; background: rgb(243, 243, 246); border-radius: 4px; font-size: .92em; white-space: nowrap; }
