.sheet { padding: clamp(10px, 1.4vw, 22px); background: var(--night); }
.frame { position: relative; border: 2px solid var(--line-night); padding: clamp(22px, 2.4vw, 44px) clamp(20px, 3.6vw, 60px) 6px; overflow: hidden; }
.frame::after { content: ""; position: absolute; inset: 5px; border: 1px solid var(--line-night); pointer-events: none; z-index: 3; }
.intro { position: relative; z-index: 2; }
.intro .label { color: var(--paper); }
h1 { font: 500 clamp(46px, 13vw, 112px)/0.95 var(--display); letter-spacing: -0.01em; margin: 10px 0 16px -0.04em; text-wrap: balance; }
.lead { font-size: clamp(18px, 1.7vw, 25px); line-height: 1.38; max-width: 24em; text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px 34px; margin-top: 26px; }
.cta { border: 2px solid var(--ink); background: var(--amber); color: #241a08; font: 600 19px/1 var(--text); padding: 17px 24px; border-radius: 3px; box-shadow: 0 4px 0 #8a5d11; transition: transform 0.12s, box-shadow 0.12s; }
.cta:hover { transform: translateY(-1px); box-shadow: 0 5px 0 #8a5d11; }
.cta:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a5d11; }
.cta[disabled] { opacity: 0.55; cursor: default; }
.closed { font-weight: 600; }
.tally { display: flex; gap: 26px; }
.tally div { display: flex; flex-direction: column-reverse; }
.tally dd { font: 500 clamp(38px, 4vw, 60px)/0.95 var(--display); font-variant-numeric: lining-nums; }
.tally dt { font: 600 13px/1.2 var(--label); letter-spacing: 0.14em; text-transform: uppercase; margin-top: 5px; }
.tally div:first-child dd { color: var(--amber); }
.key { display: flex; flex-direction: column; gap: 8px; margin-top: 30px; font-size: 16px; color: #d7d3c8; }
.key li { display: flex; align-items: center; gap: 12px; }
.key i { width: 17px; height: 23px; border: 1.6px solid #0c111b; display: inline-block; flex: none; background: linear-gradient(90deg, transparent 46%, #0c111b 46% 54%, transparent 54%), linear-gradient(transparent 30%, #0c111b 30% 36%, transparent 36%), var(--k); }
.k-live { --k: var(--amber); } .k-free { --k: #26344f; }
.key .k-plan { background: rgba(255, 124, 95, 0.16); border: 2px dashed var(--pencil-night); }
.elevation { position: relative; }
.titleblock { display: grid; grid-template-columns: 1fr; border-top: 1.5px solid var(--line-night); margin: 0 calc(-1 * clamp(20px, 3.6vw, 60px) + 6px); position: relative; background: var(--night); }
.titleblock div { padding: 9px 20px 10px; border-top: 1px solid var(--line-night); display: flex; flex-direction: column; gap: 3px; }
.titleblock div:first-child { border-top: 0; }
.titleblock .label { font-size: 11px; color: #c9c5ba; }
.titleblock b { font: 500 17px/1.2 var(--label); }
.titleblock div:nth-child(4) { display: none; }

/* close-up: the same wall, nearer */
.bricks { background: #4d261c url(/img/brick.webp); padding: clamp(30px, 4vw, 64px) clamp(16px, 4vw, 64px) 70px; border-top: 10px solid #8d867a; box-shadow: inset 0 14px 0 -8px #2b1812; min-height: 50vh; }
.bar { display: flex; flex-wrap: wrap; gap: 14px 30px; align-items: baseline; justify-content: space-between; max-width: 1500px; margin: 0 auto 34px; }
.bar h2 { font: 500 clamp(30px, 3.4vw, 50px)/1 var(--display); }
.filters { display: flex; gap: 8px; }
.filters button { background: none; border: 1.5px solid rgba(240, 235, 223, 0.5); border-radius: 3px; padding: 8px 13px; font: 600 15px/1 var(--text); color: var(--paper); }
.filters button[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.empty { max-width: 1500px; margin: 0 auto; font: 400 clamp(22px, 3vw, 32px)/1.3 var(--hand); color: #ffd9b0; }
.cards { max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 46px 40px; }
.card { position: relative; display: flex; flex-direction: column; }
.card .casement { border: 0; background: none; padding: 0; display: block; text-align: inherit; }
.plate { position: relative; margin: 6px 6% 0; background: var(--paper); color: var(--ink); border: 1.6px solid #1a1210; padding: 13px 16px 14px; flex: 1; display: flex; flex-direction: column; }
.plate .top { display: flex; justify-content: space-between; gap: 10px; font: 600 12.5px/1.2 var(--label); letter-spacing: 0.1em; text-transform: uppercase; color: #55565e; }
.plate h3 { font: 500 27px/1.08 var(--display); margin: 8px 0 3px; overflow-wrap: anywhere; }
.plate .by { font-size: 16px; }
.plate .by span { color: var(--ink-soft); }
.plate .what { font-size: 16px; line-height: 1.38; margin-top: 8px; text-wrap: pretty; overflow-wrap: anywhere; }
.plate .note { margin-top: 10px; color: var(--pencil); font: 700 17px/1.3 var(--hand); }
.plate .act { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 14px; }
.open { flex: 1; min-width: 0; text-decoration: none; background: var(--ink); color: var(--paper); padding: 11px 13px; border-radius: 3px; font: 600 15.5px/1.15 var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.open:hover { background: #101218; }
.open.off { background: none; color: var(--ink-soft); padding-left: 0; font-weight: 500; }
.ring { display: inline-flex; align-items: center; gap: 8px; border: 1.6px solid var(--ink); background: #fffaf0; border-radius: 3px; padding: 8px 12px; font: 600 16px/1 var(--text); min-height: 42px; }
.ring svg { width: 20px; height: 20px; }
.ring:hover { background: #ffe7a6; }
.ring.rung svg { animation: swing 0.7s ease; transform-origin: 50% 10%; }
@keyframes swing { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(20deg); } 45% { transform: rotate(-16deg); } 70% { transform: rotate(9deg); } }
.stamp { position: absolute; right: 12px; bottom: calc(100% + 4px); transform: rotate(-5deg); background: rgba(240, 235, 223, 0.94); color: var(--upcloud); border: 2.5px solid var(--upcloud); border-radius: 4px; padding: 5px 9px 4px; font: 600 14px/1.05 var(--label); letter-spacing: 0.09em; text-transform: uppercase; text-align: center; z-index: 3; box-shadow: inset 0 0 0 2px rgba(240, 235, 223, 1), inset 0 0 0 3px rgba(123, 0, 255, 0.45); }
.stamp b { display: block; font: 600 12px/1.15 var(--label); letter-spacing: 0.06em; }
.mine { position: absolute; left: 6%; top: -19px; z-index: 4; color: var(--pencil-night); font: 700 22px/1 var(--hand); transform: rotate(-3deg); }
.edit { border: 0; background: none; text-decoration: underline; text-underline-offset: 3px; padding: 8px 4px; font-size: 15.5px; }
.card.fresh .casement { animation: arrive 1.2s ease; }
@keyframes arrive { 0% { filter: brightness(0.3); } 30% { filter: brightness(1.2); } 45% { filter: brightness(0.5); } 70%, 100% { filter: none; } }
.foot { max-width: 1500px; margin: 60px auto 0; color: #e2cfc4; font-size: 16px; line-height: 1.6; }

/* paper */
dialog { border: 0; padding: 0; color: var(--ink); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(12, 17, 29, 0.72); }
.paper { background: var(--paper); border: 2px solid var(--ink); outline: 1px solid var(--ink); outline-offset: -8px; width: min(620px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); overflow: auto; margin: auto; overscroll-behavior: contain; }
.paper.wide { width: min(1080px, calc(100vw - 20px)); }
.paper form { padding: 26px clamp(20px, 5vw, 38px) 24px; }
.paper header { position: relative; padding-right: 44px; }
.paper header .label { color: #6a6b73; min-height: 16px; }
.paper h2 { font: 500 clamp(32px, 7vw, 44px)/1.02 var(--display); margin: 5px 0 10px; }
.close { position: absolute; right: -8px; top: -8px; width: 44px; height: 44px; border: 0; background: none; font: 400 34px/1 var(--text); }
.rows { border-top: 1.4px solid var(--ink); }
.row { display: grid; grid-template-columns: 148px 1fr; gap: 2px 14px; align-items: baseline; padding: 9px 0 8px; border: 0; border-bottom: 1.4px solid var(--ink); margin: 0; }
.row > span, .row legend { font: 600 16px/1.25 var(--text); padding: 0; }
.row input { border: 0; background: none; font-size: 19px; padding: 5px 0; width: 100%; outline: none; border-radius: 0; }
.row input::placeholder { color: #a5a194; }
.row:focus-within { box-shadow: inset 0 -3px 0 var(--amber); }
.row.bad { box-shadow: inset 0 -3px 0 var(--pencil); }
.row small { grid-column: 2; font-size: 14.5px; line-height: 1.35; color: #5d5e66; padding-bottom: 3px; }
.pick { display: block; padding-top: 11px; }
.pick legend { float: left; width: 148px; margin-right: 14px; }
.pick > div { display: flex; flex-wrap: wrap; gap: 8px; }
.pick label { position: relative; width: 54px; height: 62px; background: var(--amber); border: 2px solid var(--ink); cursor: pointer; display: grid; place-items: end center; }
.pick label svg { width: 44px; height: 44px; }
.pick label.hang { place-items: start center; }
.pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pick label:has(:checked) { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--pencil); }
.pick label:has(:focus-visible) { outline: 3px solid var(--ink); outline-offset: 7px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.error { color: var(--pencil); font-weight: 600; margin-top: 14px; }
.row .error { grid-column: 2; margin: 2px 0 6px; line-height: 1.3; }
.paper footer { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 20px; }
.paper footer .small { flex: 1 1 200px; font-size: 14.5px; line-height: 1.35; color: #5d5e66; }
.plain { border: 0; background: none; color: var(--pencil); text-decoration: underline; text-underline-offset: 3px; padding: 10px 2px; font-weight: 600; }

.detail { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.detail .scene { background: #4d261c url(/img/brick.webp); padding: 34px 26px 40px; display: grid; align-content: center; border-right: 2px solid var(--ink); }
.detail .facts { padding: 30px 32px 28px; position: relative; display: flex; flex-direction: column; gap: 12px; }
.detail .facts h2 { margin: 0; overflow-wrap: anywhere; }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 16px; border-top: 1.4px solid var(--ink); padding-top: 12px; }
.detail dt { color: #5d5e66; }
.detail dd { overflow-wrap: anywhere; }
.detail .act { display: flex; gap: 10px; align-items: stretch; margin-top: auto; padding-top: 8px; }
.detail .act .open { padding: 15px 16px; font-size: 17px; }
.detail .close { right: 12px; top: 10px; }
.detail .stamp { position: static; align-self: flex-start; margin-top: 4px; }
.detail .qr { width: 118px; }
.detail .scan { display: flex; gap: 14px; align-items: center; font-size: 15px; color: #4d4e56; line-height: 1.35; }
.toast { position: fixed; left: 14px; right: 14px; bottom: 22px; margin: 0 auto; width: fit-content; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); padding: 14px 20px; font-weight: 600; z-index: 20; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }

@media (min-width: 900px) {
  .frame { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); grid-template-rows: 1fr auto; column-gap: 1vw; min-height: calc(100vh - 2 * clamp(10px, 1.4vw, 22px)); padding-right: clamp(10px, 1.6vw, 26px); }
  .intro { align-self: center; padding-bottom: 40px; }
  h1 { font-size: clamp(64px, 7.4vw, 132px); }
  .elevation { align-self: end; justify-self: end; width: min(100%, calc((100vh - 130px) * 0.964)); min-width: 560px; }
  .titleblock { grid-column: 1 / -1; margin-right: calc(-1 * clamp(10px, 1.6vw, 26px) + 6px); grid-template-columns: 1.35fr 1.35fr 1fr 0.8fr; }
  .titleblock div { border-top: 0; border-left: 1px solid var(--line-night); }
  .titleblock div:first-child { border-left: 0; }
  .titleblock div:nth-child(4) { display: flex; }
}
@media (max-width: 899px) {
  .frame { padding-inline: 18px; }
  .elevation { margin: 26px -10px 0; }
  .titleblock { margin-inline: -12px; }
  .actions { gap: 20px 26px; }
  .actions .cta { flex: 1 1 100%; padding: 19px; font-size: 20px; }
  .key { flex-direction: row; flex-wrap: wrap; gap: 8px 20px; margin-top: 24px; font-size: 15px; }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .detail .scene { border-right: 0; border-bottom: 2px solid var(--ink); padding: 26px 14px 30px; }
  .detail .facts { padding: 22px 22px 24px; }
  .detail .scan { display: none; }
}
@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; padding-top: 10px; }
  .row small { grid-column: 1; }
  .row .error { grid-column: 1; }
  .pick { padding: 0 0 12px; }
  .pick legend { float: none; width: auto; margin: 10px 0 9px; }
  .pick > div { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
  .pick label { width: auto; }
  .pick label svg { width: 86%; height: auto; }
  .paper { outline: 0; }
  .bar { margin-bottom: 26px; }
}
