@font-face {
  font-family: "Equal Myanmar UI";
  src: url("./fonts/NotoSansMyanmarUI-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f1efe8;
  --bg-rail: #172723;
  --surface: #fffdf8;
  --surface-2: #f8f6f0;
  --surface-3: #efede6;
  --ink: #1a211e;
  --muted: #66706b;
  --soft: #8b938f;
  --line: #ddd9cf;
  --line-strong: #bdb8ad;
  --primary: #0d7a6e;
  --primary-strong: #075b53;
  --primary-soft: #e3f1ed;
  --accent: #a56c24;
  --accent-strong: #744816;
  --accent-soft: #f7eddd;
  --blue: #4b6980;
  --blue-soft: #e9eef1;
  --danger: #b53a32;
  --danger-strong: #8f2822;
  --danger-soft: #f9eae7;
  --warn: #96621d;
  --warn-soft: #f8efdf;
  --shadow: 0 10px 28px rgba(41, 39, 32, .065);
  --shadow-soft: 0 3px 10px rgba(41, 39, 32, .055);
  --nav-ink: #c8d2ce;
  --nav-ink-active: #ffffff;
  --nav-underline: #5dc2b2;
  --nav-underline-hover: rgba(255, 255, 255, .75);
  --field-bg: #fffefb;
  --field-bg-readonly: #efede7;
  --table-hover: #f2f7f4;
  --focus-ring: rgba(13, 122, 110, .22);
  --radius: 8px;
  --radius-sm: 6px;
  --touch: 40px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --font-myanmar: "Equal Myanmar UI", "Noto Sans Myanmar", "Myanmar Text", sans-serif;
  --font-ui: Aptos, "Segoe UI Variable Text", "Segoe UI", "Equal Myanmar UI", "Noto Sans Myanmar", "Myanmar Text", Arial, sans-serif;
  --font-display: Aptos, "Segoe UI Variable Display", "Segoe UI", "Equal Myanmar UI", "Noto Sans Myanmar", "Myanmar Text", Arial, sans-serif;
  --font-data: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1320;
  --bg-rail: #090e18;
  --surface: #171e2d;
  --surface-2: #1f293a;
  --surface-3: #2a3649;
  --ink: #f0f4fb;
  --muted: #a8b3c2;
  --soft: #808da0;
  --line: #303d51;
  --line-strong: #52627b;
  --primary: #2fb6c3;
  --primary-strong: #88dce6;
  --primary-soft: #123946;
  --accent: #d8a766;
  --accent-strong: #f0c98e;
  --accent-soft: #3b2b1c;
  --blue: #91b6ee;
  --blue-soft: #233654;
  --danger: #ee8078;
  --danger-strong: #ffaaa4;
  --danger-soft: #402522;
  --warn: #e2b466;
  --warn-soft: #3b301f;
  --shadow: 0 12px 30px rgba(0, 0, 0, .22);
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, .18);
  --nav-ink: #a8b3c2;
  --nav-ink-active: #ffffff;
  --nav-underline: #88dce6;
  --nav-underline-hover: rgba(255, 255, 255, .7);
  --field-bg: #121827;
  --field-bg-readonly: #222d3f;
  --table-hover: #202d3f;
  --focus-ring: rgba(47, 182, 195, .32);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: contain;
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.48;
  touch-action: manipulation;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: rgba(13, 122, 110, .12);
}

html:lang(my) body {
  font-family: var(--font-myanmar);
  font-size: 14px;
  line-height: 1.68;
}

img, svg, canvas, video {
  max-width: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(-160%);
  transition: transform .16s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  min-height: 64px;
  padding: 11px 18px;
  background: var(--bg-rail);
  color: #f8fafc;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 14px rgba(10, 16, 13, .16);
}

.brand {
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: fit-content;
  padding-right: 8px;
}

.brand:hover { text-decoration: none; }

.brand-logo {
  width: 150px;
  height: auto;
  flex: 0 0 150px;
  display: block;
}

.brand-logo-dark {
  display: none;
}

:root[data-theme="dark"] .brand-logo-light {
  display: none;
}

:root[data-theme="dark"] .brand-logo-dark {
  display: block;
}

nav {
  display: flex;
  flex: 1;
  gap: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  align-items: center;
}

nav::-webkit-scrollbar { height: 0; }
nav::-webkit-scrollbar { display: none; }

nav a {
  color: var(--nav-ink);
  padding: 10px 0;
  border-radius: 0;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  position: relative;
  white-space: nowrap;
  font-weight: 700;
  transition: color .18s ease;
}

html:lang(my) nav {
  gap: 22px;
}

html:lang(my) nav a {
  min-height: 46px;
  padding: 10px 1px;
  line-height: 1.55;
  font-weight: 650;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  height: 2px;
  border-radius: 999px;
  background: var(--nav-underline);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .2s ease, background .2s ease;
}

nav a:hover {
  color: #fff;
  text-decoration: none;
}

nav a:hover::after {
  background: var(--nav-underline-hover);
  transform: scaleX(1);
}

nav a.is-active {
  color: var(--nav-ink-active);
}

nav a.is-active::after {
  background: var(--nav-underline);
  transform: scaleX(1);
}

.mobile-nav {
  display: none;
}

.mobile-nav summary {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius-sm);
  color: #f8fafc;
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
  font-weight: 850;
  list-style: none;
}

.mobile-nav summary::-webkit-details-marker {
  display: none;
}

.mobile-nav summary {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav summary:hover {
  background: rgba(255, 255, 255, .12);
}

.menu-icon {
  display: grid;
  gap: 4px;
  width: 17px;
}

.menu-icon span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform .18s ease, opacity .18s ease;
}

.mobile-nav[open] .menu-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-nav[open] .menu-icon span:nth-child(2) {
  opacity: 0;
}

.mobile-nav[open] .menu-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-nav-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: min(330px, calc(100vw - 18px));
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  background: var(--bg-rail);
  box-shadow: 0 18px 34px rgba(0, 0, 0, .3);
}

.mobile-nav-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 5px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  color: #b9c5d4;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.mobile-nav-head strong {
  color: #fff;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.mobile-nav-panel a {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  color: var(--nav-ink);
  font-weight: 800;
}

html:lang(my) .mobile-nav-panel a {
  min-height: 42px;
  line-height: 1.42;
}

.mobile-nav-panel a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .08);
  text-decoration: none;
}

.mobile-nav-panel a.is-active {
  color: #fff;
  background: rgba(35, 169, 154, .2);
  box-shadow: inset 3px 0 0 var(--nav-underline);
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: #cbd5e1;
  font-size: 12px;
  white-space: nowrap;
}

.topbar-user > span {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-toggle {
  min-height: 32px;
  padding: 5px 9px;
  color: #d6dee8;
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .16);
  gap: 7px;
}

.theme-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}

.topbar-link {
  min-height: 32px;
  padding: 5px 9px;
  color: #d6dee8;
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .16);
}

.topbar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}

.theme-toggle-icon {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #f8fafc;
  box-shadow: inset -4px -3px 0 #94a3b8;
}

:root[data-theme="dark"] .theme-toggle-icon {
  background: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, .12);
}

.logout { margin: 0; }
.logout button {
  min-height: 32px;
  padding: 5px 9px;
  color: #d6dee8;
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .16);
}
.logout button:hover {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}

