/* Direction D — "Selected". Tokens live on html.document-page so they beat styles.css :root. */
html.document-page {
  --ground: #FFFFFF; --ink: #0B0B0B; --ink-2: #5E5E5E; --line: #E6E6E6; --fill: #F2F2F2;
  --pistachio: #B8D98A; --pistachio-ink: #7FA650; --pistachio-tint: #EEF6E4; --pistachio-text: #5E8A2E;
  --on-ink: #FFFFFF; --danger-text: #B4232C; --display-shadow: #C6C6C6; --panel-shadow: #0B0B0B; --handle: #FFFFFF;
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 10.5l4 4 8-9' fill='none' stroke='%230B0B0B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --font: "Mona Sans", system-ui, sans-serif;
  height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior: auto;
  background: var(--ground); color-scheme: light dark;
}
/* Settings → Theme can pin light or dark; "System" follows the OS. */
html.document-page[data-theme="light"] { color-scheme: light; }
html.document-page[data-theme="dark"] { color-scheme: dark; }

@media (prefers-color-scheme: dark) {
  html.document-page:not([data-theme="light"]) {
    --ground: #121012; --ink: #F4F2F3; --ink-2: #A7A1A5; --line: rgba(255, 255, 255, .10); --fill: #241F23;
    --pistachio-ink: #9CC46B; --pistachio-tint: rgba(184, 217, 138, .12); --pistachio-text: #B8D98A;
    --on-ink: #121012; --danger-text: #FF8A8F; --display-shadow: transparent; --panel-shadow: #000; --handle: #121012;
  }
}
/* Same, when Settings → Theme is set to Dark. */
html.document-page[data-theme="dark"] {
    --ground: #121012; --ink: #F4F2F3; --ink-2: #A7A1A5; --line: rgba(255, 255, 255, .10); --fill: #241F23;
    --pistachio-ink: #9CC46B; --pistachio-tint: rgba(184, 217, 138, .12); --pistachio-text: #B8D98A;
    --on-ink: #121012; --danger-text: #FF8A8F; --display-shadow: transparent; --panel-shadow: #000; --handle: #121012;
  }
