/* =====================================================
    PAGE HEADER
===================================================== */
.page-header {
  padding-block: var(--sp-xl) var(--sp-lg);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .page-header {
  background: linear-gradient(150deg, var(--teal-pale) 0%, var(--bg) 60%);
}
[data-theme="dark"] .page-header {
  background: linear-gradient(150deg, var(--teal-dim) 0%, var(--bg) 60%);
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='1.5' fill='%232A8B84' fill-opacity='.1'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: .7;
}

.page-header-inner { position: relative; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: var(--sp-md);
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-soft); text-decoration: none; transition: color .15s; }
.breadcrumb a:hover { color: var(--teal); }
.breadcrumb-sep { color: var(--border-strong); font-size: .75em; user-select: none; }
.breadcrumb [aria-current="page"] { color: var(--teal-dark); }
[data-theme="dark"] .breadcrumb [aria-current="page"] { color: var(--teal); }

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: .3rem .85rem;
  border-radius: var(--r-pill);
  width: fit-content;
  margin-bottom: var(--sp-sm);
}
[data-theme="dark"] .page-kicker { color: var(--accent-dark); }

.page-title {
  font-family: var(--f-display);
  font-size: var(--t-2xl);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--text-primary);
  max-width: 20ch;
}

.page-title em { font-style: italic; color: var(--teal); }
[data-theme="dark"] .page-title em { color: var(--teal); }

.page-subtitle {
  margin-top: var(--sp-sm);
  font-size: var(--t-md);
  color: var(--text-soft);
  max-width: 52ch;
  line-height: 1.65;
}

/* =====================================================
    PAGE LAYOUT — sidebar + main
===================================================== */
.page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-xl);
  padding-block: var(--sp-xl);
  align-items: start;
}

@media (min-width: 900px) {
  .page-layout {
    grid-template-columns: 210px 1fr;
    gap: clamp(2rem, 5vw, 4rem);
  }
}

/* =====================================================
    SIDEBAR TOC
===================================================== */
.toc { position: sticky; top: calc(64px + var(--sp-md)); }

.toc-heading {
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.toc-list {
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--border);
}

.toc-list a {
  display: block;
  font-size: var(--t-sm);
  font-weight: 400;
  color: var(--text-soft);
  text-decoration: none;
  padding: .35rem 0 .35rem 1rem;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: color .15s, border-color .15s;
  line-height: 1.45;
}

.toc-list a:hover { color: var(--teal); border-left-color: var(--teal-mid); }

@media (max-width: 899px) { .toc { display: none; } }

/* =====================================================
    MAIN CONTENT COLUMN
===================================================== */
.install-content { max-width: 72ch; }

.install-section {
  padding-bottom: var(--sp-xl);
  margin-bottom: var(--sp-xl);
  border-bottom: 1px solid var(--border);
}

.install-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section-label {
  display: block;
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin-bottom: .55rem;
}
[data-theme="dark"] .section-label { color: var(--teal); }

.section-heading {
  font-family: var(--f-display);
  font-size: var(--t-xl);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -.02em;
  color: var(--text-primary);
  margin-bottom: var(--sp-md);
  scroll-margin-top: calc(64px + 2rem);
}

.sub-heading {
  font-family: var(--f-body);
  font-size: var(--t-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-top: var(--sp-md);
  margin-bottom: var(--sp-sm);
}

.install-content p {
  font-size: var(--t-base);
  line-height: 1.82;
  color: var(--text-secondary);
  margin-bottom: var(--sp-sm);
}

.install-content p:last-child { margin-bottom: 0; }

/* Inline links within prose */
.install-content a:not(.btn) {
  color: var(--link-teal);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .15s;
}
.install-content a:not(.btn):hover { color: var(--teal); text-decoration: none; }

/* Dot list */
.dot-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-block: var(--sp-sm);
}

.dot-list li {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  font-size: var(--t-base);
  line-height: 1.65;
  color: var(--text-secondary);
}

