:root {
  color-scheme: light;
  --bg: #fffdfa;
  --panel: #f6f4f0;
  --ink: #25241f;
  --muted: #696962;
  --line: #e3e0d8;
  --accent: #af4030;
  --tint: #f6e6df;
  --safe: env(safe-area-inset-bottom, 0px);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
[hidden] {
  display: none !important;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  cursor: pointer;
  background: transparent;
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #497aa1;
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.primary {
  background: var(--accent);
  color: white;
  border-radius: 9px;
  padding: 12px 17px;
  font-weight: 650;
}
.quiet,
.danger {
  color: var(--muted);
  min-height: 44px;
}
.danger {
  color: #ac3027;
}
.icon-button {
  height: 44px;
  min-width: 44px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 21px;
}
.icon-button:hover,
.nav-btn:hover,
.task-main:hover,
.add-row:hover {
  background: var(--panel);
}
.entry {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.entry-card {
  max-width: 365px;
  width: 100%;
  display: grid;
  justify-items: start;
  gap: 15px;
}
.entry img,
.brand img {
  border-radius: 23%;
}
.entry h1,
.entry p {
  margin: 0;
}
.entry p {
  line-height: 1.55;
  color: var(--muted);
}
#pair-code {
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 3px;
  user-select: all;
}
#shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100dvh;
}
aside {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 30px 14px 18px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 23px;
  letter-spacing: -0.8px;
  font-weight: 750;
  margin: 0 8px 20px;
}
aside > .primary {
  margin: 0 5px 16px;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 7px 12px;
  text-align: left;
  overflow-wrap: anywhere;
  width: 100%;
  border-radius: 8px;
  color: #575650;
  font-size: 15px;
}
.nav-btn.selected,
.chip.selected {
  background: var(--tint);
  color: #852e21;
  font-weight: 650;
}
.nav-btn svg {
  width: 19px;
  height: 19px;
  flex: none;
}
.badge {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 13px;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color);
  display: inline-block;
  flex: none;
}
.side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 9px 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.side-heading button {
  font-size: 22px;
  width: 44px;
  min-height: 44px;
}
.sidebar-end {
  margin-top: auto;
  text-align: left;
  padding-left: 12px;
  font-size: 13px;
}
main {
  max-width: 1660px;
  width: 100%;
  margin: auto;
  align-self: start;
  padding: 24px clamp(20px, 3.6vw, 56px) 90px;
  min-width: 0;
  margin-top: 0;
}
.contextbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.crumb {
  font-weight: 650;
}
header,
.dialog-head,
.dialog-foot,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
header {
  margin: 35px 0 27px;
}
header > div {
  min-width: 0;
}
#view-title {
  overflow-wrap: anywhere;
}
h1 {
  font-size: clamp(32px, 3.7vw, 54px);
  line-height: 1.07;
  letter-spacing: -0.055em;
  margin: 0;
  font-weight: 720;
}
#view-count {
  font-size: 14px;
  color: var(--muted);
  margin: 8px 0 0;
}
.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.5vw, 24px);
  align-items: start;
}
.group {
  min-width: 0;
  border-top: 3px solid var(--color, var(--line));
  padding-top: 10px;
}
.section-head {
  min-height: 40px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.section-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  min-width: 0;
  font-weight: 680;
  font-size: 17px;
  text-align: left;
  overflow-wrap: anywhere;
}
.section-count {
  color: var(--muted);
  font-size: 13px;
}
.item {
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.check {
  min-width: 44px;
  min-height: 46px;
  display: grid;
  place-items: center;
}
.ring {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1.6px solid var(--ring, #aaa79e);
  border-radius: 50%;
  font-size: 12px;
  color: var(--muted);
}
.checked .ring {
  background: var(--panel);
}
.checked .task-name {
  text-decoration: line-through;
  color: var(--muted);
}
.task-main {
  text-align: left;
  padding: 13px 2px 12px 3px;
  flex: 1;
  min-width: 0;
  border-radius: 5px;
  line-height: 1.36;
}
.task-name {
  display: block;
  overflow-wrap: anywhere;
  font-size: 16px;
}
.meta {
  margin-top: 5px;
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.meta > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.late {
  color: var(--accent);
}
.add-row,
.more-tasks {
  color: var(--muted);
  font-size: 14px;
  min-height: 44px;
  width: 100%;
  text-align: left;
  padding: 8px;
}
.add-row span {
  font-size: 21px;
  vertical-align: -1px;
  color: var(--accent);
  margin-right: 6px;
}
.more-tasks {
  color: var(--accent);
}
.empty {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  margin: 24px 4px;
}
.stream {
  max-width: 800px;
}
.stream .group {
  margin-bottom: 26px;
}
.stream .section-head {
  border-bottom: 1px solid var(--line);
}
.chips,
#bottom-nav,
#fab {
  display: none;
}
#search-box {
  max-width: 800px;
  margin-bottom: 24px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  max-width: 480px;
  width: calc(100% - 32px);
  max-height: 88dvh;
  overflow: auto;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 22px 80px #21190e30;
}
dialog::backdrop {
  background: #211d1a55;
}
.dialog-head h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.03em;
}
.dialog-head {
  margin-bottom: 10px;
}
.dialog-head .close {
  font-size: 28px;
}
.editor-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
}
label,
.steps-title {
  display: block;
  font-size: 13px;
  font-weight: 620;
  margin: 11px 0 5px;
  color: #595950;
}
input:not([type="checkbox"]),
textarea,
select {
  display: block;
  font-size: 16px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 43px;
  border-radius: 7px;
  border: 1px solid #cdcac2;
  background: white;
  padding: 9px 11px;
  margin-top: 5px;
  outline-color: var(--accent);
}
textarea {
  resize: vertical;
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}
.dialog-foot {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.dialog-foot .primary {
  margin-left: auto;
}
.step {
  display: flex;
  align-items: center;
  gap: 7px;
}
.step input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: none;
}
.step button {
  height: 44px;
  min-width: 36px;
}
.menu-action {
  min-height: 46px;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
#notice {
  position: fixed;
  z-index: 8;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(21px + var(--safe));
  background: #292822;
  color: white;
  border-radius: 10px;
  padding: 11px 15px;
  max-width: min(490px, 90vw);
  overflow-wrap: anywhere;
  font-size: 14px;
}
body:has(dialog[open]) {
  overflow: hidden;
}
dialog #notice {
  position: sticky;
  transform: none;
  left: auto;
  bottom: 0;
  margin-top: 12px;
}
.drop {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}
@media (min-width: 761px) and (max-width: 1180px) {
  #shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  #shell {
    display: block;
  }
  aside {
    display: none;
  }
  main {
    padding: calc(15px + env(safe-area-inset-top, 0px))
      max(18px, env(safe-area-inset-right)) calc(140px + var(--safe))
      max(18px, env(safe-area-inset-left));
  }
  .contextbar {
    font-size: 12px;
    padding-bottom: 10px;
  }
  .contextbar .crumb {
    color: var(--accent);
  }
  header {
    margin: 19px 0 16px;
  }
  h1 {
    font-size: 34px;
  }
  .board {
    display: flex;
    flex-direction: column;
    gap: 17px;
  }
  .group {
    width: 100%;
    padding: 5px 0 0;
    border-top-width: 2px;
  }
  .section-head {
    padding-bottom: 3px;
  }
  .task-main {
    padding: 12px 4px;
  }
  .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px -2px 19px;
    padding: 2px;
  }
  .chips:empty {
    display: none;
  }
  .chip {
    white-space: nowrap;
    font-size: 14px;
    min-height: 44px;
    max-width: 100%;
    border-radius: 12px;
    padding: 6px 11px;
    background: var(--panel);
    display: flex;
    gap: 7px;
    align-items: center;
  }
  .chip .dot {
    width: 7px;
    height: 7px;
  }
  .chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .section-name {
    min-height: 40px;
  }
  #bottom-nav {
    display: flex;
    position: fixed;
    z-index: 3;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top: 1px solid var(--line);
    height: calc(62px + var(--safe));
    padding: 3px max(5px, env(safe-area-inset-right)) var(--safe)
      max(5px, env(safe-area-inset-left));
    justify-content: space-around;
  }
  #bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    min-width: 0;
    min-height: 48px;
    font-size: 11px;
    color: var(--muted);
  }
  #bottom-nav button.selected {
    color: var(--accent);
    font-weight: 700;
  }
  #bottom-nav svg {
    width: 21px;
    height: 21px;
  }
  #fab {
    display: grid;
    place-content: center;
    position: fixed;
    bottom: calc(75px + var(--safe));
    right: max(18px, env(safe-area-inset-right));
    z-index: 2;
    border-radius: 18px;
    width: 55px;
    height: 55px;
    background: var(--accent);
    color: white;
    font:
      300 34px/1 -apple-system,
      sans-serif;
    box-shadow: 0 4px 13px #752a2133;
  }
  #notice {
    bottom: calc(82px + var(--safe));
  }
  dialog {
    position: fixed;
    inset: auto 0 var(--keyboard, 0px);
    margin: 0;
    max-width: none;
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 13px max(18px, env(safe-area-inset-right)) calc(18px + var(--safe))
      max(18px, env(safe-area-inset-left));
    max-height: min(88dvh, calc(var(--visual-height, 100dvh) - 12px));
  }
  #editor .dialog-head {
    position: sticky;
    z-index: 1;
    top: -13px;
    padding: 10px 0 7px;
    margin-top: -10px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }
  #editor h2 {
    font-size: clamp(18px, 5.2vw, 23px);
  }
  #editor :is(input, select, textarea) {
    scroll-margin-top: 72px;
  }
  #editor #save {
    padding-inline: 12px;
  }
  .stream .group {
    margin-bottom: 18px;
  }
}