.account-settings-panel {
  margin-bottom: 12px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.settings-actions .theme-toggle,
.settings-actions .logout button {
  min-height: 36px;
  padding: 7px 11px;
  color: var(--ink);
  background: var(--surface-2);
  border-color: var(--line);
}

.settings-actions .theme-toggle:hover,
.settings-actions .logout button:hover {
  color: var(--ink);
  background: var(--surface-3);
}

.page {
  width: min(1260px, 100%);
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.page > * + * {
  margin-top: var(--space-5);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0;
  padding: 2px 0 4px;
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.eyebrow {
  color: var(--primary-strong);
  margin: 0 0 7px;
  text-transform: uppercase;
  font-family: var(--font-data);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .07em;
}

h1, h2 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
  font-family: var(--font-display);
}

h1 {
  font-size: clamp(24px, 2.35vw, 32px);
  max-width: 760px;
  text-wrap: balance;
}
h2 { font-size: 17px; }
h2, h3, .section-row strong, .tool-card strong {
  text-wrap: pretty;
}

.subtle {
  margin: 7px 0 0;
  color: var(--muted);
  max-width: 680px;
  text-wrap: pretty;
}

html:lang(my) h1,
html:lang(my) h2,
html:lang(my) h3 {
  font-family: var(--font-myanmar);
  line-height: 1.5;
  font-weight: 700;
}

html:lang(my) h1 {
  font-size: clamp(25px, 2.35vw, 33px);
}

html:lang(my) .subtle {
  line-height: 1.68;
}

h1, h2, h3, [id] {
  scroll-margin-top: 84px;
}

.table-anchor {
  scroll-margin-top: 96px;
}

.actions, .filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
}

html:lang(my) .actions,
html:lang(my) .filter-bar {
  gap: 10px;
}

.messages {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}

.audit-quick-links {
  width: min(1180px, 100%);
  margin: 0 auto 12px;
  padding: 0 14px;
}

.message, .warning-box {
  background: var(--warn-soft);
  border: 1px solid var(--warn);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
  color: var(--ink);
}

html:lang(my) .message,
html:lang(my) .warning-box {
  padding: 14px 16px;
  line-height: 1.45;
}

.message {
  --message-accent: var(--blue);
  --message-bg: color-mix(in srgb, var(--surface) 92%, var(--message-accent) 8%);
  --message-ink: var(--ink);
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 12px 15px 13px 13px;
  overflow: hidden;
  background: var(--message-bg);
  border: 1px solid color-mix(in srgb, var(--message-accent) 58%, var(--line));
  border-left: 3px solid var(--message-accent);
  box-shadow: var(--shadow);
  color: var(--message-ink);
  animation: toast-in .28s cubic-bezier(.2, .9, .25, 1) both;
  pointer-events: auto;
}

.message::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--message-accent);
  transform-origin: left;
  animation: toast-progress 5s linear forwards;
  opacity: .82;
}

.message span:not(.message-icon) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.message-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: color-mix(in srgb, var(--message-accent) 18%, transparent);
  color: var(--message-accent);
  font-size: 14px;
  font-weight: 900;
}

.message-icon::before {
  content: "i";
}

.message-close {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--message-accent) 35%, transparent);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--message-accent);
  font-size: 18px;
  line-height: 1;
}

.message-close:hover {
  background: color-mix(in srgb, var(--message-accent) 12%, transparent);
  text-decoration: none;
}

.message.is-hiding {
  animation: toast-out .2s ease-in both;
}

.message.is-hiding::after {
  animation-play-state: paused;
}

.message:hover::after,
.message:focus-within::after {
  animation-play-state: paused;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate3d(16px, 12px, 0) scale(.98);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translate3d(12px, 8px, 0) scale(.985);
  }
}

@keyframes toast-progress {
  to {
    transform: scaleX(0);
  }
}

.security-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
}

.security-warning span {
  display: block;
  margin-top: 3px;
}

.message.success { --message-accent: var(--primary); --message-bg: var(--primary-soft); }
.message.warning { --message-accent: var(--warn); --message-bg: var(--warn-soft); }
.message.error { --message-accent: var(--danger); --message-bg: var(--danger-soft); }
.message.info { --message-accent: var(--blue); --message-bg: var(--blue-soft); }
.message.success .message-icon::before { content: "\2713"; }
.message.warning .message-icon::before { content: "!"; }
.message.error .message-icon::before { content: "!"; }
.message.info .message-icon::before { content: "i"; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin: 0;
}

.dashboard-summary {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr .9fr;
  gap: 14px;
  margin: 0;
}

.warning-box + .dashboard-summary {
  margin-top: 18px;
}

.report-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-head .actions {
  align-self: flex-end;
}

.page-head .actions .button,
.page-head .actions button,
.price-actions .button,
.price-actions button {
  min-width: max-content;
  white-space: nowrap;
}

html:lang(my) .page-head .actions,
html:lang(my) .price-actions {
  align-items: stretch;
}

html:lang(my) .page-head .actions .button,
html:lang(my) .page-head .actions button,
html:lang(my) .price-actions .button,
html:lang(my) .price-actions button {
  min-width: 0;
  min-height: 42px;
  padding: 8px 13px;
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
}

html:lang(my) .date-strip .price-actions .button,
html:lang(my) .date-strip .price-actions button {
  min-height: 44px;
}

.owner-money-strip {
  gap: 12px;
  margin-bottom: 12px;
}

.money-card {
  border-top: 3px solid var(--line-strong);
  min-width: 0;
}

.money-card strong {
  max-width: 100%;
  font-size: clamp(18px, 1.15vw, 22px);
  line-height: 1.14;
  overflow-wrap: anywhere;
  word-break: normal;
}

.money-card small {
  overflow-wrap: anywhere;
}