.connect-page {
  height: auto; min-height: 100dvh; margin: 0; overflow: visible; overscroll-behavior: auto;
  background: var(--ground); color: var(--ink);
  font: 400 15px/22px var(--font); font-variation-settings: 'wdth' 100; text-transform: none;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
.connect-page [hidden] { display: none !important; }
.connect-page a { color: var(--pistachio-text); font-weight: 500; text-decoration: underline 1px; text-underline-offset: 3px; }
.connect-page strong { font-weight: 700; }
.connect-page svg { flex-shrink: 0; }
.connect-page svg :is(path, rect) { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Header + wordmark (things {i} fw). */
.connect-header { box-sizing: border-box; max-width: 1040px; height: 96px; margin: auto; padding: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.connect-header > a.connect-brand { display: flex; color: var(--ink); text-decoration: none; }
.connect-header > span { color: var(--ink-2); overflow-wrap: anywhere; font-size: 13px; line-height: 18px; text-align: right; }
.connect-wordmark { display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 0; font: 700 24px/24px var(--font); font-variation-settings: 'wdth' 125; color: var(--ink); text-shadow: var(--display-shadow) 1px 1px 0; white-space: nowrap; }
.connect-wordmark-box { position: relative; display: flex; align-items: center; padding: 0 4px 3px; border: 2px solid var(--pistachio-ink); background: #B8D98A33; letter-spacing: .01em; }
.connect-wordmark-box > i { position: absolute; box-sizing: border-box; width: 8px; height: 8px; border: 2px solid var(--pistachio-ink); background: var(--handle); }
.connect-wordmark-box > i:nth-of-type(1) { left: -5px; top: -5px; }
.connect-wordmark-box > i:nth-of-type(2) { right: -5px; top: -5px; }
.connect-wordmark-box > i:nth-of-type(3) { left: -5px; bottom: -4px; }
.connect-wordmark-box > i:nth-of-type(4) { right: -5px; bottom: -4px; }

/* Hero: loud. Everything below: calm. */
.connect-main { box-sizing: border-box; max-width: 1040px; margin: 56px auto 0; padding: 0 0 96px; }
.connect-main > * { max-width: 760px; }
.connect-main h1 { max-width: 900px; margin: 0 0 28px; color: var(--ink); font: 900 64px/66px var(--font); font-variation-settings: 'wdth' 125; letter-spacing: -.02em; text-shadow: var(--display-shadow) .04em .04em 0; overflow-wrap: normal; }
.connect-page:has(#consent:not([hidden])) .connect-main { margin-top: 40px; }
.connect-page:has(#consent:not([hidden])) .connect-main h1 { margin-bottom: 20px; }
.connect-main h2 { margin: 0 0 8px; color: var(--ink); font: 800 22px/28px var(--font); font-variation-settings: 'wdth' 125; letter-spacing: -.02em; }
.connect-main p { margin: 0; }
.connect-lead { max-width: 560px; color: var(--ink-2); font-size: 17px; line-height: 26px; }
.connect-main .connect-small { color: var(--ink-2); font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
#setup-help { margin-top: 20px; font-size: 14px; line-height: 20px; }
.connect-main .connect-notice { margin-top: 12px; min-height: 20px; font-size: 14px; font-weight: 500; line-height: 20px; }
.connect-main .connect-notice:empty { min-height: 0; margin: 0; }
.connect-notice.error { color: var(--danger-text); }
.connect-main section { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }
#login, #consent { margin-top: 40px; padding-top: 32px; }
.connect-main > #login { max-width: 640px; }
#login h2 { margin-bottom: 20px; }
#consent h2 { margin-bottom: 12px; }
#consent > p:not(.connect-small) { max-width: 720px; line-height: 24px; }
#consent > p.connect-small { margin-top: 12px; line-height: 18px; }

/* Inputs + pills. */
.connect-inline { display: flex; align-items: center; gap: 8px; margin-top: 24px; }
.connect-form { margin-top: 28px; }
.connect-form label { display: block; font-size: 14px; font-weight: 500; line-height: 20px; }
.connect-form .connect-inline { margin-top: 8px; }
.connect-page input:not([type="checkbox"]):not([type="radio"]) { box-sizing: border-box; min-width: 0; width: 100%; height: 48px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--fill); color: var(--ink); font: 400 15px/20px var(--font); text-transform: none; }
.connect-page input[readonly] { font-weight: 500; }
.connect-page input::placeholder { color: var(--ink-2); opacity: 1; text-transform: none; }
.connect-page button, .connect-page .connect-pill {
  box-sizing: border-box; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; min-height: 0; padding: 0 24px; border: 1.5px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--on-ink); font: 600 14px/20px var(--font); text-decoration: none; text-transform: none; text-shadow: none; white-space: nowrap; cursor: pointer;
}
.connect-page button.secondary, .connect-page .connect-pill { background: transparent; color: var(--ink); }
.connect-page button:not(:disabled):hover { opacity: .88; }
.connect-page button.secondary:not(:disabled):hover, .connect-page .connect-pill:hover { background: var(--fill); opacity: 1; }
.connect-page button.connect-icon-button { padding: 0 22px 0 18px; }
.connect-page button.connect-google { padding: 0 24px 0 20px; gap: 10px; }
.connect-page .connect-google svg path { stroke: none; }
.connect-page .connect-google svg path:nth-child(1) { fill: #EA4335; }
.connect-page .connect-google svg path:nth-child(2) { fill: #4285F4; }
.connect-page .connect-google svg path:nth-child(3) { fill: #FBBC05; }
.connect-page .connect-google svg path:nth-child(4) { fill: #34A853; }
.connect-page button:disabled { opacity: .45; cursor: default; }
.connect-page :is(button, input, a, summary):focus-visible { outline: 2px solid var(--pistachio-ink); outline-offset: 3px; }

/* Choices: pistachio = checked/selected. */
.connect-page fieldset { display: flex; flex-direction: column; gap: 12px; min-width: 0; margin: 28px 0 0; padding: 0; border: 0; }
.connect-page legend { float: left; width: 100%; margin: 0; padding: 0; font-weight: 600; line-height: 22px; }
.connect-choice { display: flex; align-items: center; gap: 12px; color: var(--ink); line-height: 22px; cursor: pointer; }
.connect-choice:has(input:checked) { font-weight: 500; }
.connect-page input:is([type="checkbox"], [type="radio"]) { appearance: none; box-sizing: border-box; flex-shrink: 0; width: 20px; height: 20px; margin: 0; border: 1.5px solid var(--ink); border-radius: 5px; background: var(--ground); cursor: pointer; }
.connect-page input[type="radio"] { border-radius: 999px; }
.connect-page input[type="checkbox"]:checked { border-color: var(--pistachio); background: var(--pistachio) var(--check) center / 16px no-repeat; }
.connect-page input[type="radio"]:checked { border: 2px solid var(--pistachio-ink); background: var(--pistachio-ink); box-shadow: inset 0 0 0 3px var(--ground); }
.connect-page input:is([type="checkbox"], [type="radio"]):disabled { opacity: .45; cursor: default; }
.connect-sections { display: flex; flex-direction: column; gap: 14px; max-height: 280px; overflow: auto; margin-left: 32px; padding: 18px 20px; border-radius: 14px; background: var(--fill); color: var(--ink-2); }
#consent fieldset + .connect-small { margin-top: 20px; }
#consent .connect-actions { margin-top: 20px; gap: 8px; }

/* AI apps & visual search. */
.connect-guide-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.connect-guide-links a { box-sizing: border-box; display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border: 1.5px solid var(--ink); border-radius: 999px; color: var(--ink); font-weight: 600; font-size: 14px; line-height: 20px; text-decoration: none; }
.connect-guide-links a:hover { background: var(--fill); }
.connect-guide-links + .connect-small { margin-top: 16px; }
.connect-main blockquote { position: relative; margin: 24px 0 0; padding: 20px 24px 20px 28px; border-radius: 8px; overflow: hidden; background: var(--pistachio-tint); color: var(--ink); font-weight: 500; line-height: 24px; letter-spacing: -.005em; }
.connect-main blockquote::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--pistachio-ink); }
#settings section > .connect-choice { margin-top: 24px; font-weight: 500; }
#settings section > .connect-choice + .connect-small { max-width: 700px; margin-top: 12px; padding-left: 32px; }
.connect-index-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 28px; }
#index-status { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; line-height: 20px; }
.connect-index-row .connect-actions { margin: 0; gap: 8px; }
.connect-index-row button { height: 40px; padding: 0 18px; }
.connect-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
#connections { margin-top: 12px; }
#connections > p { padding: 16px 0; color: var(--ink-2); }
.connection-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.connection-row > div { min-width: 0; overflow-wrap: anywhere; }
.connection-row strong { display: block; font-weight: 600; line-height: 22px; }
.connection-row p.connect-small { margin-top: 2px; line-height: 18px; }
.connection-row button { height: 36px; padding: 0 16px; }
.connect-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 64px; }
.connect-footer a.connect-back { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; font-size: 14px; line-height: 20px; text-decoration: none; }
.connect-footer a.connect-back:hover { text-decoration: underline 1px; }
.connect-page .connect-footer button, .connect-page .connect-footer .connect-pill { height: 40px; padding: 0 18px 0 14px; }

/* Narrow screens: display type drops below 48px, so the grey offset shadow goes with it. */
@media (max-width: 1120px) { .connect-header, .connect-main { margin-inline: 40px; } }
@media (max-width: 760px) {
  .connect-main h1 { font-size: 40px; line-height: 44px; text-shadow: none; }
  .connect-index-row { flex-direction: column; align-items: stretch; gap: 16px; }
}
@media (max-width: 540px) {
  .connect-header { height: 72px; }
  .connect-header, .connect-main { margin-inline: 20px; }
  .connect-main { margin-top: 24px; padding-bottom: 64px; }
  .connect-main h1 { font-size: 34px; line-height: 38px; margin-bottom: 20px; }
  .connect-lead { font-size: 16px; line-height: 24px; }
  .connect-main section { margin-top: 40px; padding-top: 32px; }
  .connect-inline { flex-direction: column; align-items: stretch; }
  .connect-sections { margin-left: 0; }
  .connection-row { align-items: flex-start; flex-direction: column; gap: 12px; }
  .connect-footer { flex-wrap: wrap; margin-top: 48px; }
}
