/* ফর্দ pages: the ruled ledger, rows, add box, balance, bazar mode, price pad, memo, khata, hisab, guide. */

/* ---------- List header ---------- */
.lh {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 't a' 'd d';
  align-items: center;
  column-gap: 8px;
  padding: 12px var(--pad-r) 8px var(--pad-l);
}
.lh-t {
  grid-area: t;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  min-width: 0;
  text-align: left;
}
.lh-t h1 {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: clamp(25px, 6.2vw, 32px);
  font-weight: 800;
  font-stretch: 86%;
  line-height: 1.3;
}
.lh-t .i {
  color: var(--ink-3);
  transition: transform 0.2s var(--ease);
}
.lh-t:hover .i {
  transform: translateY(2px);
}
.lh-d {
  grid-area: d;
  font-size: 14px;
  color: var(--ink-3);
}
.lh-a {
  grid-area: a;
  display: flex;
}
.sample {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  margin: 0 var(--pad-r) 10px var(--pad-l);
  padding: 7px 12px;
  font-size: 14px;
  color: var(--ink);
  background: var(--tint-y);
  border-radius: 6px;
}
.sample button {
  min-height: 40px;
  font-weight: 700;
  color: var(--alta);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Total strip (phone) ---------- */
.strip {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 8px var(--pad-r) 10px var(--pad-l);
  background: var(--paper);
  box-shadow: 0 7px 10px -9px rgba(40, 10, 30, 0.5);
}
.strip-sum {
  position: relative;
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  text-align: left;
  padding-bottom: 7px;
}
.strip-sum small {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.2;
}
.strip-n {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
}
.strip-m {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  color: var(--ink-2);
}
.strip-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--paper-3);
  border-radius: 2px;
  overflow: hidden;
}
.strip-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  width: var(--w);
  background: var(--leaf);
  transition: width 0.6s var(--ease);
}
.strip-bar.bad::after {
  background: var(--alta);
}
.strip .go {
  flex: none;
  align-self: center;
  min-height: 54px;
  padding: 8px 14px;
  font-weight: 700;
}
@media (min-width: 1080px) {
  .strip {
    display: none;
  }
}

/* ---------- Rolling numbers ---------- */
.roll {
  display: inline-flex;
  align-items: baseline;
  line-height: 1.25;
  white-space: nowrap;
}
.rd,
.rs {
  display: inline-block;
  height: 1.25em;
  line-height: 1.25em;
}
.rd {
  overflow: hidden;
  width: 0.58em;
}
.rc {
  display: block;
  transition: transform 0.75s cubic-bezier(0.16, 1.1, 0.3, 1);
}
.rc span {
  display: block;
  height: 1.25em;
  line-height: 1.25em;
  text-align: center;
}

/* ---------- The ruled ledger ---------- */
.ledger {
  position: relative;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px), var(--rule) var(--line));
  padding-bottom: var(--line);
}
.ledger::before,
.ledger::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  border-inline: 1px solid var(--margin);
  pointer-events: none;
  transform-origin: top;
  animation: ruleDrop 0.8s var(--ease) both;
}
.ledger::before {
  left: calc(var(--gl) + var(--tickw));
}
.ledger::after {
  right: calc(var(--gr) + var(--amtw));
}
@keyframes ruleDrop {
  from {
    transform: scaleY(0);
  }
}
.lg-head {
  display: none;
  height: var(--line);
  align-items: end;
  padding: 0 var(--gr) 8px var(--gl);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-3);
}
.lg-head span:last-child {
  text-align: right;
}
.lg-head span:nth-child(3),
.lg-head span:nth-child(4) {
  text-align: right;
  padding-right: 12px;
}
.lg-head span:nth-child(2) {
  padding-left: 14px;
}
@container (min-width: 500px) {
  .lg-head {
    display: grid;
    grid-template-columns: var(--tickw) minmax(0, 1fr) 104px 66px var(--amtw);
  }
  .r-main {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 104px 66px;
    align-items: center;
  }
  .row.big .r-main {
    grid-template-columns: minmax(0, 1fr) 118px 30px;
  }
  .r-qty,
  .r-rate {
    display: block !important;
    text-align: right;
    padding-right: 12px;
  }
  .row.big .r-rate {
    display: none !important;
  }
  .r-note {
    display: none;
  }
}
.cat {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: var(--line);
  padding: 0 var(--gr) 6px calc(var(--gl) + var(--tickw) + 14px);
}
.cat .glyph {
  position: absolute;
  left: calc(var(--gl) + 7px);
  bottom: 7px;
  width: 30px;
  height: 30px;
}
.cat-n {
  flex: 1;
  min-width: 0;
  font-family: var(--f-hand);
  font-size: 18px;
  font-weight: 600;
  color: var(--alta);
  line-height: 1.2;
}
.cat-s {
  width: var(--amtw);
  flex: none;
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  color: var(--alta);
}
.cat.miss {
  padding-left: calc(var(--gl) + var(--tickw) + 14px);
}

