/* The page itself owns the common inset. Inner sections only arrange their content. */
body{--inset-x:clamp(18px,4vw,76px);--inset-y:clamp(12px,2.4dvh,27px);min-height:100dvh;display:grid;grid-template-rows:auto 1fr auto}
body>main#main{box-sizing:border-box;display:grid;margin:var(--inset-y) var(--inset-x);min-width:0;min-height:0;padding:0;border:1px solid #cbbda7;background:#eae2d4;align-self:stretch}
#main>.practice-file,#main>.desk,#main>.stationery{margin:0;width:auto;box-shadow:none;border:0}
body>footer{box-sizing:border-box;padding:0;margin:0}
body>footer .legal{box-sizing:border-box;margin:0;padding:8px var(--inset-x);min-height:52px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-direction:row;border-top:1px solid #d9d0c4;font:12px/1.3 Arial,sans-serif}
body>footer .marks{box-sizing:border-box;display:flex;align-items:center;gap:12px;padding:6px 12px;background:#471c0c}
body>footer .marks img{height:22px;width:auto}
.opening{display:grid;grid-template-columns:1.25fr 1fr}.manifesto{padding:clamp(24px,4.5vw,85px);display:flex;flex-direction:column;justify-content:space-between;gap:24px;background:#471c0c;color:#fff4e3}
.manifesto .micro{color:#ead5bd}.manifesto h1{font-size:clamp(44px,5.8vw,104px);max-width:12ch;line-height:.99;letter-spacing:-.055em}
.manifesto h1 em{display:block;font-family:Georgia,serif;font-weight:400;color:#e5c5a6}
.signature{border-top:1px solid #dfbd9b66;padding-top:14px;display:flex;gap:15px;flex-wrap:wrap;align-items:baseline;justify-content:space-between}.signature p{font:14px Radley,Georgia,serif}.signature .action{margin:0}
.cover-art{background:url(media/relief.webp) 56% 54%/cover}
.practice-file .pan-frame,.leaf .pan-frame{position:relative;overflow:hidden}
.practice-file .pan-frame{--art:url(media/arcs.webp)}.leaf .pan-frame{--art:url(media/terraces.webp)}
.practice-file .pan-frame::before,.leaf .pan-frame::before{content:'';position:absolute;inset:-15%;background:var(--art) center/cover;transform:var(--pan,translate(-7%,-7%));transition:transform .85s cubic-bezier(.22,.65,.25,1)}
.pan-frame[data-view="1"]{--pan:translate(6%,-4%)}.pan-frame[data-view="2"]{--pan:translate(-4%,7%)}.pan-frame[data-view="3"]{--pan:translate(7%,6%)}
@media(max-width:720px){body{--inset-x:12px;--inset-y:8px}body>footer .legal{font-size:10px;min-height:40px;padding:5px 12px;line-height:1.25}body>footer .marks{padding:5px 7px;gap:6px}body>footer .marks img{height:15px}.opening{grid-template-columns:1fr;grid-template-rows:auto minmax(65px,1fr)}.manifesto{padding:clamp(20px,3vh,35px);gap:clamp(18px,3vh,35px)}.manifesto h1{font-size:clamp(43px,9.6vw,65px)}}
@media(max-height:520px){body{--inset-y:4px}.manifesto{gap:10px;padding:15px 23px}.manifesto h1{font-size:clamp(32px,7.8vh,48px)}.signature{padding-top:7px}}
@media(max-height:560px) and (min-width:540px){.opening{grid-template-columns:1.25fr 1fr;grid-template-rows:auto}body>footer .legal{min-height:32px;padding-block:3px}body>footer .marks{padding-block:3px}body>footer .marks img{height:16px}}
@media(prefers-reduced-motion:reduce){.practice-file .pan-frame::before,.leaf .pan-frame::before{transition:none}}
body{--foot:52px;grid-template-rows:auto 1fr var(--foot)}
body>footer .legal{height:100%;min-height:0}
@media(max-width:720px){body{--foot:44px}}
@media(max-width:365px){body{--foot:56px}}
@media(max-height:560px) and (min-width:540px){body{--foot:32px}}
@media(max-width:360px) and (max-height:340px){body{--inset-y:1px}}

/* Optical alignment below the narrower leading stroke of the numeral 1. */
@media(min-width:581px),(max-height:520px){.ledger .metrics dl>div:first-child dt{transform:translateX(clamp(3px, min(1.05vw,1.55vh),16px))}}
@media(max-width:420px) and (max-height:700px){.desk .leaf .brief-panel p{font-size:15px;line-height:1.23;margin-top:7px}.desk .leaf .brief-panel{padding:10px}.desk .leaf{grid-template-rows:clamp(30px,6vh,44px) 1fr}.desk .leaf .brief-panel .action{margin-top:8px}}
/* Every page shares the same three viewport tracks, independent of its copy. */
html body{--bar:72px;height:100dvh;min-height:0;grid-template-rows:var(--bar) minmax(0,1fr) var(--foot)}
body>main#main{grid-row:2;grid-template-rows:minmax(0,1fr);align-content:stretch}
body>main#main.ledger{grid-template-rows:minmax(0,1fr) auto}
body>main#main>:is(.opening,.stationery,.desk,.practice-file){align-self:stretch;min-height:0;margin:0}
body>footer{background:#471c0c}
body>footer .legal{justify-content:center;gap:clamp(12px,2vw,32px);background:transparent;color:#fff4e3;border:0}
body>footer .legal .marks{background:transparent;padding:0;flex:none}
.desk .desktitle .desk-prompt .action{margin:3px 0 0;padding-bottom:2px;font-size:14px}
.desk .leaf .brief-panel p,.desk .leaf .brief-panel p:last-of-type{font-size:clamp(17px,1.5vw,21px);line-height:1.38}
@media(max-width:720px){html body{--bar:50px}.desk .leaf .brief-panel p,.desk .leaf .brief-panel p:last-of-type{font-size:16px;line-height:1.28}.desktitle .desk-prompt p{margin-top:3px}.desk .desktitle .desk-prompt .action{font-size:12px}body>footer .legal{gap:10px}}
@media(max-height:560px) and (min-width:540px){html body{--bar:40px}}
@media(max-width:365px),(max-height:520px){.desk .leaf .brief-panel p,.desk .leaf .brief-panel p:last-of-type{font-size:15px;line-height:1.2}}

/* One accreditation lock-up across every page. */
footer .legal .marks {--rics-height:22px;--redress-height:26px}
body>footer .legal .marks img{width:auto;height:var(--rics-height);display:block;flex:none}
body>footer .legal .marks img[alt="Property Redress Scheme"]{height:var(--redress-height)}
@media(max-width:720px){footer .legal .marks{--rics-height:15px;--redress-height:19px}}
@media(max-height:560px) and (min-width:540px){footer .legal .marks{--rics-height:16px;--redress-height:19px}}
@media(max-width:420px) and (max-height:700px){.desk .leaf .brief-panel p,.desk .leaf .brief-panel p:last-of-type{font-size:15px;line-height:1.22}.desk .leaf .brief-panel{padding:8px 9px}.desk .leaf{grid-template-rows:30px 1fr}}
@media(max-width:350px) and (max-height:600px){#main>.desk{padding:6px}.desk .desktitle{display:flex;align-items:center;gap:8px;margin-bottom:5px}.desk .desktitle h1{font-size:28px}.desk .desk-prompt p{font-size:13px}.desk .leaf .brief-panel p,.desk .leaf .brief-panel p:last-of-type{font-size:14px;line-height:1.2}.desk .leaf .brief-panel p{margin-top:5px}}
.desk .leaf .pan-frame {
  grid-area: 1 / 1;
  align-self: stretch;
  justify-self: stretch;
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
}
.desk .leaf .pan-frame::before {
  inset: -2%;
  background: var(--art) center / cover no-repeat;
  transform: translate(-1%, -.6%);
}
.desk .leaf .pan-frame[data-view="1"]::before { transform: translate(.8%, -.4%) }
.desk .leaf .pan-frame[data-view="2"]::before { transform: translate(-.5%, .9%) }
.desk .leaf .pan-frame[data-view="3"]::before { transform: translate(.9%, .65%) }
.desk .leaf .brief-panel h2{font-size:clamp(24px,min(2.85vw,5vh),44px);line-height:1.08}
.desk .leaf .brief-panel p,.desk .leaf .brief-panel p:last-of-type{font-size:clamp(15px,1.24vw,18px);line-height:1.42;max-width:61ch}
@media(max-width:720px) and (min-height:561px), (max-width:539px){
.desk .leaf {grid-template: minmax(35px, 1fr) auto / minmax(0, 1fr)}
.desk .leaf .brief-panel {grid-area: 2 / 1; padding: clamp(12px, 2.5vh, 24px); align-self: center}
.desk .leaf .brief-panel h2 {font-size: 24px}
.desk .leaf .brief-panel p,.desk .leaf .brief-panel p:last-of-type{font-size:15px;line-height:1.3}
}
@media(max-width:365px),(max-height:520px){.desk .leaf .brief-panel h2{font-size:21px}.desk .leaf .brief-panel p,.desk .leaf .brief-panel p:last-of-type{font-size:14px;line-height:1.23}}
@media(max-width:350px) and (max-height:600px){.desk .leaf .brief-panel{padding:8px}}

.notepaper .office { max-width: 37ch; margin: clamp(14px,3vh,36px) auto 0; font: normal 13px/1.4 Arial,sans-serif; color: #594a40; }
.notepaper .office strong { display: block; font-weight: 600; }
@media (max-height: 520px) { .notepaper .office { margin-top: 8px; font-size: 12px; } }
@media (max-width: 720px) and (min-height: 561px), (max-width: 539px) {
  .enquiries .stationery {grid-template-rows: minmax(max-content, 1.6fr) minmax(35px, 1fr)}
}
@media (max-height: 520px) {
  .enquiries .stationery .notepaper {padding-block: 6px}
  .enquiries .stationery h1 {font-size: clamp(32px, 10vh, 44px)}
  .enquiries .stationery .notepaper > p:not(.label) {margin: 8px 0 5px; font-size: 16px}
  .enquiries .notepaper .office {margin: 7px auto 0; line-height: 1.25}
}
@media (max-height: 560px) and (min-width: 540px) {
  .desk .leaf {grid-template: minmax(0, 1fr) / minmax(0, .36fr) minmax(0, 1fr)}
  .desk .leaf .brief-panel {grid-area: 1 / 2; padding: 7px clamp(8px, 2vw, 22px)}
  .desk .leaf .brief-panel p, .desk .leaf .brief-panel p:last-of-type {font-size: 14px; line-height: 1.22; margin-top: 6px}
  .desk .leaf .brief-panel h2 {font-size: 23px}
  .desk .tabs {display: flex; flex-wrap: nowrap}
  .desk .tabs button {padding: 4px; font-size: 12px; min-height: 32px}
  .practice-file .practice-tabs button {min-height: 27px; padding-block: 4px}
  .practice-file .practice-preface {margin-bottom: 0}
  .practice-file .print {max-height: 22vh}
}
@media (max-width: 360px) and (max-height: 520px) {
  .practice-file .practice-preface h1 {font-size: 29px; margin-bottom: 5px}
  .practice-file .practice-preface p + p {margin-top: 3px}
  .practice-file .practice-tabs button {min-height: 23px; padding-block: 3px}
  .practice-file .brief-pages {padding-top: 6px}
  .practice-file .brief-pages h2 {font-size: 21px}
  .practice-file .brief-pages p {line-height: 1.18}
  .ledger .metrics dt {font-size: 10px; letter-spacing: .07em}
}
@media (pointer: coarse) {
  .mastbar nav a {display: inline-flex; align-items: center; min-height: min(44px, var(--bar))}
}
@media (min-width: 721px) and (max-width: 1024px) and (orientation: portrait) {
  .desk .leaf {grid-template: minmax(120px, 1fr) auto / minmax(0, 1fr)}
  .desk .leaf .brief-panel {grid-area: 2 / 1; padding: clamp(20px, 3vw, 32px)}
  .desk .leaf .brief-panel p {max-width: 65ch}
}
@media (max-height: 580px) and (max-width: 360px),
       (max-height: 360px) and (min-width: 540px) {
  .desk .desktitle {display: grid; grid-template-columns: 1fr auto; gap: 5px; align-items: center; margin-bottom: 4px}
  .desk .desktitle h1 {font-size: 24px; white-space: nowrap}
  .desk .desktitle .desk-prompt p {font-size: 12px; line-height: 1.1; margin: 0}
  .desk .desktitle .desk-prompt .action {display: block; width: max-content; font-size: 11px; line-height: 1.2; margin: 1px 0 0}
  .desk .tabs button {padding: 3px; min-height: 26px; line-height: 1.12}
  .desk .leaf .brief-panel {padding: 6px 8px}
  .desk .leaf .brief-panel p, .desk .leaf .brief-panel p:last-of-type {font-size: 14px; line-height: 1.16; margin-top: 4px}
}
@media (max-height: 360px) and (min-width: 540px) {
  .desk .leaf {grid-template-columns: minmax(0, .22fr) minmax(0, 1fr)}
  .practice-file .practice-preface {align-items: center; grid-template-columns: .58fr 1.42fr; gap: 15px}
}

footer .legal .company-details {
  color: inherit;
  text-decoration: none;
  text-underline-offset: .18em;
}

footer .legal .company-details:is(:focus-visible, :hover) {text-decoration: underline}

/* Inactive panels stay in the shared grid cell to preserve its dimensions. */
@media (prefers-reduced-motion: no-preference) {
  #main [role="tabpanel"] {
    opacity: 1;
    transition: opacity 290ms ease-out 90ms, visibility 0s;
  }
  #main [role="tabpanel"][hidden] {
    opacity: 0;
    transition: opacity 125ms ease-in, visibility 0s linear 125ms;
  }
}

.access-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(9px, 1.25vh, 13px);
  padding: clamp(18px, 5vw, 76px);
  text-align: center;
}
.access-panel h1 {
  font-size: clamp(1rem, 1.2vw, 1.1875rem);
  line-height: 1.3;
  letter-spacing: -.012em;
  color: #5e493c;
  text-wrap: balance;
}
.access-code {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr) auto) minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(.5px, .225vw, 3px);
  width: min(50%, 10rem);
  font-size: .5em;
  color: #733521;
}
.access-code input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: clamp(21px, 1.7vw, 24px);
  border: 1px solid #947e68;
  border-radius: 0;
  background: #f1eadf;
  color: #471c0c;
  padding: 0;
  text-align: center;
  font: 16px/1 Radley, Georgia, serif;
}
.access-code input:focus-visible {
  outline: 2px solid #733521;
  outline-offset: 2px;
}
@media (max-width: 460px) {
  .mastbar nav {flex: 1; justify-content: space-between; gap: 4px}
  .mastbar nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: min-content;
    white-space: normal;
    text-align: center;
    line-height: 1.12;
    min-height: 40px;
  }
}

@media (min-width: 361px) and (max-width: 720px) and (min-height: 561px) and (max-height: 640px),
       (min-width: 361px) and (max-width: 539px) and (max-height: 560px) {
  .desk .desktitle {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }
  .desk .desktitle h1 {font-size: clamp(28px, 6vw, 36px)}
  .desk .desktitle .desk-prompt p {margin-top: 0; font-size: 14px}
}
@media (max-width: 350px) and (min-height: 521px) and (max-height: 580px) {
  .ledger .byline h2 {display: inline; margin-left: 6px; font-size: 20px}
  .ledger .byline p {font-size: 15px; line-height: 1.2}
}

/* Leave enough space between the six tap targets on narrow phones. */
@media (max-width: 375px) {
  .access-code {width: min(100%, 150px); column-gap: 2px}
}

/* With a magnified viewport or an open keyboard, keep long pages inside the frame. */
@media (max-width: 539px) and (max-height: 450px) {
  body > main#main {overflow-y: auto; overscroll-behavior-y: contain}
  #main:has(> .opening) {grid-template-rows: minmax(300px, 1fr)}
  #main:has(> .stationery) {grid-template-rows: minmax(335px, 1fr)}
  #main:has(> .practice-file), #main:has(> .desk) {grid-template-rows: minmax(435px, 1fr)}
  body > main#main.ledger {grid-template-rows: minmax(max-content, 1fr) max-content}
}

@media (max-width: 460px) {
  .mastbar nav a:is(:hover, [aria-current]) {text-decoration: none}
  .mastbar nav a > span {position: relative}
  .mastbar nav a:is(:hover, [aria-current]) > span::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 1px);
    border-bottom: 1px solid currentColor;
  }
}
