/* V3 shell for local docs mini-site — light content + V3 chrome + sidebar */
:root {
  --v3-bg-white: #fff;
  --v3-bg-subtle: #f8fafc;
  --v3-text-primary: #0f172a;
  --v3-text-secondary: #64748b;
  --v3-text-muted: #94a3b8;
  --v3-accent-blue: #2563eb;
  --v3-accent-blue-bright: #0066ff;
  --v3-accent-blue-hover: #1d4ed8;
  --v3-evolve-green: #a2c523;
  --v3-border-light: #e2e8f0;
  --v3-footer-bg: #0d2f52;
  --v3-container: 1200px;
  --v3-sidebar-width: 280px;
  --link: var(--v3-accent-blue-bright);
}

html:has(body.coacheye-doc-site.v3-shell) {
  background: var(--v3-bg-white);
}

body.coacheye-doc-site.v3-shell {
  /* Remap legacy dark-theme tokens used by site.css / site-coacheye-doc.css */
  --bg: #fff;
  --fg: #0f172a;
  --muted: #64748b;
  --link: #0066ff;
  --border: #e2e8f0;

  margin: 0;
  background: var(--v3-bg-white) !important;
  background-image: none !important;
  color: var(--v3-text-primary);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  display: block !important;
  height: auto !important;
  min-height: 100vh;
}

body.v3-shell .styles_wrapper__hgmLd,
body.v3-shell #header.styles_container__oVzBv,
body.v3-shell footer.styles_container__lWOR5,
body.v3-shell .doc-subnav-wrap {
  display: none !important;
}

/* --- V3 header --- */
.v3-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px 32px;
  background: var(--v3-bg-white);
  border-bottom: 1px solid var(--v3-border-light);
}

.v3-header__brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.v3-header__logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.v3-header__titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.v3-header__name {
  margin: 0;
  color: var(--v3-text-primary);
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  font-weight: 700;
  line-height: 1.2;
}

.v3-header__tagline {
  margin: 0;
  color: var(--v3-text-secondary);
  font-size: clamp(0.8125rem, 1.1vw, 0.9375rem);
  font-weight: 400;
  line-height: 1.3;
}

.v3-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.v3-header__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 24px;
  border-radius: 9999px;
  background: var(--v3-evolve-green);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  gap: 8px;
  white-space: nowrap;
}

.v3-header__pill:hover {
  filter: brightness(0.96);
  color: #fff;
  text-decoration: none;
}

.v3-header__login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 1.5px solid var(--v3-accent-blue-bright);
  border-radius: 9999px;
  background: #fff;
  color: var(--v3-accent-blue-bright);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.v3-header__login:hover {
  background: #f0f7ff;
  color: var(--v3-accent-blue-hover);
  text-decoration: none;
}

/* --- Doc layout: sidebar + article --- */
.v3-doc-layout {
  display: grid;
  grid-template-columns: var(--v3-sidebar-width) minmax(0, 1fr);
  align-items: start;
  max-width: var(--v3-container);
  margin: 0 auto;
  min-height: 60vh;
}

/* --- Sidebar (V3 light) --- */
.v3-sidebar,
body.v3-shell .v3-sidebar,
body.v3-shell .v3-sidebar nav,
body.v3-shell .v3-sidebar__nav {
  background: #fff !important;
  background-color: #fff !important;
  background-image: none !important;
  border-bottom: none !important;
}

body.v3-shell .v3-sidebar__nav {
  padding: 0 !important;
}

.v3-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow: auto;
  padding: 28px 20px 48px 28px;
  border-right: 1px solid var(--v3-border-light);
}

.v3-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--v3-border-light);
}

.v3-sidebar__label {
  margin: 0;
  color: var(--v3-text-primary);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.v3-sidebar__mobile-toggle {
  display: none;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--v3-border-light);
  border-radius: 8px;
  background: var(--v3-bg-white);
  color: var(--v3-text-primary);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
}

.v3-sidebar__tree,
.v3-sidebar__sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.v3-sidebar__tree > li + li {
  margin-top: 2px;
}

.v3-sidebar__group {
  border: 0;
}

.v3-sidebar__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--v3-text-primary);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
  user-select: none;
}

.v3-sidebar__summary::-webkit-details-marker {
  display: none;
}

.v3-sidebar__summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--v3-text-secondary);
  border-bottom: 2px solid var(--v3-text-secondary);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-left: 8px;
}

.v3-sidebar__group[open] > .v3-sidebar__summary::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.v3-sidebar__summary:hover {
  background: var(--v3-bg-subtle);
}

.v3-sidebar__sub {
  padding: 2px 0 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.v3-sidebar__link {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--v3-text-primary) !important;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none !important;
}

.v3-sidebar__sub .v3-sidebar__link {
  font-weight: 400;
}

.v3-sidebar__link:hover {
  background: var(--v3-bg-subtle);
  color: var(--v3-text-primary) !important;
}

.v3-sidebar__link--nested {
  padding-left: 18px;
  border-left: 2px solid var(--v3-border-light);
  margin-left: 8px;
  color: var(--v3-text-primary) !important;
  font-weight: 400;
}

.v3-sidebar__link.is-active,
.v3-sidebar__link[aria-current="page"] {
  background: #f0f7ff;
  color: var(--v3-accent-blue-bright) !important;
  font-weight: 700;
}

.v3-sidebar__sub .v3-sidebar__link.is-active,
.v3-sidebar__sub .v3-sidebar__link[aria-current="page"] {
  font-weight: 400;
}

