/* Sign plate: paper ground, ink outlines, square edges. Pink only on .banner.warn. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-weight: 400; font-size: 16px; line-height: 1.4; }
h1, h2, h3 { font-family: var(--font-cond); font-weight: 700; letter-spacing: .04em; margin: 0 0 .4em; }
img { max-width: 100%; }
a { color: var(--ink); }

:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.logo { display: block; height: 40px; width: auto; }

.plate { display: inline-flex; align-items: baseline; gap: 10px; border: 3px solid var(--ink); padding: 4px 12px 2px; background: var(--white); }
.plate b { font-family: var(--font-cond); font-weight: 700; font-size: 30px; letter-spacing: .06em; line-height: 1; }
.plate span { font-size: 12.5px; }

.sec, section.box, .box { border: 2px solid var(--ink); background: var(--white); border-radius: 0; }

.field { margin: 0 0 14px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--white); border: 2px solid var(--ink); border-radius: 0; padding: 10px 12px; width: 100%; min-height: 44px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--pink); }
.field-error { color: var(--ink); font-size: 13px; margin-top: 4px; border-left: 4px solid var(--pink); padding-left: 8px; }

.btn { display: block; width: 100%; min-height: 44px; padding: 12px; border: 2px solid var(--ink); border-radius: 0; font: inherit; font-weight: 600; font-size: 15px; text-align: center; cursor: pointer; text-decoration: none; }
.btn.ink { background: var(--ink); color: var(--white); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.warn { background: var(--white); color: var(--ink); border-color: var(--pink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }

.banner { border: 2px solid var(--ink); background: var(--white); padding: 8px 12px; font-size: 14px; margin: 10px 0; }
.banner.ok { border-color: var(--green); }
.banner.warn { border-color: var(--pink); background: #fff0f6; }

.sheet-scrim { position: fixed; inset: 0; background: rgba(32, 31, 31, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.sheet { background: var(--paper); border-top: 3px solid var(--ink); width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; padding: 16px; }

.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.toast-x { background: none; border: 0; font-size: 22px; line-height: 1; min-width: 44px; min-height: 44px; cursor: pointer; color: var(--ink); }

.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
a.btn { line-height: 1.25; }
.auth-hatch { height: 10px; background: repeating-linear-gradient(135deg, var(--ink) 0 1.5px, transparent 1.5px 6px); opacity: .55; }

/* Sign-in screens (auth-app.js): one phone-width column, logo on top, the title as a sign. */
.auth { max-width: 420px; margin: 0 auto; padding: 16px 16px 40px; }
.auth-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 3px solid var(--ink); }
.auth-head .logo { flex: 0 1 210px; min-width: 0; width: 210px; height: auto; }
.lang { display: flex; flex: none; border: 2px solid var(--ink); background: var(--white); }
.lang button { min-width: 44px; min-height: 40px; padding: 0 8px; border: 0; background: transparent; color: var(--ink); font: 600 14px var(--font); letter-spacing: .06em; cursor: pointer; }
.lang button + button { border-left: 2px solid var(--ink); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.auth-main { padding-top: 22px; }
.auth-title { display: inline-block; max-width: 100%; margin: 0; padding: 5px 12px 3px; border: 3px solid var(--ink); background: var(--white); font-size: 28px; line-height: 1.1; letter-spacing: .04em; }
.lede { margin: 12px 0 0; font-size: 15px; }
.auth-main .banner { margin: 16px 0 0; }
.banner a { font-weight: 600; }
.auth-form { margin-top: 18px; }
.auth-form > .btn { margin-top: 8px; }
.auth-actions { margin-top: 18px; display: grid; gap: 10px; }
.field-hint { font-size: 13px; margin-top: 4px; }
.auth input[readonly] { background: transparent; }
.pw { display: flex; border: 2px solid var(--ink); background: var(--white); }
.pw input { flex: 1; min-width: 0; border: 0; }
.pw input:focus-visible { outline: none; }
.pw:focus-within { outline: 3px solid var(--green); outline-offset: 2px; }
.pw button { flex: none; min-width: 76px; border: 0; border-left: 2px solid var(--ink); background: transparent; color: var(--ink); font: 600 14px var(--font); cursor: pointer; }
.field.has-error .pw { border-color: var(--pink); }
.meter { display: flex; gap: 4px; margin-top: 8px; }
.meter i { flex: 1; height: 8px; border: 2px solid var(--ink); background: var(--white); }
.meter i.on { background: var(--ink); }
.meter.full i { background: var(--green); border-color: var(--green); }
.reqs { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; }
.reqs li { display: flex; align-items: center; gap: 6px; }
.reqs em { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 2px solid var(--ink); font-style: normal; font-size: 11px; font-weight: 700; line-height: 1; }
.reqs li.ok em { background: var(--green); border-color: var(--green); color: var(--white); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 0 8px; font-size: 15px; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; min-height: 0; margin: 0; padding: 0; accent-color: var(--ink); cursor: pointer; }
.auth-links { margin-top: 10px; }
.auth-links a { display: inline-block; padding: 11px 0; font-weight: 600; }
.auth-foot { margin: 22px 0 0; padding-top: 14px; border-top: 2px solid var(--ink); font-size: 14px; }

/* Sheets (ui.js Sheet): a title row with a close button. */
.sheet:focus { outline: none; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.sheet-head h2 { margin: 6px 0 0; font-size: 24px; line-height: 1.1; overflow-wrap: anywhere; }
.sheet-x { flex: none; background: none; border: 0; font-size: 26px; line-height: 1; min-width: 44px; min-height: 44px; cursor: pointer; color: var(--ink); }
.sheet-sub { margin: 4px 0 14px; font-size: 14px; }
.sheet-line { margin: 4px 0; font-weight: 600; }
.sum { border: 2px solid var(--ink); background: var(--white); padding: 8px 12px; margin: 12px 0; }
.sum > div { display: flex; justify-content: space-between; gap: 12px; margin: 3px 0; font-size: 14.5px; }
.sum b { text-align: right; }
.sum .sum-tax { display: block; font-size: 12.5px; }
.fine { font-size: 13px; margin: 8px 0 14px; }
fieldset.picks { border: 0; margin: 0 0 6px; padding: 0; min-width: 0; }
fieldset.picks legend { padding: 0; margin-bottom: 4px; font-weight: 600; font-size: 14px; }
.field-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }

/* Member phone app (member-*.js): one column, logo bar, the screen title as a sign. */
.m { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.m-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 3px solid var(--ink); }
.m-home { display: block; flex: 0 1 180px; min-width: 0; }
.m-home .logo { width: 180px; max-width: 100%; height: auto; }
.m-acct { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 2px solid var(--ink); background: var(--white); font-weight: 600; font-size: 14px; text-decoration: none; }
.m-acct[aria-current="page"] { background: var(--ink); color: var(--white); }
.m-main { flex: 1; padding: 18px 16px 24px; }
.m-title { display: inline-block; max-width: 100%; margin: 0; padding: 5px 12px 3px; border: 3px solid var(--ink); background: var(--white); font-size: 28px; line-height: 1.1; }
.m-title:focus, h1.sr:focus { outline: none; }
.m-sub { margin: 8px 0 0; font-size: 14.5px; }
.m-empty { margin: 18px 0 0; }
.m-back { display: inline-block; padding: 11px 0; font-weight: 600; font-size: 14.5px; }
.m-actions { display: grid; gap: 10px; margin-top: 16px; }
.m-note { padding: 10px 12px; margin-top: 8px; }
.m-note p { margin: 0; }
.m-bar { position: sticky; bottom: 0; z-index: 5; display: grid; gap: 8px; padding: 12px 16px 16px; background: var(--paper); border-top: 2px solid var(--ink); }
.m-bar .hint { margin: 0; text-align: center; font-size: 14.5px; }
.m-plate { margin: 4px 0 14px; }
.m + .toast { top: 12px; bottom: auto; }          /* the bottom bar holds the main buttons */

/* My spaces cards */
.cards { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.card { border: 2px solid var(--ink); background: var(--white); padding: 12px; }
.card h2 { margin: 0 0 4px; font-size: 21px; overflow-wrap: anywhere; }
.card h2 a { text-decoration: none; }
.card-meta { margin: 2px 0; font-size: 14px; }
.badge { display: inline-block; padding: 0 7px; border: 2px solid var(--pink); background: #fff0f6; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.cost { margin: 10px 0 0; padding-top: 8px; border-top: 2px solid var(--ink); }
.cost > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.cost dd { margin: 0; text-align: right; }
.tax { margin: 2px 0 0; font-size: 12.5px; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.card-actions .btn { font-size: 14px; padding: 8px 6px; }

/* The unit drawing (unit-drawing.js): uprights, boards, hatched ground. */
.ud-frame { border-left: 5px solid var(--ink); border-right: 5px solid var(--ink); padding: 0 7px; }
.ud-pos { margin: 9px 0 4px; font-size: 12.5px; font-weight: 600; }
.ud-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ud-shelf:last-child .ud-row { padding-bottom: 7px; }
.ud-board { height: 5px; margin: 7px -7px 0; background: var(--ink); }
.ud-ground { margin: 0 -16px; padding: 0 16px; border-top: 3px solid var(--ink); }
.ud-note { margin: 6px 0 0; font-size: 13px; }
.ud-hatch { height: 12px; background: repeating-linear-gradient(135deg, var(--ink) 0 1.5px, transparent 1.5px 6px); opacity: .55; }
.tile { flex: 1 1 0; min-width: 58px; min-height: 48px; padding: 6px 3px 5px; border: 2px solid var(--ink); border-radius: 0; background: var(--white); color: var(--ink); font: inherit; font-size: 12px; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.tile b { display: block; font-family: var(--font-cond); font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.tile .tile-size { display: block; margin-top: 2px; font-size: 10.5px; line-height: 1.2; }
button.tile { cursor: pointer; }
.tile.taken { border-color: #b9b6ad; background: transparent; color: #6b6862; }
.tile.yours { background: var(--lilac); }
.tile.held { border: 2px solid var(--ink); background: var(--held); font-weight: 600; }
.tile.over { border-color: var(--pink); background: #fff0f6; font-weight: 600; }
.tile.picked { background: var(--green); border-color: var(--green); color: var(--white); }
.tile.retired { border-style: dashed; background: transparent; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; padding: 0; font-size: 13px; }
.legend i { display: inline-block; width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; border: 2px solid var(--ink); background: var(--white); }
.legend i.picked { background: var(--green); border-color: var(--green); }
.legend i.yours { background: var(--lilac); }
.legend i.held { background: var(--held); }
.legend i.over { background: #fff0f6; border-color: var(--pink); }
.legend i.taken { background: transparent; border-color: #b9b6ad; }

/* Browse */
.floor { margin-top: 22px; }
.floor h2, .room h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.floor h2 { margin: 0; padding-bottom: 3px; border-bottom: 3px solid var(--ink); font-size: 23px; }
.floor small, .room small { font-family: var(--font); font-size: 13.5px; font-weight: 600; letter-spacing: 0; }
.room h3 { margin: 14px 0 6px; font-family: var(--font); font-size: 15.5px; font-weight: 600; letter-spacing: 0; }
.units { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.units a { display: block; min-height: 44px; padding: 6px 8px; border: 2px solid var(--ink); background: var(--white); text-decoration: none; }
.units a b { display: block; font-family: var(--font-cond); font-size: 21px; letter-spacing: .06em; line-height: 1.1; }
.units a span { font-size: 12.5px; }
.units a.none { border-color: #b9b6ad; background: transparent; color: #6b6862; }

/* Scan */
.scan-box { position: relative; width: 100%; max-width: 340px; aspect-ratio: 1; margin: 14px auto 0; border: 3px solid var(--ink); background: var(--ink); overflow: hidden; }
.scan-box video { display: block; width: 100%; height: 100%; object-fit: cover; }
.scan-aim { position: absolute; inset: 18%; border: 3px solid var(--green); pointer-events: none; }
.scan-status { margin: 10px 0 0; text-align: center; font-size: 14px; }

/* Account */
.acct-sec { margin-top: 18px; padding-top: 14px; border-top: 2px solid var(--ink); }
.acct-sec h2 { font-size: 21px; }
.m input[readonly] { background: transparent; }
.lang-wide { display: inline-flex; }
.lang-wide button { min-height: 44px; padding: 0 16px; }