.dot-list li::before {
  content: '';
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  margin-top: .58em;
}

/* =====================================================
    PRIMARY DOWNLOAD CARD
===================================================== */
.download-card {
  background: var(--teal-dim);
  border: 1px solid var(--teal-border);
  border-radius: var(--r-xl);
  padding: var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
}

.download-card-top {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-md);
  flex-wrap: wrap;
}

.download-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-lg);
  background: var(--icon-teal-bg);
  border: 1px solid var(--teal-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--icon-teal-fg);
}

.download-card-text { flex: 1; min-width: 180px; }

.download-card-title {
  font-family: var(--f-display);
  font-size: var(--t-lg);
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: .3rem;
}

.download-card-desc {
  font-size: var(--t-sm);
  color: var(--text-soft);
  line-height: 1.6;
}

/* =====================================================
    OS TABS
===================================================== */
.os-tabs-wrap { margin-top: var(--sp-md); }

/* Mobile OS selector */
.os-tab-select {
  display: none;
  width: 100%;
  font-family: var(--f-body);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: .65rem 1rem;
  margin-bottom: var(--sp-sm);
  cursor: pointer;
  appearance: auto;
}

.os-tab-select:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
}

/* Desktop tab bar */
.os-tab-list {
  display: flex;
  gap: .35rem;
  flex-wrap: nowrap;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
}

.os-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--f-body);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text-soft);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: .5rem .85rem;
  cursor: pointer;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}

.os-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-raised);
}

.os-tab-btn[aria-selected="true"] {
  color: var(--teal-dark);
  border-bottom-color: var(--teal);
  background: var(--bg);
}
[data-theme="dark"] .os-tab-btn[aria-selected="true"] { color: var(--teal); }

@media (max-width: 560px) {
  .os-tab-list { display: none; }
  .os-tab-select { display: block; }
}

.os-tab-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  padding: var(--sp-md);
}

@media (max-width: 560px) {
  .os-tab-panel {
    border-top: 1px solid var(--border);
    border-radius: var(--r-lg);
  }
}

.os-tab-panel.is-active { display: block; }

.os-tab-panel p {
  font-size: var(--t-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--sp-sm);
}

.os-tab-panel p:last-child { margin-bottom: 0; }

/* Inline links inside tab panels */
.os-tab-panel a {
  color: var(--link-teal);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .15s;
}
.os-tab-panel a:hover { color: var(--teal); text-decoration: none; }

/* Step list inside tab panel */
.step-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-block: var(--sp-sm);
  counter-reset: steps;
}

