/* ── Legal pages (terms, privacy, cookies, contact) ──
   A readable document column on the app's tokens: tabs between the four documents, the landing's type for the title,
   comfortable prose, and tables that scroll sideways on a phone instead of breaking the page. */

.legal { width: 100%; max-width: 820px; margin: 0 auto; padding: 32px 24px 96px; }
.legal-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 32px; padding: 4px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); }
.legal-tabs a { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 12px; border-radius: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.legal-tabs a:hover { color: var(--text); }
.legal-tabs a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.legal-tabs a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.legal-draft { margin: 0 0 28px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--amber) 55%, var(--line)); border-radius: 6px;
  background: var(--amber-soft); color: var(--text); font-size: 13.5px; line-height: 1.5; }

.legal-doc { color: color-mix(in srgb, var(--text) 82%, var(--text-2)); font-size: 16px; line-height: 1.65; }
.legal-doc > p, .legal-doc > ul, .legal-doc > ol, .legal-doc > section > p, .legal-doc > section > ul, .legal-doc > section > ol { max-width: 66ch; }
/* a bold run-in lead-in at the start of a paragraph reads as a sub-heading */
.legal-doc p > b:first-child, .legal-doc p > strong:first-child { font-weight: 650; }
.legal-doc h1 { margin: 10px 0 6px; font-size: clamp(32px, 4vw, 44px); font-weight: 740; letter-spacing: -0.04em; line-height: 1.05; color: var(--text); }
.legal-updated { margin: 0 0 28px; font-size: 12px; color: var(--text-3); }
.legal-lede { font-size: 17px; color: var(--text); }
.legal-doc h2 { margin: 40px 0 10px; font-size: 20px; font-weight: 680; letter-spacing: -0.02em; color: var(--text); scroll-margin-top: 112px; }
.legal-doc p { margin: 0 0 14px; }
.legal-doc ul, .legal-doc ol { margin: 0 0 16px; padding-left: 22px; }
.legal-doc ul { list-style: disc; }
.legal-doc ol { list-style: decimal; }
.legal-doc li { margin: 4px 0; }
.legal-doc b { color: var(--text); font-weight: 600; }
.legal-doc code { font-size: .9em; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; color: var(--text); overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.legal-doc a { overflow-wrap: anywhere; }
/* a link in text is told apart without colour (axe link-in-text-block) */
.legal-doc p a, .legal-doc li a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.legal-doc p a:hover, .legal-doc li a:hover { text-decoration-color: currentColor; }
.legal-doc a.btn { text-decoration: none; }

/* Tables are flat: no outer box, 1 px row lines, a quiet header */
.legal-table-wrap { overflow-x: auto; margin: 0 0 18px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
.legal-table th { text-align: left; padding: 8px 12px; color: var(--text-3); font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--line-strong); }
.legal-table td { padding: 10px 12px; vertical-align: top; border-top: 1px solid var(--line); min-width: 140px; }
.legal-table tr:first-child td { border-top: 0; }
.legal-table code { white-space: nowrap; overflow-wrap: normal; } /* a cookie name reads whole */

/* The contact table: a flat definition-style list */
.legal-facts { margin: 0 0 16px; }
.legal-facts > div { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.legal-facts > div:first-child { border-top: 0; }
.legal-facts dt { color: var(--text-3); font-size: 13px; }
.legal-facts dd { margin: 0; color: var(--text); font-size: 15px; overflow-wrap: anywhere; }

/* Phone: legal tables become stacked rows (each cell on its own line, the first one bold); the header row stays for screen readers */
@media (max-width: 560px) {
  .legal-table-wrap { overflow-x: visible; }
  .legal-table:not([data-pricing-table]), .legal-table:not([data-pricing-table]) tbody { display: block; }
  .legal-table:not([data-pricing-table]) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .legal-table:not([data-pricing-table]) tr { display: block; padding: 10px 0; border-top: 1px solid var(--line); }
  .legal-table:not([data-pricing-table]) tr:first-child { border-top: 0; }
  .legal-table:not([data-pricing-table]) td { display: block; min-width: 0; padding: 2px 0; border-top: 0; }
  .legal-table:not([data-pricing-table]) td:first-child { font-weight: 600; color: var(--text); }
  .legal-table code { white-space: normal; overflow-wrap: anywhere; }
}

/* Links to the documents from the sign-in forms and the landing footer */
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-3); }
.legal-links a { color: var(--text-3); }
.legal-links a:hover { color: var(--text); }
/* In the account area: under the settings rail (hidden where the rail turns into tabs — Personal data links them too) */
.account-rail .legal-links { padding: 14px 20px 18px 20px; border-top: 1px solid var(--line); }
.auth-consent { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }

