#app {
  background-color: #e8d7b4;
  background-image:
    linear-gradient(90deg, transparent 36px, rgba(139,30,24,.14) 36px, rgba(139,30,24,.14) 37px, transparent 37px),
    repeating-linear-gradient(180deg, transparent 0, transparent 31px, rgba(168,146,106,.16) 32px);
  padding: max(1.1rem, env(safe-area-inset-top)) max(1.4rem, env(safe-area-inset-right)) max(2.8rem, env(safe-area-inset-bottom)) max(2.6rem, env(safe-area-inset-left));
}
#app::before {
  content: "";
  position: absolute; left: 14px; top: 22px; bottom: 22px; width: 12px;
  background: radial-gradient(circle at 6px 8px, #1a1612 2.4px, transparent 2.8px);
  background-size: 12px 32px;
  opacity: .28; pointer-events: none;
}
.desk {
  display: grid;
  grid-template-columns: 1fr;
  gap: .85rem;
  min-width: 0;
}
.strip, .blotter, .inbox-wrap, .rail { min-width: 0; }
.strip {
  display: flex; gap: .35rem; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip img {
  height: 48px; width: 72px; object-fit: cover; flex: 0 0 auto;
  border: 1px solid #1a1612; filter: sepia(.2);
}
.cable {
  width: 100%;
  max-width: 36rem;
  position: relative;
  padding-right: 2.4rem;
}
.cable.off-spike { display: none; }
.actions { flex-direction: column; }
.actions button { width: 100%; min-height: 44px; text-align: left; }
.spike-bar { margin: 0; }
#lingo:not(.hidden) {
  position: fixed;
  left: max(1rem, env(safe-area-inset-left));
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  max-height: 42vh;
  z-index: 8;
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
}
#install { width: auto; margin-top: 1.4rem; font-size: .78rem; opacity: .7; padding: .4rem .8rem; }
.title-card { position: relative; max-width: 40rem; padding-right: 0; }
.sketchbook {
  display: flex;
  gap: .55rem;
  overflow-x: auto;
  margin: .2rem 0 1rem;
  padding-bottom: .15rem;
  scrollbar-width: thin;
}
.sketchbook figure { flex: 0 0 8.4rem; margin: 0; }
.sketchbook svg {
  display: block;
  width: 100%;
  height: 5.2rem;
  background: #f7ecd4;
  border: 1px solid #1a1612;
  box-shadow: 2px 2px 0 #cbb892;
}
.doodle { display: none; }
.doodle {
  position: absolute; top: .15rem; right: 0; width: 88px; height: 88px; margin: 0; float: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 88 88'><ellipse cx='44' cy='32' rx='26' ry='9' fill='none' stroke='%231a1612' stroke-width='1.3'/><path d='M18 32c5 16 47 16 52 0' fill='none' stroke='%231a1612'/><circle cx='44' cy='32' r='2.2' fill='%238b1e18'/><text x='10' y='78' font-size='7.5' font-family='Georgia' fill='%236d5d48'>not part of filing</text></svg>") no-repeat top center / contain;
}
.mark {
  position: absolute; top: .45rem; right: .4rem; width: 26px; height: 26px;
  background-repeat: no-repeat; background-size: contain; opacity: .7; pointer-events: none;
}
.mark-pen { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='none' stroke='%231a1612' stroke-width='1.6' d='M6 24l14-16 4 4L10 28H6z'/><path fill='none' stroke='%238b1e18' stroke-width='1.2' d='M18 10l4 4'/></svg>"); }
.mark-disc { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><ellipse cx='16' cy='16' rx='11' ry='5' fill='none' stroke='%231a1612' stroke-width='1.4'/><path fill='none' stroke='%231a1612' d='M5 16c2 6 18 6 22 0'/><circle cx='16' cy='16' r='1.5' fill='%238b1e18'/></svg>"); }
.mark-cage { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect x='8' y='6' width='16' height='20' fill='none' stroke='%231a1612' stroke-width='1.4'/><path stroke='%231a1612' d='M8 12h16M8 18h16M16 6v20'/></svg>"); }
.mark-hill { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='none' stroke='%238b1e18' stroke-width='1.5' d='M6 24V10h6v6h8V10h6v14'/></svg>"); }
.mark-pew { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='none' stroke='%231a1612' stroke-width='1.4' d='M16 6v20M10 12h12M8 26h16'/></svg>"); }
.mark-night { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='none' stroke='%231a1612' stroke-width='1.4' d='M20 8a8 8 0 1 0 4 14 10 10 0 0 1-4-14z'/></svg>"); }
.mark-bottle { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='none' stroke='%231a1612' stroke-width='1.4' d='M13 6h6v4l3 4v12H10V14l3-4z'/></svg>"); }
.mark-tube { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect x='12' y='4' width='8' height='24' rx='3' fill='none' stroke='%231a1612'/><circle cx='16' cy='16' r='2' fill='%238b1e18'/></svg>"); }
.mark-paper { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='none' stroke='%231a1612' d='M8 6h12l4 4v16H8z'/><path stroke='%231a1612' d='M20 6v4h4'/></svg>"); }
@media (min-width: 840px) {
  .desk {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .strip, .blotter { grid-column: 1 / -1; }
  .rail { grid-column: 1; }
  .inbox-wrap { grid-column: 2; }
  .actions button { width: auto; min-width: 12rem; }
}
@media (max-width: 839px) {
  .title-card { padding-right: 0; }
  .doodle { display: none; }
  .mast { flex-direction: column; align-items: flex-start; }
  .mast-right { text-align: left; }
  #begin, #experienced, #still-next, #still-skip, #next-week, #go-down, #setup-back, #resume, #wipe, #stairs { width: 100%; min-height: 44px; }
}
#next-week {
  position: sticky;
  bottom: max(.35rem, env(safe-area-inset-bottom));
  z-index: 5;
  margin: .25rem 0 1rem;
  box-shadow: 0 0 0 8px rgba(232,215,180,.92);
}
.cable { scroll-margin-top: 4.5rem; }

/* Desk objects, not one beige sheet. */
.grain { opacity: .07; }
.week {
  display: inline-block;
  max-width: 7.6rem;
  color: var(--ink);
  background: #f6ead0;
  border: 1px solid var(--ink);
  padding: .2rem .4rem;
  letter-spacing: .03em;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}
.title-card h1 {
  display: inline-block;
  border-bottom: 4px solid var(--stamp);
  padding-bottom: .15rem;
}
.cable {
  background:
    repeating-linear-gradient(180deg, transparent 0 27px, rgba(168,146,106,.22) 28px),
    #f7ecd4;
  border: 1px solid #1a1612;
  box-shadow: 5px 5px 0 #cbb892, 6px 6px 0 #1a1612;
  padding-left: 1.05rem;
}
.cable::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--stamp);
}
.cable h3 { font-size: 1.15rem; line-height: 1.25; margin: .15rem 0 .4rem; }
.stamp {
  display: inline-block;
  border: 2px solid var(--stamp);
  padding: .05rem .4rem .08rem;
  letter-spacing: .14em;
  transform: rotate(-1.5deg);
}
.blotter {
  border-top: 0;
  margin-top: .2rem;
  padding: .35rem .4rem .8rem 2.1rem;
  background:
    linear-gradient(90deg, transparent 1.35rem, rgba(139,30,24,.45) 1.35rem, rgba(139,30,24,.45) 1.42rem, transparent 1.42rem),
    repeating-linear-gradient(180deg, transparent 0 1.62rem, rgba(168,146,106,.55) 1.63rem);
}
.blotter h3 {
  margin: 0 0 .2rem;
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.blotter p { margin: 0; min-height: 1.62rem; font-size: .92rem; }
#roster h4, .lingo h4 {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .68rem;
}
.ending {
  background:
    repeating-linear-gradient(180deg, transparent 0 27px, rgba(168,146,106,.18) 28px),
    #f3e6c8;
  box-shadow: 7px 7px 0 var(--stamp);
}
.ending h2 { font-size: clamp(1.45rem, 4vw, 1.85rem); line-height: 1.15; margin: .2rem 0 .5rem; }
#next-week {
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .82rem;
  border: 2px solid #1a1612;
}
button:active { transform: translate(1px, 1px); }
button.term:active { transform: none; }
.spike-bar {
  border-left: 3px solid var(--stamp);
  padding: .15rem .5rem;
  background: #ead6b0;
}

@media (max-width: 839px) {
  #app {
    padding: max(.55rem, env(safe-area-inset-top)) max(.7rem, env(safe-area-inset-right)) max(5.2rem, calc(env(safe-area-inset-bottom) + 4.4rem)) max(.7rem, env(safe-area-inset-left));
    background-image: repeating-linear-gradient(180deg, transparent 0, transparent 31px, rgba(168,146,106,.16) 32px);
  }
  #app::before { display: none; }
  .mast {
    flex-direction: row;
    align-items: center;
    gap: .45rem;
    padding-top: .2rem;
    padding-bottom: .35rem;
    margin-bottom: .55rem;
  }
  .tod-stamp { width: 1.7rem; height: 1.7rem; font-size: .48rem; }
  .prod { font-size: 1rem; letter-spacing: .18em; }
  .sub {
    max-width: 46vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .68rem;
  }
  .mast-right { margin-left: auto; text-align: right; }
  .rank { display: none; }
  .week { font-size: .68rem; padding: .08rem .35rem; }
  #stairs {
    width: auto;
    min-height: 36px;
    margin-top: .2rem;
    padding: .25rem .55rem;
    font-size: .72rem;
  }
  .rail { display: contents; }
  .desk { display: flex; flex-direction: column; gap: .65rem; }
  .strip { order: 0; }
  #lamps { order: 1; }
  .inbox-wrap { order: 2; padding-bottom: 4.8rem; }
  #meters { order: 3; }
  #roster { order: 4; }
  .lingo-btn { order: 5; }
  #lingo { order: 6; }
  .blotter { order: 7; }
  .lamp-pair { gap: .2rem; padding: .28rem 0; }
  .lamp-row { font-size: .72rem; flex-wrap: wrap; }
  .lamp-row.held::after { display: none; }
  .lamp-row.held .lamp-word::after { content: " · goal"; letter-spacing: .04em; }
  .cable { box-shadow: 3px 3px 0 #1a1612; }
  #next-week:not(.hidden) {
    position: fixed;
    left: max(.7rem, env(safe-area-inset-left));
    right: max(.7rem, env(safe-area-inset-right));
    bottom: max(.4rem, env(safe-area-inset-bottom));
    width: auto;
    margin: 0;
    min-height: 48px;
    z-index: 7;
    box-shadow: 0 2px 0 #1a1612;
  }
  #lingo:not(.hidden) {
    bottom: max(4.4rem, calc(env(safe-area-inset-bottom) + 3.8rem));
  }
  .title-card h1 { font-size: 1.85rem; letter-spacing: .04em; }
}
@media (max-width: 560px) {
  .lamp-pair { grid-template-columns: 1fr; gap: .15rem; }
  .lamp-vs { display: none; }
  .lamp-row { flex-wrap: nowrap; font-size: .84rem; min-height: 1.7rem; }
  .lamp { width: 1.05rem; height: 1.05rem; }
}

.early-end { margin: .8rem 0 .4rem; }
.addendum {
  margin-top: .8rem;
  padding: 1rem 1rem .4rem;
  background: #f6ead0;
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 #cbb892;
}
.addendum h2 { font-size: 1.35rem; margin: .2rem 0 .6rem; }
.addendum h3 { font-size: .95rem; margin: .9rem 0 .25rem; letter-spacing: .03em; }
.addendum p { margin: .35rem 0 .55rem; }
.rank-card { margin: 0 0 .7rem; padding-bottom: .4rem; border-bottom: 1px solid #1a1612; }