.money-card.cash-in { border-top-color: var(--primary); }
.money-card.cash-out { border-top-color: var(--accent); }
.money-card.net-cash { border-top-color: var(--blue); }
.money-card.open-balance { border-top-color: #8a744e; }
.money-card.buy-total { border-top-color: #d97706; }
.money-card.sale-total { border-top-color: #0f766e; }

.report-detail-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.report-detail-grid .panel {
  min-width: 0;
}

.item-mix-panel {
  margin: 12px 0;
  padding: 18px 20px 20px;
}

.item-mix-panel .section-row {
  align-items: flex-start;
}

.item-mix-panel .subtle {
  max-width: 720px;
  margin-top: 3px;
  font-size: 13px;
}

.item-mix-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 16px;
  align-items: stretch;
}

.mix-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  padding: 4px 18px 0 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.mix-card[data-mix-chart="sell"] {
  padding: 4px 0 0 18px;
  border-right: 0;
}

.mix-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.mix-card-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.mix-card-head strong {
  order: -1;
  font-size: 18px;
  line-height: 1.15;
}

.mix-body {
  display: grid;
  grid-template-columns: minmax(112px, 136px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  min-width: 0;
}

.donut-shell {
  position: relative;
  width: min(136px, 100%);
  max-width: 100%;
  aspect-ratio: 1;
  place-self: center;
  isolation: isolate;
  perspective: 700px;
}

.donut-chart {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: filter .16s ease, transform .16s ease;
}

.donut-active {
  --active-color: var(--primary);
  --active-start: 0%;
  --active-end: 0%;
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background:
    conic-gradient(
      transparent 0% var(--active-start),
      var(--active-color) var(--active-start) var(--active-end),
      transparent var(--active-end) 100%
    );
  filter:
    drop-shadow(0 0 8px color-mix(in srgb, var(--active-color) 28%, transparent));
  opacity: .9;
  pointer-events: none;
  transform: none;
  transition: background .18s ease, filter .18s ease, transform .18s ease;
  -webkit-mask: radial-gradient(circle, transparent 0 51%, #000 52% 75%, transparent 76% 100%);
  mask: radial-gradient(circle, transparent 0 51%, #000 52% 75%, transparent 76% 100%);
  z-index: 1;
}

.donut-center {
  position: absolute;
  inset: 29%;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: none;
  z-index: 2;
}

.donut-center strong {
  font-family: var(--font-data);
  font-size: clamp(13px, 1.35vw, 16px);
  line-height: 1;
}

.donut-center span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  margin-top: 3px;
}

.mix-detail {
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  overflow: hidden;
  align-self: stretch;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.mix-detail > span {
  display: block;
  padding: 10px 12px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.mix-detail > strong {
  display: block;
  margin: 0;
  padding: 4px 12px 12px;
  font-family: var(--font-data);
  font-size: clamp(20px, 2.2vw, 25px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.mix-detail dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
  align-self: end;
}

.mix-detail dl div {
  display: grid;
  gap: 2px;
  padding: 9px 12px;
}

.mix-detail dl div + div {
  border-left: 1px solid var(--line);
}

.mix-detail dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mix-detail dd {
  margin: 0;
  text-align: left;
  font-family: var(--font-data);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.mix-legend {
  display: grid;
  gap: 7px;
  align-content: start;
  max-height: 292px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
}

.mix-legend button {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}

.mix-legend button:hover,
.mix-legend button.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.mix-legend button:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.mix-legend button span {
  width: 10px;
  height: 22px;
  border-radius: 999px;
  background: var(--mix-color);
}

.mix-legend button strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.15;
}

.mix-legend button small {
  color: var(--muted);
  font-family: var(--font-data);
  font-weight: 850;
}

.mix-card.is-empty .donut-shell {
  opacity: .55;
}

.transaction-sheet > .section-row #add-line {
  display: none !important;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.pagination-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.button.is-disabled {
  opacity: .45;
  pointer-events: none;
}

.summary-card {
  min-width: 0;
  min-height: 108px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
  transition: border-color .16s ease, background .16s ease;
}

html:lang(my) .summary-card {
  min-height: 116px;
  padding: 16px;
}

.summary-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.dashboard-summary .summary-card:nth-child(2) { border-top-color: var(--accent); }
.dashboard-summary .summary-card:nth-child(3) { border-top-color: var(--blue); }
.dashboard-summary .summary-card:nth-child(4) { border-top-color: var(--line-strong); }

.summary-card span,
.summary-card small {
  display: block;
  color: var(--muted);
}

.summary-card span {
  font-size: 12px;
  font-weight: 850;
}

.summary-card strong {
  display: block;
  margin: 7px 0 4px;
  font-family: var(--font-data);
  font-size: clamp(18px, 1.75vw, 23px);
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.summary-card small {
  font-size: 12px;
  line-height: 1.35;
}

.exact-money {
  display: block;
  margin: 0 0 4px;
  color: var(--muted);
  font-family: var(--font-data);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

html:lang(my) .summary-card span,
html:lang(my) .summary-card small,
html:lang(my) .exact-money {
  line-height: 1.45;
}

.summary-primary {
  border-top-color: var(--primary);
}

.stats-grid article, .panel, .form-card, .total-panel, .auth-panel, .receipt {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.stats-grid article {
  min-height: 104px;
  padding: 13px 14px;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

html:lang(my) .stats-grid article {
  min-height: 116px;
  padding: 15px 16px;
}

.stats-grid article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--primary);
}

.stats-grid article:nth-child(2)::before { background: var(--accent); }
.stats-grid article:nth-child(3)::before { background: var(--blue); }
.stats-grid article:nth-child(4)::before { background: var(--line-strong); }

.stats-grid span,
.stats-grid small {
  color: var(--muted);
  display: block;
}

.stats-grid strong {
  font-family: var(--font-data);
  font-size: clamp(20px, 2.4vw, 27px);
  display: block;
  margin: 5px 0 3px;
  letter-spacing: 0;
  max-width: 100%;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  word-break: normal;
}

.panel, .form-card, .auth-panel { padding: 18px 20px; }
.panel + .panel { margin-top: var(--space-5); }

html:lang(my) .panel,
html:lang(my) .form-card,
html:lang(my) .auth-panel {
  padding: 20px 22px;
}

html:lang(my) .panel + .panel {
  margin-top: 20px;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 12.75px;
  font-variant-numeric: tabular-nums;
}

th, td {
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

html:lang(my) th,
html:lang(my) td {
  padding: 12px 14px;
  line-height: 1.6;
}

html:lang(my) th {
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

th {
  color: var(--muted);
  background: var(--surface-3);
  font-size: 10.5px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .045em;
}

tbody tr {
  transition: background-color .14s ease;
}

tbody tr:hover { background: var(--table-hover); }
.voided { opacity: .58; text-decoration: line-through; }

.amount {
  text-align: right;
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

th.amount {
  font-family: var(--font-ui);
  text-align: right;
}

td.amount {
  max-width: 190px;
}

.record-link {
  color: var(--primary-strong);
  font-family: var(--font-data);
  font-weight: 800;
  white-space: nowrap;
}

.table-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.mini-badge.success {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-strong);
}

.mini-badge.danger {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.file-path {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-data);
  color: var(--muted);
}

.backup-summary .path-note {
  font-family: var(--font-data);
  overflow-wrap: anywhere;
}

.safety-plan-panel {
  margin-bottom: 14px;
}

.safety-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.safety-plan-grid article {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.safety-plan-grid article:nth-child(2) {
  border-left-color: var(--blue);
}

.safety-plan-grid article:nth-child(3) {
  border-left-color: var(--accent);
}

.safety-plan-grid span,
.safety-plan-grid small {
  color: var(--muted);
  font-size: 12px;
}

.safety-plan-grid span {
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.safety-plan-grid strong {
  font-size: 16px;
}

.safety-mode {
  margin-bottom: 14px;
}

.restore-steps {
  margin: 0 0 10px;
  padding-left: 22px;
  color: var(--ink);
}

.restore-steps li + li {
  margin-top: 7px;
}

.restore-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.restore-grid > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  min-width: 0;
}

.restore-grid span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  font-size: 11px;
}

.restore-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.link-list {
  display: grid;
  gap: 10px;
}

.link-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  min-width: 0;
}

.link-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.link-card a,
.link-card strong {
  color: var(--primary-strong);
  font-family: var(--font-data);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.health-list {
  display: grid;
  gap: 8px;
}

.health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.health-row.is-ok {
  border-left-color: var(--primary);
}

.health-row.needs-work {
  border-left-color: var(--danger);
}

.health-row strong,
.health-row span {
  display: block;
}

.health-row div > span {
  margin-top: 3px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.launch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.launch-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

.launch-card .restore-steps {
  margin: 10px 0 0;
}

.ops-strip {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 10px;
  margin: 0 0 12px;
}

.ops-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.ops-item strong,
.ops-item small {
  display: block;
}

.ops-item strong {
  font-size: 13px;
}

.ops-item small {
  color: var(--muted);
  margin-top: 2px;
}

.ops-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.ops-dot.neutral {
  background: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}

.ops-dot.cash {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.ops-item.needs-action .ops-dot {
  background: var(--warn);
  box-shadow: 0 0 0 4px var(--warn-soft);
}

.empty-state {
  display: grid;
  gap: 4px;
  justify-items: center;
  max-width: 460px;
  margin: 0 auto;
}

.empty-state strong {
  color: var(--ink);
}

.empty-state span {
  color: var(--muted);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 9px;
  border-radius: 5px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
  font-size: 11px;
}

html:lang(my) .status-chip {
  min-height: 34px;
  padding: 5px 10px;
  line-height: 1.35;
}

.panel > h2 {
  margin-bottom: 12px;
}

.auth-panel {
  width: min(860px, 100%);
  margin: 24px auto;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 12px;
  padding: 14px;
}

.auth-intro {
  min-height: 300px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--ink);
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.auth-logo-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.auth-logo-lockup img {
  width: min(430px, 100%);
  height: auto;
  display: block;
}

.auth-logo-lockup .login-logo-dark {
  display: none;
}

:root[data-theme="dark"] .auth-logo-lockup .login-logo-light {
  display: none;
}

:root[data-theme="dark"] .auth-logo-lockup .login-logo-dark {
  display: block;
}

.auth-form {
  box-shadow: none;
  border-color: var(--line);
  display: grid;
  align-content: center;
  gap: 8px;
}

.auth-form.has-login-error input,
.auth-form.has-username-error #id_username,
.auth-form.has-password-error #id_password {
  border-color: var(--line);
  background: var(--field-bg);
  outline: 1px solid var(--danger);
  outline-offset: -1px;
  box-shadow: none;
}

.auth-form.has-login-error input:focus,
.auth-form.has-username-error #id_username:focus,
.auth-form.has-password-error #id_password:focus {
  border-color: var(--line);
  outline: 1px solid var(--danger);
  outline-offset: -1px;
  box-shadow: none;
}

.auth-form button {
  margin-top: 10px;
}

.entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: start;
}

.entry-layout > .form-card {
  grid-column: 1;
  min-width: 0;
}
.transaction-sheet { display: grid; gap: 12px; }
.transaction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.note-field { grid-column: 1 / -1; }
.payment-choice {
  grid-column: 1 / -1;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  background: transparent;
}
.payment-choice legend {
  font-weight: 800;
  padding: 0;
  margin-bottom: 7px;
}
.payment-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.payment-option {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field-bg);
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.payment-option:hover {
  border-color: var(--primary);
  background: var(--surface-2);
}

.payment-option:has(input:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-color: var(--primary);
}
.payment-option:has(input:checked) {
  background: var(--primary-soft);
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 38%, transparent);
}
.payment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  min-height: 1px;
}
.payment-option-mark {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
  background: var(--surface);
  display: grid;
  place-items: center;
}
.payment-option-mark::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: transparent;
}
.payment-option:has(input:checked) .payment-option-mark {
  border-color: var(--primary);
  background: var(--surface);
}
.payment-option:has(input:checked) .payment-option-mark::after {
  background: var(--primary);
}
.payment-option strong,
.payment-option small {
  display: block;
}
.payment-option small {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2px;
}

html:lang(my) .payment-option {
  min-height: 72px;
  padding: 10px 12px;
}

html:lang(my) .payment-option strong,
html:lang(my) .payment-option small {
  line-height: 1.58;
}
.partial-paid-field { display: none; }
.partial-paid-field.is-visible { display: grid; }

.total-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: sticky;
  top: 78px;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-top: 3px solid var(--primary);
  box-shadow: var(--shadow);
}

.total-panel span { color: var(--muted); font-weight: 800; }
.total-panel strong {
  font-family: var(--font-data);
  font-size: 24px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.total-panel-head {
  display: grid;
  gap: 4px;
}

.total-panel-head small {
  color: var(--muted);
  font-weight: 750;
}

.total-panel-head .exact-money {
  margin-bottom: 0;
}

.total-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.total-breakdown > div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.total-breakdown span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.total-breakdown strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.total-breakdown .needs-attention {
  color: var(--accent-strong);
}

.total-actions {
  display: grid;
  gap: 8px;
}

.form-alert {
  padding: 9px 10px;
  border: 1px solid var(--danger);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 850;
}

.date-warning {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid rgba(199, 106, 29, .45);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  color: var(--ink);
}

.date-warning[hidden] {
  display: none;
}

.date-warning strong {
  font-size: 12px;
}

.date-warning span,
.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

form p { display: grid; gap: 5px; margin: 0 0 10px; }

html:lang(my) form p {
  gap: 7px;
  margin-bottom: 12px;
}

label {
  font-weight: 750;
  font-size: 12px;
  color: var(--ink);
  line-height: 1.25;
}

html:lang(my) label {
  font-family: var(--font-myanmar);
  line-height: 1.58;
  font-weight: 650;
}

html:lang(my) .field-help,
html:lang(my) .payment-option small,
html:lang(my) .form-alert,
html:lang(my) .date-warning {
  line-height: 1.52;
}

input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font: inherit;
  line-height: 1.25;
  background: var(--field-bg);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

html:lang(my) input,
html:lang(my) select,
html:lang(my) textarea {
  min-height: 46px;
  padding: 9px 12px;
  font-family: var(--font-myanmar);
  line-height: 1.6;
}

select {
  appearance: none;
  cursor: pointer;
  padding-right: 38px;
  font-weight: 750;
  background-color: var(--field-bg);
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23617084' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}

:root[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239ba9ba' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

select:hover {
  border-color: var(--primary);
  box-shadow: none;
}

select:focus-visible {
  box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow-soft);
}

select option {
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  line-height: 1.55;
}

select option:checked {
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 850;
}

:root[data-theme="dark"] select option {
  background: var(--bg-rail);
  color: var(--ink);
}

:root[data-theme="dark"] select option:checked {
  background: var(--primary);
  color: #06120f;
}

select:disabled {
  cursor: not-allowed;
  opacity: .72;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-color: var(--primary);
}

textarea { resize: vertical; }

button, .button {
  border: 1px solid var(--line-strong);
  background: var(--field-bg);
  color: var(--ink);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 750;
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease, transform .08s ease;
}

html:lang(my) button,
html:lang(my) .button {
  min-height: 42px;
  padding: 8px 13px;
  font-family: var(--font-myanmar);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 650;
}

html:lang(my) .primary,
html:lang(my) .button,
html:lang(my) .compact {
  text-wrap: balance;
}

button:hover, .button:hover {
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  border-color: var(--primary);
}

button:active,
.button:active {
  transform: translateY(1px);
  box-shadow: none;
}

button:disabled,
button[aria-busy="true"] {
  cursor: progress;
  opacity: .72;
  transform: none;
  box-shadow: none;
}

.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: none;
}

.primary:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}
.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.danger-soft { background: var(--danger-soft); color: var(--danger); border-color: #efbbb6; }
.full { width: 100%; }

.field-error {
  margin: 0;
  padding: 9px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 800;
}

.validation-summary {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: grid;
  gap: 5px;
  width: min(420px, calc(100vw - 24px));
  margin: 0;
  padding: 12px 13px;
  border: 1px solid var(--danger);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--ink);
  box-shadow: var(--shadow);
  animation: toast-in .28s cubic-bezier(.2, .9, .25, 1) both;
}

html:lang(my) .validation-summary {
  gap: 7px;
  padding: 14px 15px;
  line-height: 1.45;
}

.validation-summary strong {
  color: var(--danger);
  font-size: 14px;
}

.validation-summary span {
  color: var(--muted);
  font-weight: 750;
}

.validation-summary ul,
.errorlist {
  margin: 4px 0 0;
  padding-left: 18px;
}

.validation-summary li,
.errorlist li {
  margin-top: 3px;
}

.errorlist {
  color: var(--danger);
  font-size: 12px;
  font-weight: 850;
  display: none;
}

:is(input, select, textarea)[aria-invalid="true"],
:is(input, select, textarea).is-invalid {
  border-color: var(--line);
  background: var(--field-bg);
  outline: 1px solid var(--danger);
  outline-offset: -1px;
  box-shadow: none;
}

:is(input, select, textarea)[aria-invalid="true"]:focus,
:is(input, select, textarea).is-invalid:focus {
  border-color: var(--line);
  outline: 1px solid var(--danger);
  outline-offset: -1px;
  box-shadow: none;
}

.inline-error {
  display: block;
  margin-top: 5px;
  color: var(--danger);
  font-size: 11px;
  font-weight: 850;
}

.has-error {
  border-color: var(--line) !important;
  outline: 1px solid var(--danger) !important;
  outline-offset: -1px !important;
  box-shadow: none !important;
}

.payment-safety-card,
.danger-review-card {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.danger-review-card {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  border-left: 4px solid var(--danger);
  background: color-mix(in srgb, var(--danger-soft) 55%, var(--surface));
}

.payment-safety-card > div,
.danger-review-card > div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.payment-safety-card span,
.danger-review-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.payment-safety-card strong,
.danger-review-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-family: var(--font-data);
  font-size: 15px;
}

.payment-safety-balance {
  border-color: var(--accent) !important;
}

.danger-review-card p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: var(--ink);
  font-weight: 800;
}

.item-table-wrap {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.item-entry-table th,
.item-entry-table td {
  vertical-align: top;
}
.item-entry-table input,
.item-entry-table select {
  min-height: 38px;
}

.customer-sale-row input[name$="-custom_item_name"] {
  min-width: 0;
  width: 100%;
}

.customer-sale-row select[name$="-unit_type"] {
  min-width: 0;
  width: 100%;
}

.customer-sale-row input[name$="-quantity"],
.customer-sale-row input[name$="-unit_price"],
.customer-sale-row input[name$="-final_total"] {
  min-width: 0;
  width: 100%;
}

.customer-sale-row .item-picker-label {
  white-space: normal;
  line-height: 1.15;
}

.line-subtotal-preview {
  display: block;
  margin-top: 5px;
  white-space: normal;
}

.line-action {
  width: 108px;
  white-space: normal;
}

.line-action .remove-line {
  min-width: 82px;
  justify-content: center;
}

html:lang(my) .line-action {
  width: 118px;
}

html:lang(my) .line-action .remove-line {
  min-width: 96px;
  white-space: normal;
}

.line-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
}

.line-toolbar small {
  color: var(--muted);
  font-weight: 750;
}

.item-entry-table td[data-label="Item"],
.item-entry-table td[data-label="Saved item"] {
  position: relative;
  z-index: 2;
}

.line-row:has(.item-picker.is-open) td[data-label="Item"],
.line-row:has(.item-picker.is-open) td[data-label="Saved item"] {
  z-index: 12;
}

.native-item-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.item-picker {
  position: relative;
  min-width: 0;
}

.item-picker-trigger {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  justify-content: space-between;
  gap: 10px;
  border-color: var(--line-strong);
  background: var(--field-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .48);
}

.item-picker-trigger > span:first-child {
  display: grid;
  gap: 1px;
  min-width: 0;
  text-align: left;
}

.item-picker-label,
.item-picker-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-picker-label {
  color: var(--ink);
  font-weight: 850;
}

.item-picker-meta {
  min-height: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.item-picker-chevron {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .16s ease, border-color .16s ease;
}

.item-picker.has-value .item-picker-trigger {
  border-color: var(--primary);
}

.item-picker.is-open .item-picker-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow-soft);
}

.item-picker.is-open .item-picker-chevron {
  border-color: var(--primary);
  transform: rotate(225deg) translate(-2px, -1px);
}

.item-picker-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 7px);
  z-index: 80;
  width: max(100%, 280px);
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 38px rgba(20, 35, 32, .18);
  transform: translateY(-4px) scale(.985);
  transform-origin: top left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}

.item-picker.is-open .item-picker-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.item-picker-option {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  align-items: center;
  padding: 8px 10px 8px 12px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  text-align: left;
  transform: none;
}

.item-picker-option:hover {
  background: var(--surface-3);
  border-left-color: var(--primary);
  box-shadow: none;
  transform: none;
}

.item-picker-option.is-active,
.item-picker-option.is-selected {
  background: var(--primary-soft);
  border-left-color: var(--primary);
  color: var(--primary-strong);
}

.item-picker-name {
  overflow: hidden;
  color: inherit;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-picker-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-picker-option.is-selected .item-picker-sub {
  color: var(--primary-strong);
}

:root[data-theme="dark"] .item-picker-trigger {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

:root[data-theme="dark"] .item-picker-menu {
  background: #0d1722;
  border-color: var(--line-strong);
  box-shadow: 0 22px 44px rgba(0, 0, 0, .42);
}

:root[data-theme="dark"] .item-picker-option:hover {
  background: var(--surface-3);
}

:root[data-theme="dark"] .item-picker-option.is-active,
:root[data-theme="dark"] .item-picker-option.is-selected {
  background: #103b37;
  color: var(--primary-strong);
}

.line-total,
.price-input[readonly] {
  background: var(--field-bg-readonly);
  font-family: var(--font-data);
  font-weight: 800;
}
.date-strip {
  display: grid;
  grid-template-columns: minmax(220px, 400px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.date-strip p {
  margin: 0;
}

.price-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.date-strip .price-actions .button,
.date-strip .price-actions button {
  min-height: 42px;
}

.price-workbench {
  border-top: 3px solid var(--primary);
}

.price-workbench .item-table-wrap {
  background: var(--surface);
}

.price-table td:first-child strong,
.product-row strong {
  display: block;
  color: var(--ink);
}

.price-table td:first-child small,
.product-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.table-actions {
  white-space: normal;
}

.table-actions .button,
.table-actions button {
  white-space: normal;
}

.compact {
  min-height: 34px;
  padding: 5px 9px;
  font-size: 12px;
}

html:lang(my) .compact {
  min-height: 38px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.5;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.product-list {
  display: grid;
  gap: 8px;
}

.product-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.setup-card { max-width: none; }

.settings-tool-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.settings-groups {
  display: grid;
  gap: 16px;
}

.settings-group {
  display: grid;
  gap: 9px;
}

.settings-group h3 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.settings-tool-grid.compact-tools {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-card {
  display: grid;
  gap: 4px;
  min-height: 108px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 3px solid transparent;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  transition: border-color .16s ease, background-color .16s ease;
}

html:lang(my) .tool-card {
  gap: 6px;
  min-height: 118px;
  padding: 16px;
}

.tool-card:hover {
  text-decoration: none;
  border-color: var(--primary);
  border-top-color: var(--primary);
  background: var(--surface);
}

.tool-card span {
  color: var(--primary-strong);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  overflow-wrap: anywhere;
}

.tool-card strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.tool-card small {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

html:lang(my) .tool-card span,
html:lang(my) .tool-card strong,
html:lang(my) .tool-card small {
  line-height: 1.62;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 14px;
}

.settings-form-grid p {
  margin: 0;
}

.printer-settings {
  scroll-margin-top: 96px;
}

.printer-reality-note {
  display: grid;
  gap: 4px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
}

.printer-reality-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.printer-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .8fr);
  gap: 16px;
  align-items: start;
}

.printer-paper-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.printer-paper-field legend {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.printer-paper-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.printer-paper-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field-bg);
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.printer-paper-option:hover,
.printer-paper-option:has(input:focus-visible) {
  border-color: var(--primary);
}

.printer-paper-option:has(input:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.printer-paper-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 38%, transparent);
}

.printer-paper-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.printer-paper-mark {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}

.printer-paper-mark::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
}

.printer-paper-option:has(input:checked) .printer-paper-mark {
  border-color: var(--primary);
}

.printer-paper-option:has(input:checked) .printer-paper-mark::after {
  background: var(--primary);
}

.printer-paper-option strong,
.printer-paper-option small {
  display: block;
}

.printer-paper-option small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

.printer-name-field {
  margin: 0;
}

.printer-behavior-options {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.setting-switch {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
}

.setting-switch:has(input:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-color: var(--primary);
}

.setting-switch:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.setting-switch input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

.setting-switch strong,
.setting-switch small {
  display: block;
}

.setting-switch small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.4;
}

.printer-mode-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.printer-mode-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 11px 12px;
  border-top: 2px solid var(--primary);
  background: var(--surface-2);
}

.printer-mode-summary span {
  color: var(--primary-strong);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.printer-mode-summary small {
  color: var(--muted);
  line-height: 1.4;
}

.inline-settings-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.inline-settings-form p,
.inline-settings-form .form-actions {
  margin: 0;
}

.inline-settings-form .form-actions {
  display: flex;
  justify-content: flex-start;
}

.language-settings-panel select {
  min-height: 46px;
}

html:lang(my) .inline-settings-form {
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 16px;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 23, .48);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}

.confirm-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal-card {
  width: min(360px, 100%);
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 26px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .24);
  transform: translateY(10px) scale(.98);
  transition: transform .18s ease, opacity .18s ease;
}

.confirm-modal.is-open .confirm-modal-card {
  transform: translateY(0) scale(1);
}

.confirm-modal-copy h2 {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.2;
  text-align: center;
}

.confirm-modal-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
  font-size: 13px;
}

.confirm-modal-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.confirm-modal-actions .button,
.confirm-modal-actions .primary {
  min-height: 42px;
  justify-content: center;
}

html:lang(my) .confirm-modal-copy h2,
html:lang(my) .confirm-modal-copy p {
  line-height: 1.65;
}

.span-2 {
  grid-column: 1 / -1;
}

.switch-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
}

.switch-row input {
  width: 19px;
  min-height: 19px;
  flex: 0 0 19px;
}

.switch-row strong,
.switch-row small {
  display: block;
}

.switch-row small {
  color: var(--muted);
  margin-top: 3px;
}

.merge-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.merge-preview > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.merge-preview span,
.merge-preview small {
  display: block;
  color: var(--muted);
}

.merge-preview strong {
  display: block;
  margin: 4px 0;
  font-size: 16px;
}

.form-actions {
  margin-top: 12px;
}

.filter-bar {
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  align-items: end;
}

.filter-bar p {
  min-width: 0;
  margin: 0;
}

.filter-bar input,
.filter-bar select,
.filter-bar button,
.filter-bar .button {
  min-height: 42px;
}

.filter-bar button,
.filter-bar .button {
  min-width: 118px;
  width: 100%;
}

html:lang(my) .filter-bar button,
html:lang(my) .filter-bar .button {
  min-height: 44px;
  padding: 8px 13px;
  font-size: 13px;
  line-height: 1.5;
}

.report-filter button { margin-left: 0; }
.warning-text { color: var(--warn); font-weight: 800; }
.compact-switch {
  grid-column: auto;
  min-height: 38px;
  padding: 7px 9px;
}

.compact-switch strong {
  white-space: nowrap;
}

.history-filter button[type="submit"] {
  grid-column: -2 / -1;
}

.report-insights {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr);
  grid-auto-rows: 1fr;
  gap: 12px;
  align-items: stretch;
  margin: 12px 0;
}