/* ---------- Rows ---------- */
.row {
  position: relative;
  z-index: 1;
  height: var(--line);
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.row-bg {
  position: absolute;
  inset: 0 0 1px;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding-inline: 18px;
  font-weight: 700;
  color: #fff;
}
.row-bg span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.12s;
}
.swiping .row-bg {
  display: flex;
}
.swiping[data-dir='r'] .row-bg {
  background: var(--leaf);
}
.swiping[data-dir='l'] .row-bg {
  background: var(--alta);
}
.swiping[data-dir='r'] .row-bg-r,
.swiping[data-dir='l'] .row-bg-l {
  opacity: 0.6;
}
.armed[data-dir='r'] .row-bg-r,
.armed[data-dir='l'] .row-bg-l {
  opacity: 1;
}
.row-in {
  position: relative;
  display: grid;
  grid-template-columns: var(--tickw) minmax(0, 1fr) var(--amtw);
  align-items: stretch;
  height: 100%;
  padding-left: var(--gl);
  padding-right: var(--gr);
  transform: translateX(var(--sx, 0));
  transition: transform 0.3s var(--ease), background-color 0.2s;
}
.swiping .row-in {
  transition: none;
  background: var(--paper);
}
.tick {
  display: grid;
  place-items: center;
  height: 100%;
}
.tk {
  width: 28px;
  height: 28px;
  overflow: visible;
  transition: transform 0.35s var(--spring);
}
.tk-o {
  fill: transparent;
  stroke: var(--ink-3);
  stroke-width: 2;
  transition: fill 0.2s, stroke 0.2s;
}
.tk-c {
  fill: none;
  stroke: var(--paper);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.3s 0.05s var(--ease);
}
.tick:hover .tk-o {
  stroke: var(--ink);
}
.tick:active .tk {
  transform: scale(0.84);
}
.row.bought .tk-o {
  fill: var(--leaf);
  stroke: var(--leaf);
}
.row.bought .tk-c {
  stroke-dashoffset: 0;
}
.row.bought .tk {
  animation: tickPop 0.42s var(--spring);
}
@keyframes tickPop {
  from {
    transform: scale(0.7) rotate(-14deg);
  }
}
.r-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding-left: 14px;
  padding-right: 6px;
  text-align: left;
}
.r-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}
.nm {
  position: relative;
  display: inline-block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 0.25s;
  padding-block: 1px;
}
.strike {
  position: absolute;
  left: -2px;
  right: -2px;
  top: 50%;
  width: calc(100% + 4px);
  height: 10px;
  margin-top: -5px;
  overflow: visible;
  clip-path: inset(-10px 100% -10px -10px);
  transition: clip-path 0.38s cubic-bezier(0.4, 0, 0.3, 1);
  pointer-events: none;
}
.strike path {
  fill: none;
  stroke: var(--alta);
  stroke-width: 2.4;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.row.bought .strike,
.row.missing .strike {
  clip-path: inset(-10px -10px -10px -10px);
}
.row.bought .nm,
.row.missing .nm {
  color: var(--ink-3);
}
.r-qty {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13.5px;
  line-height: 1.3;
  color: var(--ink-2);
}
.r-note {
  font-style: normal;
  color: var(--ink-3);
}
.r-rate {
  display: none;
  font-size: 15px;
  color: var(--ink-2);
}
.guess {
  color: var(--ink-3) !important;
}
.r-amt {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.r-none {
  color: var(--ink-3);
  font-weight: 400;
}
.flag {
  flex: none;
  padding: 0 5px;
  font-size: 11.5px;
  font-style: normal;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--paper-3);
  border-radius: 3px;
}
.flag.warn {
  color: #6b3a00;
  background: #ffdf9e;
}
.r-del {
  position: absolute;
  top: 50%;
  right: calc(var(--gr) + var(--amtw) + 8px);
  display: none;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  place-items: center;
  color: var(--ink-3);
  background: var(--paper-2);
  border-radius: 6px;
}
.r-del .i {
  width: 18px;
  height: 18px;
}
.r-del:hover {
  color: var(--alta);
}
@media (hover: hover) {
  .row:not(.big):hover .r-del,
  .r-del:focus-visible {
    display: grid;
  }
  .row:not(.big):hover .row-in {
    background: color-mix(in srgb, var(--marigold) 7%, transparent);
  }
}
.row.enter .row-in {
  animation: rowIn 0.42s var(--ease) both;
}
@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}
.nm.hold {
  opacity: 0;
}
.nm.inked {
  animation: inked 0.5s var(--ease);
}
@keyframes inked {
  from {
    color: var(--alta);
  }
}
.lg-total {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: var(--line);
  padding: 0 var(--gr) 8px calc(var(--gl) + var(--tickw) + 14px);
  font-weight: 700;
}
.lg-total > span {
  font-family: var(--f-hand);
  font-size: 20px;
  color: var(--ink);
}
.lg-total b {
  position: relative;
  font-size: 23px;
  font-weight: 800;
}
.lg-total b::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -6px;
  width: calc(var(--amtw) - 4px);
  height: 5px;
  border-block: 1.5px solid var(--ink);
}
.blank {
  position: relative;
  z-index: 1;
  padding: 18px var(--pad-r) 24px calc(var(--gl) + var(--tickw) + 14px);
}
.blank-t {
  font-family: var(--f-hand);
  font-size: 25px;
  font-weight: 600;
  color: var(--alta);
}
.blank-s {
  color: var(--ink-2);
  margin-top: 2px;
}
.blank-c {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* ---------- Add box ---------- */
.adder {
  position: sticky;
  bottom: 0;
  z-index: 6;
  background: var(--paper);
  box-shadow: 0 -8px 12px -10px rgba(40, 10, 30, 0.5);
}
.adder-top {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 10px var(--pad-r) 0 var(--pad-l);
}
.adder-top.open {
  display: flex;
  animation: rowIn 0.26s var(--ease) both;
}
.ap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 9px;
  font-size: 15px;
  color: var(--ink-2);
}
.ap .glyph {
  width: 26px;
  height: 26px;
}
.ap b {
  color: var(--ink);
  font-weight: 700;
  font-size: 16.5px;
}
.ap-t {
  color: var(--leaf);
  font-weight: 700;
}
.ap-c {
  margin-left: auto;
  padding: 0 7px 1px;
  font-size: 13px;
  font-weight: 600;
  color: var(--alta);
  background: color-mix(in srgb, var(--alta) 10%, transparent);
  border-radius: 3px;
}
.ac {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-inline: calc(var(--pad-l) * -1) calc(var(--pad-r) * -1);
  padding-inline: var(--pad-l) var(--pad-r);
}
.ac::-webkit-scrollbar {
  display: none;
}
.adder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px var(--pad-r) 10px var(--pad-l);
}
.adder-pen {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  color: var(--ink-3);
}
.adder-in {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 2px;
  font-size: 18px;
  font-weight: 500;
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--ink-3);
  border-radius: 0;
  transition: border-color 0.15s;
}
.adder-in::placeholder {
  color: var(--ink-3);
  font-weight: 400;
}
.adder-in:focus {
  outline: none;
  border-bottom-color: var(--alta);
}
.adder-paste {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 48px;
  color: var(--ink-2);
  border-radius: 8px;
}
.adder-paste:hover {
  background: var(--paper-2);
}
.adder-go {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 48px;
  color: var(--on-alta);
  background: var(--alta);
  border-radius: 8px 7px 9px 6px;
  box-shadow: 0 3px 0 var(--alta-lo);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.adder-go:active {
  transform: translateY(3px);
  box-shadow: none;
}
.adder-go .i {
  width: 26px;
  height: 26px;
}

/* ---------- Balance panel ---------- */
.r-h {
  font-size: 25px;
  font-weight: 800;
  font-stretch: 86%;
  margin-bottom: 4px;
}
.r-h3 {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  font-family: var(--f-hand);
  font-size: 20px;
  font-weight: 600;
  color: var(--alta);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 4px;
}
.sum {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.scale {
  width: min(100%, 400px);
  margin-inline: auto;
}
.scale-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.wt {
  opacity: 0;
  transition: opacity 0.25s;
}
.wt.on {
  opacity: 1;
}
.pans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: center;
}
.pans small {
  display: block;
  font-size: 13.5px;
  color: var(--ink-3);
}
.pans b {
  font-size: 25px;
  font-weight: 800;
}
.pan-r.bad b {
  color: var(--alta);
}
.verdict {
  padding: 8px 12px;
  font-size: 15.5px;
  font-weight: 500;
  text-align: center;
  color: var(--ink-2);
  background: var(--paper-2);
  border-radius: 6px;
  text-wrap: balance;
}
.verdict.ok {
  color: var(--leaf);
  background: color-mix(in srgb, var(--leaf) 10%, transparent);
}
.verdict.bad {
  color: var(--alta);
  background: color-mix(in srgb, var(--alta) 10%, transparent);
}
.sum-warn {
  font-size: 13.5px;
  text-align: center;
  color: var(--ink-3);
}
.sets {
  display: flex;
  flex-direction: column;
}
.setrow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 8px 2px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: padding-left 0.2s var(--ease), color 0.15s;
}
button.setrow:hover,
label.setrow:hover {
  padding-left: 7px;
}
.setrow span {
  flex: 1;
  min-width: 0;
  color: var(--ink-2);
}
.setrow b {
  font-size: 18px;
  font-weight: 700;
}
.setrow .i {
  width: 18px;
  height: 18px;
  color: var(--ink-3);
}
.setrow.static {
  cursor: default;
}
.setrow.ok b,
.setrow.ok span {
  color: var(--leaf);
}
.setrow.bad b,
.setrow.bad span,
.setrow.bad .i {
  color: var(--alta);
}
.btn.go.big {
  width: 100%;
  min-height: 64px;
  margin-top: 16px;
  font-size: 21px;
  font-weight: 700;
}
.mini {
  margin-top: 22px;
}
.mini h3 {
  font-family: var(--f-hand);
  font-size: 20px;
  font-weight: 600;
  color: var(--alta);
  margin-bottom: 4px;
}
.mini-r {
  display: grid;
  grid-template-columns: 28px 94px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  font-size: 14.5px;
}
.mini-r .glyph {
  width: 24px;
  height: 24px;
}
.mini-bar {
  height: 8px;
  background: var(--paper-2);
  border-radius: 2px;
  overflow: hidden;
}
.mini-bar i {
  display: block;
  height: 100%;
  width: var(--w);
  background: var(--ink-2);
  border-radius: 2px;
  transition: width 0.6s var(--ease);
}
.mini-r b {
  font-weight: 700;
}
.margin-note {
  position: relative;
  margin-top: 22px;
  padding: 12px 14px;
  font-family: var(--f-hand);
  font-size: 17.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--tint-y);
  border-radius: 2px;
  transform: rotate(-0.6deg);
}
.muted-note {
  padding: 10px 2px;
  color: var(--ink-3);
  font-size: 15px;
}

