/* Raisejar — a jar on a pale shelf, plum ink, lime for whatever is standing. The CA hangs on a tag at the right edge. */
:root {
  --paper: #F2F4E4; --card: #FBFCF3; --line: #D9DCC5; --ink: #2B0E26; --plum: #5B1F4E; --mute: #6F5A69; --dim: #988A92;
  --lime: #BDF54A; --lime-deep: #6E9A0E; --lime-ink: #1E2A05; --lime-soft: rgba(189, 245, 74, .35);
  --tag: 92px;
  --disp: 'Syne', 'Manrope', system-ui, sans-serif; --body: 'Manrope', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--body); min-height: 100vh; overflow-x: hidden; padding-right: calc(var(--tag) + 4px); }
a { color: inherit; }
code { font-family: var(--mono); }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }

/* the lid: a thin strip, not a header */
.lid { display: flex; align-items: center; gap: 9px; padding: 10px 10px 4px 14px; max-width: 1120px; margin: 0 auto; }
.lid-mark { display: flex; align-items: center; gap: 7px; text-decoration: none; font: 800 15px/1 var(--disp); }
.lid-mark img { border-radius: 7px; display: block; }
.lid-jar { flex: 1; min-width: 0; font: 10.5px/1.2 var(--mono); color: var(--dim); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lid-hand { flex: none; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 700; }
.lid-hand.is-on { background: var(--ink); color: var(--lime); font-family: var(--mono); font-weight: 400; }

/* the jar tag: the CA, hung on the right edge at every width */
.jartag { position: fixed; z-index: 30; right: 0; top: 50%; transform: translateY(-50%); width: var(--tag); padding: 12px 8px 10px 10px;
  display: flex; flex-direction: column; gap: 8px; background: var(--ink); color: var(--paper); border-radius: 14px 0 0 14px; box-shadow: -4px 6px 0 var(--lime); }
.jartag::before { content: ''; position: absolute; left: 50%; top: -9px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; border: 3px solid var(--ink); background: var(--paper); }
.jartag-k { font: 600 9px/1.25 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--lime); }
.jartag-addr { display: block; font: 500 9.5px/1.35 var(--mono); word-break: break-all; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; color: #FFF; }
.jartag-addr.is-wait { color: #BFA9B9; user-select: none; }
.jartag-copy { border: 0; border-radius: 8px; background: var(--lime); color: var(--lime-ink); padding: 8px 0; font: 700 12px/1 var(--mono); }
.jartag-copy:disabled { background: #4A2443; color: #A88EA2; }
.jartag-copy.is-done { background: #FFF; color: var(--ink); }
.jartag-gm { font: 10px/1 var(--mono); color: #CDB8C7; text-align: center; }

.pantry { max-width: 1120px; margin: 0 auto; padding: 4px 10px 28px 14px; display: flex; flex-direction: column; gap: 12px; }

/* the shelf: the outbid moment, the live sentence, the jar and the dial */
.shelf { background: var(--card); border: 1.5px solid var(--ink); border-radius: 18px; padding: 12px 12px 0; box-shadow: 0 6px 0 var(--plum); }
.shelf-flash { margin: 0 0 6px; display: flex; gap: 8px; align-items: flex-start; font: 600 13px/1.35 var(--body); color: var(--plum); }
.flash-pip { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--lime); border: 1.5px solid var(--ink); margin-top: 4px; }
.shelf-flash.is-quiet .flash-pip { background: var(--line); }
.shelf-flash.is-fresh { animation: jolt .9s ease-out; }
@keyframes jolt { 0% { transform: translateY(-4px); background: var(--lime-soft); } 100% { transform: none; background: transparent; } }
.shelf-live { margin: 0 0 10px; font: 700 18px/1.28 var(--disp); }
.shelf-live b { background: var(--lime); padding: 0 4px; border-radius: 4px; }
.shelf-live code { font-size: .74em; background: #ECEEDB; padding: 1px 5px; border-radius: 5px; }
.shelf-live .t { font-family: var(--mono); color: var(--plum); font-size: .9em; }
.shelf-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 10px; align-items: end; }
.glass { position: relative; height: 290px; }
.glass-line { position: absolute; inset: 0; width: 100%; height: 100%; }
.glass-line path { fill: rgba(91, 31, 78, .04); stroke: var(--ink); stroke-width: 2; }
.glass-line path + path { fill: none; stroke-width: 1.5; }
.layers { position: absolute; left: 8%; right: 8%; bottom: 4%; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column-reverse; gap: 3px; max-height: 76%; overflow: hidden; }
.layer { position: relative; display: flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 7px; border-radius: 6px; background: #E6D7E1; color: var(--ink); font: 10.5px/1.15 var(--mono); overflow: hidden; }
.layer::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 20%; background: repeating-linear-gradient(135deg, var(--lime) 0 3px, #DDEFB0 3px 6px); }
.layer > * { position: relative; z-index: 1; }
.layer-a { font-weight: 600; }
.layer-w { color: var(--mute); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-s { color: var(--mute); font-size: 9.5px; padding-right: 22%; white-space: nowrap; }
.layer.is-top { background: var(--lime); border: 1.5px solid var(--ink); }
.layer.is-top::after { display: none; }
.layer.is-top .layer-w, .layer.is-top .layer-s { color: var(--ink); padding-right: 0; }
.layer.is-fresh { animation: drop .7s cubic-bezier(.2,1.4,.4,1); }
@keyframes drop { 0% { transform: translateY(-120px); opacity: .2; } 100% { transform: none; opacity: 1; } }
.layer.is-ghost { background: transparent; border: 1.5px dashed var(--plum); color: var(--plum); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { background: var(--lime-soft); } }
.layer.is-ghost::after { display: none; }
.layer.is-ghost .layer-w, .layer.is-ghost .layer-s { color: var(--plum); padding-right: 0; }
.layer.is-sediment { min-height: 18px; background: #EFE6EC; color: var(--dim); font-size: 9.5px; }
.glass-note { margin: 6px 0 0; padding: 7px 0 9px; border-top: 1.5px solid var(--ink); text-align: center; font: 10px/1.3 var(--mono); color: var(--mute); }

.gauge { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-bottom: 8px; }
.dial { --q: 1; position: relative; width: 100px; height: 100px; border-radius: 50%; padding: 8px; border: 1.5px solid var(--ink);
  background: conic-gradient(var(--plum) calc(var(--q) * 360deg), #E9EBD6 0); transition: background .5s; }
.dial.is-low { background: conic-gradient(#C2185B calc(var(--q) * 360deg), #E9EBD6 0); }
.dial-ticks { position: absolute; inset: 2px; border-radius: 50%; background: repeating-conic-gradient(from -1deg, var(--card) 0 2deg, transparent 2deg 36deg); -webkit-mask: radial-gradient(circle, transparent 41px, #000 42px); mask: radial-gradient(circle, transparent 41px, #000 42px); }
.dial-face { position: relative; width: 100%; height: 100%; border-radius: 50%; background: var(--lime); border: 1.5px solid var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dial-face b { font: 600 20px/1 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.dial-face i { font-style: normal; font: 8.5px/1.2 var(--mono); color: var(--plum); margin-top: 4px; text-transform: uppercase; letter-spacing: .06em; }
.gauge-read { margin: 0; width: 100%; display: flex; flex-direction: column; gap: 5px; }
.gauge-read div { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: 4px; }
.gauge-read dt { font: 8.5px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.gauge-read dd { margin: 1px 0 0; font: 700 15px/1.2 var(--disp); font-variant-numeric: tabular-nums; }
.gauge-read dd.is-cut { color: var(--lime-deep); }

/* the raise form */
.bid { background: var(--ink); color: var(--paper); border-radius: 18px; padding: 12px; }
.bid-row { display: flex; gap: 8px; align-items: stretch; }
.bid-field { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; background: #3A1634; border-radius: 12px; padding: 6px 10px 7px; border: 1.5px solid transparent; }
.bid-field:focus-within { border-color: var(--lime); }
.bid-lbl { grid-column: 1 / -1; font: 9.5px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: #C9B3C3; }
.bid-field input { min-width: 0; width: 100%; border: 0; background: transparent; color: #FFF; font: 600 20px/1.2 var(--mono); padding: 2px 0 0; outline: none; }
.bid-field input::placeholder { color: #8E6E87; }
.bid-unit { align-self: end; font: 10px/1.8 var(--mono); color: #C9B3C3; padding-left: 4px; }
.bid-go { flex: none; min-width: 92px; max-width: 42%; white-space: normal; border: 0; border-radius: 12px; background: var(--lime); color: var(--lime-ink); font: 800 15px/1.1 var(--disp); padding: 0 14px; }
.bid-go:disabled { background: #4A2443; color: #A88EA2; }
.bid-steps { display: flex; gap: 6px; align-items: center; margin-top: 9px; flex-wrap: wrap; }
.step { border: 1px solid #6A3A60; background: transparent; color: #F2E6EE; border-radius: 999px; padding: 5px 10px; font: 11.5px/1.2 var(--mono); }
.step:hover { border-color: var(--lime); }
.bid-how { margin-left: auto; font-size: 12px; color: var(--lime); }
.bid-fine { margin: 8px 0 0; font-size: 12.5px; line-height: 1.4; color: #D8C6D2; }
.bid-fine b { color: var(--lime); }

/* the tape */
.tape { background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 12px 13px 14px; }
.tape-h { display: flex; justify-content: space-between; align-items: baseline; font: 10px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--mute); }
.tape-h a { color: var(--plum); font-weight: 600; }
.tape-h2 { margin-top: 14px; }
.tape-roll { list-style: none; margin: 8px 0 0; padding: 0; max-height: 300px; overflow-y: auto; }
.tape-roll li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 13px; line-height: 1.4; }
.tape-roll li:first-child { border-top: 0; }
.tape-roll time { font: 10.5px/1.75 var(--mono); color: var(--dim); }
.tape-roll b { background: var(--lime); padding: 0 3px; border-radius: 3px; font-weight: 700; }
.tape-roll code { font-size: 11.5px; color: var(--plum); }
.tape-roll li.is-new { animation: print .8s ease-out; }
@keyframes print { 0% { background: var(--lime-soft); } 100% { background: transparent; } }
.tape-roll li.tape-none { display: block; color: var(--mute); }
.tape-tools { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tape-btn { flex: 1 1 130px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; font-weight: 700; }
.tape-btn:disabled { color: var(--dim); border-color: var(--line); }
.tape-btn.is-hot { background: var(--lime); }
.tape-past { list-style: none; margin: 6px 0 0; padding: 0; }
.tape-past li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--mute); }
.tape-past b { color: var(--ink); font-family: var(--mono); font-weight: 600; }

/* the warning label: the rules */
.label { border: 2px solid var(--ink); border-radius: 6px; padding: 0 0 14px; background: #FFFDF2; overflow: hidden; }
.label-h { margin: 0 0 10px; padding: 9px 14px; background: var(--lime); border-bottom: 2px solid var(--ink); font: 800 14px/1.2 var(--disp); text-transform: uppercase; letter-spacing: .05em; }
.label-list { margin: 0 14px; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; line-height: 1.5; }
.label-case { margin: 12px 14px 0; border-top: 1.5px dashed var(--ink); padding-top: 10px; }
.label-case span { font: 10px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--mute); }
.label-case p { margin: 5px 0 0; font-size: 13.5px; line-height: 1.55; }
.label-case b { font-family: var(--mono); font-weight: 600; color: var(--plum); }

/* the base */
.base { max-width: 1120px; margin: 0 auto; padding: 18px 14px 40px; border-top: 1.5px solid var(--ink); color: var(--mute); font-size: 12.5px; }
.base-links { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
.base-links a { color: var(--ink); font-weight: 600; }
.base-refs { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font: 11px/1.45 var(--mono); }
.base-refs dt { color: var(--dim); }
.base-refs dd { margin: 0; word-break: break-all; }
.base-note { margin: 12px 0 0; }

/* the drawer: routed views */
.drawer { position: fixed; inset: 0; z-index: 60; background: rgba(43, 14, 38, .5); display: flex; align-items: flex-end; justify-content: center; }
.drawer[hidden] { display: none; }
.drawer-card { width: 100%; max-width: 640px; max-height: 84vh; overflow: auto; background: var(--card); border-radius: 18px 18px 0 0; padding: 14px 16px 24px; border-top: 2px solid var(--ink); }
.drawer-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font: 800 16px/1.2 var(--disp); }
.drawer-x { border: 1.5px solid var(--ink); background: transparent; color: var(--ink); border-radius: 8px; padding: 5px 10px; font-size: 12px; }
.drawer-body { font-size: 14px; }
.drawer-body table { width: 100%; border-collapse: collapse; font: 12px/1.4 var(--mono); }
.drawer-body th, .drawer-body td { text-align: left; padding: 6px 4px; border-top: 1px solid var(--line); }
.drawer-body th { color: var(--mute); font-weight: 400; }
.picks { display: flex; flex-direction: column; gap: 8px; }
.picks button { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); border-radius: 10px; padding: 10px 12px; }
.picks img { width: 24px; height: 24px; }

.toasts { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--lime); font: 600 13px/1.3 var(--body); padding: 8px 14px; border-radius: 10px; }

/* ~ tablet: one column still, wider measure, a bigger jar, a wider tag */
@media (min-width: 640px) {
  :root { --tag: 150px; }
  .jartag { padding: 14px 12px 12px 14px; }
  .jartag-addr { font-size: 11px; }
  .pantry { padding: 6px 20px 32px; gap: 14px; }
  .shelf { padding: 16px 18px 0; }
  .shelf-live { font-size: 23px; }
  .shelf-row { grid-template-columns: minmax(0, 1fr) 170px; gap: 22px; }
  .glass { height: 360px; }
  .layer { min-height: 28px; font-size: 12px; }
  .dial { width: 156px; height: 156px; padding: 12px; }
  .dial-ticks { -webkit-mask: radial-gradient(circle, transparent 64px, #000 65px); mask: radial-gradient(circle, transparent 64px, #000 65px); }
  .dial-face b { font-size: 32px; }
  .dial-face i { font-size: 10px; }
  .gauge-read dd { font-size: 19px; }
  .bid { padding: 16px 18px; }
}

/* desktop: the page recomposes — the jar left, the form and the tape in a second column, the label under the jar */
@media (min-width: 1000px) {
  :root { --tag: 196px; }
  .jartag-addr { font-size: 12px; }
  .jartag-k { font-size: 10px; }
  .lid { padding: 16px 20px 8px; }
  .pantry { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "shelf bid" "shelf tape" "label tape"; grid-template-rows: auto 1fr auto; align-items: start; column-gap: 24px; row-gap: 16px; padding: 8px 20px 40px; }
  .shelf { grid-area: shelf; padding: 20px 22px 0; }
  .shelf-live { font-size: 28px; }
  .shelf-row { grid-template-columns: minmax(0, 1fr) 200px; }
  .glass { height: 420px; }
  .layer { min-height: 32px; font-size: 12.5px; }
  .dial { width: 188px; height: 188px; padding: 14px; }
  .dial-ticks { -webkit-mask: radial-gradient(circle, transparent 78px, #000 79px); mask: radial-gradient(circle, transparent 78px, #000 79px); }
  .dial-face b { font-size: 38px; }
  .bid { grid-area: bid; padding: 20px; }
  .bid-field input { font-size: 24px; }
  .tape { grid-area: tape; }
  .tape-roll { max-height: 460px; }
  .label { grid-area: label; }
  .base { padding: 22px 20px 48px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 40px; }
  .base-note { grid-column: 1 / -1; }
  .drawer { align-items: center; }
  .drawer-card { border-radius: 18px; border: 2px solid var(--ink); }
}