.report-visual {
  min-width: 0;
}

.trend-list {
  display: grid;
  gap: 11px;
}

.trend-row {
  display: grid;
  gap: 6px;
}

.trend-meta,
.trend-values,
.top-balance-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.trend-meta strong,
.top-balance-list strong {
  font-family: var(--font-data);
  white-space: nowrap;
}

.trend-meta span,
.trend-values,
.balance-overview span,
.balance-overview small,
.top-balance-list span {
  color: var(--muted);
}

.trend-values {
  font-size: 11px;
}

.trend-track {
  display: flex;
  min-height: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-3);
}

.trend-segment {
  display: block;
  min-width: 0;
  transition: opacity .16s ease, transform .16s ease;
}

.trend-row:hover .trend-segment {
  opacity: .82;
}

.trend-segment.buy {
  background: var(--primary);
}

.trend-segment.sell {
  background: var(--accent);
}

.balance-overview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.balance-overview > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.balance-overview > div:nth-child(2) {
  border-left-color: var(--accent);
}

.balance-overview > div.net {
  border-left-color: var(--blue);
}

.balance-overview span,
.balance-overview small {
  display: block;
  font-weight: 800;
  font-size: 11px;
}

.balance-overview strong {
  display: block;
  margin: 4px 0 2px;
  font-family: var(--font-data);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.top-balance-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.top-balance-list > div {
  padding: 0 1px;
}

.close-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.close-summary span,
.close-difference span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  font-size: 11px;
}