/* ---------- Bazar mode ---------- */
.bz {
  position: sticky;
  top: 0;
  z-index: 7;
  padding: 6px var(--pad-r) 10px var(--pad-l);
  color: var(--on-cloth);
  background-color: var(--cloth);
  background-image: var(--weave), linear-gradient(180deg, var(--cloth-hi), var(--cloth));
  box-shadow: 0 4px 12px rgba(40, 0, 10, 0.4);
  animation: bzIn 0.5s var(--ease) both;
}
@keyframes bzIn {
  from {
    transform: translateY(-14px);
  }
}
.bz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
}
.bz-back {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  min-width: 0;
  font-weight: 600;
}
.bz-back span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.bz-nums {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}
.bz-n {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 62px;
  padding: 2px 0;
  text-align: left;
}
.bz-n small {
  font-size: 14px;
  color: var(--on-cloth-2);
  line-height: 1.25;
}
.bz-n b {
  font-size: clamp(28px, 8.5vw, 36px);
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
}
.bz-n.bad b {
  color: var(--foil-1);
}
.bz-n .i {
  width: 30px;
  height: 30px;
  margin-top: 4px;
}
.bz-bar {
  height: 6px;
  margin-top: 6px;
  background: rgba(60, 0, 15, 0.55);
  border-radius: 3px;
  overflow: hidden;
}
.bz-bar i {
  display: block;
  height: 100%;
  width: var(--w);
  background: linear-gradient(90deg, var(--foil-2), var(--foil-1));
  border-radius: 3px;
  transition: width 0.7s var(--spring);
}
.ledger.bazar {
  --line: 72px;
}
.ledger.bazar .lg-head {
  display: none;
}
.row.big .nm {
  font-size: 22px;
}
.row.big .r-qty {
  font-size: 15.5px;
}
.row.big .r-amt {
  font-size: 19px;
}
.row.big .tk {
  width: 32px;
  height: 32px;
}
.r-chev {
  display: none;
}
@container (min-width: 500px) {
  .r-chev {
    display: grid;
    place-items: center;
    color: var(--ink-3);
  }
}
.alldone {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px var(--pad-r);
  text-align: center;
}
.alldone p {
  font-family: var(--f-hand);
  font-size: 27px;
  font-weight: 600;
  color: var(--leaf);
}
.bagbar {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 6px var(--pad-r) 8px var(--pad-l);
  text-align: left;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 -8px 12px -8px rgba(40, 10, 30, 0.5);
}
.bagbar-art {
  display: block;
  width: 62px;
  height: 70px;
  margin-top: -20px;
  transform-origin: bottom center;
}
.bagbar-t b {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}
.bagbar-t small {
  display: block;
  font-size: 13.5px;
  line-height: 1.25;
  color: var(--ink-2);
}
.bagbar > .i {
  color: var(--ink-3);
}
.bag-svg {
  display: block;
  width: 100%;
  height: 100%;
}
.bag-list {
  display: flex;
  flex-direction: column;
}
.bag-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 6px 2px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  transition: padding-left 0.2s var(--ease);
}
.bag-row:hover {
  padding-left: 7px;
}
.bag-rn {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.25;
}
.bag-rn small {
  display: block;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink-2);
}
.bag-row b {
  font-weight: 700;
  font-size: 17px;
}
.bag-row b.warn {
  font-size: 13px;
  color: var(--alta);
}

