/* FLY edition: reading, comparison and personal records share the same ruled surface. */
.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .7fr);
  align-items: end;
  gap: 64px;
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.page-head h1 {
  font: 600 64px/1.18 Bricolage, Manrope, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  letter-spacing: -.035em;
  margin: 0;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.page-head p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--muted);
  max-width: 44ch;
  margin: 0;
}
.page-head + .notice { margin-bottom: 32px; }

/* Guides form a continuous index, not isolated floating cards. */
.guide-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  padding: 0 0 28px;
  margin: 0;
}
.guide-tools input, .guide-tools select { width: 100%; max-width: none; }
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  padding-bottom: 80px;
}
.guide-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 36px 40px 32px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  transform: none;
  transition: background .2s, color .2s;
}
.guide-card:nth-child(even) { padding-left: 40px; padding-right: 0; border-left: 1px solid var(--line); }
.guide-card:hover { border-color: var(--line); background: #e2d9c7; box-shadow: none; transform: none; }
.guide-card h2 { font-size: 28px; line-height: 1.45; letter-spacing: -.025em; margin: 24px 0 12px; }
.guide-card p { font-size: 15px; color: var(--muted); line-height: 1.85; max-width: 52ch; margin-bottom: 24px; }
.guide-card > a { border: 0; padding: 12px 0 0; margin-top: auto; color: var(--blue); min-height: 44px; font-size: 14px; }
.guide-card > a .icon { flex-shrink: 0; }
.guide-card .badges { gap: 8px; }
.guide-grid > .empty { grid-column: 1 / -1; }

/* A broad masthead and a quiet, continuous reading column. */
.detail-hero {
  background: var(--ground);
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 48px 0 56px;
}
.detail-hero .shell { max-width: 1440px; }
.detail-hero .crumb { margin-bottom: 36px; color: var(--muted); font-size: 13px; gap: 12px; }
.detail-hero .badges { margin-bottom: 24px; }
.detail-hero h1 {
  font: 600 64px/1.12 Bricolage, Manrope, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  letter-spacing: -.035em;
  max-width: 23ch;
  overflow-wrap: anywhere;
  text-wrap: balance;
  margin: 0 0 24px;
}
.detail-hero p { max-width: 76ch; color: var(--muted); font-size: 16px; line-height: 1.9; margin: 12px 0 0; }
.detail-layout {
  max-width: 1440px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 64px;
  padding: 48px 0 80px;
  align-items: start;
}
.detail-content { min-width: 0; }
.detail-content > section { padding-top: 32px; margin: 40px 0 0; border-top: 1px solid var(--line); }
.detail-content > section:first-child { margin-top: 0; }
.detail-content h2 { font-size: 28px; line-height: 1.4; letter-spacing: -.02em; margin: 0 0 24px; }
.detail-content h3 { font-size: 20px; line-height: 1.5; }
.detail-content p, .detail-content li { font-size: 16px; line-height: 1.95; }
.detail-content .section-note { font-size: 13px; line-height: 1.85; color: var(--muted); }
.detail-content .panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
.detail-content .panel ul { padding-left: 22px; max-width: 78ch; }
.detail-content .panel li { padding-left: 4px; }
.detail-content details.panel { padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-content details.panel summary { min-height: 32px; font-size: 16px; }
.detail-content .notice { border: 0; border-radius: 0; padding: 20px 24px; box-shadow: none; font-size: 14px; line-height: 1.9; }
.detail-content .notice:not(.amber) { background: #ede9e2; color: #5a4e38; }
.detail-content .section-head { margin: 0; }
.apply-panel {
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding: 0 0 0 28px;
  box-shadow: none;
  background: transparent;
  align-self: start;
  position: sticky;
  top: 112px;
}
.apply-panel h2 { font-size: 22px; line-height: 1.4; letter-spacing: -.02em; margin: 0 0 20px; }
.apply-panel p { font-size: 14px; line-height: 1.9; color: var(--muted); margin: 0 0 24px; }
.apply-panel .button { width: 100%; justify-content: space-between; gap: 12px; padding-inline: 16px; min-height: 48px; margin: 12px 0 0; }
.apply-panel .mini { padding-top: 20px; margin: 24px 0 0; border-top: 1px solid var(--line); font-size: 12px; }
.fact-grid { border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; }
.fact-grid > div { padding: 24px 24px 24px 0; border-color: var(--line); }
.fact-grid > div:nth-child(even) { padding-left: 24px; }
.fact-grid > div:nth-child(odd) { border-right: 1px solid var(--line); }
.fact-grid > div:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
.fact-grid dt { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.fact-grid dd { font-size: 16px; line-height: 1.9; color: var(--ink); }
.step-list li { padding: 0 0 28px 54px; }
.step-list li:before { background: transparent; color: var(--blue); border: 1px solid var(--line); border-radius: 50%; width: 32px; height: 32px; }
.sources details { padding: 22px 0; margin: 0; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.sources details:first-child { border-top: 1px solid var(--line); }
.sources summary { font-size: 16px; line-height: 1.8; padding-right: 8px; }
.sources summary .badge { font-size: 12px; vertical-align: middle; }
.sources p { font-size: 14px; line-height: 1.9; max-width: 76ch; }
.sources a { font-size: 13px; line-height: 1.8; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.email-form { padding-top: 8px; gap: 24px; }
.email-form label { font-size: 14px; }
.email-output { background: #ede9e2; border-radius: 0; padding: 28px; border: 0; }
.email-output textarea { min-height: 360px; background: var(--ground); }

/* Related opportunities inherit the list vocabulary but fit the reading column. */
.detail-content .results-grid { display: block; border: 0; border-top: 1px solid var(--line); border-radius: 0; overflow: visible; background: transparent; }
.detail-content .op-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 24px 28px;
  padding: 28px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  transform: none;
}
.detail-content .op-card:hover { background: #e2d9c7; box-shadow: none; transform: none; }
.detail-content .op-identity { grid-column: 1; grid-row: 1; min-width: 0; padding: 0; }
.detail-content .op-card h3 { font-size: 24px; padding: 0; line-height: 1.35; margin: 0; }
.detail-content .op-card .location { font-size: 13px; line-height: 1.8; margin: 10px 0 16px; }
.detail-content .op-conditions { grid-column: 2; grid-row: 1; padding: 0; margin: 0; border: 0; min-width: 0; }
.detail-content .op-conditions > div { display: block; margin-bottom: 12px; }
.detail-content .op-conditions > div > span { display: block; font-size: 12px; line-height: 1.7; margin-bottom: 4px; }
.detail-content .op-conditions p { font-size: 14px; line-height: 1.85; }
.detail-content .op-conditions .checked { font-size: 12px; margin: 12px 0 0; }
.detail-content .op-actions { grid-column: 1 / -1; grid-row: 2; display: flex; flex-direction: row; align-items: center; gap: 20px; padding: 16px 0 0; margin: 0; border-top: 1px solid var(--line); }
.detail-content .op-actions .save { position: static; width: 44px; height: 44px; flex-shrink: 0; }
.detail-content .op-actions .detail-link { margin: 0 0 0 auto; min-height: 44px; }
.detail-content .op-actions .compare-toggle { min-height: 44px; font-size: 13px; }

/* Personal applications: two continuous working columns, with no floating containers. */
body[data-view=plan] .results-top { padding: 0 0 24px; margin: 0; border-bottom: 1px solid var(--line); }
.plan-list { display: block; padding: 0 0 80px; }
.plan-item { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 0; padding: 0; margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; }
.plan-item > div { padding: 36px 40px 36px 0; min-width: 0; }
.plan-item > div + div { padding-left: 40px; padding-right: 0; border-left: 1px solid var(--line); }
.plan-item h2 { font: 600 32px/1.3 Bricolage, Manrope, sans-serif; letter-spacing: -.025em; overflow-wrap: anywhere; }
.plan-item p { font-size: 14px; line-height: 1.85; }
.plan-item .plan-label { font-size: 14px; color: var(--ink); margin: 28px 0 12px; }
.plan-item > div + div .plan-label { margin-top: 0; }
.plan-item select { max-width: 340px; }
.plan-item textarea { min-height: 244px; width: 100%; background: #fff; }
.plan-item .section-note { font-size: 12px; color: var(--muted); }
.plan-actions { gap: 24px; flex-wrap: wrap; margin-top: 8px; }
.plan-actions a, .plan-actions button { font-size: 14px; min-height: 44px; }

/* Comparison remains a semantic table; the rules are its visual structure. */
.compare-wrap { border: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; margin: 0 0 80px; overflow-x: auto; }
.compare-table { width: 100%; min-width: 720px; table-layout: fixed; }
.compare-table th, .compare-table td { padding: 28px; border-color: var(--line); font-size: 15px; line-height: 1.85; }
.compare-table th { color: var(--ink); background: #ece8e2; font-weight: 600; }
.compare-table th:first-child { width: 160px; }
.compare-table thead th:not(:first-child) { font: 600 24px/1.35 Bricolage, Manrope, sans-serif; letter-spacing: -.02em; }
.compare-table tbody tr:nth-child(even) td { background: #f0ede8; }
.compare-table .button { font-family: var(--font); font-size: 13px; letter-spacing: 0; margin-top: 20px; }

/* Audit records use the same edge-to-edge ruled editorial flow. */
.audit-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0 0 32px; background: transparent; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.audit-stats > div { padding: 24px 32px; border-right: 1px solid var(--line); }
.audit-stats > div:first-child { padding-left: 0; }
.audit-stats > div:last-child { padding-right: 0; border-right: 0; }
.audit-stats b { color: var(--ink); font: 500 40px/1.35 Bricolage, Manrope, sans-serif; margin: 12px 0 4px; }
.audit-stats span { font-size: 13px; color: var(--muted); line-height: 1.7; }
body[data-view=audit] main > .shell > .notice { border-radius: 0; box-shadow: none; padding: 24px; margin-bottom: 40px; }
body[data-view=audit] main > .shell > .panel { padding: 0 0 36px; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
body[data-view=audit] .panel > h2 { font-size: 28px !important; line-height: 1.4; }
body[data-view=audit] .panel > p { font-size: 15px !important; line-height: 1.9; max-width: 86ch; }
.audit-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px 32px; padding: 32px 0; margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; }
.audit-row .badges { grid-column: 1; grid-row: 1 / 4; align-content: start; }
.audit-row h3 { grid-column: 2; font-size: 24px; line-height: 1.45; letter-spacing: -.02em; margin: 0 !important; }
.audit-row ul { grid-column: 2; margin: 0; padding-left: 20px; }
.audit-row li { font-size: 15px; line-height: 1.9; color: var(--muted); }
.audit-row > a { grid-column: 2; font-size: 14px; min-height: 44px; display: inline-flex; gap: 12px; align-items: center; justify-self: start; }

@media(max-width:1100px) {
  .page-head { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 56px; }
  .page-head h1 { font-size: 56px; }
  .page-head p { max-width: 68ch; }
  .detail-hero h1 { font-size: 56px; }
  .detail-layout { grid-template-columns: minmax(0, 1fr) 248px; gap: 32px; }
  .apply-panel { padding-left: 24px; }
  .apply-panel h2 { font-size: 20px; }
  .detail-content .op-card { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .detail-content .op-identity { grid-column: 1; grid-row: 1; }
  .detail-content .op-conditions { grid-column: 1; grid-row: 2; }
  .detail-content .op-actions { grid-column: 1; grid-row: 3; gap: 12px; flex-wrap: wrap; }
  .guide-card { padding-right: 28px; }
  .guide-card:nth-child(even) { padding-left: 28px; }
  .guide-card h2 { font-size: 24px; }
  .plan-item > div { padding-right: 28px; }
  .plan-item > div + div { padding-left: 28px; }
  .audit-row { grid-template-columns: 110px minmax(0, 1fr); gap: 12px 24px; }
}

@media(max-width:760px) {
  .page-head { display: block; padding: 36px 0 28px; margin-bottom: 24px; }
  .page-head h1 { font-size: 36px; line-height: 1.3; margin-bottom: 20px; }
  .page-head p { font-size: 14px; line-height: 1.85; max-width: none; }
  .guide-tools { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-bottom: 24px; }
  .guide-grid { grid-template-columns: minmax(0, 1fr); padding-bottom: 48px; }
  .guide-card, .guide-card:nth-child(even) { padding: 28px 0; border-left: 0; }
  .guide-card h2 { font-size: 24px; margin-top: 20px; }
  .guide-card p { font-size: 14px; margin-bottom: 16px; }
  .guide-card > a { font-size: 14px; }
  .detail-hero { padding: 28px 0 32px; }
  .detail-hero .crumb { margin-bottom: 24px; font-size: 12px; }
  .detail-hero .badges { margin-bottom: 20px; }
  .detail-hero h1 { font-size: 36px; line-height: 1.2; max-width: none; margin-bottom: 20px; }
  .detail-hero p { font-size: 14px; line-height: 1.9; }
  .detail-layout { display: flex; flex-direction: column; gap: 36px; padding: 28px 0 48px; }
  .detail-content { width: 100%; }
  .detail-content > section { margin-top: 32px; padding-top: 28px; }
  .detail-content h2 { font-size: 24px; margin-bottom: 20px; }
  .detail-content p, .detail-content li { font-size: 15px; line-height: 1.9; }
  .detail-content .notice { padding: 18px; font-size: 13px; }
  .apply-panel { position: static; order: 0; width: 100%; border-left: 0; border-top: 1px solid var(--line); padding: 28px 0 0; }
  .apply-panel h2 { font-size: 24px; }
  .apply-panel p { font-size: 14px; }
  .apply-panel .button { min-height: 48px; }
  .fact-grid > div, .fact-grid > div:nth-child(even) { padding: 20px 16px; }
  .fact-grid > div:nth-child(odd) { padding-left: 0; }
  .fact-grid > div:nth-child(even) { padding-right: 0; }
  .fact-grid dt { font-size: 12px; }
  .fact-grid dd { font-size: 14px; line-height: 1.85; }
  .sources summary { font-size: 15px; }
  .sources details { padding: 20px 0; }
  .sources summary .badge { margin-top: 6px; }
  .email-form { gap: 20px; }
  .email-output { padding: 18px; }
  .detail-content .op-card { padding: 24px 0; }
  .detail-content .op-card h3 { font-size: 24px; }
  .detail-content .op-actions .detail-link { font-size: 14px; }
  .detail-content .op-actions .compare-toggle { font-size: 12px; }
  .plan-list { padding-bottom: 48px; }
  .plan-item { display: block; padding: 0; }
  .plan-item > div { padding: 28px 0 24px; }
  .plan-item > div + div { padding: 0 0 32px; border-left: 0; }
  .plan-item h2 { font-size: 28px; }
  .plan-item textarea { min-height: 180px; }
  .plan-item select { max-width: none; }
  .plan-item .plan-label { font-size: 14px; margin-top: 24px; }
  .plan-actions { gap: 20px; }
  .compare-wrap { margin-bottom: 48px; }
  .compare-table { min-width: 680px; }
  .compare-table th, .compare-table td { padding: 20px; font-size: 14px; }
  .compare-table th:first-child { width: 120px; }
  .compare-table thead th:not(:first-child) { font-size: 20px; }
  .audit-stats { grid-template-columns: minmax(0, 1fr); }
  .audit-stats > div, .audit-stats > div:first-child, .audit-stats > div:last-child { display: grid; grid-template-columns: minmax(0, 1fr) auto 72px; align-items: center; gap: 12px; padding: 20px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .audit-stats > div:last-child { border-bottom: 0; }
  .audit-stats b { font-size: 32px; margin: 0; }
  .audit-stats span { font-size: 12px; }
  .audit-stats > div > span:last-child { max-width: none; }
  body[data-view=audit] main > .shell > .notice { padding: 18px; }
  body[data-view=audit] .panel > h2 { font-size: 24px !important; }
  body[data-view=audit] .panel > p { font-size: 14px !important; }
  .audit-row { display: block; padding: 28px 0; }
  .audit-row .badges { margin-bottom: 16px; }
  .audit-row h3 { font-size: 22px; margin-bottom: 16px !important; }
  .audit-row ul { margin-bottom: 16px; }
  .audit-row li { font-size: 14px; }
}

@media(max-width:380px) {
  .page-head h1, .detail-hero h1 { font-size: 32px; }
  .fact-grid { grid-template-columns: minmax(0, 1fr); }
  .fact-grid > div, .fact-grid > div:nth-child(even), .fact-grid > div:nth-child(odd) { padding: 20px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-content .op-actions { gap: 10px; }
  .detail-content .op-actions .detail-link { margin-left: auto; }
  .detail-content .op-actions .compare-toggle { flex-basis: 100%; }
  .audit-stats > div { grid-template-columns: minmax(0, 1fr) auto 64px; }
}

@media(prefers-reduced-motion:reduce) {
  .guide-card { transition: none; }
}

/* Keep eligibility and official actions close to the opportunity heading. */
@media(max-width:760px){.opportunity-detail .apply-panel{order:-1;border-top:0;border-bottom:1px solid var(--line);padding:0 0 28px}.opportunity-detail .apply-panel .mini{margin-top:18px;padding-top:18px}}
