@layer pages {
/* Network planner (/plan). */
.pl { padding-bottom: var(--section-y-tight); }
.pl-intro .page-meta a { color: var(--primary); text-decoration: underline; }
.pl-layout { display: grid; gap: var(--space-8); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) { .pl-layout { grid-template-columns: 380px minmax(0, 1fr); } }

/* Form */
.pl-form { display: grid; gap: var(--space-5); }
.pl-form > * + * { margin-top: 0; }
.pl-form-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.pl-modes { display: flex; gap: var(--space-1); }
.pl-q { display: grid; gap: var(--space-2); }
.pl-q legend { float: left; width: 100%; font-size: var(--fs-small); font-weight: var(--fw-bold); }
.pl-opt { font-weight: var(--fw-regular); color: var(--text-muted); }
.pl-why { font-size: var(--fs-meta); color: var(--text-muted); }
.pl-options { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pl-form .chip { position: relative; cursor: pointer; }
.pl-form .chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pl-form .chip:has(input:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.pl-advanced { display: grid; gap: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.pl-weight { display: grid; grid-template-columns: minmax(0, 1fr) 120px 20px; align-items: center; gap: var(--space-3); font-size: var(--fs-small); }
.pl-weight input { accent-color: var(--primary); width: 100%; }
.pl-weight output { font-variant-numeric: tabular-nums; font-weight: var(--fw-bold); text-align: right; }
.pl-select { display: grid; gap: var(--space-2); margin-top: var(--space-3); font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.pl-select select { width: 100%; font-weight: var(--fw-regular); }
.pl-unknown { font-size: var(--fs-meta) !important; }
.pl-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); padding-top: var(--space-2); }

/* Results */
.pl-results { display: grid; gap: var(--space-6); min-width: 0; }
.pl-results:focus { outline: none; }
.pl-results-head > * + * { margin-top: var(--head-gap); }
.pl-jump { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4) !important; }
.pl-first > * + * { margin-top: var(--space-2); }
.pl-consult a { color: var(--primary); text-decoration: underline; }

.pl-plan { display: grid; gap: var(--space-5); container-type: inline-size; }
.pl-plan > * + * { margin-top: 0; }
.pl-plan.is-featured { border-color: color-mix(in oklab, var(--primary) 30%, var(--border)); }
/* Title block left, price right; on a narrow card the price drops below the title, left-aligned. */
.pl-plan-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2) var(--space-6); align-items: start; }
.pl-plan-head > div > * + * { margin-top: var(--space-2); }
.pl-cats { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.pl-cats-more { font-size: var(--fs-meta); color: var(--text-muted); }
.pl-plan-title { font-size: var(--fs-h3); line-height: var(--lh-h3); }
.pl-price { display: grid; justify-items: end; text-align: right; padding-top: var(--space-1); }
@container (max-width: 520px) {
  .pl-plan-head { grid-template-columns: minmax(0, 1fr); }
  .pl-price { justify-items: start; text-align: left; padding-top: 0; }
}
.pl-price-num { font-size: var(--fs-h2); line-height: 1; font-weight: var(--fw-heavy); font-variant-numeric: tabular-nums; }
.pl-price-label { font-size: var(--fs-meta); color: var(--text-muted); }

/* Flow diagram: a row of nodes joined by connectors on wide cards, a column on narrow ones. */
.pl-diagram { padding: var(--space-4); border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); }
.pl-flow { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-5); list-style: none; margin: 0; padding: 0; }
.pl-node {
  position: relative; display: grid; gap: var(--space-1); padding: var(--space-2) var(--space-3); min-width: 0;
  border-radius: var(--radius-md); border: 1.5px solid var(--border-strong); background: var(--card); text-align: center;
}
.pl-node strong { font-size: var(--fs-small); line-height: var(--lh-small); }
.pl-node span { font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--text-muted); }
.pl-node.is-primary { border-color: var(--primary); box-shadow: var(--shadow-1); }
.pl-node.is-group { background: var(--tint); }
/* Connector into each node after the first: vertical by default. */
.pl-node + .pl-node::before { content: ""; position: absolute; left: 50%; top: calc(-1 * var(--space-5) - 1px); height: var(--space-5); border-left: 2px solid var(--primary); }
.pl-node.is-wireless::before { border-left-style: dashed !important; border-color: var(--violet) !important; }
@container (min-width: 560px) {
  .pl-flow { flex-direction: row; align-items: center; gap: var(--space-6); }
  .pl-node { flex: 1 1 0; }
  .pl-node + .pl-node::before { left: calc(-1 * var(--space-6) - 1px); top: 50%; width: var(--space-6); height: 0; border-left: 0; border-top: 2px solid var(--primary); }
  .pl-node.is-wireless::before { border-top-style: dashed; border-color: var(--violet); }
}

.pl-plan-grid { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .pl-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pl-block > * + * { margin-top: var(--space-2); }
.pl-block h4 { font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--text-muted); }
.pl-block p { font-size: var(--fs-small); color: var(--text-muted); }
.pl-list { display: grid; gap: var(--space-1); padding-left: 1.1em !important; list-style: disc !important; font-size: var(--fs-small); }
.pl-list.is-muted { color: var(--text-muted); }
.pl-steps { list-style: decimal !important; }
.pl-steps a { color: var(--primary); text-decoration: underline; }
.pl-parts td a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.pl-cost-note { margin-top: var(--space-2); font-size: var(--fs-meta); color: var(--text-muted); }
.pl-role { display: block; font-size: var(--fs-meta); color: var(--text-muted); }
.pl-parts tfoot th, .pl-parts tfoot td { font-weight: var(--fw-bold); border-top: 1px solid var(--border-strong); background: var(--surface); }
.pl-plan-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.pl-more-list { display: grid; gap: var(--space-4); }
.pl-excluded > ul { margin-top: var(--space-2); }

.pl-comparebar {
  position: sticky; bottom: var(--space-4); z-index: 5; justify-self: center;
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  border-radius: var(--radius-pill); background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-3); font-size: var(--fs-small);
}
.pl-comparebar[hidden] { display: none; }
.pl-compare { width: min(calc(100vw - 2 * var(--space-3)), 1000px); }
.pl-compare-body > * + * { margin-top: var(--space-4); }
/* Equal plan columns whatever the title length; long names wrap instead of widening one column. */
.pl-compare-table { table-layout: fixed; min-width: 560px; }
.pl-compare-table th[scope="row"] { width: 24%; color: var(--text-muted); }
.pl-compare-table thead th { white-space: normal; overflow-wrap: anywhere; vertical-align: bottom; }
.pl-compare-table td { overflow-wrap: anywhere; }
.pl-compare-note { max-width: 80ch; }
}