/* ---------- Pad ---------- */
.pd-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}
.pd-g {
  width: 40px;
  height: 40px;
}
.pd-t {
  flex: 1;
  min-width: 0;
}
.pd-t h2 {
  font-size: 22px;
  font-weight: 800;
  font-stretch: 90%;
  line-height: 1.25;
}
.pd-last {
  display: block;
  font-size: 14px;
  color: var(--ink-2);
}
.pd-last.up {
  color: var(--alta);
  font-weight: 500;
}
.pd-last.down {
  color: var(--leaf);
  font-weight: 500;
}
.pd-mid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}
.pd-qty {
  display: flex;
  align-items: center;
  gap: 2px;
}
.pd-qty b {
  min-width: 70px;
  text-align: center;
  font-weight: 700;
  font-size: 16.5px;
}
.pd-mid .seg button {
  padding-inline: 8px;
  font-size: 14px;
}
.stp {
  display: grid;
  place-items: center;
  width: 42px;
  height: 44px;
  background: var(--paper-2);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--edge);
  transition: transform 0.1s;
}
.stp:active {
  transform: scale(0.9);
}
.pd-disp {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 4px 4px 6px;
  border-bottom: 3px double var(--ink);
}
.pd-v {
  display: inline-flex;
  align-items: baseline;
  font-size: clamp(38px, 11vw, 46px);
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.pd-v i {
  font-style: normal;
  font-weight: 500;
  color: var(--ink-3);
  margin-right: 3px;
}
.pd-ph {
  color: var(--paper-3);
}
.caret {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  margin-left: 3px;
  background: var(--alta);
  align-self: center;
  animation: caret 1s steps(1) infinite;
}
.pd-disp.fresh .pd-v {
  color: var(--ink-3);
}
@keyframes caret {
  50% {
    opacity: 0;
  }
}
.pd-c {
  text-align: right;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--leaf);
}
.keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 10px;
}
.key {
  position: relative;
  height: clamp(50px, 8.2vh, 62px);
  overflow: hidden;
  font-size: 26px;
  font-weight: 600;
  background: var(--paper-2);
  border-radius: 8px 7px 9px 6px;
  box-shadow: inset 0 0 0 1px var(--edge), 0 2px 0 var(--paper-3);
  display: grid;
  place-items: center;
  transition: transform 0.08s, box-shadow 0.08s;
  user-select: none;
}
.key:active {
  transform: translateY(2px);
  box-shadow: inset 0 0 0 1px var(--edge);
  background: var(--paper-3);
}
.pd-act {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.pd-act .btn {
  min-height: 56px;
}
.presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}
.presets:empty {
  display: none;
}
.presets.left {
  justify-content: flex-start;
}
.presets .chip {
  padding-inline: 12px;
}

/* ---------- Forms ---------- */
.edit,
.newf {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fld {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.fld > span {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}
.fld em {
  font-style: normal;
  font-weight: 400;
  color: var(--ink-3);
}
.fld-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.radios {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.rd-chip {
  position: relative;
  cursor: pointer;
}
.rd-chip input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.rd-chip span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  padding: 4px 11px;
  font-size: 14.5px;
  font-weight: 500;
  background: var(--paper-2);
  border-radius: 7px 6px 8px 5px;
  box-shadow: inset 0 0 0 1px var(--edge);
  transition: background-color 0.15s, color 0.15s;
}
.rd-chip .glyph {
  width: 20px;
  height: 20px;
  color: inherit;
}
.rd-chip input:checked + span {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}
.rd-chip input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.new-h {
  font-family: var(--f-hand);
  font-size: 18px;
  font-weight: 600;
  color: var(--alta);
  margin-top: 4px;
}
.new-from {
  display: flex;
  flex-direction: column;
  max-height: 240px;
  overflow-y: auto;
}
.menu {
  display: flex;
  flex-direction: column;
}
.menu-r {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 6px 2px;
  text-align: left;
  font-weight: 500;
  border-bottom: 1px solid var(--rule);
  transition: padding-left 0.18s var(--ease);
}
.menu-r:hover {
  padding-left: 7px;
}
.menu-r small {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-3);
}
.menu-r.bad {
  color: var(--alta);
}
.paste-prev {
  display: flex;
  flex-direction: column;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 6px;
}
.pp {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
  animation: rowIn 0.25s var(--ease) both;
}
.pp .glyph {
  width: 24px;
  height: 24px;
}
.pp span {
  margin-left: auto;
  color: var(--ink-2);
  font-size: 14px;
}
.share-slip {
  margin-top: 8px;
  padding: 4px 14px 8px;
  background: var(--tint-y);
  border-radius: 3px;
  transform: rotate(-0.5deg);
}
.share-slip > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  font-weight: 500;
}
.share-slip i {
  font-style: normal;
  font-weight: 400;
  color: var(--ink-2);
  white-space: nowrap;
}
.share-slip .more {
  color: var(--ink-2);
  font-weight: 400;
  border: 0;
}
.share-a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.share-a .btn {
  width: 100%;
  min-height: 52px;
}
.share-n {
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-2);
}
.memo-img {
  display: block;
  width: 100%;
  margin-top: 8px;
  border-radius: 4px;
}

