/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
@layer properties;
.fixed {
  position: fixed;
}
.relative {
  position: relative;
}
.static {
  position: static;
}
.sticky {
  position: sticky;
}
.left-1\/2 {
  left: calc(1 / 2 * 100%);
}
.z-50 {
  z-index: 50;
}
.z-\[100\] {
  z-index: 100;
}
.container {
  width: 100%;
}
.mx-auto {
  margin-inline: auto;
}
.mb-\[24px\] {
  margin-bottom: 24px;
}
.block {
  display: block;
}
.contents {
  display: contents;
}
.flex {
  display: flex;
}
.grid {
  display: grid;
}
.hidden {
  display: none;
}
.inline {
  display: inline;
}
.table {
  display: table;
}
.h-\[220px\] {
  height: 220px;
}
.h-full {
  height: 100%;
}
.w-full {
  width: 100%;
}
.max-w-\[360px\] {
  max-width: 360px;
}
.max-w-\[520px\] {
  max-width: 520px;
}
.flex-1 {
  flex: 1;
}
.-translate-x-1\/2 {
  --tw-translate-x: calc(calc(1 / 2 * 100%) * -1);
  translate: var(--tw-translate-x) var(--tw-translate-y);
}
.scale-95 {
  --tw-scale-x: 95%;
  --tw-scale-y: 95%;
  --tw-scale-z: 95%;
  scale: var(--tw-scale-x) var(--tw-scale-y);
}
.scale-100 {
  --tw-scale-x: 100%;
  --tw-scale-y: 100%;
  --tw-scale-z: 100%;
  scale: var(--tw-scale-x) var(--tw-scale-y);
}
.transform {
  transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
}
.resize {
  resize: both;
}
.grid-cols-\[78px_1fr_1fr_54px\] {
  grid-template-columns: 78px 1fr 1fr 54px;
}
.flex-col {
  flex-direction: column;
}
.flex-wrap {
  flex-wrap: wrap;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.gap-\[2px\] {
  gap: 2px;
}
.gap-\[6px\] {
  gap: 6px;
}
.gap-\[12px\] {
  gap: 12px;
}
.gap-\[18px\] {
  gap: 18px;
}
.overflow-y-auto {
  overflow-y: auto;
}
.rounded-\[var\(--bp-r-card\)\] {
  border-radius: var(--bp-r-card);
}
.rounded-\[var\(--bp-r-ctrl\)\] {
  border-radius: var(--bp-r-ctrl);
}
.border {
  border-style: var(--tw-border-style);
  border-width: 1px;
}
.border-\[3px\] {
  border-style: var(--tw-border-style);
  border-width: 3px;
}
.border-t-2 {
  border-top-style: var(--tw-border-style);
  border-top-width: 2px;
}
.border-t-\[2px\] {
  border-top-style: var(--tw-border-style);
  border-top-width: 2px;
}
.border-b-\[2px\] {
  border-bottom-style: var(--tw-border-style);
  border-bottom-width: 2px;
}
.border-\[\#ffb8b8\] {
  border-color: #ffb8b8;
}
.border-\[\#ffd8a8\] {
  border-color: #ffd8a8;
}
.border-\[var\(--bp-line\)\] {
  border-color: var(--bp-line);
}
.border-\[var\(--bp-line-strong\)\] {
  border-color: var(--bp-line-strong);
}
.bg-\[\#ffe3e3\] {
  background-color: #ffe3e3;
}
.bg-\[\#ffe8cc\] {
  background-color: #ffe8cc;
}
.bg-\[var\(--bp-line\)\] {
  background-color: var(--bp-line);
}
.bg-\[var\(--bp-surface\)\] {
  background-color: var(--bp-surface);
}
.p-\[18px\] {
  padding: 18px;
}
.p-\[24px\] {
  padding: 24px;
}
.px-\[14px\] {
  padding-inline: 14px;
}
.px-\[16px\] {
  padding-inline: 16px;
}
.py-\[10px\] {
  padding-block: 10px;
}
.py-\[14px\] {
  padding-block: 14px;
}
.py-\[16px\] {
  padding-block: 16px;
}
.pb-\[88px\] {
  padding-bottom: 88px;
}
.pb-\[100px\] {
  padding-bottom: 100px;
}
.text-center {
  text-align: center;
}
.text-\[14px\] {
  font-size: 14px;
}
.text-\[16px\] {
  font-size: 16px;
}
.text-\[17px\] {
  font-size: 17px;
}
.text-\[18px\] {
  font-size: 18px;
}
.text-\[21px\] {
  font-size: 21px;
}
.text-\[22px\] {
  font-size: 22px;
}
.leading-\[1\.6\] {
  --tw-leading: 1.6;
  line-height: 1.6;
}
.font-\[700\] {
  --tw-font-weight: 700;
  font-weight: 700;
}
.font-\[800\] {
  --tw-font-weight: 800;
  font-weight: 800;
}
.font-\[var\(--bp-mono\)\] {
  --tw-font-weight: var(--bp-mono);
  font-weight: var(--bp-mono);
}
.text-wrap {
  text-wrap: wrap;
}
.whitespace-pre-line {
  white-space: pre-line;
}
.text-\[\#d9480f\] {
  color: #d9480f;
}
.text-\[\#e03131\] {
  color: #e03131;
}
.text-\[var\(--bp-ink\)\] {
  color: var(--bp-ink);
}
.text-\[var\(--bp-ink-2\)\] {
  color: var(--bp-ink-2);
}
.text-\[var\(--bp-ink-3\)\] {
  color: var(--bp-ink-3);
}
.text-\[var\(--bp-save\)\] {
  color: var(--bp-save);
}
.uppercase {
  text-transform: uppercase;
}
.opacity-0 {
  opacity: 0%;
}
.opacity-100 {
  opacity: 100%;
}
.ring {
  --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
}
.filter {
  filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
}
.backdrop-filter {
  -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
  backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
}
.transition {
  transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
  transition-timing-function: var(--tw-ease, ease);
  transition-duration: var(--tw-duration, 0s);
}
.transition-colors {
  transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
  transition-timing-function: var(--tw-ease, ease);
  transition-duration: var(--tw-duration, 0s);
}
.transition-opacity {
  transition-property: opacity;
  transition-timing-function: var(--tw-ease, ease);
  transition-duration: var(--tw-duration, 0s);
}
.transition-transform {
  transition-property: transform, translate, scale, rotate;
  transition-timing-function: var(--tw-ease, ease);
  transition-duration: var(--tw-duration, 0s);
}
.duration-300 {
  --tw-duration: 300ms;
  transition-duration: 300ms;
}
@media (hover: hover) {
  .hover\:brightness-95:hover {
    --tw-brightness: brightness(95%);
    filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
  }
}
.dark\:border-\[\#7a4e1a\]:where(.dark, .dark *) {
  border-color: #7a4e1a;
}
.dark\:border-\[\#521c1c\]:where(.dark, .dark *) {
  border-color: #521c1c;
}
.dark\:bg-\[\#3b1212\]:where(.dark, .dark *) {
  background-color: #3b1212;
}
.dark\:bg-\[\#5c3a14\]:where(.dark, .dark *) {
  background-color: #5c3a14;
}
.dark\:text-\[\#ff6b6b\]:where(.dark, .dark *) {
  color: #ff6b6b;
}
.dark\:text-\[\#ff8787\]:where(.dark, .dark *) {
  color: #ff8787;
}
.dark\:text-\[\#ffd8a8\]:where(.dark, .dark *) {
  color: #ffd8a8;
}
@layer base {
  :root {
    --bp-bg: #f2f2f2;
    --bp-surface: #fff;
    --bp-header: #224a60;
    --bp-header-sub: #b4dde1;
    --bp-ink: #15191b;
    --bp-ink-2: #3f4448;
    --bp-ink-3: #5a6064;
    --bp-ink-mute: #7d858a;
    --bp-am-border: #f5c114;
    --bp-am-chip: #ffd636;
    --bp-am-tint: #ffefb0;
    --bp-am-ink: #6b4f00;
    --bp-pm-border: #375786;
    --bp-pm-chip: #375786;
    --bp-pm-soft: #9db1d0;
    --bp-save: #137253;
    --bp-save-ink: #0e5a41;
    --bp-save-tint: #e8f4ee;
    --bp-ok: #198964;
    --bp-line: #e4e6e7;
    --bp-line-strong: #cdd1d3;
    --bp-line-ink: #272b2e;
    --bp-zebra: #f7f8f8;
    --bp-font: 'LINE Seed','Noto Sans TC','PingFang TC','Microsoft JhengHei',sans-serif;
    --bp-mono: 'JetBrains Mono',ui-monospace,Menlo,monospace;
    --bp-r-card: 14px;
    --bp-r-ctrl: 12px;
  }
  * {
    box-sizing: border-box;
  }
  html {
    -webkit-text-size-adjust: 100%;
  }
  body {
    margin: 0;
    background: var(--bp-bg);
    font-family: var(--bp-font);
    color: var(--bp-ink);
  }
  .app {
    max-width: 480px;
    margin: 0 auto;
    background: var(--bp-bg);
    min-height: 100dvh;
    padding: 24px 20px 40px;
    display: flex;
    flex-direction: column;
  }
  a {
    color: var(--bp-save-ink);
  }
  a:hover {
    color: var(--bp-save);
  }
  input,button {
    font-family: inherit;
    margin: 0;
  }
  button {
    -webkit-appearance: none;
    appearance: none;
    background: 0 0;
    border: none;
    padding: 0;
    margin: 0;
  }
  input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
  }
  input:focus-visible,button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(25,137,100,.45);
  }
  header {
    background: var(--bp-header);
    padding: 26px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  header h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.15;
    color: #fff;
  }
  header .sub {
    font-size: 18px;
    color: var(--bp-header-sub);
  }
  main {
    padding: 18px 18px 40px;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .notice {
    background: var(--bp-am-tint);
    border: 3px solid var(--bp-am-border);
    border-radius: var(--bp-r-card);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--bp-am-ink);
  }
  .notice h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
  }
  .notice .steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 17px;
    line-height: 1.6;
    text-wrap: pretty;
  }
  .notice .steps div {
    display: flex;
    gap: 10px;
  }
  .notice .steps b {
    flex: none;
  }
  .field {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .field>label {
    font-size: 18px;
    font-weight: 800;
    color: var(--bp-ink-2);
  }
  input[type=date] {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: 100%;
    background: var(--bp-surface);
    border: 3px solid var(--bp-line-ink);
    border-radius: var(--bp-r-ctrl);
    padding: 18px 16px;
    font: 700 24px var(--bp-mono);
    color: var(--bp-ink);
  }
  .card {
    background: var(--bp-surface);
    border-radius: var(--bp-r-card);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .card.am {
    border: 3px solid var(--bp-am-border);
  }
  .card.pm {
    border: 3px solid var(--bp-pm-border);
  }
  .card>.head {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .card>.head .chip {
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .card.am .chip {
    background: var(--bp-am-chip);
  }
  .card.pm .chip {
    background: var(--bp-pm-chip);
  }
  .card>.head .t {
    font-size: 26px;
    font-weight: 800;
  }
  .card>.head .tag {
    margin-left: auto;
    font-size: 15px;
    font-weight: 700;
    border-radius: 999px;
    padding: 8px 14px;
  }
  .card.am .tag {
    color: var(--bp-am-ink);
    background: var(--bp-am-tint);
  }
  .card.pm .tag {
    color: #fff;
    background: var(--bp-pm-border);
  }
  .bp {
    display: flex;
    align-items: flex-end;
    gap: 10px;
  }
  .bp .col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
  }
  .bp .col span {
    font-size: 17px;
    font-weight: 800;
    color: var(--bp-ink-2);
  }
  .bp input {
    width: 100%;
    text-align: center;
    background: var(--bp-surface);
    border-radius: var(--bp-r-ctrl);
    font-weight: 800;
    font-size: clamp(24px, 8vw, 36px);
    line-height: 1;
    font-family: var(--bp-mono);
    color: var(--bp-ink);
    padding: 26px 0;
  }
  .bp .slash {
    font-size: 38px;
    font-weight: 800;
    color: #a7adb1;
    padding-bottom: 22px;
  }
  .card.am .bp input {
    border: 3px solid var(--bp-line-ink);
  }
  .card.am .bp .hr input {
    border-color: var(--bp-line-strong);
  }
  .card.pm .bp input {
    border: 3px solid var(--bp-pm-border);
  }
  .card.pm .bp .hr input {
    border-color: var(--bp-pm-soft);
  }
  .bp input::placeholder {
    color: #a7adb1;
  }
  .med {
    border-top: 2px solid var(--bp-line);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .med .q {
    font-size: 18px;
    font-weight: 800;
    color: var(--bp-ink-2);
  }
  .med .n {
    font-size: 16px;
    color: var(--bp-ink-3);
  }
  .med .row {
    display: flex;
    gap: 10px;
  }
  .med button {
    flex: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 64px;
    border-radius: var(--bp-r-ctrl);
    font-size: 20px;
    font-weight: 800;
    background: var(--bp-surface);
    color: var(--bp-ink-3);
    border: 3px solid var(--bp-line-strong);
  }
  .med button svg {
    display: none;
  }
  .med button[aria-pressed=true] {
    color: #fff;
  }
  .med button[aria-pressed=true] svg {
    display: block;
  }
  .med button.yes[aria-pressed=true] {
    background: var(--bp-save);
    border-color: var(--bp-save);
  }
  .med button.no[aria-pressed=true] {
    background: var(--bp-ink-2);
    border-color: var(--bp-ink-2);
  }
  .save {
    width: 100%;
    height: 84px;
    border: none;
    border-radius: var(--bp-r-card);
    background: var(--bp-save);
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
  }
  .save:hover {
    filter: brightness(.94);
  }
  .save:active {
    transform: translateY(1px) scale(.995);
  }
  .history {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 8px;
  }
  .history .bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .history .bar h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
  }
  .ghost {
    cursor: pointer;
    background: var(--bp-surface);
    color: var(--bp-save-ink);
    border: 3px solid var(--bp-save);
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 17px;
    font-weight: 800;
  }
  .ghost:hover {
    background: var(--bp-save-tint);
  }
  .ranges {
    display: flex;
    gap: 8px;
  }
  .ranges button {
    flex: 1;
    cursor: pointer;
    min-height: 48px;
    border-radius: 999px;
    font-size: 18px;
    font-weight: 800;
    background: var(--bp-surface);
    color: var(--bp-ink-2);
    border: 3px solid var(--bp-line-strong);
  }
  .ranges button[aria-pressed=true] {
    background: var(--bp-ink);
    color: #fff;
    border-color: var(--bp-ink);
  }
  .backup-btn {
    flex: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bp-surface);
    color: var(--bp-ink-2);
    border: 3px solid var(--bp-line-strong);
    border-radius: var(--bp-r-ctrl);
    padding: 14px;
    font-size: 16px;
    font-weight: 800;
  }
  .backup-btn:active {
    transform: translateY(1px) scale(.98);
  }
  @keyframes fadeInDown {
    0% {
      opacity: 0;
      transform: translateY(-10px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .animate-fade-in-down {
    animation: fadeInDown 0.5s ease-out forwards;
  }
  .table {
    background: var(--bp-surface);
    border: 3px solid var(--bp-line-strong);
    border-radius: var(--bp-r-card);
    overflow: hidden;
  }
  .tr {
    display: grid;
    grid-template-columns: 78px 1fr 1fr 54px;
    gap: 6px;
    align-items: center;
    padding: 16px 14px;
    border-top: 2px solid var(--bp-line);
  }
  .th {
    display: grid;
    grid-template-columns: 78px 1fr 1fr 54px;
    gap: 6px;
    background: var(--bp-line);
    padding: 12px 14px;
    font-size: 16px;
    font-weight: 800;
    color: var(--bp-ink-2);
  }
  .th span:last-child,.tr span:last-child {
    text-align: center;
  }
  .tr:nth-child(even) {
    background: var(--bp-zebra);
  }
  .tr .d {
    font: 800 17px var(--bp-mono);
    color: var(--bp-ink-2);
  }
  .tr .v {
    font: 700 21px var(--bp-mono);
  }
  .tr .m {
    font-size: 22px;
    font-weight: 800;
  }
  .tr .m.ok {
    color: var(--bp-ok);
  }
  .tr .m.no {
    color: #a7adb1;
  }
  .empty {
    padding: 26px 16px;
    text-align: center;
    font-size: 17px;
    color: var(--bp-ink-3);
  }
  .avg {
    background: var(--bp-surface);
    border: 3px solid var(--bp-line-strong);
    border-radius: var(--bp-r-card);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
  }
  .avg .l {
    font-size: 17px;
    font-weight: 700;
    color: var(--bp-ink-3);
  }
  .avg .v {
    font: 800 26px var(--bp-mono);
    color: var(--bp-header);
  }
  .avg .r {
    margin-left: auto;
    font-size: 17px;
    font-weight: 800;
    color: var(--bp-save-ink);
  }
  footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 4px 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--bp-ink-mute);
    text-wrap: pretty;
  }
  .dark {
    --bp-bg: #111827;
    --bp-surface: #1f2937;
    --bp-header: #0f172a;
    --bp-header-sub: #94a3b8;
    --bp-ink: #f9fafb;
    --bp-ink-2: #e5e7eb;
    --bp-ink-3: #9ca3af;
    --bp-ink-mute: #6b7280;
    --bp-am-border: #b45309;
    --bp-am-chip: #d97706;
    --bp-am-tint: #451a03;
    --bp-am-ink: #fde68a;
    --bp-pm-border: #0f766e;
    --bp-pm-chip: #0d9488;
    --bp-pm-soft: #115e59;
    --bp-save: #0369a1;
    --bp-save-ink: #f0f9ff;
    --bp-save-tint: #0c4a6e;
    --bp-ok: #10b981;
    --bp-line: #374151;
    --bp-line-strong: #4b5563;
    --bp-line-ink: #9ca3af;
    --bp-zebra: #1f2937;
  }
}
.bp-modal-enter {
  opacity: 0;
}
.bp-modal-enter-active {
  opacity: 1;
  transition: opacity 200ms ease-in;
}
.bp-modal-exit {
  opacity: 1;
}
.bp-modal-exit-active {
  opacity: 0;
  transition: opacity 200ms ease-out;
}
.dark input[type="date"] {
  color-scheme: dark;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.5;
}
.dark .ranges button[aria-pressed=true] {
  color: var(--bp-bg);
}
.dark .avg .v {
  color: #ffffff;
}
.theme-toggle-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.2s;
}
.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}
.dark .theme-toggle-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fbbf24;
}
.dark .theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.theme-toggle-btn #sunIcon {
  display: none;
}
.theme-toggle-btn #moonIcon {
  display: block;
}
.dark .theme-toggle-btn #sunIcon {
  display: block;
}
.dark .theme-toggle-btn #moonIcon {
  display: none;
}
.bottom-0 {
  bottom: 0;
}
.left-0 {
  left: 0;
}
.right-0 {
  right: 0;
}
.left-1\/2 {
  left: 50%;
}
.-translate-x-1\/2 {
  transform: translateX(-50%);
}
.inset-0 {
  inset: 0;
}
.top-4 {
  top: 1rem;
}
.right-4 {
  right: 1rem;
}
.scale-95 {
  transform: scale(0.95);
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.hidden {
  display: none !important;
}
.flex {
  display: flex;
}
@media (min-width: 768px) {
  #inputSection, #historySection {
    display: flex !important;
  }
  .md\:hidden {
    display: none !important;
  }
  .md\:pb-\[24px\] {
    padding-bottom: 24px !important;
  }
  .md\:\!flex {
    display: flex !important;
  }
}
@property --tw-translate-x {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}
@property --tw-translate-y {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}
@property --tw-translate-z {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}
@property --tw-scale-x {
  syntax: "*";
  inherits: false;
  initial-value: 1;
}
@property --tw-scale-y {
  syntax: "*";
  inherits: false;
  initial-value: 1;
}
@property --tw-scale-z {
  syntax: "*";
  inherits: false;
  initial-value: 1;
}
@property --tw-rotate-x {
  syntax: "*";
  inherits: false;
}
@property --tw-rotate-y {
  syntax: "*";
  inherits: false;
}
@property --tw-rotate-z {
  syntax: "*";
  inherits: false;
}
@property --tw-skew-x {
  syntax: "*";
  inherits: false;
}
@property --tw-skew-y {
  syntax: "*";
  inherits: false;
}
@property --tw-border-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}
@property --tw-leading {
  syntax: "*";
  inherits: false;
}
@property --tw-font-weight {
  syntax: "*";
  inherits: false;
}
@property --tw-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}
@property --tw-shadow-color {
  syntax: "*";
  inherits: false;
}
@property --tw-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}
@property --tw-inset-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}
@property --tw-inset-shadow-color {
  syntax: "*";
  inherits: false;
}
@property --tw-inset-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}
@property --tw-ring-color {
  syntax: "*";
  inherits: false;
}
@property --tw-ring-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}
@property --tw-inset-ring-color {
  syntax: "*";
  inherits: false;
}
@property --tw-inset-ring-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}
@property --tw-ring-inset {
  syntax: "*";
  inherits: false;
}
@property --tw-ring-offset-width {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
@property --tw-ring-offset-color {
  syntax: "*";
  inherits: false;
  initial-value: #fff;
}
@property --tw-ring-offset-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}
@property --tw-blur {
  syntax: "*";
  inherits: false;
}
@property --tw-brightness {
  syntax: "*";
  inherits: false;
}
@property --tw-contrast {
  syntax: "*";
  inherits: false;
}
@property --tw-grayscale {
  syntax: "*";
  inherits: false;
}
@property --tw-hue-rotate {
  syntax: "*";
  inherits: false;
}
@property --tw-invert {
  syntax: "*";
  inherits: false;
}
@property --tw-opacity {
  syntax: "*";
  inherits: false;
}
@property --tw-saturate {
  syntax: "*";
  inherits: false;
}
@property --tw-sepia {
  syntax: "*";
  inherits: false;
}
@property --tw-drop-shadow {
  syntax: "*";
  inherits: false;
}
@property --tw-drop-shadow-color {
  syntax: "*";
  inherits: false;
}
@property --tw-drop-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}
@property --tw-drop-shadow-size {
  syntax: "*";
  inherits: false;
}
@property --tw-backdrop-blur {
  syntax: "*";
  inherits: false;
}
@property --tw-backdrop-brightness {
  syntax: "*";
  inherits: false;
}
@property --tw-backdrop-contrast {
  syntax: "*";
  inherits: false;
}
@property --tw-backdrop-grayscale {
  syntax: "*";
  inherits: false;
}
@property --tw-backdrop-hue-rotate {
  syntax: "*";
  inherits: false;
}
@property --tw-backdrop-invert {
  syntax: "*";
  inherits: false;
}
@property --tw-backdrop-opacity {
  syntax: "*";
  inherits: false;
}
@property --tw-backdrop-saturate {
  syntax: "*";
  inherits: false;
}
@property --tw-backdrop-sepia {
  syntax: "*";
  inherits: false;
}
@property --tw-duration {
  syntax: "*";
  inherits: false;
}
@layer properties {
  @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
    *, ::before, ::after, ::backdrop {
      --tw-translate-x: 0;
      --tw-translate-y: 0;
      --tw-translate-z: 0;
      --tw-scale-x: 1;
      --tw-scale-y: 1;
      --tw-scale-z: 1;
      --tw-rotate-x: initial;
      --tw-rotate-y: initial;
      --tw-rotate-z: initial;
      --tw-skew-x: initial;
      --tw-skew-y: initial;
      --tw-border-style: solid;
      --tw-leading: initial;
      --tw-font-weight: initial;
      --tw-shadow: 0 0 #0000;
      --tw-shadow-color: initial;
      --tw-shadow-alpha: 100%;
      --tw-inset-shadow: 0 0 #0000;
      --tw-inset-shadow-color: initial;
      --tw-inset-shadow-alpha: 100%;
      --tw-ring-color: initial;
      --tw-ring-shadow: 0 0 #0000;
      --tw-inset-ring-color: initial;
      --tw-inset-ring-shadow: 0 0 #0000;
      --tw-ring-inset: initial;
      --tw-ring-offset-width: 0px;
      --tw-ring-offset-color: #fff;
      --tw-ring-offset-shadow: 0 0 #0000;
      --tw-blur: initial;
      --tw-brightness: initial;
      --tw-contrast: initial;
      --tw-grayscale: initial;
      --tw-hue-rotate: initial;
      --tw-invert: initial;
      --tw-opacity: initial;
      --tw-saturate: initial;
      --tw-sepia: initial;
      --tw-drop-shadow: initial;
      --tw-drop-shadow-color: initial;
      --tw-drop-shadow-alpha: 100%;
      --tw-drop-shadow-size: initial;
      --tw-backdrop-blur: initial;
      --tw-backdrop-brightness: initial;
      --tw-backdrop-contrast: initial;
      --tw-backdrop-grayscale: initial;
      --tw-backdrop-hue-rotate: initial;
      --tw-backdrop-invert: initial;
      --tw-backdrop-opacity: initial;
      --tw-backdrop-saturate: initial;
      --tw-backdrop-sepia: initial;
      --tw-duration: initial;
    }
  }
}

