:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: #152235;
  background: #f7f9fc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #152235;
  --muted: #526174;
  --blue: #3569e8;
  --line: #e0e7ef;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px 32px;
}
.site-header { border-bottom: 1px solid var(--line); }
.wordmark {
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.07em;
  text-decoration: none;
}
.wordmark span { color: var(--blue); }
.header-link {
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}
.hero {
  max-width: 1160px;
  margin: 0 auto;
  padding: 112px 32px 104px;
}
.eyebrow {
  margin: 0 0 18px;
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3.2rem, 8vw, 6.8rem);
  letter-spacing: -0.075em;
  line-height: 0.98;
}
h1 span { color: var(--blue); }
.hero-copy {
  max-width: 620px;
  margin: 28px 0 30px;
  color: var(--muted);
  font-size: 1.16rem;
  line-height: 1.7;
}
.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 0 23px;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-size: 0.96rem;
  font-weight: 700;
  text-decoration: none;
}
.button:hover { background: #2457d1; }
.button-secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.button-secondary:hover { background: #eef2f8; }
.quiet-note {
  max-width: 560px;
  margin: 16px 0 0;
  color: #647286;
  font-size: 0.85rem;
  line-height: 1.6;
}
.section,
.status-panel,
.app-shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 52px 32px 88px;
}
.app-shell[hidden] { display: none; }
.app-shell {
  max-width: 920px;
  padding-top: 28px;
  padding-bottom: 54px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.account-label,
.finder-note,
.feature-copy { color: var(--muted); line-height: 1.65; }
.account-label { margin: 0; overflow-wrap: anywhere; }
.search-form { display: grid; gap: 12px; margin-top: 26px; }
.search-actions { display: grid; gap: 22px; margin-top: 8px; }
.content-search-action { display: grid; justify-items: start; gap: 10px; }
.consent-note {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}
.button:disabled { cursor: not-allowed; opacity: 0.55; }
.search-form label { font-size: 0.9rem; font-weight: 700; }
.search-form input:not([type="checkbox"]),
.search-form textarea,
.search-form select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #b9c6d5;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.search-form input:focus,
.search-form textarea:focus,
.search-form select:focus,
.button:focus-visible,
a:focus-visible { outline: 3px solid #91b4ff; outline-offset: 2px; }
.search-options { display: grid; grid-template-columns: 1fr 180px; gap: 16px; }
.search-options > div { display: grid; gap: 8px; }
.app-status { min-height: 1.5em; margin: 18px 0 0; color: var(--muted); }
.app-status[data-kind="error"] { color: #a32626; }
/* Any feedback line set by setStatus(..., "error") must stand out, wherever it sits;
   "ok" (all is well) is green so success is just as easy to notice (6G-DEC-025). */
[role="status"][data-kind="error"] { color: #a32626; font-weight: 600; }
[role="status"][data-kind="ok"], .app-status[data-kind="ok"] { color: #1d7a3e; font-weight: 600; }
.search-results { display: grid; gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.result-card { padding: 18px; border: 1px solid var(--line); border-radius: 10px; }
.result-name { margin: 0 0 8px; font-size: 1.05rem; overflow-wrap: anywhere; }
.result-details { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.65; overflow-wrap: anywhere; }
.result-match { margin: 8px 0 0; color: #294f9d; font-size: 0.88rem; }
.feature-copy { max-width: 780px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.feature-card {
  min-height: 230px;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.feature-number { color: var(--blue); font-size: 0.78rem; font-weight: 750; }
h2 { margin: 16px 0 10px; font-size: 1.3rem; letter-spacing: -0.035em; }
.feature-card p,
.status-panel > p:last-child { color: var(--muted); line-height: 1.7; }
.status-panel {
  max-width: 1096px;
  margin-bottom: 82px;
  padding: 34px 38px;
  border: 1px solid #d7e2f5;
  border-radius: 14px;
  background: #edf3ff;
}
.status-panel h2 { margin-top: 0; font-size: 1.6rem; }
.status-panel > p:last-child { max-width: 850px; margin-bottom: 0; }
.site-footer {
  gap: 20px;
  border-top: 1px solid var(--line);
  color: #647286;
  font-size: 0.82rem;
}
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--muted); }
.legal-draft { max-width: 820px; margin: 0 auto; padding: 44px 28px 88px; background: #fff; }
.draft-banner {
  margin: 34px 0 18px;
  padding: 13px 16px;
  border: 1px solid #f2c987;
  border-radius: 8px;
  background: #fff6e8;
  color: #754500;
  font-size: 0.9rem;
  font-weight: 750;
}
.legal-title {
  font-size: clamp(2.5rem, 8vw, 4rem);
  letter-spacing: -0.065em;
  line-height: 1.05;
}
.legal-draft p,
.legal-draft li { color: var(--muted); line-height: 1.75; }
.legal-draft h2 { margin-top: 34px; }
.legal-draft code { padding: 2px 5px; border-radius: 4px; background: #eef2f7; }

@media (max-width: 720px) {
  .hero { padding-top: 80px; }
  .feature-grid { grid-template-columns: 1fr; }
  .search-options { grid-template-columns: 1fr; }
  .account-bar { align-items: flex-start; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

#wda-pairing { max-width: 760px; }
#wda-pairing .search-form label:has(input[type="checkbox"]) { display: flex; gap: 10px; align-items: start; font-weight: 400; }
#wda-pairing textarea { resize: vertical; overflow-wrap: anywhere; }

/* Keep consent panels and sign-in controls hidden when the application hides them. */
[hidden] { display: none !important; }

.workspace-nav { display:flex; flex-wrap:wrap; gap:1rem; margin-bottom:1rem; }
#active-workspace { max-width:100%; }
#home-usage dt { font-weight:700; margin-top:1rem; }
#home-usage dd { margin-left:0; overflow-wrap:anywhere; }

/* Compact native connection approval; controls stay readable on small screens. */
#sca-connect-dialog { max-width: 32rem; width: calc(100% - 2rem); max-height: 90vh; overflow: auto; border-radius: 1rem; padding: 1.5rem; border: 1px solid #64748b; }
#sca-connect-dialog::backdrop { background: rgb(0 0 0 / 45%); }
#sca-connect-form { display: grid; gap: 1rem; }
#sca-connect-form select { width: 100%; padding: .75rem; }

/* Signed-in work stays focused; account context and navigation remain available. */
#workspace-controls { max-width: 920px; margin: 20px auto; padding: 0 20px; }
#workspace-controls label { display: block; margin: 12px 0 6px; color: var(--muted); font-size: .875rem; }
#workspace-controls select { min-height: 44px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; }
#workspace-controls .workspace-nav { gap: 8px; margin: 0; }
#workspace-controls .workspace-nav a { padding: 10px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; }
#workspace-controls .workspace-nav a[aria-current="page"] { background: #eaf0ff; color: #2457d1; font-weight: 700; }
#finder details { padding: 12px 0; color: var(--muted); }
#finder summary { cursor: pointer; font-size: .9rem; }
#finder details[open] > summary { margin-bottom: 12px; }
#query { font-size: 1.05rem; min-height: 52px; }
#workspace-controls select:focus-visible, summary:focus-visible { outline: 3px solid #91b4ff; outline-offset: 2px; }

/* Email + code sign-in */
#email-signin { max-width: 420px; margin-top: 22px; }
#email-signin form { display: grid; gap: 12px; }
#email-signin form > button { justify-self: start; }
.quiet-note[data-kind="error"] { color: #a32626; }
#signin-link { margin-top: 16px; }

/* Search results (plan153): cards, sort, type chips and pages. */
.result-tools { display: grid; gap: 12px; margin: 18px 0 0; }
.result-toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.result-toolbar label, .result-toolbar .toolbar-label { color: var(--muted); font-size: .875rem; }
.result-toolbar select { min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; }
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font: inherit; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: #2457d1; background: #eaf0ff; color: #2457d1; font-weight: 700; }
.chip:focus-visible, .pager-button:focus-visible { outline: 3px solid #91b4ff; outline-offset: 2px; }
.result-card { display: flex; gap: 14px; align-items: flex-start; }
.result-body { min-width: 0; flex: 1; }
.type-badge { flex: none; min-width: 48px; padding: 8px 4px; border-radius: 8px; background: #eef2f7; color: #475569; font-size: .72rem; font-weight: 750; text-align: center; letter-spacing: .02em; }
.type-badge[data-group="doc"] { background: #e6efff; color: #1f4fb4; }
.type-badge[data-group="sheet"] { background: #e4f5ea; color: #1d6b39; }
.type-badge[data-group="slides"] { background: #fff0e0; color: #9a4b00; }
.type-badge[data-group="image"] { background: #f3e8ff; color: #6b2fa3; }
.result-name mark { background: #fff1a8; color: inherit; border-radius: 3px; }
.result-path { margin: 0 0 6px; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pager { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin: 14px 0; }
.pager-summary { margin: 0; color: var(--muted); font-size: .9rem; }
.pager-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pager-button { min-width: 40px; min-height: 40px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; cursor: pointer; }
.pager-button[aria-current="page"] { border-color: #2457d1; background: #eaf0ff; color: #2457d1; font-weight: 700; }
.pager-button:disabled { opacity: .55; cursor: default; }
.pager-gap { padding: 0 4px; color: var(--muted); }
/* One tidy line per folder: name on the left, button on the right; the question sits below. */
.folder-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; padding: 6px 0; }
.folder-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.folder-button { flex: none; white-space: nowrap; }
.folder-confirm { flex: 1 0 100%; margin: 0; color: var(--muted); font-size: .9rem; }
@media (max-width: 720px) {
  .result-card { flex-direction: column; gap: 8px; }
  .pager { justify-content: flex-start; }
}
