/* Reusable components: buttons, forms, lists, chips, toast, sheets. */
.btn {
  background: var(--acc);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0 18px;
  min-height: 44px;
  font-weight: 600;
  cursor: pointer;
}
.btn.danger {
  background: var(--exp);
}
.btn.sec {
  background: var(--acc2);
  color: var(--acc);
}
.seg {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
}
.seg button {
  border: 0;
  background: none;
  padding: 0 16px;
  min-height: 38px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--mut);
}
.seg button.on {
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px #0002;
}
.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
}
.form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
  margin-top: 14px;
}
.err {
  color: var(--exp);
  font-size: 13px;
  min-height: 20px;
  margin-top: 6px;
}
.item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--acc2);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex: none;
}
.amt {
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
}
.exp {
  color: var(--exp);
}
.inc {
  color: var(--inc);
}
.chip {
  font-size: 12px;
  background: var(--acc2);
  color: var(--acc);
  border-radius: 99px;
  padding: 2px 10px;
  border: 0;
  cursor: pointer;
}
.chip.un {
  background: #fef3c7;
  color: var(--warn);
}
.big {
  font-size: 30px;
  font-weight: 700;
}
.empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--mut);
}
.chk {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
}
.chk input {
  width: 20px;
  min-height: 20px;
}
.theme {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  flex: none;
}
.mwrap {
  position: relative;
}
.mwrap input {
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: transparent;
}
.mwrap input::placeholder {
  color: var(--mut);
  -webkit-text-fill-color: var(--mut);
}
.mwrap input::selection {
  background: transparent;
}
.ghost {
  position: absolute;
  inset: 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  pointer-events: none;
  white-space: pre;
  overflow: hidden;
  color: var(--ink);
}
.mwrap:focus-within .ghost::after {
  content: "";
  width: 2px;
  height: 1.2em;
  background: var(--acc);
  margin-left: 1px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
@media(prefers-reduced-motion:reduce) {
  .mwrap:focus-within .ghost::after {
    animation: none;
  }
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom,0px));
  transform: translate(-50%,12px);
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 10px 18px 10px 12px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 30px #0004;
  transition: opacity .25s ease,transform .25s ease;
}
.toast.on {
  opacity: 1;
  transform: translate(-50%,0);
}
.toast .tk {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--acc);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}
@media(max-width:767px) {
  .toast {
    bottom: calc(84px + env(safe-area-inset-bottom,0px));
  }
}
@media(prefers-reduced-motion:reduce) {
  .toast {
    transition: none;
  }
}
.lockw {
  position: relative;
}
.lockw::after {
  content: '🔒';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: .7;
  pointer-events: none;
}
input.lk {
  background: repeating-linear-gradient(135deg,var(--bg) 0 7px,var(--line) 7px 8px);
  color: var(--mut);
  cursor: not-allowed;
  padding-right: 38px;
  border-style: dashed;
  user-select: none;
}
.lockw.shake {
  animation: shake .4s;
}
.lockw.shake input.lk {
  border-color: var(--exp);
  border-style: solid;
}
@keyframes shake {
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}
@media(prefers-reduced-motion:reduce) {
  .lockw.shake {
    animation: none;
  }
}
.theme:disabled {
  opacity: .4;
  cursor: default;
}
kbd, .kb {
  font: 600 11px/1 system-ui,sans-serif;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid currentColor;
  margin-left: 6px;
  white-space: nowrap;
}
.mut kbd {
  margin: 0 2px;
  color: var(--ink);
  border-color: var(--line);
  background: var(--bg);
}
@media(pointer:coarse) {
  .kb, .kbhint {
    display: none;
  }
}
.pb {
  height: 8px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.pb i {
  display: block;
  height: 100%;
  background: var(--acc);
}
.dc {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.dc:first-child {
  border-top: 0;
}
.req {
  color: #ef4444;
  font-weight: 700;
}
.mini {
  min-height: 32px;
  padding: 2px 8px;
  font-size: 12px;
  width: auto;
  max-width: 48%;
}
[aria-invalid=true] {
  border-color: #ef4444;
}
select:disabled {
  opacity: .6;
}
.sheet-bg {
  position: fixed;
  inset: 0;
  background: #0006;
  display: none;
  z-index: 30;
  align-items: flex-end;
  justify-content: center;
}
.sheet-bg.open {
  display: flex;
}
.sheet {
  background: var(--card);
  width: 100%;
  max-width: 520px;
  border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom,0px));
}
.scroll {
  overflow-x: auto;
}
.warn {
  background: #fef3c7;
  color: #78350f;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 13px;
  display: none;
}
.inline-new {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}
.inline-new[hidden] {
  display: none;
}