.step-list li {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  font-size: var(--t-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  counter-increment: steps;
}

.step-list li::before {
  content: counter(steps);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: var(--icon-teal-bg);
  border: 1px solid var(--teal-border);
  color: var(--icon-teal-fg);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  margin-top: .15em;
}

/* =====================================================
    CODE BLOCK
===================================================== */
.code-wrap {
  margin-block: var(--sp-sm);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.code-bar {
  /* Always dark — code bars are a terminal aesthetic regardless of theme */
  background: #1A1714;
  padding: .4rem .85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.code-label {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  color: rgba(255,255,255,.5);
  letter-spacing: .03em;
}

.code-copy {
  font-family: var(--f-body);
  font-size: var(--t-xs);
  font-weight: 500;
  color: rgba(255,255,255,.5);
  background: none;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--r-sm);
  padding: .2rem .6rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.code-copy:hover {
  color: rgba(255,255,255,.9);
  border-color: rgba(255,255,255,.4);
}

.code-copy.copied {
  color: var(--teal-mid);
  border-color: var(--teal-mid);
}

pre {
  background: #2A2522;
  padding: var(--sp-md);
  overflow-x: auto;
  margin: 0;
}

pre code {
  font-family: var(--f-mono);
  font-size: var(--t-sm);
  color: #e8d5c0;
  line-height: 1.7;
  /* override inline code styles when inside a pre block */
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
}

/* Inline code */
p code, li code {
  font-family: var(--f-mono);
  font-size: .9em;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: .1em .4em;
  border-radius: var(--r-sm);
  border: 1px solid var(--teal-border);
}

/* =====================================================
    REQUIREMENTS TABLE
===================================================== */
.req-table-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-block: var(--sp-sm);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}

.req-table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  font-size: var(--t-sm);
}

.req-table thead { background: var(--bg-raised); }

.req-table th {
  text-align: left;
  font-weight: 600;
  font-size: var(--t-xs);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.req-table td {
  padding: .75rem 1rem;
  color: var(--text-secondary);
  vertical-align: top;
  line-height: 1.55;
  border-bottom: 1px solid var(--border);
}

.req-table td:last-child { max-width: 28ch; }
.req-table tbody tr:last-child td { border-bottom: none; }
.req-table tbody tr:hover td { background: var(--accent-dim); }

/* Card layout for very small screens */
@media (max-width: 560px) {
  .req-table,
  .req-table thead,
  .req-table tbody,
  .req-table tr,
  .req-table th,
  .req-table td { display: block; }

  .req-table { min-width: 0; border: none; }
  .req-table-wrap { border-radius: var(--r-lg); overflow: hidden; }
  .req-table thead { display: none; }

  .req-table tbody tr {
    border: none;
    border-bottom: 1px solid var(--border);
    padding: var(--sp-sm) var(--sp-md);
    background: var(--bg);
  }

  .req-table tbody tr:last-child { border-bottom: none; }
  .req-table tbody tr:hover td { background: transparent; }

  .req-table td {
    border: none;
    padding: .2rem 0;
    max-width: 100%;
    display: flex;
    gap: .5rem;
    align-items: baseline;
  }

  .req-table td[data-label]::before {
    content: attr(data-label);
    font-size: var(--t-xs);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
    min-width: 7rem;
    flex-shrink: 0;
  }
}

.req-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: var(--t-xs);
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: var(--r-pill);
}

.badge-req { background: var(--icon-teal-bg); color: var(--icon-teal-fg); border: 1px solid var(--teal-border); }
.badge-opt { background: var(--icon-stone-bg); color: var(--icon-stone-fg); border: 1px solid var(--border); }

/* =====================================================
    OS PLATFORM BADGES
===================================================== */
.platform-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-block: var(--sp-sm);
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: .4rem .85rem;
  border-radius: var(--r-pill);
}

.platform-badge svg { color: var(--teal); }

/* =====================================================
    CALLOUT PANELS
===================================================== */
.callout {
  border-radius: var(--r-lg);
  padding: var(--sp-md);
  margin-block: var(--sp-md);
  display: flex;
  gap: var(--sp-sm);
  align-items: flex-start;
}

.callout-warning {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
}

.callout-info {
  background: var(--teal-dim);
  border: 1px solid var(--teal-border);
}

.callout-neutral {
  background: var(--bg-raised);
  border: 1px solid var(--border);
}

.callout-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ci-warning { background: var(--icon-orange-bg); color: var(--icon-orange-fg); border: 1px solid var(--accent-border); }
.ci-info    { background: var(--icon-teal-bg);   color: var(--icon-teal-fg);   border: 1px solid var(--teal-border); }
.ci-neutral { background: var(--icon-stone-bg);  color: var(--icon-stone-fg);  border: 1px solid var(--border); }

.callout-body { flex: 1; }

.callout-title {
  font-weight: 600;
  font-size: var(--t-base);
  color: var(--text-primary);
  margin-bottom: .35rem;
  line-height: 1.3;
}

.callout-body p {
  font-size: var(--t-sm) !important;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: .4rem;
}

.callout-body p:last-child { margin-bottom: 0 !important; }

/* Inline links inside callouts */
.callout-body a {
  color: var(--link-teal);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .15s;
}
.callout-body a:hover { color: var(--teal); text-decoration: none; }

/* =====================================================
    HELP SECTION
===================================================== */
.help-panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-lg);
}

.help-links {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: var(--sp-md);
}
