/* LinkWeightLens screen (ADR-014). The approved frames of docs/mockups/screen/ are the reference for the
   layout, the colours and the sizes. Selected elements are gold, never black (CLAUDE.md rule 23). Open
   Sans is served from the screen's own files (spec §3: nothing from another host). No page scrolls
   sideways at any width from 360 px up (spec §3, §10). */

@font-face { font-family: 'Open Sans'; src: url('fonts/OpenSans-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Open Sans'; src: url('fonts/OpenSans-SemiBold.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Open Sans'; src: url('fonts/OpenSans-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* A word is never broken inside; only an address may break (spec 1.8 §3, §17 item 44): `.page-path` and `.site`. */
body { margin: 0; background: #FFFFFF; color: #101215; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px; line-height: 1.45; overflow-wrap: normal; word-break: normal; hyphens: manual; }
h1, h2, h3, p { margin: 0; }
button, input { font-family: inherit; }
:focus-visible { outline: 3px solid #F2B01E; outline-offset: 2px; }

.muted { color: #50586B; }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.stack-2 { display: flex; flex-direction: column; gap: 2px; }
.stack-4 { display: flex; flex-direction: column; gap: 4px; }

/* Fields and buttons */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; font-weight: 600; color: #50586B; }
.field input { min-height: 44px; width: 100%; min-width: 0; padding: 0 12px; border-radius: 10px; border: 1px solid #C9C5B8; background: #FFFFFF; color: #101215; font-size: 14px; font-weight: 400; }
.toolbar .field input { width: 260px; max-width: 100%; }
.field-big { flex: 999 1 320px; }
.field-big input { min-height: 52px; padding: 0 16px; border-radius: 12px; font-size: 16px; }
.button-gold { min-height: 44px; padding: 0 18px; border-radius: 10px; border: 0; background: #FED366; color: #101215; font-size: 14px; font-weight: 700; cursor: pointer; }
.button-gold:hover { background: #F9C843; }
.button-gold:disabled { opacity: 0.6; cursor: default; }
.button-big { min-height: 52px; padding: 0 26px; border-radius: 12px; font-size: 16px; flex: 1 1 auto; }
.button-plain { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid #E4E1D8; background: #FFFFFF; color: #101215; font-size: 14px; font-weight: 600; cursor: pointer; }
.button-plain.square { width: 44px; padding: 0; }
.trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* The start screen (frame start-screen.html) */
.start { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; padding: 40px 24px 44px; }
.start-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 14px; border-radius: 18px; background: #F7F6F2; border: 1px solid #E4E1D8; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.chips-label { font-size: 14px; font-weight: 600; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid #C9C5B8; background: #FFFFFF; color: #101215; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip[aria-pressed='true'] { background: #FED366; border-color: #F2B01E; }
.cards { display: flex; flex-wrap: wrap; gap: 14px; }
.cards .start-card { flex: 1 1 220px; gap: 8px; padding: 18px; }
.start-card .card-heading { font-size: 15px; }
.card-icon { width: 28px; height: 28px; flex: none; fill: none; stroke: #B97F00; stroke-width: 2px; stroke-linecap: round; stroke-linejoin: round; }
.positioning { font-size: 14px; font-weight: 600; }
.privacy-line:empty { display: none; }

/* Banners (frame messages.html) */
.messages:empty { display: none; }
.banner { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 14px; }
.banner h2 { font-size: 16px; font-weight: 700; }
.banner p { font-size: 14px; }
.banner-warning { background: #FFF8E1; border: 1px solid #F2D58A; }
.banner-error { background: #FDEBE4; border: 1px solid #F1B9A4; }
.banner-info { background: #F7F6F2; border: 1px solid #E4E1D8; }

/* The report (frames report-*.html) */
.report { max-width: 1360px; margin: 0 auto; }
.report-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; background: #F7F6F2; border-bottom: 1px solid #E4E1D8; }
.report-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.partial-line { font-size: 13px; font-weight: 700; color: #8A4B00; }
.site { font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
/* The progress screen (frame progress-screen.html, spec 1.11 §3, ADR-014 f) */
.progress { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; padding: 40px 24px 44px; }
.progress-head { display: flex; flex-direction: column; gap: 4px; }
.progress-heading { font-size: 22px; font-weight: 700; }
.progress-heading:focus { outline: none; }
.progress-site { font-size: 14px; color: #50586B; overflow-wrap: anywhere; }
.progress-bar { display: block; height: 10px; border-radius: 5px; background: #EFEEE8; overflow: hidden; }
.progress-fill { display: block; height: 10px; border-radius: 5px; width: 0; background: #F2B01E; }
.progress-steps { margin: 0; padding: 0; list-style: none; }
.progress-step { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid #E4E1D8; }
.step-icon { width: 28px; height: 28px; flex: none; }
.step-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; color: #101215; }
.step-active .step-name { font-weight: 700; }
.step-waiting .step-name { color: #50586B; }
.step-note { font-size: 13px; color: #50586B; }
/* The progress frame's own sizes for the waiting list's field and button. */
.progress-partial .waiting-form .field { flex-basis: 240px; }
.progress-partial .button-gold { padding: 0 26px; border-radius: 12px; }

/* The downloads (spec 1.10 §12.1, frames report-overview.html and report-link-plan.html) */
.header-downloads, .button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.agent-card { flex: none; background: #FFF8E1; border-color: #F2D58A; }
.agent-lines { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
/* The map image's drawing, out of sight while its texts take their look from this sheet (ADR-015 c). */
.export-host { position: fixed; left: -10000px; top: 0; width: 800px; visibility: hidden; pointer-events: none; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 24px; border-bottom: 1px solid #E4E1D8; }
.tab { min-height: 48px; padding: 0 16px; border: 0; border-bottom: 4px solid transparent; background: transparent; color: #50586B; font-size: 15px; font-weight: 600; cursor: pointer; }
.tab[aria-pressed='true'] { color: #101215; font-weight: 700; border-bottom-color: #F2B01E; }
.tab-body { padding: 20px 24px 28px; }

/* Layout C: filters on the left, the content in the middle, the page details on the right */
.layout-c { display: flex; flex-wrap: wrap; gap: 20px; }
.filters { flex: 1 1 200px; max-width: 240px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.middle { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.right { flex: 1 1 250px; max-width: 290px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.eyebrow { font-size: 12px; font-weight: 700; color: #50586B; }
.eyebrow.green { color: #1E8A4C; }
.segmented { display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 12px; background: #EFEEE8; }
.toggle { min-height: 44px; padding: 0 20px; border-radius: 9px; border: 0; background: transparent; color: #50586B; font-size: 14px; font-weight: 600; cursor: pointer; }
.toggle[aria-pressed='true'] { background: #FED366; color: #101215; font-weight: 700; }
.filter-list { display: flex; flex-direction: column; gap: 4px; }
.filter-chip { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 12px; border-radius: 10px; border: 1px solid #E4E1D8; background: #FFFFFF; color: #101215; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.filter-chip .chip-text { flex: 1 1 auto; min-width: 0; }
.filter-chip .chip-count { color: #50586B; font-weight: 400; }
.filter-chip[aria-pressed='true'] { background: #FED366; border-color: #F2D58A; font-weight: 700; }
/* The map's topic and depth chips show what is drawn: on (white, as the frame) or off (faded). */
.map-filters .filter-chip[aria-pressed='true'] { background: #FFFFFF; border-color: #E4E1D8; font-weight: 600; }
.map-filters .filter-chip[aria-pressed='false'] { background: #F7F6F2; color: #50586B; opacity: 0.6; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: #F2B01E; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.zoom { margin-left: auto; display: flex; gap: 6px; }
.heading-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.section-heading { font-size: 16px; font-weight: 700; }

/* The map */
.map-box { border: 1px solid #E4E1D8; border-radius: 16px; background: #FFFFFF; overflow: hidden; }
.map { display: block; width: 100%; height: auto; font-family: 'Open Sans', Arial, sans-serif; }
.node { cursor: pointer; }
.node:focus { outline: none; }
.node:focus-visible .dot-main { stroke: #B97F00; stroke-width: 4px; }
.map-label { font-size: 13px; font-weight: 700; fill: #101215; paint-order: stroke; stroke: #FFFFFF; stroke-width: 4px; stroke-linejoin: round; }
.map-small { font-size: 11px; font-weight: 400; fill: #50586B; paint-order: stroke; stroke: #FFFFFF; stroke-width: 4px; stroke-linejoin: round; }
.map-small.strong { font-weight: 700; }
.map-legend { display: flex; flex-direction: column; gap: 10px; }
.legend-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #50586B; }
.legend-icon { height: 20px; flex: none; }
.legend-icon.w20 { width: 20px; }
.legend-icon.w34 { width: 34px; }
.legend-icon.w40 { width: 40px; }
.phone-note:empty { display: none; }
/* The phone's one-page map (frame report-map-phone.html) */
.phone-only-box:empty { display: none; }
.phone-lists { display: flex; flex-direction: column; gap: 8px; }
.phone-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.phone-value { font-size: 18px; font-weight: 700; }
.phone-list { margin: 0; padding: 0; list-style: none; }
.phone-list li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid #E4E1D8; font-size: 14px; }

/* The page details (frames Map and Pages, right column) */
.details { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 14px; background: #FFF8E1; border: 1px solid #F2D58A; }
.details:empty { display: none; }
.details .eyebrow { color: #8A4B00; }
.details .eyebrow.green { color: #1E8A4C; }
.details-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.details-name { font-size: 17px; font-weight: 700; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #E4E1D8; }
.detail-value { font-size: 14px; font-weight: 700; text-align: right; }
.details-list { display: flex; flex-direction: column; gap: 6px; }
.details-list ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }

/* Pages and pills */
.dot { width: 20px; height: 20px; flex: none; }
.page-cell { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.page-cell-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.page-name { font-weight: 600; }
.page-path { font-size: 12px; color: #50586B; overflow-wrap: anywhere; }
/* A page with no title is named by its address, which may break anywhere (spec 1.8 §17 item 44). */
.address { overflow-wrap: anywhere; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill-strong, .pill-low { background: #DDF2E4; color: #14603A; }
.pill-medium { background: #FFF1C2; color: #6B4A00; }
.pill-weak, .pill-high { background: #FDE3D6; color: #8A2E0B; }
mark { background: #FED366; color: #101215; padding: 0 3px; border-radius: 3px; }

/* Tables: a table on a desktop, a list of cards on a phone (ADR-014 c) */
.table-box { border: 1px solid #E4E1D8; border-radius: 16px; background: #FFFFFF; overflow: hidden; }
.cards-on-phone { width: 100%; border-collapse: collapse; }
.cards-on-phone th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 700; color: #50586B; border-bottom: 1px solid #C9C5B8; }
.cards-on-phone td { padding: 12px; font-size: 13px; vertical-align: top; border-bottom: 1px solid #E4E1D8; }
/* Columns of page names get room for a title of 6 words on at most 3 lines at 1280 px (spec 1.8 §17 item 44). */
/* Gate 7a, Gate 6c: the page columns hold a title of 6 words on at most 3 lines and "Reason" takes at most
   4 lines, with the agent card above the table at 1280 px and beside it from 1440 px (spec 1.11 §17
   item 64): narrower side padding, the priority column as narrow as its pill, a share for "Reason". */
.plan-table th, .plan-table td { padding-left: 8px; padding-right: 8px; }
.plan-table th:nth-child(1) { width: 1%; }
.plan-table th:nth-child(2), .plan-table th:nth-child(3) { width: 21%; }
.plan-table th:nth-child(5) { width: 22%; }
.plan-table th:nth-child(6) { width: 17%; }
/* Pages (spec 1.10 §17 item 58): the Page column takes the free width, the others are as narrow as their
   content allows, so a name of 6 words stands on at most 2 lines at 1280 px. */
.pages-table th:nth-child(n+2) { width: 1%; }
.pages-table th, .pages-table td { padding-left: 8px; padding-right: 8px; }
.issues-table th:nth-child(1) { width: 34%; }
.cell-label { display: none; }
tr.selectable { cursor: pointer; }
tr.selectable:hover td { background: #FFFBEB; }
tr[aria-current='true'] td { background: #FFF8E1; }
tr[aria-current='true'] td:first-child { box-shadow: inset 4px 0 0 #F2B01E; }
tr[aria-current='true'] .bar-fill { background: #B97F00; }
.authority-cell { display: grid; grid-template-columns: minmax(40px, 80px) 28px; align-items: center; gap: 8px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.flag-weak { background: #FDE3D6; color: #8A2E0B; }
.flag-unsupported { background: #E8EEF3; color: #30465B; }
.flag-poor-anchors { background: #EFE7FB; color: #4A2F8F; }
.flag-content-orphan { background: #FBDDE2; color: #8A0F25; }
.flag-diluted, .flag-deep { background: #EFEEE8; color: #50586B; }
.check-list { display: flex; flex-direction: column; }

/* Overview (frame report-overview.html) */
.overview { display: flex; flex-direction: column; gap: 16px; }
.card-row { display: flex; flex-wrap: wrap; gap: 16px; }
.card { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px solid #E4E1D8; border-radius: 16px; background: #FFFFFF; }
.card-heading { font-size: 16px; font-weight: 700; }
.soft-card { background: #F7F6F2; }
.score-card { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 20px; background: #FFF8E1; border-color: #F2D58A; }
.score-ring { width: 128px; height: 128px; flex: none; }
.score-number { font-size: 36px; font-weight: 700; fill: #101215; font-family: 'Open Sans', Arial, sans-serif; }
.number-card { flex: 1 1 150px; gap: 4px; }
.big-number { font-size: 28px; font-weight: 700; }
.waiting-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.waiting-form .field { flex: 1 1 220px; }
.joined { font-weight: 600; }
.strength-bar { display: flex; gap: 3px; border-radius: 9px; overflow: hidden; }
.strength-seg { display: block; height: 18px; }
.strength-strong { background: #14603A; }
.strength-medium { background: #6B4A00; }
.strength-weak { background: #8A2E0B; }
.legend-row { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 32px; align-items: center; gap: 10px; font-size: 13px; }
.bar-row-page { grid-template-columns: minmax(0, 1fr) 120px 32px; }
.bar { display: block; height: 8px; border-radius: 4px; background: #EFEEE8; }
.bar-fill { display: block; height: 8px; border-radius: 4px; background: #8A909C; }
.bar-fill.bar-gold { background: #F2B01E; }
.bar-number { font-weight: 700; text-align: right; }

/* A table with whole words needs about 700 px (Gate 6b, spec 1.8 §17 item 44). From 900 px up the
   content column never gets narrower than its table: the side columns wrap below it instead. Under
   900 px a table is a list of cards. */
@media (min-width: 900px) {
  .middle { min-width: min-content; }
}
/* The Link Plan's agent card stands beside the table from 1440 px up; under that, above it (spec 1.11 §17
   item 64: at 1280 px beside the table the "Reason" column was one word wide). */
@media (max-width: 1439px) {
  .agent-column { order: -1; flex-basis: 100%; max-width: none; }
}
@media (max-width: 899px) {
  .cards-on-phone, .cards-on-phone tbody, .cards-on-phone tr, .cards-on-phone td { display: block; width: 100%; }
  .cards-on-phone thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cards-on-phone tr { padding: 8px 0; border-bottom: 1px solid #E4E1D8; }
  .cards-on-phone td { border: 0; padding: 6px 14px; }
  .cell-label { display: block; font-size: 11px; font-weight: 700; color: #50586B; margin-bottom: 2px; }
  tr[aria-current='true'] td:first-child { box-shadow: none; }
  tr[aria-current='true'] { box-shadow: inset 4px 0 0 #F2B01E; }
}
/* Narrow screens: the side columns take the whole width */
@media (max-width: 719px) {
  .filters, .right { max-width: none; flex-basis: 100%; }
  .segmented { flex-direction: row; }
  .segmented .toggle { flex: 1 1 0; }
  /* Pages: the selected page's details come before the list, not after a hundred cards. */
  .details-first .filters { order: -2; }
  .details-first .right { order: -1; }
}
@media (max-width: 639px) {
  .desktop-only { display: none; }
  .start, .progress { padding: 24px 16px 32px; }
  .tab-body { padding: 16px; }
  .report-header, .tabs { padding-left: 16px; padding-right: 16px; }
  .tab { padding: 0 10px; }
}
@media (max-width: 480px) {
  .bar-row { grid-template-columns: 96px 1fr 32px; }
  .bar-row-page { grid-template-columns: minmax(0, 1fr) 56px 32px; }
}
@media (min-width: 640px) {
  .phone-note { display: none; }
}
