/* R4: calmer proportions, consistent reading rhythm and useful action rows.
   This stylesheet changes layout only; the approved Forest & Sand materials stay. */
@media screen {
  html[data-companion-layout="r4"] .app-screen {padding-top:30px}
  html[data-companion-layout="r4"] .app-screen-heading {max-width:740px;margin-bottom:24px}
  html[data-companion-layout="r4"] .app-screen-heading .eyebrow {margin-bottom:8px}
  html[data-companion-layout="r4"] .app-screen-heading.compact h1 {font-size:clamp(28px,2.6vw,38px);line-height:1.16;letter-spacing:-.035em;margin-bottom:10px}
  html[data-companion-layout="r4"] .app-screen-heading>p:last-child {max-width:62ch;font-size:16px;line-height:1.6;margin-bottom:0;text-wrap:pretty}
  html[data-companion-layout="r4"] .app-topbar {height:auto;min-height:80px;padding-block:14px}
  html[data-companion-layout="r4"] .app-brand img {width:42px;height:42px}
  html[data-companion-layout="r4"] .app-brand b {font-size:18px}
  html[data-companion-layout="r4"] .app-task-title {font-size:25px;line-height:1.22;letter-spacing:-.025em;margin-bottom:6px;text-wrap:pretty}
  html[data-companion-layout="r4"] .tracker-task-panel>.app-muted {font-size:14px;line-height:1.6;margin-bottom:12px}
  html[data-companion-layout="r4"] .app-notice {padding:16px 18px;font-size:14px;line-height:1.65;max-width:78ch}
  html[data-companion-layout="r4"] .tracker-week-grid {gap:16px;margin-top:18px;align-items:stretch}
  html[data-companion-layout="r4"] .tracker-action-card {
    display:flex;flex-direction:column;gap:0;padding:22px;border-radius:17px;
    border-width:1px;min-width:0;box-shadow:inset 0 1px #fffdf5,inset 0 -1px #b39b7738,0 2px 0 #d6c5a64d,0 8px 18px #0b2b2529;
  }
  html[data-companion-layout="r4"] .tracker-action-card.is-complete {padding-left:22px;box-shadow:inset 3px 0 #5c7b49,var(--studio-card-shadow,var(--app-shadow))}
  html[data-companion-layout="r4"] .tracker-action-head {display:flex;margin-bottom:8px}
  html[data-companion-layout="r4"] .tracker-task-kind {font-size:11px;line-height:1.4;letter-spacing:.08em}
  html[data-companion-layout="r4"] .tracker-action-card h3 {font-size:19px;font-weight:650;line-height:1.3;letter-spacing:-.02em;margin:0 0 10px;max-width:44ch;text-wrap:pretty}
  html[data-companion-layout="r4"] .tracker-action-card p {font-size:15px;line-height:1.62;max-width:66ch;margin:0 0 16px;text-wrap:pretty}
  .spatial-task-actions {display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:auto;padding-top:12px;border-top:1px solid #a7ae904d}
  html[data-companion-layout="r4"] .tracker-task-toggle {min-height:44px;min-width:98px;padding:10px 14px;font-size:12px;line-height:1.35;border-radius:10px;flex-shrink:0;align-self:center}
  html[data-companion-layout="r4"] .tracker-guide-link {font-size:13px;line-height:1.4;min-height:44px;padding:8px 0;max-width:100%;width:auto}
  html[data-companion-layout="r4"] .app-stage-finish {padding:24px 0 8px}
  html[data-companion-layout="r4"] .app-stage-finish>[role=status] {font-size:14px;font-weight:600;line-height:1.6;max-width:65ch;margin-bottom:12px}
  html[data-companion-layout="r4"] .app-button-row {gap:10px;margin:12px 0}
  html[data-companion-layout="r4"] .btn {padding:11px 16px;min-height:46px;font-size:14px;line-height:1.5}
  html[data-companion-layout="r4"] .app-intro {gap:28px;align-items:center;margin-bottom:24px}
  html[data-companion-layout="r4"] .app-intro h1 {font-size:clamp(32px,3.3vw,46px);line-height:1.13;margin-bottom:14px}
  html[data-companion-layout="r4"] .app-landscape {height:200px}
  html[data-companion-layout="r4"] .app-today-grid {grid-template-columns:minmax(0,1.65fr) minmax(280px,1fr);gap:18px}
  html[data-companion-layout="r4"] .app-focus-card {padding:26px 28px;border-radius:20px}
  html[data-companion-layout="r4"] .app-focus-label {margin-bottom:16px;font-size:11px;letter-spacing:.1em}
  html[data-companion-layout="r4"] .app-focus-card .eyebrow {margin-bottom:8px}
  html[data-companion-layout="r4"] .app-focus-card h2 {font-size:30px;line-height:1.18;margin-bottom:12px;max-width:24ch;text-wrap:pretty}
  html[data-companion-layout="r4"] .app-focus-card>p:not(.eyebrow) {line-height:1.6;font-size:15px;max-width:58ch;margin-bottom:14px}
  html[data-companion-layout="r4"] .app-focus-card .btn {margin-top:2px}
  html[data-companion-layout="r4"] .app-step-track {margin-top:22px;max-width:none}
  html[data-companion-layout="r4"] .app-focus-foot {margin-top:8px;font-size:12px}
  html[data-companion-layout="r4"] .app-progress-card {padding:24px;border-radius:20px}
  html[data-companion-layout="r4"] .app-progress-ring {width:120px;height:120px}
  html[data-companion-layout="r4"] .app-progress-card>.eyebrow {margin:0 0 14px}
  html[data-companion-layout="r4"] .app-progress-card>p:not(.eyebrow) {margin-bottom:4px}
  html[data-companion-layout="r4"] .app-quick-links {gap:16px;margin-top:18px}
  html[data-companion-layout="r4"] .app-quick-links a {padding:18px 20px;gap:14px;border-radius:16px}
  html[data-companion-layout="r4"] .app-quick-links b {font-size:15px;line-height:1.4}
  html[data-companion-layout="r4"] .app-quick-links small {font-size:13px;line-height:1.5;margin-top:4px}
  html[data-companion-layout="r4"] .app-welcome-note {gap:18px;margin-top:4px}
  html[data-companion-layout="r4"] .app-overview {padding:24px;gap:24px;grid-template-columns:minmax(0,1fr) minmax(0,1.55fr);border-radius:20px;margin-bottom:24px}
  html[data-companion-layout="r4"] .app-overview p {font-size:26px;line-height:1.2}
  html[data-companion-layout="r4"] .app-overview .eyebrow {font-size:11px;line-height:1.5}
  html[data-companion-layout="r4"] .app-overview dl {gap:10px}
  html[data-companion-layout="r4"] .app-overview dl>div {display:grid;grid-template-rows:auto 1fr;align-content:start;padding:12px}
  html[data-companion-layout="r4"] .app-overview dd {font-size:34px;line-height:1.2;margin:0 0 8px}
  html[data-companion-layout="r4"] .app-overview dd small {font-size:11px}
  html[data-companion-layout="r4"] .app-overview dt {grid-row:2;font-size:12px;line-height:1.45}
  html[data-companion-layout="r4"] .app-overview dd {grid-row:1}
  html[data-companion-layout="r4"] .app-path-legend {font-size:14px;line-height:1.6;margin:0 0 16px}
  html[data-companion-layout="r4"] .app-path-row {gap:16px;padding:20px;margin-bottom:16px;border-radius:18px;grid-template-columns:40px minmax(0,1fr) minmax(330px,1.15fr)}
  html[data-companion-layout="r4"] .app-path-number {width:40px;height:40px;border-radius:12px}
  html[data-companion-layout="r4"] .app-path-row h2 {font-size:17px;line-height:1.35;text-wrap:pretty;margin-bottom:6px}
  html[data-companion-layout="r4"] .app-path-row p {font-size:13px;line-height:1.5}
  html[data-companion-layout="r4"] .app-path-meter {margin-top:10px}
  html[data-companion-layout="r4"] .app-path-stages {padding:4px;gap:6px;border-radius:13px}
  html[data-companion-layout="r4"] .app-path-stages button {min-height:104px;padding:10px;gap:5px;border-radius:9px}
  html[data-companion-layout="r4"] .app-path-stages button b {font-size:13px;line-height:1.35;text-wrap:pretty}
  html[data-companion-layout="r4"] .app-path-stages button small {font-size:12px}
  html[data-companion-layout="r4"] .app-settings-card {padding:24px;border-radius:18px}
  html[data-companion-layout="r4"] .app-settings-card h2 {font-size:24px;line-height:1.2;margin-bottom:10px;text-wrap:pretty}
  html[data-companion-layout="r4"] .app-settings-card>p:not(.eyebrow) {font-size:15px;line-height:1.6;max-width:65ch;margin-bottom:12px}
  html[data-companion-layout="r4"] .app-settings-grid {gap:18px;align-items:stretch}
  html[data-companion-layout="r4"] .app-settings-card.tracker-install-card {padding:26px;gap:24px}
  html[data-companion-layout="r4"] .app-notebook {padding:26px;max-width:900px;border-radius:18px}
  html[data-companion-layout="r4"] .app-notebook>label {font-size:12px;margin-bottom:10px}
  html[data-companion-layout="r4"] .app-notebook textarea {min-height:300px;resize:vertical}
  html[data-companion-layout="r4"] .app-reset-card {padding:20px 24px}
  html[data-companion-layout="r4"] .app-reset-card h2 {font-size:18px}
  html[data-companion-layout="r4"] .app-dialog {padding:28px;max-width:620px}
  html[data-companion-layout="r4"] .app-dialog h2 {font-size:27px;line-height:1.2}
}
@media screen and (min-width:900px) and (max-width:1099px), screen and (min-width:1280px) {
  html[data-companion-layout="r4"] .tracker-week-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media screen and (min-width:1100px) {
  html[data-companion-layout="r4"] .companion-app {max-width:1440px;padding:0 36px 60px 260px}
  html[data-companion-layout="r4"] .app-nav {width:196px;padding:22px 12px 18px;border-radius:23px}
  html[data-companion-layout="r4"] .app-nav-intro {padding:0 10px 20px;margin-bottom:10px}
  html[data-companion-layout="r4"] .app-nav-intro>span {margin-bottom:18px}
  html[data-companion-layout="r4"] .app-nav-intro strong {font-size:21px}
  html[data-companion-layout="r4"] .app-section-picker summary {padding-block:14px}
  html[data-companion-layout="r4"] .tracker-stage-strip button {min-height:70px;padding:14px 16px}
  html[data-companion-layout="r4"] .tracker-stage-intro .eyebrow {display:none}
}
@media screen and (min-width:701px) and (max-width:1099px) {
  .mobile-path:not([hidden]) {display:grid;grid-template-columns:minmax(0,1fr) minmax(275px,.9fr);gap:0 18px;padding:10px 14px}
  .mobile-path-open {grid-column:1;grid-row:1}
  .mobile-path-current {grid-column:1;grid-row:2;margin:1px 0 0}
  .mobile-path-stages {grid-column:2;grid-row:1/3;align-self:center}
}
@media screen and (max-width:1099px) {
  html[data-companion-layout="r4"] .companion-app {padding-inline:26px}
  html[data-companion-layout="r4"] .app-path-row {grid-template-columns:40px minmax(0,1fr)}
  html[data-companion-layout="r4"] .app-path-stages {grid-column:1/-1}
  .mobile-path:not([hidden]) {margin-top:10px;padding:8px 11px 9px;border-radius:17px}
  .mobile-path-current {margin:1px 0 6px;line-height:1.4}
  .mobile-path-stages {padding:3px;gap:6px}
  .mobile-path-stages button {padding-block:7px}
  html[data-companion-layout="r4"] .app-nav {padding:5px 4px}
  html[data-companion-layout="r4"] .app-nav a {min-height:52px;gap:4px;font-size:11px}
  html[data-companion-layout="r4"] .companion-app[data-path-nav=on] [data-screen=tasks] .app-screen-heading {margin-bottom:20px}
}
@media screen and (max-width:700px) {
  html[data-companion-layout="r4"] .companion-app {padding:0 16px 108px}
  html[data-companion-layout="r4"] .app-topbar {min-height:72px;padding-block:10px;gap:8px}
  html[data-companion-layout="r4"] .app-brand {gap:8px}
  html[data-companion-layout="r4"] .app-brand img {width:34px;height:34px}
  html[data-companion-layout="r4"] .app-brand b {font-size:15px}
  html[data-companion-layout="r4"] .app-save-chip {font-size:11px;max-width:86px}
  html[data-companion-layout="r4"] .app-screen {padding-top:22px}
  html[data-companion-layout="r4"] [data-screen=tasks] {padding-top:18px}
  html[data-companion-layout="r4"] .companion-app[data-path-nav=on] [data-screen=tasks] .app-screen-heading {margin-bottom:16px}
  html[data-companion-layout="r4"] .app-screen-heading.compact h1 {font-size:28px}
  html[data-companion-layout="r4"] .app-screen-heading>p:last-child {font-size:15px;line-height:1.6}
  html[data-companion-layout="r4"] .app-task-title {font-size:23px}
  html[data-companion-layout="r4"] .app-stage-finish .app-button-row {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  html[data-companion-layout="r4"] .app-stage-finish .btn {width:100%;min-height:48px;padding-inline:10px;font-size:13px}
  html[data-companion-layout="r4"] .tracker-week-grid {gap:14px;margin-top:12px}
  html[data-companion-layout="r4"] .tracker-task-panel>.app-muted {margin-bottom:8px}
  html[data-companion-layout="r4"] .tracker-action-card {padding:18px;border-radius:16px}
  html[data-companion-layout="r4"] .tracker-action-card.is-complete {padding-left:18px}
  html[data-companion-layout="r4"] .tracker-action-head {margin-bottom:7px}
  html[data-companion-layout="r4"] .tracker-action-card h3 {font-size:18px;margin-bottom:8px}
  html[data-companion-layout="r4"] .tracker-action-card p {font-size:15px;line-height:1.6;margin-bottom:14px}
  .spatial-task-actions {padding-top:10px;gap:10px}
  html[data-companion-layout="r4"] .app-intro h1 {font-size:32px;line-height:1.13}
  html[data-companion-layout="r4"] .app-intro {margin-bottom:20px}
  html[data-companion-layout="r4"] .app-landscape {height:88px;margin-top:18px;border-radius:24px 14px 14px 14px}
  html[data-companion-layout="r4"] .app-landscape-caption {font-size:23px;bottom:12px}
  html[data-companion-layout="r4"] .app-today-grid {grid-template-columns:1fr;gap:16px}
  html[data-companion-layout="r4"] .app-focus-card {padding:22px;border-radius:18px}
  html[data-companion-layout="r4"] .app-focus-label {font-size:10px;margin-bottom:14px}
  html[data-companion-layout="r4"] .app-focus-card h2 {font-size:26px}
  html[data-companion-layout="r4"] .app-progress-card {display:grid;grid-template-columns:84px minmax(0,1fr);grid-template-rows:auto auto auto;align-items:center;justify-items:start;gap:2px 24px;padding:22px}
  html[data-companion-layout="r4"] .app-progress-card .app-progress-ring {grid-column:1;grid-row:1/4;width:80px;height:80px;margin:0}
  html[data-companion-layout="r4"] .app-progress-card>.eyebrow {grid-column:2;grid-row:1;margin:0;font-size:11px}
  html[data-companion-layout="r4"] .app-progress-card>p:not(.eyebrow) {grid-column:2;grid-row:2;margin:0;font-size:13px}
  html[data-companion-layout="r4"] .app-progress-card>.app-text-link {grid-column:2;grid-row:3;min-height:44px;padding-block:6px;font-size:13px}
  html[data-companion-layout="r4"] .app-progress-ring span {font-size:28px}
  html[data-companion-layout="r4"] .app-progress-ring small {font-size:11px}
  html[data-companion-layout="r4"] .app-quick-links {grid-template-columns:1fr;gap:12px;margin-top:16px}
  html[data-companion-layout="r4"] .app-quick-links a {padding:16px;gap:14px}
  html[data-companion-layout="r4"] .app-quick-links a>div {min-width:0}
  html[data-companion-layout="r4"] .app-welcome-note {flex-direction:column;gap:8px;padding-top:16px}
  html[data-companion-layout="r4"] .app-overview {padding:20px;display:block;margin-bottom:20px}
  html[data-companion-layout="r4"] .app-overview p {font-size:24px}
  html[data-companion-layout="r4"] .app-overview dl {gap:8px;margin-top:20px}
  html[data-companion-layout="r4"] .app-overview dl>div {padding:10px 8px}
  html[data-companion-layout="r4"] .app-overview dd {font-size:28px;margin-bottom:6px}
  html[data-companion-layout="r4"] .app-overview dd small {font-size:11px;margin-left:3px}
  html[data-companion-layout="r4"] .app-overview dt {font-size:11px;line-height:1.45}
  html[data-companion-layout="r4"] .app-path-row {padding:16px;gap:14px 12px;margin-bottom:14px;grid-template-columns:36px minmax(0,1fr)}
  html[data-companion-layout="r4"] .app-path-number {width:36px;height:36px;border-radius:11px;font-size:13px}
  html[data-companion-layout="r4"] .app-path-row h2 {font-size:16px}
  html[data-companion-layout="r4"] .app-path-row p {font-size:12px}
  html[data-companion-layout="r4"] .app-path-stages {gap:5px;padding:4px}
  html[data-companion-layout="r4"] .app-path-stages button {padding:9px 7px 12px;min-height:104px;gap:5px}
  html[data-companion-layout="r4"] .app-path-stages button b {font-size:12px}
  html[data-companion-layout="r4"] .app-path-stages button small {font-size:11px}
  html[data-companion-layout="r4"] .app-settings-grid {grid-template-columns:1fr;gap:16px}
  html[data-companion-layout="r4"] .app-settings-card,html[data-companion-layout="r4"] .app-settings-card.tracker-install-card {padding:20px}
  html[data-companion-layout="r4"] .app-settings-card h2 {font-size:23px}
  html[data-companion-layout="r4"] .app-notebook {padding:20px}
  html[data-companion-layout="r4"] .app-notebook textarea {min-height:280px}
  html[data-companion-layout="r4"] .app-reset-card h2 {font-size:18px}
  html[data-companion-layout="r4"] .app-dialog {padding:24px}
  html[data-companion-layout="r4"] .app-dialog h2 {font-size:25px}
  .mobile-path-picker {padding:18px;border-radius:21px}
  .mobile-path:not([hidden]) {padding-block:8px 7px}
  .mobile-path-current {margin:0 0 4px}
  .mobile-path-picker h2 {font-size:24px}
  .mobile-path-options button {padding:12px;min-height:68px;border-radius:13px}
}
/* Let enlarged text expand the top bar without colliding with the path dock. */
@media(max-width:700px){
  html[data-companion-layout="r4"][data-palette="sand"][data-finish="refined"] .app-topbar{height:auto;min-height:84px}
  html[data-companion-layout="r4"] .mobile-path-stages button{flex-wrap:wrap}
  html[data-companion-layout="r4"] .mobile-path-stages span{white-space:nowrap}
}