/* ---------- Cash memo ---------- */
.memo-wrap {
  position: relative;
  padding: 0 var(--pad-r) 24px var(--pad-l);
}
.memo-slot {
  height: 8px;
  margin-inline: -4px;
  background: var(--ink);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.printing .memo-slot {
  opacity: 1;
}
.memo-clip {
  clip-path: inset(0 -30px -30px -30px);
  filter: drop-shadow(0 6px 10px rgba(40, 10, 30, 0.28));
}
.memo {
  --z: 14px;
  position: relative;
  padding: 24px 18px 42px;
  color: #131c55;
  background: #fbe9ea;
  background-image: repeating-linear-gradient(to bottom, transparent 0 39px, rgba(90, 110, 190, 0.2) 39px 40px);
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--z) 51% repeat-x, conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--z) 51% repeat-x;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--z) 51% repeat-x, conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--z) 51% repeat-x;
}
.printing .memo {
  animation: printOut 1.35s cubic-bezier(0.3, 0.7, 0.4, 1) both;
}
@keyframes printOut {
  from {
    transform: translateY(-101%);
  }
}
.memo-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.memo-logo {
  font-family: var(--f-sign);
  font-size: 36px;
  line-height: 1.15;
  color: #a4122b;
}
.memo-kind {
  padding: 1px 9px 2px;
  font-size: 13.5px;
  font-weight: 700;
  color: #a4122b;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}
.memo-m {
  margin-top: 4px;
}
.memo-m b {
  display: block;
  font-size: 20px;
  font-weight: 800;
  font-stretch: 90%;
  line-height: 1.3;
}
.memo-m span {
  font-size: 13.5px;
  color: #434c86;
}
.memo-t {
  margin-top: 12px;
  font-size: 15px;
}
.mt-h,
.mt-r {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(62px, auto) 46px 62px;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}
.mt-h {
  min-height: 30px;
  font-size: 12.5px;
  font-weight: 700;
  color: #434c86;
  border-bottom: 1.5px solid #131c55;
}
.mt-h span:nth-child(n + 2),
.mt-r span:nth-child(n + 2) {
  text-align: right;
}
.mt-r span:first-child {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mt-r span:nth-child(2),
.mt-r span:nth-child(3) {
  font-size: 13.5px;
  color: #434c86;
}
.mt-r span:last-child {
  font-weight: 700;
}
.mt-r .warn {
  color: #a4122b;
  font-size: 13px;
}
.mt-r.none {
  grid-template-columns: 1fr;
}
.memo-no {
  margin-top: 10px;
  font-size: 13.5px;
  color: #434c86;
}
.memo-no.warn {
  color: #a4122b;
}
.memo-sum {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 12px;
  margin-left: auto;
  width: min(100%, 250px);
  font-size: 15px;
}
.memo-sum > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.ms-total {
  align-items: baseline;
  padding-bottom: 3px;
  border-bottom: 4px double #131c55;
  font-weight: 700;
  font-size: 18px;
}
.ms-total b {
  font-size: 28px;
  font-weight: 800;
}
.memo-sum .bad {
  color: #a4122b;
  font-weight: 700;
}
.memo-stamp {
  position: absolute;
  right: 10px;
  top: 58px;
  width: 112px;
  color: #6b2bb0;
  opacity: 0.8;
  transform: rotate(-13deg);
  pointer-events: none;
  mix-blend-mode: multiply;
}
.stamp-svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--f-ui);
}
.printing .memo-stamp {
  opacity: 0;
}
.stamped .memo-stamp {
  animation: slam 0.46s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.stamped .memo {
  animation: thud 0.3s 0.13s var(--ease);
}
@keyframes slam {
  from {
    opacity: 0;
    transform: rotate(-30deg) scale(2.8);
  }
  55% {
    opacity: 0.95;
  }
}
@keyframes thud {
  30% {
    transform: translateY(4px) scale(0.995);
  }
}
.acts {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}
.act-b {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 62px;
  padding: 8px 2px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  transition: padding-left 0.2s var(--ease);
}
.act-b:hover {
  padding-left: 8px;
}
.act-b .i {
  width: 26px;
  height: 26px;
  color: var(--alta);
}
.act-b b {
  display: block;
  font-weight: 700;
}
.act-b small {
  display: block;
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.3;
}
@media (max-width: 1079px) {
  .page-r {
    padding: 8px var(--pad-r) 28px var(--pad-l);
  }
  .app[data-mode='done'] .page-r {
    display: block;
  }
}

/* ---------- Page headers + sections ---------- */
.pg-h {
  padding: 14px var(--pad-r) 8px var(--pad-l);
}
.pg-h h1 {
  font-size: clamp(30px, 8vw, 40px);
  font-weight: 800;
  font-stretch: 86%;
  line-height: 1.2;
}
.pg-h p {
  color: var(--ink-2);
}
.sec-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 22px var(--pad-r) 6px var(--pad-l);
  font-family: var(--f-hand);
  font-size: 21px;
  font-weight: 600;
  color: var(--alta);
}
.sec-h span {
  font-size: 15px;
  color: var(--ink-3);
}
.page-r .sec-h {
  margin-inline: 0;
}
.page-r .sec-h.first {
  margin-top: 8px;
}