.close-difference small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.close-summary strong,
.close-difference strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-data);
  font-size: 18px;
}

.close-difference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  border: 1px solid var(--primary);
}

.close-difference.needs-action {
  background: var(--warn-soft);
  border-color: var(--warn);
}

.receipt {
  width: min(430px, 100%);
  margin: 10px auto 14px;
  padding: 18px;
  color: #17202b;
  background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(250,249,245,.99));
  border: 0;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .13);
  color-scheme: light;
}

.receipt-header {
  text-align: center;
  margin-bottom: 10px;
  padding: 4px 0 12px;
  border-bottom: 1px dashed #aeb7c2;
}

.receipt h1 {
  font-family: var(--font-myanmar);
  font-size: 31px;
  line-height: 1.15;
  margin: 2px 0 0;
  color: #101827;
  letter-spacing: 0;
}

.receipt-contact {
  display: grid;
  gap: 2px;
  margin: 7px auto 0;
  max-width: 96%;
  color: #5f6c7c;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.receipt-meta {
  padding: 9px 0 10px;
  border-top: 0;
  border-bottom: 1px dashed #aeb7c2;
  font-size: 12px;
}

.receipt-meta, .totals { display: grid; gap: 6px; margin: 10px 0; }
.receipt-meta div, .totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  min-width: 0;
}

