@media (min-width: 1024px) {
  .mobile-bar,
  .mobile-filters {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
  }
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  padding: 0 !important;
}
.refresh-btn svg { display: block; }
.refresh-btn.spin svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.top-nav .refresh-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #f4f1ec;
}
.top-nav .refresh-btn:hover { background: #2a2a2a; }

.pin-wrap { position: relative; margin-bottom: 10px; }
.pin-wrap input { margin-bottom: 0; padding-right: 64px; }
#pin-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  padding: 6px 8px;
  background: transparent;
  color: #b9b3aa;
  border: 0;
  font: 12px Outfit, system-ui, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.sheet-stack {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 1.15rem 0.75rem;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #111;
}
.sheet-kicker {
  margin: 0;
  font: 11px "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(244 241 236 / 0.45);
}
.sheet-title {
  margin: 0.2rem 0 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  color: #f4f1ec;
}
.sheet-move {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 1rem 0;
}
.sheet-move .move-btn { margin: 0; min-height: 2.75rem; }
.sheet-move .move-btn:not(.live) {
  background: rgb(244 241 236 / 0.08);
  border-color: transparent;
  color: #f4f1ec;
}

@media (max-width: 1023px) {
  html, body {
    overscroll-behavior: none;
    height: 100%;
    overflow-x: hidden;
  }
  html.sheet-open, body.sheet-open {
    overflow: hidden;
    height: 100%;
  }
  body {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding-bottom: env(safe-area-inset-bottom);
    background: #f4f1ec;
  }
  .top,
  .desk-chrome {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    flex: 0 0 0 !important;
  }
  .mobile-bar {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    width: 100%;
    padding: 0.5rem 0.75rem;
    padding-top: calc(0.5rem + env(safe-area-inset-top));
    background: #111;
    color: #f4f1ec;
  }
  .mobile-bar .brand { min-width: 0; }
  .mobile-bar .mark { margin: 0; font-size: 1.15rem; color: #f4f1ec; }
  .mobile-bar .desk { color: #b9b3aa; }
  .mobile-search { flex: 1 1 0; min-width: 0; }
  .mobile-search input {
    width: 100%;
    height: 2.5rem;
    border: 0;
    border-radius: 0.5rem;
    background: rgb(244 241 236 / 0.1);
    color: #f4f1ec;
    padding: 0 0.75rem;
    font: 14px Outfit, system-ui, sans-serif;
    outline: none;
  }
  .mobile-search input::placeholder { color: rgb(244 241 236 / 0.45); }
  .mobile-search input:focus { box-shadow: 0 0 0 2px #ff5310; }
  .mobile-bar .icon-btn.ink {
    width: auto;
    min-width: 3.4rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 0;
    border-radius: 0.5rem;
    background: #ff5310;
    color: #111;
    font: 500 13px Outfit, system-ui, sans-serif;
  }
  .mobile-filters {
    display: flex !important;
    gap: 0.35rem;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 0 0 auto;
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: #f4f1ec;
    border-bottom: 1px solid #e6e1d8;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-filters::-webkit-scrollbar { display: none; }
  .mobile-filters button {
    height: 2.5rem;
    border: 0;
    border-radius: 999px;
    padding: 0 0.85rem;
    background: #fff;
    color: #111;
    box-shadow: 0 0 0 1px rgb(17 17 17 / 0.06), 0 1px 2px rgb(17 17 17 / 0.04);
    font: 500 13px Outfit, system-ui, sans-serif;
    white-space: nowrap;
    flex: none;
    cursor: pointer;
  }
  .mobile-filters button.on {
    background: #111;
    color: #f4f1ec;
    box-shadow: none;
  }
  .mobile-filters .refresh-btn {
    width: 2.5rem;
    padding: 0;
  }
  .stage {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: auto;
    padding: 0;
    overflow-x: hidden;
    min-width: 0;
  }
  .gutter,
  .pane.record,
  .pane.move,
  .keys,
  #btn-reset-layout,
  .pane-head,
  .rail-hit {
    display: none !important;
  }
  .pane.queue {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    flex: 1;
    min-height: 0;
    min-width: 0;
    height: auto;
    overflow-x: hidden;
  }
  .toolbar { flex-wrap: wrap; min-width: 0; }
  .toolbar input { display: none; }
  .toolbar .ink,
  .toolbar .paper { flex: 1; min-height: 2.5rem; }
  .list {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 24px;
    overflow-x: hidden;
    overflow-y: auto;
    min-width: 0;
  }
  .row {
    display: grid;
    grid-template-columns: 24px 28px minmax(0, 1fr) 28px;
    gap: 8px;
    align-items: start;
    padding: 12px 10px;
    min-height: 3rem;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
  .row-main { min-width: 0; }
  .row-title {
    display: block;
    min-width: 0;
  }
  .row-title strong {
    display: block;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
  }
  .row-title time { display: none; }
  .subline {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
    padding-top: 2px;
  }
  .due-chip, .count-chip {
    display: inline;
    white-space: nowrap;
  }
  .done-dot { width: 24px; height: 24px; margin-top: 2px; }
  .avatar { margin-top: 1px; }
  .row-del { opacity: 1; width: 28px; height: 28px; }
  .minis, .projects-row {
    padding-left: 12px;
    padding-right: 12px;
    min-width: 0;
  }
  .mini, .proj { min-height: 2.5rem; }
  .scrim { background: rgba(17, 17, 17, 0.72); }
  .sheet {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 92dvh;
    height: 92dvh;
    padding: 0;
    color: #f4f1ec;
    left: 0;
    right: 0;
    bottom: 0;
  }
  .sheet.hidden {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    visibility: hidden !important;
  }
  .sheet.sheet-arm,
  .sheet.sheet-arm * {
    pointer-events: none !important;
  }
  .sheet-close {
    position: static;
    width: 2.75rem;
    height: 2.75rem;
    background: rgb(244 241 236 / 0.1);
    color: #fff;
    border: 0;
    border-radius: 0.5rem;
    font-size: 1.4rem;
    cursor: pointer;
    flex-shrink: 0;
  }
  .sheet .record {
    margin: 0 1rem;
    overflow: visible;
  }
  .flash {
    top: calc(8px + env(safe-area-inset-top));
    right: 12px;
    left: auto;
    bottom: auto;
    max-width: 60vw;
  }
}