/* ========================================================
   自訂 UI 樣式修補 (抽菸追蹤器與設定按鈕)
======================================================== */
.settings-btn-offset {
  right: 74px !important;
}

.smoke-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  background-color: var(--bp-bg);
  padding: 16px;
  border-radius: 12px;
  border: 2px solid var(--bp-line-strong);
}

.smoke-btn {
  width: 68px;
  height: 68px;
  background-color: var(--bp-surface);
  border-radius: 14px;
  font-size: 40px;
  font-weight: 900;
  border: 3px solid var(--bp-line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: transform 0.1s;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.smoke-btn:active {
  transform: scale(0.92);
}
.smoke-btn.minus {
  color: #ff6b6b;
}
.smoke-btn.plus {
  color: #339af0;
}

.smoke-display-wrapper {
  flex: 1;
  text-align: center;
}
.smoke-display-number {
  font-size: 52px;
  font-weight: 900;
  font-family: monospace;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--bp-ink);
}
.smoke-display-unit {
  font-size: 18px;
  font-weight: 700;
  color: var(--bp-ink-3);
  margin-left: 4px;
}

/* ========================================================
   自訂 UI 樣式修補 (彈窗與表格)
======================================================== */
.modal-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background-color: rgba(0,0,0,0.6);
    z-index: 110;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    opacity: 0;
    transition: opacity 0.3s;
}
.dark .modal-overlay {
    background-color: rgba(0,0,0,0.8);
}
.modal-card {
    width: 100%;
    max-width: 360px;
    background-color: var(--bp-surface);
    border-radius: var(--bp-r-card);
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border: 3px solid var(--bp-line-strong);
    transform: scale(0.95);
    transition: transform 0.3s;
}
.modal-card.settings {
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 85vh;
    overflow-y: auto;
}