.receipt-meta .receipt-number {
  align-items: center;
  margin-bottom: 2px;
  padding: 0 0 5px;
  border-bottom: 1px solid #e3e8ef;
}

.receipt-meta .receipt-number dd {
  font-size: 12.5px;
}

.receipt dt,
.receipt .totals dt { color: #667085; }
.receipt dd,
.receipt .totals dd {
  margin: 0;
  font-weight: 800;
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.receipt-items {
  display: grid;
  gap: 0;
  margin: 10px 0 0;
  border-top: 0;
  border-bottom: 1px dashed #aeb7c2;
  overflow: hidden;
}

.receipt-items-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 7px 0 5px;
  color: #475569;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.receipt-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: baseline;
  padding: 7px 0;
  font-family: var(--font-data);
  font-size: 12.25px;
  font-variant-numeric: tabular-nums;
  color: #111827;
}

.receipt-item + .receipt-item {
  border-top: 1px solid #e3e8ef;
}

.receipt-items-head span:last-child,
.receipt-item-total {
  text-align: right;
  white-space: nowrap;
}

.receipt-item-name {
  font-family: var(--font-ui);
  font-weight: 900;
  font-size: 12.5px;
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.receipt-item-total {
  font-weight: 900;
}

.receipt-item-detail {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 6px;
  color: #667085;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.35;
}

.totals {
  border-top: 0;
  padding: 10px 0 0;
}

.totals .grand-total {
  font-size: 17px;
  padding-bottom: 7px;
  border-bottom: 1px solid #e3e8ef;
}

.totals .grand-total dt,
.totals .grand-total dd {
  color: #101827;
}

.totals .balance-total dd {
  color: #0f766e;
  font-size: 15px;
}

.totals .paid-full dd {
  color: #0f766e;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.receipt-footer {
  display: block;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #aeb7c2;
  color: #4b5565;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0;
}

.receipt-closing {
  break-inside: avoid;
  page-break-inside: avoid;
}
.void-banner { border: 2px solid var(--danger); color: var(--danger); padding: 8px; text-align: center; font-weight: 800; margin: 10px 0; }

.receipt-actions {
  justify-content: center;
  margin: 0 auto 18px;
}

.receipt-print-page {
  min-height: 100vh;
  background: var(--bg);
}

.receipt-print-shell {
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.receipt-print-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  background: var(--surface);
}

.receipt-print-toolbar h1 {
  margin: 2px 0;
  font-family: var(--font-data);
  font-size: 18px;
}

.receipt-print-toolbar p {
  margin: 0;
}

.receipt-print-notice {
  grid-column: 1 / -1;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.45;
}

.receipt-print-checklist {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  margin: 0;
  padding: 10px 0 0 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.receipt-print-checklist strong {
  color: var(--ink);
}

.receipt-print-sheet {
  width: fit-content;
  margin: 0 auto;
}

.receipt-print-sheet .receipt {
  margin: 0;
}

/* Keep the dedicated preview metrically identical to the printed receipt so
   JavaScript can calculate the continuous-roll page length before printing. */
.receipt-print-page .receipt {
  padding: 0;
  font-size: 11px;
}

.receipt-print-page .receipt h1 {
  font-size: 22px;
}

.receipt-print-page .receipt-header {
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.receipt-print-page .receipt-contact {
  gap: 1px;
  margin-top: 5px;
  font-size: 10px;
}

.receipt-print-page .receipt-meta {
  gap: 3px;
  margin: 7px 0;
  padding-bottom: 8px;
  font-size: 10px;
}

.receipt-print-page .receipt-meta .receipt-number {
  margin-bottom: 1px;
  padding: 0;
}

.receipt-print-page .receipt-meta .receipt-number dd {
  font-size: 10.5px;
}

.receipt-print-page .receipt-meta div,
.receipt-print-page .totals div {
  gap: 6px;
}

.receipt-print-page .receipt-items {
  margin-top: 7px;
}

.receipt-print-page .receipt-items-head {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 5px 0 4px;
  font-size: 8px;
}

.receipt-print-page .receipt-item {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding: 5px 0;
  font-size: 11.5px;
}

.receipt-print-page .receipt-item-name {
  font-size: 11.5px;
}

.receipt-print-page .receipt-item-detail {
  gap: 2px 5px;
  font-size: 9.5px;
}

.receipt-print-page .totals {
  gap: 3px;
  margin: 7px 0;
  padding-top: 7px;
}

.receipt-print-page .totals .grand-total {
  padding-bottom: 4px;
  font-size: 14px;
}

.receipt-print-page .totals .paid-full dd {
  padding: 0;
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
}

.receipt-print-page .receipt-footer {
  margin-top: 8px;
  padding-top: 7px;
}

.receipt-print-page.receipt-paper-58 .receipt h1 {
  font-size: 19px;
}

.receipt-print-page.receipt-paper-58 .receipt-contact,
.receipt-print-page.receipt-paper-58 .receipt-meta {
  font-size: 8.5px;
}

.receipt-print-page.receipt-paper-58 .receipt-items-head {
  display: none;
}

.receipt-print-page.receipt-paper-58 .receipt-item {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 6px;
  padding: 5px 0;
  font-size: 10px;
}

.receipt-print-page.receipt-paper-58 .receipt-item-name {
  font-size: 10px;
}

.receipt-print-page.receipt-paper-58 .receipt-item-detail {
  font-size: 8.5px;
}

.receipt-paper-58 .receipt-print-sheet .receipt {
  width: min(330px, calc(100vw - 28px));
}

.print-guide {
  width: min(430px, 100%);
  margin: 0 auto 18px;
}

.print-guide ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.print-guide li + li {
  margin-top: 5px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .message {
    animation: none;
  }
}

@media (max-width: 1180px) {
  .report-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .topbar {
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
  }
  .brand {
    flex: 1 1 auto;
    min-width: 0;
  }
  .brand-logo {
    width: 132px;
    height: auto;
    flex-basis: 132px;
  }
  nav { display: none; }
  .mobile-nav {
    display: block;
    order: 3;
    width: auto;
    flex: 0 0 auto;
    position: relative;
  }
  .topbar-user {
    order: 2;
    margin-left: auto;
    flex: 0 0 auto;
  }
  .topbar-user > span {
    max-width: 84px;
    color: #b9c5d4;
  }
  .ops-strip, .launch-grid { grid-template-columns: 1fr; }
  .dashboard-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-tool-grid,
  .settings-tool-grid.compact-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid, .entry-layout, .auth-panel { grid-template-columns: 1fr; }
  .report-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .total-panel { grid-column: auto; grid-row: auto; position: static; }
  .transaction-grid { grid-template-columns: 1fr; }
  .note-field { grid-column: auto; }
  .date-strip { grid-template-columns: 1fr; }
  .price-actions,
  .date-strip .price-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .date-strip .price-actions .button,
  .date-strip .price-actions button {
    flex: 1 1 180px;
  }
  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .history-filter button[type="submit"] {
    grid-column: auto;
  }
  .payment-options { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .actions { width: auto; display: flex; }
  .actions .button { width: auto; min-width: 0; }
  .payment-safety-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .payment-safety-balance {
    grid-column: 1 / -1;
  }
  .danger-review-card {
    grid-template-columns: 1fr;
  }
  .security-warning { align-items: flex-start; flex-direction: column; }
  .close-summary { grid-template-columns: 1fr; }
  .report-insights { grid-template-columns: 1fr; }
  .item-mix-grid { grid-template-columns: 1fr; }
  .mix-card {
    padding: 0 0 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .mix-card[data-mix-chart="sell"] {
    padding: 18px 0 0;
    border-bottom: 0;
  }
  .safety-plan-grid { grid-template-columns: 1fr; }
  .merge-preview { grid-template-columns: 1fr; }
  .restore-grid { grid-template-columns: 1fr; }
  .report-filter button { margin-left: 0; }
  .auth-intro { min-height: 220px; }
  h1 { font-size: 27px; }
  h2 { font-size: 16px; }
}

@media (max-width: 700px) {
  .printer-settings-grid,
  .printer-behavior-options,
  .printer-mode-summary {
    grid-template-columns: 1fr;
  }
  .printer-behavior-options {
    grid-column: auto;
  }
  .receipt-print-toolbar {
    grid-template-columns: 1fr;
  }
  .receipt-print-toolbar .actions,
  .receipt-print-notice {
    grid-column: auto;
  }
  .actions,
  .form-actions,
  .receipt-actions,
  .total-actions,
  .price-actions {
    width: 100%;
  }
  .actions .button,
  .actions button,
  .form-actions .button,
  .form-actions button,
  .receipt-actions .button,
  .receipt-actions button,
  .total-actions .button,
  .total-actions button,
  .price-actions .button,
  .price-actions button {
    flex: 1 1 150px;
    min-width: 0;
  }
  .filter-bar { gap: 10px; }
  .filter-bar p {
    min-width: 0;
  }
  .filter-bar button,
  .filter-bar .button,
  .compact-switch {
    width: 100%;
  }
  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .dashboard-summary,
  .report-stats {
    grid-template-columns: 1fr;
  }
  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }
  .table-wrap table {
    background: transparent;
    font-size: 12px;
  }
  .table-wrap thead {
    display: none;
  }
  .table-wrap tbody {
    display: grid;
    gap: 8px;
  }
  .table-wrap tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: none;
  }
  html:lang(my) .table-wrap tr {
    gap: 10px 14px;
    padding: 14px;
  }
  .table-wrap td {
    min-width: 0;
    padding: 0;
    border: 0;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.32;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  html:lang(my) .table-wrap td {
    line-height: 1.52;
  }
  .table-wrap td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 850;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: .04em;
    overflow-wrap: anywhere;
  }
  html:lang(my) .table-wrap td::before {
    font-size: 10px;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
  }
  .table-wrap td:first-child {
    grid-column: 1 / -1;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--line);
  }
  .table-wrap td:first-child::before {
    display: inline;
    margin: 0 6px 0 0;
  }
  .table-wrap .amount {
    grid-column: 1 / -1;
    white-space: normal;
  }
  .table-wrap .record-link,
  .table-wrap td:first-child strong {
    font-size: 13px;
  }
  .table-wrap .mini-badge {
    min-height: 20px;
    padding: 1px 6px;
    font-size: 10px;
  }
  .table-wrap .table-note {
    font-size: 11px;
  }
  .table-wrap .empty-cell {
    grid-column: 1 / -1;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
  }
  .table-wrap .empty-cell::before {
    content: none;
  }
  .item-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }
  .item-entry-table thead { display: none; }
  .item-entry-table,
  .item-entry-table tbody,
  .item-entry-table tr {
    display: block;
    width: 100%;
  }
  .item-entry-table {
    background: transparent;
  }
  .item-entry-table tbody {
    display: grid;
    gap: 10px;
  }
  .item-entry-table td {
    display: grid;
    grid-template-columns: minmax(78px, .45fr) minmax(0, 1fr);
    gap: 9px;
    width: 100%;
    align-items: center;
  }
  html:lang(my) .item-entry-table td {
    grid-template-columns: minmax(96px, .45fr) minmax(0, 1fr);
    gap: 10px;
  }
  .item-entry-table tr {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: none;
  }
  .item-entry-table td {
    border: 0;
    padding: 0 0 8px;
  }
  .item-entry-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-weight: 800;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
  }
  .item-entry-table tr > td:last-child {
    padding-bottom: 0;
  }
  .line-action {
    width: 100%;
    white-space: normal;
  }
  .line-action .remove-line {
    width: 100%;
  }
  .line-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .line-toolbar .button {
    width: 100%;
  }
  .item-picker-menu {
    width: 100%;
    max-height: 260px;
  }
  .table-actions {
    display: flex !important;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-start;
    white-space: normal;
    min-width: 0;
  }
  .table-actions .button,
  .table-actions button {
    flex: 1 1 92px;
    min-width: 0;
  }
  .table-wrap .table-actions {
    grid-column: 1 / -1;
    padding-top: 6px;
    border-top: 1px solid var(--line);
  }
  .table-wrap .table-actions::before {
    content: none;
  }
  .table-wrap .table-actions .button,
  .table-wrap .table-actions button {
    flex: 0 1 auto;
    width: auto;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
    align-items: center;
    justify-content: center;
  }
  .price-table td:first-child strong,
  .product-row strong {
    line-height: 1.2;
  }
  .dashboard-summary {
    gap: 9px;
  }
  .summary-card {
    min-height: 104px;
    padding: 11px;
  }
  .mix-body {
    grid-template-columns: minmax(112px, 136px) minmax(0, 1fr);
  }
  .donut-shell {
    width: min(136px, 100%);
  }
}

@media (max-width: 520px) {
  .printer-paper-options {
    grid-template-columns: 1fr;
  }
  .messages {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }
  body { font-size: 13px; }
  html:lang(my) body { font-size: 14px; }
  .page { padding: 12px 10px 24px; }
  .topbar { padding: 9px; }
  .topbar-user { font-size: 11px; }
  .mobile-nav-panel {
    grid-template-columns: 1fr;
    width: min(300px, calc(100vw - 18px));
  }
  .mobile-nav-panel a { min-height: 36px; }
  html:lang(my) .mobile-nav-panel a { min-height: 42px; }
  .panel, .form-card, .auth-panel, .stats-grid article { padding: 12px; }
  html:lang(my) .panel,
  html:lang(my) .form-card,
  html:lang(my) .auth-panel,
  html:lang(my) .stats-grid article {
    padding: 14px;
  }
  .actions .button,
  .actions button,
  .form-actions .button,
  .form-actions button,
  .receipt-actions .button,
  .receipt-actions button,
  .total-actions .button,
  .total-actions button,
  .price-actions .button,
  .price-actions button,
  .table-actions .button,
  .table-actions button {
    flex-basis: 100%;
    width: 100%;
  }
  .page-head .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }
  .page-head .actions .button,
  .page-head .actions button {
    width: auto;
    min-width: 0;
  }
  .date-strip .price-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .date-strip .price-actions .button,
  .date-strip .price-actions button {
    width: auto;
    min-width: 0;
  }
  .payment-safety-card,
  .danger-review-card {
    grid-template-columns: 1fr;
    padding: 10px;
  }
  .payment-safety-balance {
    grid-column: auto;
  }
  .dashboard-summary,
  .report-stats,
  .settings-tool-grid,
  .settings-tool-grid.compact-tools,
  .settings-form-grid,
  .inline-settings-form,
  html:lang(my) .inline-settings-form {
    grid-template-columns: 1fr;
  }
  .inline-settings-form .form-actions,
  .inline-settings-form .form-actions button {
    width: 100%;
  }
  .confirm-modal {
    align-items: end;
    padding: 12px;
  }
  .confirm-modal-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .confirm-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .confirm-modal-actions .button,
  .confirm-modal-actions button {
    width: auto;
    min-width: 0;
  }
  .mix-card {
    padding: 12px;
  }
  .mix-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .mix-detail {
    width: 100%;
  }
  .mix-legend {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: auto;
  }
  .tool-card {
    min-height: 92px;
    padding: 14px;
  }
  html:lang(my) .tool-card {
    min-height: 104px;
    padding: 16px;
  }
  .link-card,
  .launch-card,
  .tool-card,
  .summary-card,
  .stats-grid article {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .auth-panel { margin: 10px auto; }
  th, td { padding: 8px 9px; }
  table { font-size: 12px; }
  input, select, textarea { min-height: 40px; padding: 8px 10px; }
  button, .button { min-height: 38px; padding: 7px 10px; }
  html:lang(my) input,
  html:lang(my) select,
  html:lang(my) textarea {
    min-height: 44px;
    padding: 9px 11px;
  }
  html:lang(my) button,
  html:lang(my) .button {
    min-height: 42px;
    padding: 9px 11px;
  }
  .payment-option { min-height: 58px; }
  .stats-grid strong { font-size: 22px; }
  .ops-item { min-height: 58px; padding: 9px 10px; }
  .filter-bar {
    grid-template-columns: 1fr;
  }
  .security-warning {
    margin-top: 14px;
  }
  .table-wrap {
    margin-left: -2px;
    margin-right: -2px;
  }
  .section-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .settings-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .settings-actions .button,
  .settings-actions .theme-toggle,
  .settings-actions .logout,
  .settings-actions .logout button {
    width: 100%;
  }
  .trend-meta,
  .trend-values,
  .top-balance-list > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
  .item-entry-table td {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .table-wrap tr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 12px;
  }
  html:lang(my) .table-wrap tr {
    gap: 12px 14px;
    padding: 14px;
  }
  .table-wrap td {
    display: block;
    font-size: 12px;
    line-height: 1.4;
  }
  html:lang(my) .table-wrap td {
    font-size: 12.5px;
    line-height: 1.65;
  }
  .table-wrap td::before {
    margin: 0 0 3px;
    font-size: 9px;
    line-height: 1.2;
  }
  html:lang(my) .table-wrap td::before {
    font-size: 10px;
    line-height: 1.4;
  }
  .table-wrap td:first-child {
    display: block;
    grid-column: 1 / -1;
  }
  .table-wrap td:first-child::before {
    display: inline;
  }
  .table-wrap .table-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-column: 1 / -1;
  }
  .table-wrap .table-actions .button,
  .table-wrap .table-actions button {
    width: 100%;
  }
  .receipt {
    width: 100%;
    padding: 12px;
  }
  .receipt-items-head,
  .receipt-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
}