/* ---------- Khata ---------- */
.newslip {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - var(--pad-l) - var(--pad-r));
  margin: 8px var(--pad-r) 0 var(--pad-l);
  padding: 14px;
  text-align: left;
  color: var(--on-alta);
  background: var(--alta);
  border-radius: 8px 7px 9px 6px;
  box-shadow: 0 3px 0 var(--alta-lo);
  transition: transform 0.14s var(--ease), box-shadow 0.14s var(--ease);
}
.newslip:active {
  transform: translateY(3px);
  box-shadow: none;
}
.newslip .i {
  width: 28px;
  height: 28px;
}
.newslip b {
  display: block;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
}
.newslip small {
  font-size: 14px;
  opacity: 0.88;
}
.slips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 12px;
  padding: 4px var(--pad-r) 8px var(--pad-l);
}
.page-r .slips {
  padding-inline: 0;
}
.slip {
  --z: 12px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 't a' 'm m' 'b b';
  gap: 2px 10px;
  padding: 14px 14px 22px;
  text-align: left;
  color: var(--ink);
  transform: rotate(var(--r));
  transition: transform 0.26s var(--spring);
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--z) 51% repeat-x, linear-gradient(#000 0 0) top / 100% 51% no-repeat;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--z) 51% repeat-x, linear-gradient(#000 0 0) top / 100% 51% no-repeat;
}
.slip:hover {
  transform: rotate(0deg) translateY(-3px);
}
.slip:active {
  transform: scale(0.98);
}
.tint-y {
  background: var(--tint-y);
}
.tint-p {
  background: var(--tint-p);
}
.tint-b {
  background: var(--tint-b);
}
.slip-top {
  grid-area: t;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.slip-t {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}
.slip-pin .i {
  width: 16px;
  height: 16px;
  color: var(--alta);
}
.slip-m {
  grid-area: m;
  font-size: 13.5px;
  color: var(--ink-2);
}
.slip-amt {
  grid-area: a;
  font-size: 18px;
  font-weight: 800;
}
.slip-bar {
  grid-area: b;
  height: 4px;
  margin-top: 6px;
  background: color-mix(in srgb, var(--ink) 14%, transparent);
  border-radius: 2px;
  overflow: hidden;
}
.slip-bar i {
  display: block;
  height: 100%;
  width: var(--w);
  background: var(--alta);
}
.nolist {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 40px var(--pad-r) 40px var(--pad-l);
}
.nolist h1 {
  font-family: var(--f-hand);
  font-size: 30px;
  font-weight: 600;
  color: var(--alta);
}

/* ---------- Hisab ---------- */
.mon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 12px max(8px, var(--pad-r)) 4px max(8px, var(--pad-l));
}
.mon h1 {
  font-size: clamp(23px, 6vw, 29px);
  font-weight: 800;
  font-stretch: 88%;
  text-align: center;
}
.mon-total {
  padding: 6px var(--pad-r) 10px var(--pad-l);
  text-align: center;
}
.mon-total small {
  display: block;
  color: var(--ink-3);
}
.mon-total b {
  display: block;
  font-size: clamp(46px, 13vw, 64px);
  font-weight: 800;
  font-stretch: 90%;
  line-height: 1.15;
}
.mon-total > span {
  font-size: 14.5px;
  color: var(--ink-2);
}
.mon-bud {
  display: block;
  width: calc(100% - var(--pad-l) - var(--pad-r));
  margin: 2px var(--pad-r) 0 var(--pad-l);
  padding: 8px 2px;
  text-align: left;
  border-block: 1px solid var(--rule);
}
.mb-t {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}
.mb-t > span {
  flex: 1;
  color: var(--ink-2);
}
.mb-t b {
  font-size: 18px;
  font-weight: 700;
}
.mb-t .i {
  width: 18px;
  height: 18px;
  color: var(--ink-3);
}
.mb-bar {
  display: block;
  height: 8px;
  margin: 3px 0 4px;
  background: var(--paper-3);
  border-radius: 2px;
  overflow: hidden;
}
.mb-bar i {
  display: block;
  height: 100%;
  width: var(--w);
  background: var(--leaf);
  border-radius: 2px;
  animation: growW 0.9s var(--ease) both;
}
.mon-bud.bad .mb-bar i {
  background: var(--alta);
}
.mon-bud small {
  font-size: 13.5px;
  color: var(--ink-2);
}
.mon-bud.bad small {
  color: var(--alta);
  font-weight: 600;
}
@keyframes growW {
  from {
    width: 0;
  }
}
.bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-inline: var(--pad-l) var(--pad-r);
}
.bar-r {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  min-height: 52px;
}
.bar-b {
  min-width: 0;
}
.bar-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 15.5px;
}
.bar-top b {
  font-weight: 700;
}
.bar-tr {
  display: block;
  height: 10px;
  margin-top: 3px;
  background: var(--paper-2);
  border-radius: 2px;
  overflow: hidden;
}
.bar-tr i {
  display: block;
  height: 100%;
  width: var(--w);
  background: var(--ink);
  border-radius: 2px;
  animation: growW 0.9s calc(var(--i) * 70ms) var(--ease) both;
}
.bar-r:first-child .bar-tr i {
  background: var(--alta);
}
.bar-p {
  font-size: 14px;
  text-align: right;
  color: var(--ink-2);
}
.page-l > .margin-note {
  margin-inline: var(--pad-l) var(--pad-r);
  margin-bottom: 18px;
}
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-h {
  display: grid;
  place-items: center;
  height: 28px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
}
.cal-d {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 0.82;
  min-height: 40px;
  font-size: 15px;
  color: var(--ink-3);
}
.cal-d.has {
  color: var(--paper);
  font-weight: 700;
}
.cal-d.has i {
  position: absolute;
  inset: 8% 14%;
  background: var(--ink);
  opacity: var(--a);
  border-radius: 47% 53% 44% 56% / 55% 42% 58% 45%;
  animation: blot 0.5s calc(var(--i) * 18ms) var(--spring) both;
  transition: transform 0.2s var(--spring);
}
.cal-d.has span {
  position: relative;
}
.cal-d.has:hover i {
  transform: scale(1.1);
}
.cal-d.has.sel i {
  background: var(--alta);
  opacity: 1;
  transform: scale(1.1);
}
@keyframes blot {
  from {
    transform: scale(0);
  }
}
.day-d {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--tint-p);
  border-radius: 3px;
  font-size: 14.5px;
  animation: rowIn 0.28s var(--ease) both;
}
.day-d p {
  color: var(--ink-2);
}
.moves {
  display: flex;
  flex-direction: column;
}
.move {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  border-bottom: 1px solid var(--rule);
}
.move-n {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  line-height: 1.25;
}
.move-n small {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink-2);
}
.move-n .i {
  width: 13px;
  height: 13px;
}
.move b {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-weight: 700;
}
.move b .i {
  width: 16px;
  height: 16px;
}
.move.up b {
  color: var(--alta);
}
.move.down b {
  color: var(--leaf);
}
.page-r .btn.wide {
  margin-top: 16px;
}

