@media screen {
  body[data-page="home"] { background: var(--rm-paper); }
  .rm-home { width: 100%; max-width: none; margin: 0; padding: 0; }
  .rm-home h1, .rm-home h2, .rm-home h3, .rm-home p { margin-top: 0; }
  .rm-home-hero { min-height: calc(100svh - 88px); display: grid; grid-template-columns: .95fr 1.05fr; gap: clamp(32px, 5vw, 80px); align-items: center; padding-block: 64px 80px; }
  .rm-home-copy h1 { font-size: clamp(46px, 4.65vw, 68px); line-height: 1.06; letter-spacing: -.04em; font-weight: 600; max-width: 10.6em; margin-bottom: 28px; }
  .rm-home-copy > p { font-size: 19px; line-height: 1.65; max-width: 39ch; color: var(--rm-muted); margin-bottom: 28px; }
  .rm-home-copy .rm-local-note { font-size: 14px; margin-top: 24px; margin-bottom: 0; max-width: 45ch; }
  .rm-home-action { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 13px 24px; border-radius: 8px; background: var(--rm-accent); color: white; font-size: 16px; font-weight: 600; border: 1px solid var(--rm-accent); text-decoration: none; transition: background .18s, transform .18s; }
  .rm-home-action:hover { background: var(--rm-accent-hover); transform: translateY(-2px); }
  .rm-home-action:active { transform: translateY(0); }
  .rm-plan-preview { background: var(--rm-accent); padding: 24px; border-radius: 20px; box-shadow: 0 22px 48px -24px #174b5a55; animation: rm-preview-enter .65s ease-out both; }
  .rm-preview-sheet { overflow: hidden; background: white; border-radius: 10px; }
  .rm-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; border-bottom: 1px solid var(--rm-line); }
  .rm-preview-heading strong { font-size: 17px; font-weight: 600; }
  .rm-preview-heading span { color: var(--rm-muted); font-size: 13px; }
  .rm-preview-drawing { position: relative; background: #f1f5f5; padding: 32px 56px 24px 60px; }
  .rm-plan-width { display: block; width: 100%; text-align: center; color: #4b646c; font-size: 13px; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
  .rm-plan-height { position: absolute; left: 14px; top: 52%; writing-mode: vertical-rl; transform: rotate(180deg); color: #4b646c; font-size: 13px; font-variant-numeric: tabular-nums; }
  .rm-tile-plan { aspect-ratio: 2400 / 3100; max-height: 280px; margin-inline: auto; display: grid; grid-template-columns: repeat(3, 1fr) .99fr; grid-template-rows: repeat(5, 1fr) .15fr; gap: 3px; padding: 3px; background: #c2d2d5; border: 2px solid #78949b; width: min(100%, 217px); }
  .rm-tile-plan i { background: #fff; min-width: 0; min-height: 0; }
  .rm-tile-plan i:nth-child(4n), .rm-tile-plan i:nth-last-child(-n+4) { background: #8cbcb7; }
  .rm-preview-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; padding-top: 16px; color: var(--rm-muted); font-size: 12px; }
  .rm-preview-legend span { display: inline-flex; align-items: center; gap: 7px; }
  .rm-preview-legend i { width: 10px; height: 10px; background: white; border: 1px solid #8da7ad; }
  .rm-preview-legend span:last-child i { background: #8cbcb7; }
  .rm-preview-order { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 20px 24px; margin: 0; }
  .rm-preview-order > div { padding-right: 8px; }
  .rm-preview-order dt { font-size: 12px; color: var(--rm-muted); line-height: 1.4; margin-bottom: 8px; }
  .rm-preview-order dd { font-size: 28px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; margin: 0; color: var(--rm-ink); }
  .rm-preview-assumptions { padding: 0 24px 16px; margin: 0; color: var(--rm-muted); font-size: 12px; line-height: 1.5; }
  .rm-preview-link { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 24px; border-top: 1px solid var(--rm-line); color: var(--rm-accent); font-size: 14px; font-weight: 600; text-decoration: none; min-height: 48px; }
  .rm-preview-link:hover { background: var(--rm-tint); }
  .rm-directory { background: white; border-top: 1px solid var(--rm-line); border-bottom: 1px solid var(--rm-line); padding-block: 72px 80px; }
  .rm-directory-heading { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 32px; }
  .rm-directory h2 { font-size: clamp(30px, 3.25vw, 46px); line-height: 1.15; letter-spacing: -.025em; font-weight: 600; margin-bottom: 12px; }
  .rm-directory-heading p { color: var(--rm-muted); margin-bottom: 0; max-width: 53ch; }
  .rm-directory-filters { display: flex; gap: 12px; flex: 0 1 440px; }
  .rm-directory-filters label { display: flex; flex-direction: column; gap: 7px; font-size: 14px; color: var(--rm-muted); flex: 1; min-width: 0; }
  .rm-directory-filters input, .rm-directory-filters select { width: 100%; min-height: 46px; border: 1px solid #a3b6bd; border-radius: 7px; padding: 10px 12px; background: white; color: var(--rm-ink); font-size: 16px; }
  .rm-directory-filters select { padding-right: 24px; }
  .rm-tool-entry { display: grid; grid-template-columns: 144px minmax(0, 1fr) auto; gap: 36px; align-items: center; border-top: 1px solid var(--rm-line); padding-block: 28px; }
  .rm-tool-entry:last-of-type { border-bottom: 1px solid var(--rm-line); }
  .rm-tool-entry h3 { font-size: 27px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 12px; }
  .rm-tool-entry h3 a { color: var(--rm-ink); text-decoration: none; }
  .rm-tool-entry h3 a:hover { color: var(--rm-accent); }
  .rm-tool-entry p { color: var(--rm-muted); margin-bottom: 0; max-width: 61ch; }
  .rm-tool-link { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #a5bcc2; min-height: 48px; padding: 10px 19px; border-radius: 8px; color: var(--rm-accent); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; transition: background .18s, border-color .18s; }
  .rm-tool-link:hover { background: var(--rm-tint); border-color: var(--rm-accent); }
  .rm-material { height: 112px; border-radius: 10px; overflow: hidden; padding: 20px; background: #e9f0ef; display: grid; gap: 4px; }
  .rm-material i { border: 1px solid #92adae; background: #fafcfc; }
  .rm-material-tile { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
  .rm-material-tile i:nth-child(3n) { background: #b2d1cb; }
  .rm-material-deck { grid-template-columns: repeat(5, 1fr); background: #f1eee7; transform: none; }
  .rm-material-deck i { background: #d9c5a8; border-color: #baa584; }
  .rm-material-block { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); background: #edf0f3; gap: 5px; }
  .rm-material-block i { background: #b6c3cd; border-color: #95a6b2; }
  .rm-workflow { padding-block: 80px; display: grid; grid-template-columns: .85fr 1.15fr; gap: 80px; }
  .rm-workflow h2 { font-size: clamp(30px, 3.3vw, 46px); font-weight: 600; line-height: 1.15; letter-spacing: -.025em; margin-bottom: 22px; }
  .rm-workflow-intro > p { color: var(--rm-muted); max-width: 44ch; }
  .rm-workflow ol { margin: 0; padding: 0; list-style: none; counter-reset: workflow; }
  .rm-workflow li { position: relative; padding: 0 0 24px 52px; counter-increment: workflow; }
  .rm-workflow li + li { padding-top: 24px; border-top: 1px solid var(--rm-line); }
  .rm-workflow li::before { content: counter(workflow); position: absolute; left: 0; font-size: 17px; color: var(--rm-accent); border: 1px solid #a5bcc2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; }
  .rm-workflow h3 { font-size: 21px; margin-bottom: 10px; font-weight: 600; }
  .rm-workflow li p { margin-bottom: 0; color: var(--rm-muted); max-width: 55ch; }
  .rm-empty-directory { padding: 32px; text-align: center; background: var(--rm-paper); border-radius: 8px; }
  body[data-page="home"] .rm-footer { margin-top: 0; }
  @keyframes rm-preview-enter { from { opacity: .85; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  @media (max-width: 1100px) {
    .rm-home-hero { gap: 32px; }
    .rm-plan-preview { padding: 16px; }
    .rm-directory-heading { display: block; }
    .rm-directory-filters { max-width: 600px; margin-top: 24px; }
    .rm-tool-entry { grid-template-columns: 112px minmax(0, 1fr) auto; gap: 24px; }
  }
  @media (max-width: 760px) {
    .rm-home-hero { grid-template-columns: 1fr; min-height: auto; padding-block: 40px 48px; gap: 40px; }
    .rm-home-copy h1 { max-width: 14ch; font-size: clamp(40px, 7vw, 58px); }
    .rm-home-copy > p { font-size: 17px; max-width: 44ch; }
    .rm-home-copy .rm-local-note { font-size: 14px; }
    .rm-plan-preview { width: 100%; max-width: 560px; margin-inline: auto; }
    .rm-tile-plan { max-height: 290px; }
    .rm-directory { padding-block: 44px; }
    .rm-tool-entry { grid-template-columns: 90px minmax(0, 1fr); gap: 20px; padding-block: 24px; }
    .rm-tool-entry h3 { font-size: 23px; }
    .rm-tool-entry .rm-tool-link { grid-column: 2; justify-self: start; }
    .rm-tool-entry .rm-material { grid-row: 1 / span 2; height: 100px; padding: 14px; }
    .rm-workflow { grid-template-columns: 1fr; gap: 32px; padding-block: 48px; }
  }
  @media (max-width: 420px) {
    .rm-home-copy h1 { font-size: 40px; }
    .rm-home-action { width: 100%; }
    .rm-preview-heading { padding: 16px; }
    .rm-preview-heading span { max-width: 70px; text-align: right; }
    .rm-preview-drawing { padding-inline: 42px 32px; }
    .rm-preview-order { padding: 18px 16px; gap: 10px; }
    .rm-preview-order dt { min-height: 34px; }
    .rm-directory-filters { flex-direction: column; }
    .rm-tool-entry { grid-template-columns: 72px minmax(0, 1fr); gap: 16px; }
    .rm-tool-entry .rm-material { height: 92px; padding: 12px; gap: 3px; }
    .rm-tool-entry h3 { font-size: 22px; }
    .rm-tool-entry p { font-size: 15px; }
    .rm-tool-entry .rm-tool-link { justify-self: stretch; white-space: normal; text-align: center; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .rm-plan-preview { animation: none; }
  .rm-home-action, .rm-tool-link { transition: none; }
}