.history-row {
    display: grid;
    grid-template-columns: 80px 1fr 1fr 30px;
    gap: 6px;
    align-items: center;
    padding: 16px 14px;
    border-top: 2px solid var(--bp-line);
}

.opacity-100 {
    opacity: 1 !important;
}
.scale-100 {
    transform: scale(1) !important;
}

.settings-input {
    width: 100%;
    font-size: 18px;
    font-weight: 700;
    padding: 12px;
    background-color: var(--bp-bg);
    border: 2px solid var(--bp-line-strong);
    border-radius: 8px;
    color: var(--bp-ink);
    outline: none;
    transition: border-color 0.2s;
}
.settings-input:focus {
    border-color: var(--bp-save);
}
.settings-btn {
    width: 100%;
    margin-top: 8px;
    background-color: var(--bp-save);
    color: white;
    font-weight: 800;
    padding: 12px;
    border-radius: 10px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
}
.settings-btn:active { transform: scale(0.95); }

.sync-btn {
    width: 100%;
    background-color: #e7f5ff;
    color: #1971c2;
    border: 2px solid #a5d8ff;
    font-weight: 800;
    padding: 12px;
    border-radius: 10px;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.1s;
}
.dark .sync-btn {
    background-color: #183650;
    color: #74c0fc;
    border-color: #2b5a84;
}
.sync-btn:active { transform: scale(0.95); }