.v3-sidebar__divider {
  height: 1px;
  margin: 14px 4px;
  background: var(--v3-border-light);
}

/* Article / main — light readable body */
body.v3-shell .v3-doc-layout > main.coacheye-article,
body.v3-shell .v3-doc-layout > main {
  background: var(--v3-bg-white) !important;
  background-image: none !important;
  color: var(--v3-text-primary) !important;
  max-width: none;
  margin: 0;
  padding: clamp(32px, 4vw, 56px) clamp(24px, 3vw, 40px) 64px !important;
}

body.v3-shell main.coacheye-article h1,
body.v3-shell main.coacheye-article h2,
body.v3-shell main.coacheye-article h3,
body.v3-shell main.coacheye-article h4,
body.v3-shell main h1,
body.v3-shell main h2,
body.v3-shell main h3,
body.v3-shell main h4 {
  color: var(--v3-text-primary) !important;
}

body.v3-shell main.coacheye-article p,
body.v3-shell main.coacheye-article li,
body.v3-shell main.coacheye-article ul,
body.v3-shell main.coacheye-article ol,
body.v3-shell main p,
body.v3-shell main li {
  color: var(--v3-text-primary) !important;
}

/* Bold emphasis: same ink as body, only weight changes */
body.v3-shell main.coacheye-article strong,
body.v3-shell main.coacheye-article b,
body.v3-shell main.coacheye-article p strong,
body.v3-shell main strong,
body.v3-shell main b {
  color: var(--v3-text-primary) !important;
  font-weight: 700;
}

body.v3-shell main.coacheye-article em,
body.v3-shell main em {
  color: var(--v3-text-primary) !important;
}

body.v3-shell main a {
  color: var(--v3-accent-blue-bright) !important;
}

body.v3-shell main a:hover {
  color: var(--v3-accent-blue-hover) !important;
}

body.v3-shell main.coacheye-article strong a,
body.v3-shell main strong a {
  color: var(--v3-accent-blue-bright) !important;
}

body.v3-shell main code,
body.v3-shell main.coacheye-article code {
  background: var(--v3-bg-subtle) !important;
  color: var(--v3-text-primary) !important;
  border: 1px solid var(--v3-border-light);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

body.v3-shell main hr,
body.v3-shell main.coacheye-article hr {
  border: none;
  border-top: 1px solid var(--v3-border-light) !important;
}

body.v3-shell main th,
body.v3-shell main td {
  border-color: var(--v3-border-light) !important;
  color: var(--v3-text-primary) !important;
}

body.v3-shell main th {
  background: var(--v3-bg-subtle) !important;
  color: var(--v3-text-primary) !important;
}

body.v3-shell .pending-i18n {
  background: #fff7ed !important;
  border: 1px solid #fdba74 !important;
  color: #9a3412 !important;
}

/* Screenshots: 50% size, no black/dark frame */
body.v3-shell figure.doc-figure img,
body.v3-shell figure.doc-figure img.doc-figure__thumb,
body.v3-shell main.coacheye-article figure.doc-figure img,
body.v3-shell .doc-table-image {
  width: 50% !important;
  max-width: 50% !important;
  height: auto !important;
  border: 0 !important;
  border-radius: 8px;
  box-shadow: none !important;
  outline: none;
}

body.v3-shell figure.doc-figure img:hover,
body.v3-shell main.coacheye-article figure.doc-figure img:hover {
  box-shadow: none !important;
  transform: none;
}

body.v3-shell figure.doc-figure {
  text-align: center;
}

body.v3-shell figure.doc-figure figcaption,
body.v3-shell main.coacheye-article figure.doc-figure figcaption {
  text-align: center;
}

/* --- V3 footer --- */
.v3-footer {
  background: var(--v3-footer-bg);
  color: #fff;
  padding: clamp(40px, 5vw, 56px) 32px;
}

.v3-footer__inner {
  max-width: var(--v3-container);
  margin: 0 auto;
}

.v3-footer__columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.v3-footer__title {
  margin: 0 0 16px;
  font-size: 0.9375rem;
  font-weight: 700;
}

.v3-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.v3-footer__links a {
  color: rgb(255 255 255 / 85%);
  text-decoration: none;
  font-size: 0.875rem;
}

.v3-footer__links a:hover {
  color: #fff;
  text-decoration: underline;
}

.v3-footer__note {
  margin: 32px 0 0;
  color: rgb(255 255 255 / 55%);
  font-size: 0.75rem;
}

@media (max-width: 960px) {
  .v3-doc-layout {
    grid-template-columns: 1fr;
  }

  .v3-sidebar {
    position: relative;
    max-height: none;
    overflow: visible;
    padding: 16px 24px;
    border-right: 0;
    border-bottom: 1px solid var(--v3-border-light);
  }

  .v3-sidebar__mobile-toggle {
    display: inline-flex;
  }

  .v3-sidebar__nav {
    display: none;
  }

  .v3-sidebar.is-open .v3-sidebar__nav {
    display: block;
    margin-top: 12px;
  }

  .v3-footer__columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.v3-shell figure.doc-figure img,
  body.v3-shell figure.doc-figure img.doc-figure__thumb,
  body.v3-shell main.coacheye-article figure.doc-figure img,
  body.v3-shell .doc-table-image {
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 768px) {
  .v3-header {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 24px;
  }

  .v3-header__actions {
    justify-content: stretch;
  }

  .v3-header__pill,
  .v3-header__login {
    flex: 1;
  }
}

@media (max-width: 560px) {
  .v3-footer__columns {
    grid-template-columns: 1fr;
  }
}