/* ---------- Learn ---------- */
.tourcard {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 12px;
  width: calc(100% - var(--pad-l) - var(--pad-r));
  margin: 6px var(--pad-r) 0 var(--pad-l);
  padding: 10px 12px;
  text-align: left;
  color: var(--on-cloth);
  background-color: var(--cloth);
  background-image: var(--weave), linear-gradient(100deg, var(--cloth-lo), var(--cloth-hi));
  border-radius: 8px 7px 9px 6px;
  box-shadow: 0 3px 0 var(--cloth-deep);
  transition: transform 0.14s var(--ease), box-shadow 0.14s var(--ease);
}
.tourcard:active {
  transform: translateY(3px);
  box-shadow: none;
}
.tourcard-art .whl {
  animation-play-state: paused;
}
.tourcard:hover .whl {
  animation-play-state: running;
}
.tourcard-t b {
  display: block;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
}
.tourcard-t small {
  font-size: 14.5px;
}
.tourcard-go {
  transition: transform 0.25s var(--ease);
}
.tourcard:hover .tourcard-go {
  transform: translateX(4px);
}
.welcome-art .rk-man,
.welcome-art .rk-body,
.tourcard-art .rk-man,
.tourcard-art .rk-body {
  animation: none;
}
.guide {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 14px;
  padding: 0 var(--pad-r) 18px var(--pad-l);
}
.gd {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--rule);
}
.gd h3 {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 18.5px;
  font-weight: 700;
}
.gd h3 span {
  font-family: var(--f-hand);
  color: var(--alta);
  font-size: 21px;
}
.gd li {
  position: relative;
  margin-top: 4px;
  padding-left: 13px;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--ink-2);
}
.gd li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 2px;
  background: var(--alta);
}
.setline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  min-height: 58px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--rule);
}
.setline > span {
  color: var(--ink-2);
}
.setline small {
  display: block;
  font-size: 13px;
  color: var(--ink-3);
}
.setline .txt {
  width: 190px;
  max-width: 100%;
}
.faq details {
  border-bottom: 1px solid var(--rule);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 8px 2px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary .i {
  color: var(--ink-3);
  transition: transform 0.28s var(--spring);
}
.faq details[open] summary .i {
  transform: rotate(180deg);
}
.faq p {
  padding: 0 2px 12px;
  color: var(--ink-2);
  font-size: 15px;
  animation: rowIn 0.28s var(--ease) both;
}

/* ---------- Guide vignettes: small looping demonstrations ---------- */
.gd-v {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--paper-2);
  background-image: repeating-linear-gradient(to bottom, transparent 0 23px, var(--rule) 23px 24px);
  border-radius: 4px;
  color: var(--ink);
}
.vg {
  position: absolute;
  inset: 0;
  padding: 8px;
  font-size: 12.5px;
  font-weight: 600;
}
.vg-row {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  white-space: nowrap;
}
.vg-row b {
  margin-left: auto;
}
.vg-dot {
  flex: none;
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--ink-3);
  border-radius: 50%;
}
.vg-line {
  height: 26px;
  margin-bottom: 8px;
  padding: 3px 4px;
  overflow: hidden;
  white-space: nowrap;
  background: var(--paper);
  border-bottom: 2px solid var(--alta);
}
.vg-type {
  display: inline-block;
  clip-path: inset(0 100% 0 0);
  animation: vgType 5.5s steps(14) infinite;
}
@keyframes vgType {
  0%, 6% { clip-path: inset(0 100% 0 0); }
  38%, 54% { clip-path: inset(0 0 0 0); opacity: 1; }
  58%, 100% { clip-path: inset(0 0 0 0); opacity: 0; }
}
.vg-new {
  animation: vgNew 5.5s var(--ease) infinite;
}
@keyframes vgNew {
  0%, 52% { opacity: 0; transform: translateY(-20px); }
  62%, 94% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}
.vg-share {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.vg-ph {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 34px;
  height: 58px;
  padding: 9px 5px;
  background: var(--paper);
  border-radius: 5px;
  box-shadow: inset 0 0 0 2px var(--ink);
}
.vg-ph i {
  height: 3px;
  background: var(--ink-3);
  border-radius: 1px;
}
.vg-ph.b i {
  transform-origin: left;
  animation: vgLines 4.5s infinite;
}
.vg-ph.b i:nth-child(2) {
  animation-delay: 0.12s;
}
.vg-ph.b i:nth-child(3) {
  animation-delay: 0.24s;
}
@keyframes vgLines {
  0%, 55% { transform: scaleX(0); }
  65%, 100% { transform: scaleX(1); }
}
.vg-send {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -12px 0 0 -12px;
  color: var(--wa);
  animation: vgSend 4.5s var(--ease) infinite;
}
@keyframes vgSend {
  0%, 12% { transform: translateX(-32px) scale(0.6); opacity: 0; }
  24% { transform: translateX(-26px) scale(1); opacity: 1; }
  54% { transform: translateX(26px) scale(1); opacity: 1; }
  64%, 100% { transform: translateX(32px) scale(0.6); opacity: 0; }
}
.vg-st {
  position: relative;
}
.vg-st::after {
  content: '';
  position: absolute;
  left: -1px;
  right: -1px;
  top: 50%;
  height: 2px;
  background: var(--alta);
  transform-origin: left;
  animation: vgSt 4.5s infinite;
}
@keyframes vgSt {
  0%, 18% { transform: scaleX(0); }
  30%, 100% { transform: scaleX(1); }
}
.vg-bazar .vg-dot.on {
  animation: vgDot 4.5s infinite;
}
@keyframes vgDot {
  0%, 18% { background: transparent; }
  26%, 100% { background: var(--leaf); border-color: var(--leaf); }
}
.vg-drop {
  position: absolute;
  left: 50%;
  top: 28px;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  animation: vgDrop 4.5s infinite;
}
.vg-drop .glyph {
  width: 100%;
  height: 100%;
}
@keyframes vgDrop {
  0%, 26% { transform: translateY(-4px) scale(0.5); opacity: 0; }
  34% { transform: translateY(0) scale(1); opacity: 1; }
  52% { transform: translateY(32px) scale(0.8); opacity: 1; }
  58%, 100% { transform: translateY(36px) scale(0.6); opacity: 0; }
}
.vg-bag {
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 46px;
  height: 52px;
  margin-left: -23px;
  transform-origin: bottom;
  animation: vgBag 4.5s infinite;
}
@keyframes vgBag {
  0%, 52% { transform: scale(1, 1); }
  58% { transform: scale(1.14, 0.86); }
  66% { transform: scale(0.95, 1.08); }
  74%, 100% { transform: scale(1, 1); }
}
.vg-balance {
  display: grid;
  place-items: center;
  padding: 4px;
}
.vg-balance svg {
  width: 100%;
  overflow: visible;
}
.vgb {
  transform-origin: 100px 18px;
  animation: vgBal 5s ease-in-out infinite;
}
@keyframes vgBal {
  0%, 12% { transform: rotate(-11deg); }
  42%, 56% { transform: rotate(0deg); }
  80%, 92% { transform: rotate(10deg); }
  100% { transform: rotate(-11deg); }
}
.vg-memo {
  overflow: hidden;
}
.vg-slip {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 92%;
  margin-inline: 6%;
  padding: 12px 8px;
  background: var(--tint-p);
  animation: vgPrint 5s var(--ease) infinite;
}
.vg-slip > i {
  height: 3px;
  background: var(--ink-3);
}
.vg-slip > i.short {
  width: 55%;
  margin-left: auto;
  background: var(--ink);
  height: 4px;
}
@keyframes vgPrint {
  0% { transform: translateY(-105%); }
  28%, 100% { transform: translateY(0); }
}
.vg-stamp {
  position: absolute;
  left: 10%;
  bottom: 12%;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 800;
  color: var(--stamp);
  border: 2px solid currentColor;
  border-radius: 4px;
  animation: vgStamp 5s infinite;
}
@keyframes vgStamp {
  0%, 36% { opacity: 0; transform: rotate(-30deg) scale(2.4); }
  44%, 100% { opacity: 1; transform: rotate(-12deg) scale(1); }
}
.vg-month {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vg-b {
  height: 9px;
  width: var(--w);
  background: var(--ink);
  border-radius: 1px;
  transform-origin: left;
  animation: vgGrow 5s var(--ease) infinite;
}
.vg-b:first-child {
  background: var(--alta);
}
@keyframes vgGrow {
  0% { transform: scaleX(0); }
  30%, 100% { transform: scaleX(1); }
}
.vg-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-top: auto;
}
.vg-cal i {
  aspect-ratio: 1;
  background: var(--paper-3);
  border-radius: 50%;
}
.vg-cal i.on {
  background: var(--ink);
  animation: vgBlot 5s infinite;
}
@keyframes vgBlot {
  0%, 30% { transform: scale(0.3); opacity: 0.2; }
  42%, 100% { transform: scale(1); opacity: 1; }
}

/* ---------- Large screens ---------- */
@media (min-width: 1080px) {
  :root {
    --line: 52px;
    --gl: 22px;
    --gr: 30px;
    --pad-l: 34px;
    --pad-r: 34px;
    --amtw: 92px;
  }
  .lh {
    padding-top: 22px;
  }
  .lh-t h1 {
    font-size: 34px;
  }
  .pg-h {
    padding-top: 24px;
  }
  .sample {
    margin-top: 4px;
  }
  .ledger.bazar {
    --line: 66px;
  }
  .bz {
    padding-top: 12px;
  }
  .bagbar {
    display: none;
  }
  .guide {
    grid-template-columns: 1fr;
  }
  .memo-wrap {
    padding-top: 6px;
    max-width: 560px;
  }
  .sum-scale {
    margin-top: 6px;
  }
  .btn.go.big {
    margin-top: 18px;
  }
  #toasts {
    bottom: 44px;
  }
}
@media (min-width: 720px) and (max-width: 1079px) {
  .spread {
    border-radius: 12px 12px 0 0;
    width: min(100%, 860px);
    left: 50%;
    transform: translateX(-50%);
  }
  .tabs {
    width: min(100%, 860px);
    margin-inline: auto;
  }
  .bar {
    max-width: 860px;
    width: 100%;
    margin-inline: auto;
  }
}

