/* Site-wide finishing layer of the rental service, loaded after every other stylesheet.
   Visual language: Apple-style surfaces and type (system font, grey canvas, white borderless cards,
   capsule buttons, translucent bars), with the Astryx conventions for hierarchy and states:
   one filled action per view, radius by role, hairline or shadow but not both, alpha hover tints,
   pressed = scale(.98), status never by hue alone. Element rules sit inside :where() so a component
   that styles its own buttons keeps its design. */
:root{--ui-canvas:#f5f5f7;--ui-ink:#1d1d1f;--ui-sub:#6e6e73;--ui-hairline:rgba(0,0,0,.08);--ui-line:#d2d2d7;--ui-fill:#e8e8ed;--ui-fill-hover:#dedee3;--ui-primary:#0071e3;--ui-primary-hover:#0077ed;--ui-primary-active:#006edb;--ui-danger:#d70015;--ui-radius:12px;--ui-card:18px;--ui-pill:980px;--ui-ease:cubic-bezier(.25,1,.5,1)}
body:not([data-urban]){background-color:var(--ui-canvas);color:var(--ui-ink);-webkit-font-smoothing:antialiased}

/* 1. Buttons with a role class: a grey capsule by default, one blue capsule for the main action. */
.button,a.button,button.primary,button.secondary,button.danger{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:10px 20px;border:0;border-radius:var(--ui-pill);background:var(--ui-fill);color:var(--ui-ink);font-size:15px;font-weight:500;line-height:1.3;letter-spacing:-.01em;text-decoration:none;cursor:pointer;box-shadow:none;transition:transform .175s var(--ui-ease)}
.button:where(:hover),button.secondary:where(:hover){background:var(--ui-fill-hover)}
.button:where(:active),button.primary:where(:active),button.secondary:where(:active){transform:scale(.98)}
.button.primary,button.primary,a.primary{background:var(--ui-primary);color:#fff}
.button.primary:where(:hover),button.primary:where(:hover),a.primary:where(:hover){background:var(--ui-primary-hover)}
button.danger,.button.danger{color:var(--ui-danger)}
button:where(:disabled),.button:where([aria-disabled=true]){opacity:.45;cursor:not-allowed}
.link{color:var(--ui-primary)}

/* 2. Plain buttons on the form-style screens: grey capsule, blue when the button submits a form. */
:where(html:has(link[href*="documents.css"],link[href*="/app.css"],link[href*="experience.css"],link[href*="portfolio.css"],link[href*="parties.css"])) button:where(:not([class])){display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:10px 20px;border:0;border-radius:var(--ui-pill);background:var(--ui-fill);color:var(--ui-ink);font-size:15px;font-weight:500;line-height:1.3;letter-spacing:-.01em;cursor:pointer;transition:transform .175s var(--ui-ease)}
:where(html:has(link[href*="documents.css"],link[href*="/app.css"],link[href*="experience.css"],link[href*="portfolio.css"],link[href*="parties.css"])) button:where(:not([class]):hover){background:var(--ui-fill-hover)}
:where(html:has(link[href*="documents.css"],link[href*="/app.css"],link[href*="experience.css"],link[href*="portfolio.css"],link[href*="parties.css"])) button:where(:not([class]):active){transform:scale(.98)}
:where(html:has(link[href*="documents.css"],link[href*="/app.css"],link[href*="experience.css"],link[href*="portfolio.css"],link[href*="parties.css"])) form button:where(:not([class]):not([type=button]):not([type=reset])){background:var(--ui-primary);color:#fff}
:where(html:has(link[href*="documents.css"],link[href*="/app.css"],link[href*="experience.css"],link[href*="portfolio.css"],link[href*="parties.css"])) form button:where(:not([class]):not([type=button]):not([type=reset]):hover){background:var(--ui-primary-hover)}
/* The participant screens colour every plain button through a stronger selector: match it. */
html:has(script[src*="parties.js"]) body button:where(:not([class])){background:var(--ui-fill);border-color:transparent;border-radius:var(--ui-pill);color:var(--ui-ink)}
html:has(script[src*="parties.js"]) body button:where(:not([class]):hover){background:var(--ui-fill-hover)}
html:has(script[src*="parties.js"]) body form button:where(:not([class]):not([type=button]):not([type=reset])){background:var(--ui-primary);color:#fff}
html:has(script[src*="parties.js"]) body form button:where(:not([class]):not([type=button]):not([type=reset]):hover){background:var(--ui-primary-hover)}

/* 3. Text fields and selects: one border, one radius, a soft ring on focus. */
input:where(:not([type=checkbox],[type=radio],[type=file],[type=range],[type=hidden],[type=color],[type=submit],[type=button])),select,textarea{border:1px solid var(--ui-line);border-radius:var(--ui-radius);background-color:#fff;color:var(--ui-ink)}
input:where(:not([type=checkbox],[type=radio],[type=file],[type=range]):focus),select:where(:focus),textarea:where(:focus){border-color:var(--ui-primary);box-shadow:0 0 0 4px rgba(0,113,227,.16)}
:where(input,textarea)::placeholder{color:#86868b;opacity:1}

/* 4. Surfaces: white cards on the grey canvas, no outline. A card inside a card becomes a grey well. */
body:not(.collection-page) :is(.panel,.card,.work-start,.focus-panel,.work-group){border-color:transparent;border-radius:var(--ui-card);box-shadow:none}
body:not(.collection-page) :is(.panel,.card) :is(.panel,.card){background:var(--ui-canvas);border-radius:14px}

/* 5. Type: large bold titles with tight tracking, quieter supporting text. */
body:not(.collection-page) :is(main>.intro h1,main>h1,.wrap h1,.heading h1){font-size:32px!important;font-weight:700;letter-spacing:-.022em!important;line-height:1.2}
:where(h2,h3){letter-spacing:-.015em}
@media(max-width:760px){body:not(.collection-page) :is(main>.intro h1,main>h1,.wrap h1,.heading h1){font-size:28px!important}}

/* 6. Bars: translucent with a hairline, brand and links on the left, account on the right. */
.rental-page-tools{align-items:center;gap:4px;min-height:56px;background:rgba(255,255,255,.72);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);border-bottom:1px solid var(--ui-hairline)}
.rental-page-tools :where(a,button,summary,details,div){margin:0}
.rental-page-tools details{border:0;padding:0}
body .rental-page-tools .rental-page-brand{margin-right:10px;font-weight:700;letter-spacing:-.02em;color:var(--ui-ink)!important}
body .rental-page-tools>a:not(.rental-page-brand){font-weight:400;color:#424245!important;padding:8px 12px;border-radius:var(--ui-pill)}
body .rental-page-tools>a:not(.rental-page-brand):hover{background:rgba(0,0,0,.05)}
body .rental-page-tools>.rental-account{margin-left:auto}
.rental-page-tools .account-menu>summary{border:0;background:var(--ui-fill);border-radius:var(--ui-pill)}
.bottomnav{background:rgba(255,255,255,.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);border-top:1px solid var(--ui-hairline)}
/* The bar already holds the brand, back, space switch and account: drop the second page header. */
body[data-unified-tools]:is([data-rental-screen=parties],[data-rental-screen=governance])>header,body[data-unified-tools] .wrap>header{display:none}
@media(max-width:760px){
 /* Row one: brand and account. Row two: the three links at equal width. */
 body .rental-page-tools{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;padding:8px 12px;align-items:center}
 body .rental-page-tools .rental-page-brand{grid-column:1/4;grid-row:1;justify-content:flex-start;margin-right:0;padding-left:4px}
 body .rental-page-tools>.rental-account{grid-column:4/7;grid-row:1;justify-self:end;margin-left:0;min-width:0;max-width:100%}
 body .rental-page-tools>a:not(.rental-page-brand){grid-column:span 2;min-width:0;background:rgba(118,118,128,.12);font-size:13px!important;padding:8px 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}

/* 7. Small fixes found during the screen review. */
.room-card .room-no{white-space:nowrap}
.room-card .panel-head{gap:8px;flex-wrap:wrap}
body #roles .scope-label{background:#fff;color:var(--ui-ink);border:0;border-radius:14px;padding:14px 18px;font-size:15px;font-weight:400}
body #roles .scope-label a{color:var(--ui-primary)}
@media(prefers-reduced-motion:reduce){.button,button{transition:none!important}}

/* 8. One voice for type and controls. */
body:not([data-urban]),body:not([data-urban]) :is(button,input,select,textarea){font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Apple SD Gothic Neo","Pretendard","Noto Sans KR",system-ui,sans-serif}
body:not([data-urban]) :is(input:not([type=checkbox],[type=radio],[type=file],[type=range]),select,textarea){font-weight:400!important;letter-spacing:-.01em}
/* A label above a title reads as a quiet category name, not a tracked-out stamp. */
body:not([data-urban]) .eyebrow{letter-spacing:0!important;font-size:13px;font-weight:500}
body[data-rental-screen=ownership] .eyebrow{display:none}
body:not([data-urban]) :focus-visible{outline-color:#0071e3!important}

/* 9. Bar: the back link carries a chevron; on a phone the links become plain blue toolbar text. */
body .rental-page-tools>.rental-back::before{content:"";flex:0 0 auto;width:8px;height:8px;margin:0 6px 0 2px;border-left:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg)}
@media(max-width:760px){
 body .rental-page-tools{row-gap:0;padding:6px 14px 2px}
 html body[data-unified-tools] .rental-page-tools>a:not(.rental-page-brand){background:none;color:var(--ui-primary)!important;font-size:15px!important;font-weight:400;padding:6px 2px;justify-content:center}
 body .rental-page-tools>a:not(.rental-page-brand):hover{background:none}
 body .rental-page-tools>.rental-back{justify-content:flex-start}
 body .rental-page-tools>a:not(.rental-page-brand):last-of-type{justify-content:flex-end}
 body .rental-page-tools .rental-page-brand{font-size:17px!important}
}
/* The bar already shows the brand: the side menu starts with its links. */
@media(min-width:761px){body[data-unified-tools] .sidebar>.brand{display:none}}

/* 10. Space cards and their main link. */
.space-card{border-color:transparent}
.space-links .space-primary{border-radius:var(--ui-pill);padding:11px 18px}

/* 11. Ledger screens: borderless fact tiles, plain form labels, and a bottom sheet on phones. */
body.ledger-page .tp-facts>div{border:0;border-radius:14px}
body.ledger-page .roster-form label{font-size:13px;font-weight:500;color:var(--ui-sub)}
body.ledger-page .roster-form :is(input,select,textarea){font-size:17px;padding:11px 14px}
@media(max-width:860px){
 body.ledger-page dialog.lg-dialog{width:100%;max-width:100%;margin:auto 0 0;border-radius:20px 20px 0 0;padding:10px 20px calc(24px + env(safe-area-inset-bottom));max-height:min(92dvh,var(--rental-visible-height,92vh));box-shadow:0 -8px 40px rgba(0,0,0,.18)}
 body.ledger-page dialog.lg-dialog::before{content:"";display:block;width:36px;height:5px;margin:0 auto 14px;border-radius:3px;background:#c7c7cc}
 body.ledger-page dialog.lg-dialog[open]{animation:ui-sheet .41s var(--ui-ease)}
}
@keyframes ui-sheet{from{transform:translateY(32px);opacity:0}}
@media(prefers-reduced-motion:reduce){body.ledger-page dialog.lg-dialog[open]{animation:none}}