.settings-textarea {
    width: 100%;
    font-size: 14px;
    font-weight: 500;
    padding: 10px;
    background-color: var(--bp-surface);
    border: 2px solid var(--bp-line-strong);
    border-radius: 6px;
    color: var(--bp-ink);
    resize: none;
    outline: none;
}
.settings-textarea:focus { border-color: var(--bp-save); }

.manual-sync-btn {
    width: 100%;
    margin-top: 8px;
    background-color: var(--bp-line);
    color: var(--bp-ink);
    border: 2px solid var(--bp-line-strong);
    font-weight: 800;
    padding: 8px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
}
.manual-sync-btn:active { transform: scale(0.95); }

.modal-close-btn {
    width: 36px;
    height: 36px;
    background-color: var(--bp-line);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    color: var(--bp-ink-2);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.modal-close-btn:hover, .modal-close-btn:active {
    background-color: #ffe3e3;
    color: #e03131;
}

.settings-form-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.backup-btn {
    flex: 1;
    background-color: var(--bp-surface);
    color: var(--bp-ink);
    border: 2px solid var(--bp-line-strong);
    font-weight: 800;
    padding: 10px;
    border-radius: 8px;
    font-size: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.1s, border-color 0.2s;
}
.backup-btn:active {
    transform: scale(0.95);
    border-color: var(--bp-save);
}

/* Toast UI */
#toastContainer {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}
.toast {
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}
.toast.error { background-color: #e03131; }
.toast.success { background-color: #0ca678; }