@media (max-width: 430px) {
  .actions { gap: 6px; }
  .receipt-print-checklist { grid-template-columns: 1fr; }
}

@media print {
  @page {
    size: auto;
    margin: 1.5mm 3mm;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html, body {
    width: 68mm;
    min-width: 68mm;
    max-width: 68mm;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: #fff !important;
    color: #000 !important;
    font-family: "Equal Myanmar UI", "Myanmar Text", "Noto Sans Myanmar", Arial, sans-serif;
    color-scheme: light;
    overflow: visible;
  }

  body * {
    visibility: hidden;
  }

  .receipt,
  .receipt * {
    visibility: visible;
  }

  .no-print, .topbar, .messages { display: none !important; }
  .page {
    width: 68mm;
    min-width: 68mm;
    max-width: 68mm;
    margin: 0;
    padding: 0;
    background: #fff !important;
    color: #000 !important;
  }
  .receipt {
    position: absolute;
    left: 0;
    top: 0;
    border: 0;
    box-shadow: none;
    width: 68mm;
    min-width: 68mm;
    max-width: 68mm;
    padding: 0;
    margin: 0;
    color: #000;
    background: #fff;
    font-size: 11px;
    overflow: visible;
    color-scheme: light;
  }

  .receipt-print-page,
  .receipt-print-page .receipt-print-shell,
  .receipt-print-page .receipt-print-sheet {
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 0;
    background: #fff;
    vertical-align: top;
  }

  .receipt-print-page .receipt-print-shell,
  .receipt-print-page .receipt-print-sheet {
    display: block;
  }

  .receipt-print-page .receipt {
    position: static;
    left: auto;
    top: auto;
  }

  .receipt,
  .receipt * {
    background: #fff !important;
    box-shadow: none !important;
    color: #000 !important;
    text-decoration: none !important;
    text-shadow: none !important;
  }

  .receipt a[href]::after {
    content: none !important;
  }

  .receipt h1 { font-size: 22px; }
  .receipt-contact,
  .receipt-footer,
  .receipt-meta dt,
  .totals dt {
    color: #333;
  }
  .receipt h1,
  .receipt-contact,
  .receipt-footer {
    overflow-wrap: anywhere;
  }
  .receipt-header {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border: 0;
    border-bottom: 1px dashed #999;
    border-radius: 0;
  }
  .receipt-contact {
    gap: 1px;
    margin-top: 5px;
    font-size: 10px;
  }
  .receipt-meta {
    gap: 3px;
    margin: 7px 0;
    padding-bottom: 8px;
    border-bottom-color: #999;
    font-size: 10px;
  }

  .receipt-meta .receipt-number {
    padding: 0;
    border: 0;
    border-radius: 0;
    margin-bottom: 1px;
  }

  .receipt-meta .receipt-number dd {
    font-size: 10.5px;
  }

  .receipt-meta div,
  .totals div {
    gap: 6px;
    min-width: 0;
  }

  .receipt-meta dt,
  .totals dt {
    flex: 0 0 auto;
  }

  .receipt-meta dd,
  .totals dd {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .receipt-items {
    margin-top: 7px;
    border: 0;
    border-bottom: 1px dashed #999;
    border-radius: 0;
    overflow: visible;
  }

  .receipt-items-head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 5px 0 4px;
    font-size: 8px;
  }
  .receipt-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 8px;
    padding: 5px 0;
    font-size: 11.5px;
    break-inside: avoid;
    page-break-inside: avoid;
    min-width: 0;
  }
  .receipt-item + .receipt-item {
    border-top-color: #ddd;
  }

  .receipt-item-name {
    font-size: 11.5px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .receipt-item-detail {
    gap: 2px 5px;
    font-size: 9.5px;
  }
  .totals {
    gap: 3px;
    margin: 7px 0;
    padding-top: 7px;
    border: 0;
    border-radius: 0;
  }
  .totals .grand-total {
    font-size: 14px;
    padding-bottom: 4px;
    border-bottom-color: #ccc;
  }
  .totals .balance-total dd,
  .totals .paid-full dd,
  .totals .grand-total dt,
  .totals .grand-total dd {
    color: #000;
  }
  .totals .paid-full dd {
    display: block;
    padding: 0;
    font-size: 11.5px;
    text-transform: none;
    letter-spacing: 0;
  }
  .receipt-footer {
    margin-top: 8px;
    padding-top: 7px;
    border-top-color: #999;
  }
  .void-banner {
    border-color: #000;
    color: #000;
  }

  .receipt-paper-58 .receipt h1 {
    font-size: 19px;
  }

  .receipt-paper-58 .receipt-contact {
    font-size: 8.5px;
  }

  .receipt-paper-58 .receipt-meta {
    font-size: 8.5px;
  }

  .receipt-paper-58 .receipt-items-head {
    display: none;
  }

  .receipt-paper-58 .receipt-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 6px;
    padding: 5px 0;
    font-size: 10px;
  }

  .receipt-paper-58 .receipt-item-name {
    font-size: 10px;
  }

  .receipt-paper-58 .receipt-item-detail {
    font-size: 8.5px;
  }
}