/* ---------- Print: just the memo ---------- */
@media print {
  html,
  body,
  #root,
  .app,
  .book,
  .spread-wrap {
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
    padding: 0 !important;
  }
  .spread {
    position: static !important;
    overflow: visible !important;
    display: block !important;
    box-shadow: none !important;
  }
  .bar,
  .tabs,
  .lh,
  .sample,
  .page-r,
  #sheets,
  #toasts,
  .tour,
  .cover,
  .memo-slot {
    display: none !important;
  }
  .book {
    width: 100% !important;
    margin: 0 !important;
    transform: none !important;
    display: block !important;
  }
  .page {
    height: auto !important;
    overflow: visible !important;
    box-shadow: none !important;
  }
  .memo-wrap {
    max-width: 150mm;
    margin-inline: auto;
    padding: 0;
  }
  .memo-clip {
    clip-path: none;
    filter: none;
  }
  .memo {
    mask: none;
    -webkit-mask: none;
    background: #fff;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .memo-stamp {
    mix-blend-mode: normal;
  }
}

/* ---------- Short screens: landscape phones and very small handsets ---------- */
@media (max-height: 620px) and (max-width: 1079px) {
  .lh {
    padding-top: 6px;
    padding-bottom: 4px;
  }
  .strip {
    padding-top: 4px;
    padding-bottom: 6px;
  }
  .strip-sum small {
    display: none;
  }
  .strip-n {
    font-size: 25px;
  }
  .strip .go {
    min-height: 48px;
  }
  .adder-row {
    padding-top: 4px;
    padding-bottom: 6px;
  }
  .adder-in,
  .adder-paste,
  .adder-go {
    height: 44px;
  }
  .key {
    height: 44px;
    font-size: 23px;
  }
  .keys {
    gap: 5px;
    margin-top: 6px;
  }
  .pd-act {
    margin-top: 8px;
  }
  .pd-act .btn {
    min-height: 48px;
  }
  .pd-disp {
    margin-top: 4px;
    padding-block: 0 3px;
  }
  .pd-v {
    font-size: 34px;
  }
  .pd-mid {
    margin-top: 2px;
  }
  .stp {
    height: 38px;
  }
  .pd-mid .seg button {
    min-height: 32px;
  }
  .bz-top {
    min-height: 42px;
  }
  .bz-n {
    min-height: 0;
  }
  .bz-n b {
    font-size: 25px;
  }
  .ledger.bazar {
    --line: 62px;
  }
  .row.big .nm {
    font-size: 19px;
  }
  .bagbar {
    min-height: 54px;
    padding-block: 3px 4px;
  }
  .bagbar-art {
    width: 46px;
    height: 52px;
    margin-top: -12px;
  }
  .bagbar-t small {
    display: none;
  }
}
@media (max-height: 480px) and (max-width: 1079px) {
  .lh-d,
  .strip-m {
    display: none;
  }
  .bz {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
    align-items: center;
    column-gap: 14px;
    padding-top: 2px;
    padding-bottom: 4px;
  }
  .bz-top {
    display: contents;
  }
  .bz-back {
    grid-column: 1;
    grid-row: 1;
  }
  .bz-nums {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
  }
  .bz-top .btn {
    grid-column: 3;
    grid-row: 1;
  }
  .bz-bar {
    grid-column: 1 / -1;
    margin-top: 2px;
    height: 4px;
  }
  .bz-n b {
    font-size: 22px;
  }
  .bz-n small {
    font-size: 12.5px;
  }
  .sheet.pad-sheet {
    max-width: 780px;
    max-height: 100%;
  }
  .pad-sheet .sheet-in {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 18px;
  }
  .pad-sheet .sheet-in > * {
    grid-column: 1;
  }
  .pad-sheet .keys {
    grid-column: 2;
    grid-row: 1 / span 6;
    margin-top: 0;
    align-self: center;
  }
  .pad-sheet .key {
    height: 52px;
  }
  .pad-sheet .grab {
    display: none;
  }
}
