:root {
  color-scheme: light;
  --ink: #252521;
  --hairline: #dfdfd9;
  --paper: #fff;
}
* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--hand);
  -webkit-font-smoothing: antialiased;
}
button, select { font: inherit; color: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
:focus-visible { outline: 3px solid #455ad0; outline-offset: 4px; }
.workspace { display: flex; flex-direction: column; height: 100vh; height: 100dvh; width: min(100%, 1570px); padding: 0 clamp(22px, 4.7vw, 78px); margin: auto; }
.mast {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: clamp(10px, 2vw, 32px);
  flex: none; min-height: clamp(80px, 14vh, 147px); border-bottom: 1px solid var(--hairline);
}
#brand { display: flex; align-items: center; justify-self: start; margin: 0; line-height: 1; }
.controls { display: flex; align-items: center; gap: clamp(12px, 2vw, 30px); }
.owner-control {
  position: relative; display: flex; align-items: center; isolation: isolate;
  background: white; border: 1px solid #bbbcb4; border-radius: 8px;
  box-shadow: 0 2px 0 #e7e7e2; height: 43px;
}
.owner-control:hover { border-color: #7d7e76; }
.owner-icon { position: absolute; width: 19px; height: 19px; left: 12px; pointer-events: none; }
#owner {
  appearance: none; border: 0; background: transparent; border-radius: 8px;
  padding: 0 35px 0 39px; height: 100%; width: 100%; min-width: 108px;
  font-family: var(--hand); font-size: 1.18rem; line-height: 1.1;
}
.chevron { position: absolute; right: 14px; border: solid currentColor; border-width: 0 1.6px 1.6px 0; width: 6px; height: 6px; transform: translateY(-2px) rotate(45deg); pointer-events: none; }
#period { display: inline-flex; align-items: center; gap: 2px; border: 1px solid #c7c8c1; background: #f5f5f2; padding: 3px; border-radius: 9px; }
#period button { border: 1px solid transparent; background: transparent; border-radius: 6px; font-size: 1.18rem; min-width: 54px; padding: 3px 10px 4px; height: 35px; line-height: 1; }
#period button[aria-pressed=true] { background: #fff; border-color: #bfc0b9; box-shadow: 0 1px 2px #2e302518; }
#period button:hover { background: white; }
#period button span { display: inline-block; }
#session { display: flex; gap: 6px; align-items: center; }
#session:empty { display: none; }
#session form { display: flex; margin: 0; }
#paint-brush {
  appearance: none; display: grid; place-items: stretch; background: transparent;
  border: 0; border-radius: 45%; padding: 0; touch-action: manipulation;
}
.session-button { border: 0; border-radius: 50%; width: 40px; height: 40px; background: transparent; color: #575953; display: grid; place-items: center; cursor: pointer; }
.session-button:hover, .session-button:focus-visible { background: #f2f2ee; color: var(--ink); }
.session-button svg { width: 21px; height: 21px; }
main { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; padding: clamp(16px, 3.8vh, 54px) 0 0; }
.board { display: grid; min-height: 0; grid-auto-rows: minmax(0, 1fr); grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2.2vw, 40px); }
.lane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.lane h2 { flex: none; margin: 0; text-align: center; font-size: clamp(1.5rem, 2.4vw, 2.2rem); line-height: 1.3; font-weight: 400; }
.bin {
  display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #c9c7c1 transparent; padding: 10px 0 3px; background: transparent;
  mask-image: linear-gradient(to bottom, transparent, #000 var(--fade-top, 0px),
    #000 calc(100% - var(--fade-bottom, 0px)), transparent);
}
.bin > .cassette-stack { flex: none; margin-block-start: auto; }
.source-tools {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  justify-self: center; gap: 2px; height: var(--desk-height); padding: 6px 0 max(3px, env(safe-area-inset-bottom));
}
.legend { display: flex; justify-content: center; align-items: center; list-style: none; gap: clamp(19px, 3vw, 48px); margin: 0; padding: 0; }
#paint-brush { width: clamp(90px, 9vw, 146px); height: clamp(34px, 4.7dvh, 47px); cursor: pointer; }
.legend li { display: flex; gap: 9px; align-items: center; font-size: 1.12rem; line-height: 1.4; }
.swatch { --chip: var(--rocket-internet, #aa96d4); --edge: color-mix(in srgb, var(--chip) 74%, #261e25); display: inline-block; width: 22px; height: 12px; border-radius: 3px; border: 1px solid var(--edge); background: var(--chip); position: relative; transform: skewY(-5deg); box-shadow: 1px 2px 0 var(--edge); }
.swatch::after { content: ""; position: absolute; left: 4px; right: 4px; top: 3px; height: 3px; border: 1px solid var(--edge); border-radius: 3px; background: #ffffffb3; }
.swatch.fresh { --chip: var(--rocket-fresh, #eabb62); }
.swatch.phone { --chip: var(--rocket-phone, #83ac94); }
/* Keep four physical stacks proportional to a desktop monitor, independently of the header. */
@media (min-width: 871px) and (hover: hover) and (pointer: fine) {
  main { grid-template-columns: minmax(0, 1fr); }
  .board {
    width: min(93.2vw, max(1540px, 82vw));
    justify-self: center;
    column-gap: clamp(6px, .78vw, 18px);
  }
}
@media (max-width: 870px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 7vw; row-gap: 16px; }
  .lane h2 { font-size: 1.75rem; }
}
@media (max-width: 870px) {
  .mast { grid-template-columns: 1fr auto; min-height: 0; gap: 3px 9px; padding: 3px 0 8px; }
  #brand .rocket-wordmark { width: 151px; }
  #session { grid-area: 1 / 2; justify-self: end; }
  .controls { grid-area: 2 / 1 / 3 / -1; gap: 9px; }
  #period button { min-width: 42px; padding-inline: 6px; }
  .owner-control { max-width: 48%; }
  .board { column-gap: 3vw; row-gap: 10px; }
  .bin { padding-top: 5px; }
  .lane h2 { font-size: 1.42rem; }
  main { padding-top: 10px; }
}
@media (max-width: 480px) {
  .workspace { padding-inline: max(14px, 4vw); }
  .controls { gap: 7px; }
  #owner { min-width: 82px; padding: 0 24px 0 31px; font-size: 1.05rem; }
  .owner-icon { width: 16px; left: 9px; }
  .chevron { right: 10px; }
  .owner-control { max-width: 42%; }
  #period button { font-size: 1.04rem; min-width: 37px; padding-inline: 5px; }
  .session-button { width: 32px; }
}

.rocket-tape[data-url] { cursor: grab; user-select: none; -webkit-user-select:none; -webkit-touch-callout:none; touch-action:pan-y; }
.rocket-tape.is-picked { cursor: grabbing; }
@media(max-width:650px) {
  .legend { gap: 11px; align-items: center; align-self:center; justify-self:center; }
  .legend li { font-size:.95rem; gap:4px; }
  .legend .swatch { width:14px; height:9px; }
  .legend .swatch::after { left:2px; right:2px; top:2px; height:2px; }
}
@media(max-width:560px) {
  .source-tools { margin-right: 22px; }
  #paint-brush { width: 86px; height: 35px; }
}
@media(max-width:360px) {
  .legend { gap: 6px; }
  .legend li { gap: 3px; font-size: .89rem; }
}
@media(max-height:520px) and (min-width:561px) {
  .mast { grid-template-columns: minmax(0, 1fr) auto auto; min-height: 50px; gap: 8px; padding: 3px 0; }
  .controls, #session { grid-area: auto; }
  .controls { gap: 8px; }
  .owner-control { width: clamp(124px, 23vw, 172px); max-width: none; }
  #period button { min-width: 38px; padding-inline: 6px; }
  #brand .rocket-wordmark { max-width: 122px; }
  #paint-brush { height:25px; width:80px; }
  .source-tools { gap:0; padding: 0; }
  .board { grid-template-columns: repeat(4,minmax(0,1fr)); gap:10px; }
  main { padding-top:7px; }
  .lane h2 { font-size:1.3rem; }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #period button, .owner-control { transition: box-shadow 110ms, background-color 110ms; }
  :is(#period button span, .session-button svg, .note-dialog button svg, .paint-tools button svg) {
    transition: transform 110ms ease-out;
  }
  #period button:hover, .owner-control:hover {
    box-shadow: inset 0 2px 3px #39372e2a;
    background-color: #f0efeb;
  }
  :is(#period button, .session-button, .note-dialog button, .paint-tools button):not(:disabled):hover > :is(span, svg) {
    transform: translateY(2px) scale(.96);
  }
}