@media (max-width: 760px) {
  .legal { padding: 20px 16px 64px; }
  .legal-tabs a { flex-basis: calc(50% - 4px); }
  .legal-facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (max-width: 900px) {
  .account-rail .legal-links { display: none; }
}

/* Pricing page as a plan chooser (spec docs/specs/pricing-and-refund-pages.md AC9). Two plan cards on the flat-sheet grammar (a bordered surface, no shadow), Premium marked by the one orange accent.
   The Monthly / Yearly choice is two radio inputs before the cards: CSS shows the matching price and button, so it needs no script. */
.pricing-page { max-width: 980px; }
.pricing-head { text-align: center; margin: 0 0 28px; }
.pricing-head .legal-lede { max-width: 38ch; margin: 0 auto; }
.plan-chooser { position: relative; margin: 0 0 40px; }
.bill-radio { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.price-card { display: flex; flex-direction: column; padding: 22px 22px 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.price-card h2 { margin: 0 0 10px; font-size: 18px; }
.plan-premium { border-color: var(--brand); }
.price-line { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; color: var(--text); }
.price-amount { font-size: 34px; font-weight: 740; letter-spacing: -0.03em; line-height: 1.1; }
.price-per { color: var(--text-3); font-size: 14px; }
.legal-doc .price-card .price-sub { margin: 4px 0 0; font-size: 13.5px; color: var(--text-3); }
.legal-doc .price-card .price-saving { color: var(--text-2); }
.plan-badge { display: inline-block; padding: 2px 9px; border-radius: var(--radius-sm); background: var(--brand); color: var(--on-brand); font-size: 12px; font-weight: 700; letter-spacing: 0; }
/* The trial, first thing on the Premium card: a large line above the price (the length is Paddle's), and one honest line under the button. */
.legal-doc .trial-lede { margin: 6px 0 0; font-size: 17px; font-weight: 650; color: var(--brand-text, var(--text)); }
.legal-doc .price-card .trial-badge { display: inline-block; align-self: flex-start; margin: 0 0 10px; padding: 5px 14px; border-radius: var(--radius-sm); background: var(--brand); color: var(--on-brand); font-size: 18px; font-weight: 750; letter-spacing: -0.01em; }
.legal-doc .price-card .trial-note { margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.legal-doc .plan-lead { margin: 18px 0 8px; font-weight: 600; color: var(--text); }
.legal-doc ul.plan-features { list-style: none; margin: 16px 0 20px; padding: 0; }
.plan-premium ul.plan-features { margin-top: 0; }
.plan-features li { position: relative; margin: 0 0 8px; padding-left: 24px; color: var(--text-2); }
.plan-features li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 700; }
.price-action { margin-top: auto; }
.price-action form { margin: 0; }
.btn-block { display: flex; width: 100%; justify-content: center; align-items: center; height: 42px; font-size: 14.5px; font-weight: 600; margin: 0 0 8px; }
.plan-toggle { display: inline-flex; align-self: flex-start; padding: 3px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.plan-toggle label { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 18px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer; }
#bill-year:checked ~ .plan-grid label[for="bill-year"],
#bill-month:checked ~ .plan-grid label[for="bill-month"] { background: var(--brand); color: var(--on-brand); }
#bill-year:focus-visible ~ .plan-grid label[for="bill-year"],
#bill-month:focus-visible ~ .plan-grid label[for="bill-month"] { outline: 2px solid var(--text); outline-offset: 2px; }
#bill-year:checked ~ .plan-grid .when-month,
#bill-month:checked ~ .plan-grid .when-year { display: none; }
.purchase-renewal, .purchase-consent { font-size: 13px; line-height: 1.5; color: var(--text-2); }
.purchase-renewal a, .purchase-consent a, .plan-trust a, .faq a { text-decoration: underline; text-underline-offset: 2px; } /* a link in text is told apart without colour (axe link-in-text-block) */
.purchase-renewal { margin: 0 0 10px; }
.purchase-consent { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; }
.purchase-consent input { margin-top: 3px; flex: none; }
.legal-doc ul.plan-trust { list-style: none; margin: 10px 0 0; padding: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }
.plan-trust li { margin: 0 0 4px; }
.faq details { margin: 0 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.faq summary { padding: 12px 14px; cursor: pointer; font-weight: 600; color: var(--text); }
.faq summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.faq details > p { margin: 0; padding: 0 14px 14px; }
.plan-closing { margin: 48px 0 0; padding: 28px 0 0; text-align: center; border-top: 1px solid var(--line); }
.plan-closing h2 { margin-top: 0; }
.legal-doc .plan-closing p { max-width: none; }
/* The Free plan's action is the one live button: the filled accent. */
/* the free plan's button is the page's one accent only while Premium has no buy button of its own (payments off) */
.plan-chooser:not(:has([data-plan-card="premium"] .btn-primary)) .price-card[data-plan-card="free"] .btn-block { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.plan-chooser:not(:has([data-plan-card="premium"] .btn-primary)) .price-card[data-plan-card="free"] .btn-block:hover { filter: brightness(0.94); }
.btn-block:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
/* The comparison table: flat, its two value columns line up with the two cards above (50/50, same gap) */
.pricing-page .legal-table-wrap { overflow: visible; }
.legal-table[data-pricing-table], .legal-table[data-pricing-table] tbody, .legal-table[data-pricing-table] thead { display: block; }
.legal-table[data-pricing-table] tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; padding: 10px 0; border-top: 1px solid var(--line); }
.legal-table[data-pricing-table] thead tr { border-top: 0; padding: 0 0 6px; }
.legal-table[data-pricing-table] thead th:first-child { display: none; }
.legal-table[data-pricing-table] thead th { padding: 6px 0; border-bottom: 1px solid var(--line-strong); }
.legal-table[data-pricing-table] tbody th { grid-column: 1 / -1; padding: 0 0 2px; border: 0; color: var(--text-3); font-size: 13px; font-weight: 600; }
.legal-table[data-pricing-table] td { min-width: 0; padding: 0; border: 0; color: var(--text); }
@media (max-width: 760px) {
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .plan-premium { order: -1; }
  .price-card { padding: 18px 16px 16px; }
}
@media (max-width: 480px) {
  .legal-tabs a { min-height: 44px; }
  .legal-doc p a, .legal-doc li a { padding-block: 0.2em; }
  .faq summary { min-height: 44px; display: flex; align-items: center; }
  .btn-block { height: 46px; }
  .legal-links a, .legal-links .linklike { display: inline-flex; align-items: center; min-height: 40px; }
  .plan-toggle { align-self: stretch; }
  .plan-toggle label { flex: 1 1 0; }
  .legal-table[data-pricing-table] tr { column-gap: 12px; }
}

/* Cookie choice about Microsoft Clarity (spec docs/specs/cookie-consent.md). A quiet card at the bottom-left, not a modal, so the page stays usable;
   Accept and Reject share one style on purpose: neither is the highlighted answer. */
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: none; }
.lp-footer .linklike { color: var(--text-2); }
.legal-links .linklike { color: var(--text-3); }
.linklike:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.cookie-banner { position: fixed; z-index: 40; left: 16px; bottom: 16px; width: min(380px, calc(100vw - 32px)); padding: 16px 18px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius-md, 10px); box-shadow: 0 6px 24px rgb(0 0 0 / 12%); font-size: 13.5px; line-height: 1.5; }
.cookie-banner[hidden] { display: none; }
/* The signed-in withdrawal (spec cookie-consent AC12): nothing shows until cookie-consent.js has found a stored "accept" and marked <html>; the panel opens on a click. */
.cookie-withdraw-open, .cookie-withdraw-panel { display: none; }
html[data-cookie-accepted] .cookie-withdraw-open { display: inline; }
html[data-cookie-accepted][data-cookie-withdraw-asked] .cookie-withdraw-panel { display: inline; }
html[data-cookie-accepted][data-cookie-withdraw-asked] .cookie-withdraw-open { display: none; }
.cookie-banner h2 { margin: 0 0 6px; font-size: 14.5px; font-weight: 600; }
.cookie-banner p { margin: 0 0 12px; color: var(--text-2); }
.cookie-banner a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-btn { flex: 1 1 0; min-height: 38px; padding: 0 14px; font: inherit; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.cookie-btn:hover { background: var(--surface-3); }
.cookie-btn:focus-visible, .cookie-banner h2:focus-visible, .linklike:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.public-foot { max-width: 1100px; margin: 0 auto; padding: 28px 24px 36px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .cookie-banner { left: 8px; right: 8px; bottom: 8px; width: auto; }
}

/* ── Logbook grammar (spec logbook-design-system AC9): layout and type only; the wording of every page is unchanged ──
   One left edge on the landing's 1240 px sheet, Band for the tabs and notes, Leaf columns for the plans, no boxes. */
.legal { max-width: none; margin: 0; padding-left: max(16px, calc((100% - 1240px) / 2 + 32px)); padding-right: max(16px, calc((100% - 1240px) / 2 + 32px)); }
.legal-tabs { border: 0; border-radius: var(--radius-sm); background: var(--surface-3); gap: 2px; padding: 2px; }
.legal-tabs a { border-radius: var(--radius-sm); }
.legal-tabs a[aria-current="page"] { background: var(--surface); box-shadow: none; }
.legal-draft { border: 0; border-radius: var(--radius-sm); background: var(--surface-3); }
.legal-doc > * { max-width: 820px; }
/* The frame (LegalDoc.razor) is hash-guarded, so its small "Legal" line stays and is styled as a plain line of text. */
.legal-doc > .lp-label { font-size: 14px; font-weight: 400; }
.legal-doc h1 { font-weight: 650; font-stretch: 75%; letter-spacing: -0.01em; }
.legal-doc h2 { font-weight: 650; font-stretch: 85%; letter-spacing: -0.01em; }
.pricing-page > .legal-doc > *, .pricing-page .plan-chooser { max-width: none; }
.pricing-page .legal-doc > p { max-width: 38ch; } /* about 75 characters: this page sets its text in a narrower cut than the help center, so 38ch (spec logbook-design-system AC19) */
.pricing-head { text-align: left; }
.pricing-head .legal-lede { margin: 0; }
.plan-grid { gap: 2px; }
.price-card { border: 0; border-radius: var(--radius-sm); }
.plan-premium { border: 0; }
.plan-badge, .legal-doc .price-card .trial-badge { background: var(--surface-3); color: var(--text); }
.plan-toggle { border: 0; border-radius: var(--radius-md); background: var(--surface-3); }
.plan-toggle label { border-radius: var(--radius-sm); }
#bill-year:checked ~ .plan-grid label[for="bill-year"],
#bill-month:checked ~ .plan-grid label[for="bill-month"] { background: var(--surface); color: var(--text); }
.legal-doc .trial-lede { color: var(--text); }
.faq details { border: 0; border-radius: var(--radius-sm); margin: 0 0 2px; }
.plan-closing { text-align: left; border-top: 0; margin-top: 48px; padding: 24px; border-radius: var(--radius-sm); background: var(--surface-3); }

/* The plans comparison is a real three-column table (feature, Free, Premium) once the window is wide enough; below 700 px it keeps the stacked rows. */
@media (min-width: 701px) {
  .legal-table[data-pricing-table] { display: table; table-layout: fixed; }
  .legal-table[data-pricing-table] thead { display: table-header-group; }
  .legal-table[data-pricing-table] tbody { display: table-row-group; }
  .legal-table[data-pricing-table] tr { display: table-row; padding: 0; border-top: 0; }
  .legal-table[data-pricing-table] thead th:first-child { display: table-cell; }
  .legal-table[data-pricing-table] thead th, .legal-table[data-pricing-table] tbody th, .legal-table[data-pricing-table] tbody td { display: table-cell; padding: 10px 12px; border: 0; border-top: 1px solid var(--line); vertical-align: top; }
  .legal-table[data-pricing-table] thead th { padding: 8px 12px; border-top: 0; border-bottom: 1px solid var(--line-strong); }
  .legal-table[data-pricing-table] tbody th { color: var(--text); font-size: 14px; font-weight: 600; width: 40%; }
  .legal-table[data-pricing-table] tbody tr:first-child th, .legal-table[data-pricing-table] tbody tr:first-child td { border-top: 0; }
}
/* Running text on the plans page and the connect page keeps a measure of about 75 characters (46ch in this face). */
.pricing-page .legal-doc > section:not(.plan-closing) :is(p, li), .pricing-page .faq :is(p, li) { max-width: 38ch; } /* the cards and the closing box keep their own width */
.connect-page .main-rail .rail-body :is(p, li) { max-width: 46ch; }
.connect-page .main-rail .rail-body .alert p, .connect-page .main-rail .rail-body .url-box { max-width: none; }
