:root {
  --bg: #f4f7fb;
  --panel: #fff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --dark: #0f172a;
  --blue: #2563eb;
  --rose: #e11d48;
  --green: #059669;
  --orange: #f97316;
  --purple: #7c3aed;
  --shadow: 0 16px 40px rgba(15, 23, 42, .08);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  max-width: 100%;
  font: inherit;
}

.app {
  display: flex;
  min-height: 100vh;
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex: 0 0 280px;
  flex-direction: column;
  gap: 24px;
  width: 280px;
  height: 100vh;
  padding: 28px;
  overflow-y: auto;
  background: #0f172a;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: var(--blue);
  font-weight: 900;
}

.brand strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.brand span,
.userbox small {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
}

.userbox {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 22px;
  background: rgba(255, 255, 255, .06);
}

.userbox b,
.userbox span {
  overflow-wrap: anywhere;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav a {
  display: block;
  padding: 15px 16px;
  border-radius: 16px;
  color: #94a3b8;
  font-weight: 800;
}

.nav a.active,
.nav a:hover {
  background: var(--blue);
  color: #fff;
}

.logout {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: #94a3b8;
  font-weight: 800;
}

main {
  flex: 1;
  min-width: 0;
  padding: 34px;
  overflow-x: hidden;
  overflow-y: auto;
}

.wrap {
  width: min(100%, 1440px);
  margin: 0 auto;
}

.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.top h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: 0;
  line-height: 1.18;
}

.top p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.55;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--dark);
  color: #fff;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
}

.btn.blue {
  background: var(--blue);
}

.btn.green {
  background: var(--green);
}

.btn.light {
  background: #f1f5f9;
  color: #334155;
}

.btn.rose {
  background: var(--rose);
}

.btn.small {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 12px;
}

.grid2,
.grid3,
.grid4,
.formgrid {
  display: grid;
  gap: 18px;
}

.grid2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.grid3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}

.grid4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 14px;
}

.formgrid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 14px;
}

.layout2 {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 420px);
  gap: 20px;
}

.card {
  min-width: 0;
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card > :first-child {
  margin-top: 0;
}

.stat small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stat strong {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.24;
}

.tablebox {
  min-width: 0;
  margin-bottom: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.toolbar > * {
  min-width: 0;
}

.toolbar input,
.toolbar select {
  flex: 1 1 180px;
  min-width: min(100%, 180px);
}

.scroll {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
}

th {
  padding: 15px;
  border-bottom: 1px solid var(--line);
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 15px;
  border-bottom: 1px solid #f1f5f9;
  font-weight: 700;
  vertical-align: middle;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.center {
  text-align: center;
}

.badge {
  display: inline-flex;
  padding: 4px 9px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.blue {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
}

.badge.green {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #059669;
}

.badge.rose {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #e11d48;
}

.badge.orange {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #ea580c;
}

.badge.purple {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #7c3aed;
}

.badge.slate {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #475569;
}

.field,
label.field {
  display: block;
}

.field label,
.field > span {
  display: block;
  margin: 0 0 6px 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.field input,
.field textarea,
.field select,
.actions input,
.actions textarea,
.actions select,
.toolbar input,
.toolbar textarea,
.toolbar select,
form > input,
form > select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  padding: 13px;
  font-weight: 800;
}

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

.actions input,
.actions select {
  flex: 1 1 130px;
  min-width: min(100%, 130px);
}

.actions .btn {
  flex: 0 0 auto;
}

.accounting-stat-cards {
  margin-top: 16px;
}

.accounting-stat-cards .stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
}

.accounting-stats table {
  min-width: 560px;
}

.accounting-stats th,
.accounting-stats td {
  padding: 12px;
}

.branch-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.branch-row-actions form {
  margin: 0;
}

.branch-edit-row td {
  padding: 16px;
  background: #f8fafc;
}

.branch-edit-form {
  min-width: 980px;
}

.branch-edit-form .formgrid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.branch-stamp-field {
  gap: 8px;
}

.branch-stamp-current {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
}

.branch-stamp-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.branch-stamp-remove {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.branch-stamp-remove input {
  width: auto;
}

.urn-target-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  min-width: 360px;
}

.urn-target-cell {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.urn-target-cell b {
  font-size: 13px;
}

.urn-target-cell label {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.urn-target-cell input {
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

.urn-target-details {
  min-width: 126px;
}

.urn-target-details[open] {
  min-width: 300px;
}

.urn-target-details > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.urn-target-details > summary::-webkit-details-marker {
  display: none;
}

.urn-target-details[open] > summary {
  margin-bottom: 8px;
}

.urn-sort-actions {
  display: grid;
  grid-template-columns: repeat(2, 32px);
  gap: 6px;
  min-width: 70px;
}

.urn-sort-actions form {
  margin: 0;
}

.urn-sort-actions .btn {
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1;
}

.urn-group-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

.urn-group-list form {
  margin: 0;
}

.urn-group-readonly {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-weight: 900;
}

.urn-settings-table {
  min-width: 1320px;
}

.urn-settings-table th,
.urn-settings-table td {
  padding: 8px;
}

.urn-settings-table .urn-target-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
  min-width: 300px;
}

.urn-settings-table .urn-target-cell {
  gap: 4px;
  padding: 6px;
  border-radius: 7px;
}

.urn-settings-table .urn-target-cell input {
  padding: 6px;
  border-radius: 7px;
}

.urn-settings-table .urn-group-col {
  min-width: 165px;
  width: 165px;
}

.urn-settings-table .urn-name-col {
  min-width: 220px;
  width: 230px;
}

.urn-settings-table .urn-group-col .urn-inline-input,
.urn-settings-table .urn-name-col .urn-inline-input {
  width: 100%;
}

.urn-settings-table .urn-group-col .urn-inline-input {
  min-width: 145px;
}

.urn-settings-table .urn-name-col .urn-inline-input {
  min-width: 200px;
}

.urn-settings-table .urn-inline-input,
.urn-settings-table .urn-money-input,
.urn-settings-table .urn-stock-input {
  padding: 6px 8px;
  border-radius: 7px;
}

.urn-settings-table .urn-money-input {
  min-width: 100px;
}

.urn-inline-input,
.urn-money-input,
.urn-stock-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  font-weight: 800;
}

.urn-money-input {
  min-width: 110px;
  text-align: right;
}

.urn-stock-input {
  max-width: 90px;
}

.urn-catalog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 116px;
}

.urn-catalog-actions form {
  margin: 0;
}

.orders-layout {
  grid-template-columns: minmax(0, 1fr);
}

.order-list-box table {
  min-width: 1280px;
}

.order-item-list {
  display: grid;
  gap: 8px;
  min-width: 240px;
}

.order-item-line {
  display: grid;
  gap: 2px;
}

.order-route {
  display: grid;
  gap: 3px;
  min-width: 130px;
}

.order-route strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.order-route small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.order-item-line small,
.partial-line small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-actions {
  align-items: flex-start;
}

.partial-receive {
  position: relative;
}

.partial-receive > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.partial-receive > summary::-webkit-details-marker {
  display: none;
}

.partial-receive[open] > summary {
  margin-bottom: 8px;
}

.partial-receive form {
  display: grid;
  gap: 8px;
  min-width: 260px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.partial-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 8px;
  align-items: center;
}

.partial-line input {
  width: 82px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 9px;
  font-weight: 900;
  text-align: right;
}

.period-filter {
  margin-left: auto;
}

.period-filter select {
  flex: 0 0 auto;
  min-width: 110px;
}

.user-row-actions {
  align-items: flex-start;
  gap: 8px;
}

.user-row-actions details {
  position: relative;
}

.user-row-actions summary {
  list-style: none;
}

.user-row-actions summary::-webkit-details-marker {
  display: none;
}

.user-password-form {
  display: grid;
  gap: 8px;
  min-width: 220px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.user-password-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 9px;
  font-weight: 800;
}

.alert {
  margin-bottom: 14px;
  padding: 13px 16px;
  border-radius: 16px;
  font-weight: 800;
  line-height: 1.55;
}

.alert.success {
  border: 1px solid #bbf7d0;
  background: #ecfdf5;
  color: #047857;
}

.alert.danger {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.alert.info {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.notice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notice-head form {
  flex: 0 0 auto;
  margin: 0;
}

.notice-item p {
  margin-bottom: 0;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin-top: 0;
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1.2;
}

.receipt-wrap {
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px;
  border-radius: 24px;
  background: #e2e8f0;
}

.receipt-layout {
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
}

.compact-line {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.receipt-print-area {
  display: flex;
  justify-content: center;
}

.receipt-print-set {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.receipt-copy-receiver {
  display: none;
}

.receipt-sheet {
  width: 720px;
  min-width: 720px;
  padding: 6px 34px 16px;
  background: #fff;
  color: #000;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 800;
}

.receipt-sheet input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 0;
  outline: 0;
  background: transparent;
  font-weight: 900;
  text-align: center;
}

.receipt-meta {
  display: grid;
  grid-template-columns: 1fr 220px;
  align-items: center;
  min-height: 36px;
}

.receipt-place {
  width: 380px;
  height: 31px;
  padding: 0 12px;
  background: #fdeaea !important;
  color: #888;
  text-align: left !important;
}

.receipt-issuer {
  text-align: center;
}

.receipt-issuer input {
  width: 80px;
  text-align: left;
}

.receipt-frame {
  border: 2px solid #111;
}

.receipt-heading {
  padding: 18px 28px 8px;
  border-bottom: 2px solid #111;
}

.receipt-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.receipt-title-row strong {
  font-size: 30px;
  letter-spacing: .32em;
}

.receipt-title-row span {
  font-size: 14px;
  font-weight: 700;
}

.receipt-recipient {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  white-space: nowrap;
}

.receipt-recipient b:first-child {
  margin-right: 8px;
  font-size: 22px;
}

.receipt-recipient input {
  height: 32px;
  background: #fdeaea;
  color: #999;
  font-size: 18px;
}

.receipt-recipient [data-deceased-output] {
  width: 105px;
}

.receipt-recipient [data-family-output] {
  width: 190px;
}

.receipt-frame table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

.receipt-frame th,
.receipt-frame td {
  height: 34px;
  padding: 5px 8px;
  border: 1px solid #111;
  background: #fff;
  color: #000;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  word-break: keep-all;
}

.receipt-frame th {
  background: #fff;
}

.receipt-business td:not(.vertical),
.receipt-business input,
.receipt-items tbody td:nth-child(-n+3) {
  background: #fdeaea;
}

.receipt-address-input {
  width: 100%;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.receipt-business .vertical {
  width: 38px;
  background: #fff;
  font-size: 17px;
  line-height: 1.55;
}

.receipt-business .stamp-cell {
  width: 82px;
  background: #fdeaea;
}

.receipt-summary th,
.receipt-summary td {
  height: 40px;
  font-size: 17px;
}

.receipt-summary tr:first-child th {
  border-top: 2px solid #111;
}

.receipt-summary tr:nth-child(2) td {
  height: 42px;
}

.receipt-summary tr:last-child td {
  height: 32px;
  border-top: 2px solid #111;
  font-size: 15px;
}

.receipt-items th {
  height: 30px;
  font-size: 15px;
}

.receipt-items td {
  height: 34px;
}

.receipt-total-table th,
.receipt-total-table td {
  height: 50px;
  border-top: 2px solid #111;
  font-size: 18px;
}

.receipt-total-table th {
  width: 45%;
}

.receipt-bank {
  margin-top: 12px;
  padding: 4px 12px;
  background: #fdeaea;
  text-align: center;
  font-size: 15px;
  font-weight: 900;
}

.receipt-bank input {
  border: 0;
  outline: 0;
  background: transparent;
  font-weight: 900;
  text-align: center;
}

.receipt-bank input[name="bank_name"],
.receipt-bank input[data-receipt-bind="bank_name"] {
  width: 90px;
}

.receipt-bank input[name="account_no"],
.receipt-bank input[data-receipt-bind="account_no"] {
  width: 190px;
}

.receipt-bank input[name="account_holder"],
.receipt-bank input[data-receipt-bind="account_holder"] {
  width: 150px;
}

.print-only {
  display: none;
}

.stamp {
  display: grid;
  width: 62px;
  height: 62px;
  margin: auto;
  place-items: center;
  border: 2px solid #ef4444;
  color: #ef4444;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.05;
}

.receipt-stamp-image {
  display: block;
  width: 62px;
  height: 62px;
  margin: auto;
  object-fit: contain;
}

.page-note {
  margin-top: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.engraving-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 150px);
  min-height: 760px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0a0a0a;
  box-shadow: var(--shadow);
}

@media (max-width: 1200px) {
  .layout2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1050px) {
  .app {
    display: block;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    max-height: none;
    padding: 20px;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  }

  .logout {
    margin-top: 0;
  }

  main {
    padding: 18px;
  }

  .top {
    display: block;
  }
}

@media (max-width: 640px) {
  :root {
    --radius: 18px;
    --shadow: 0 10px 28px rgba(15, 23, 42, .07);
  }

  .sidebar {
    gap: 14px;
    padding: 14px;
  }

  .brand strong {
    font-size: 18px;
  }

  .userbox,
  .card,
  .toolbar,
  .receipt-wrap {
    padding: 16px;
  }

  .receipt-sheet {
    width: 720px;
    min-width: 720px;
  }

  main {
    padding: 14px;
  }

  .nav {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .nav a {
    min-height: 42px;
    padding: 10px 8px;
    border-radius: 12px;
    font-size: 13px;
    text-align: center;
    line-height: 1.25;
  }

  .top {
    margin-bottom: 16px;
  }

  .top h1 {
    font-size: 26px;
  }

  .top p {
    font-size: 14px;
  }

  .grid2,
  .grid3,
  .grid4,
  .formgrid {
    gap: 12px;
  }

  .stat strong {
    font-size: 25px;
  }

  table {
    min-width: 900px;
  }

  th,
  td {
    padding: 12px;
  }

  .toolbar input,
  .toolbar select,
  .actions input,
  .actions select,
  .actions .btn,
  .top .btn {
    flex-basis: 100%;
    width: 100%;
  }

  .btn {
    width: 100%;
    white-space: normal;
  }

  .btn.small {
    min-height: 36px;
  }

  .login-card {
    padding: 24px;
  }

  .engraving-frame {
    height: 820px;
    min-height: 820px;
    border-radius: 16px;
  }
}

@media (max-width: 390px) {
  main {
    padding: 10px;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 6mm;
  }

  html,
  body {
    width: 285mm;
    height: 198mm;
    margin: 0;
    background: #fff !important;
    overflow: hidden;
  }

  body * {
    visibility: hidden !important;
  }

  .receipt-print-area,
  .receipt-print-area * {
    visibility: visible !important;
  }

  .receipt-print-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 285mm;
    height: 198mm;
    padding: 0;
    margin: 0;
    overflow: hidden;
    background: #fff !important;
  }

  .receipt-print-set {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12mm;
    width: 285mm;
    height: 198mm;
    padding: 0;
    margin: 0;
  }

  .receipt-copy-receiver {
    display: block;
    padding-top: 0;
  }

  .screen-only {
    display: none !important;
  }

  .print-only {
    display: block;
  }

  .receipt-sheet {
    width: 136.5mm;
    height: 198mm;
    min-width: 0;
    max-width: 136.5mm;
    padding: 0;
    background: #fff !important;
    color: #000 !important;
    font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
    font-size: 9px;
    font-weight: 900;
    break-inside: avoid;
    page-break-inside: avoid;
    overflow: hidden;
  }

  .receipt-wrap {
    padding: 0;
    background: #fff !important;
  }

  .receipt-meta {
    display: block;
    height: 7.5mm;
    min-height: 7.5mm;
    text-align: center;
  }

  .receipt-meta-blank {
    line-height: 0;
  }

  .receipt-place {
    display: none;
  }

  .receipt-issuer {
    font-size: 8.6px;
    line-height: 6.8mm;
    text-align: center;
  }

  .receipt-issuer input {
    width: 18mm;
    text-align: left;
  }

  .receipt-heading {
    box-sizing: border-box;
    flex: 0 0 25mm;
    height: 25mm;
    padding: 5.1mm 4.5mm 2.6mm;
  }

  .receipt-title-row {
    gap: 3mm;
  }

  .receipt-title-row strong {
    font-size: 18px;
    letter-spacing: .2em;
    font-weight: 900;
  }

  .receipt-title-row span {
    font-size: 8px;
  }

  .receipt-recipient {
    gap: 1.5mm;
    margin-top: 2.8mm;
  }

  .receipt-recipient b:first-child {
    margin-right: 1.5mm;
    font-size: 12.5px;
  }

  .receipt-recipient input {
    height: 6.2mm;
    font-size: 9.7px;
  }

  .receipt-recipient [data-deceased-output] {
    width: 20mm;
  }

  .receipt-recipient [data-family-output] {
    width: 34mm;
  }

  .receipt-frame {
    border-width: 1.4px;
    width: 100%;
    height: 176mm;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }

  .receipt-frame th,
  .receipt-frame td {
    height: 6.7mm;
    padding: .6mm .8mm;
    font-size: 8.4px;
    font-weight: 900;
    line-height: 1.15;
  }

  .receipt-address-input {
    width: 100%;
    font-size: 7.8px;
    letter-spacing: -0.03em;
  }

  .receipt-business {
    flex: 0 0 30mm;
    height: 30mm;
  }

  .receipt-business .vertical {
    width: 7.2mm;
    font-size: 9px;
    line-height: 1.45;
  }

  .receipt-business .stamp-cell {
    width: 15mm;
  }

  .receipt-summary th,
  .receipt-summary td {
    height: 7.1mm;
    font-size: 8.7px;
  }

  .receipt-summary tr:nth-child(2) td {
    height: 7.7mm;
  }

  .receipt-summary tr:last-child td {
    height: 6.4mm;
    font-size: 8.2px;
  }

  .receipt-items {
    flex: 1 1 auto;
    height: 84mm;
  }

  .receipt-items th {
    height: 6mm;
    font-size: 8.2px;
  }

  .receipt-items td {
    height: 7.8mm;
  }

  .receipt-total-table th,
  .receipt-total-table td {
    height: 11mm;
    font-size: 10px;
  }

  .receipt-summary,
  .receipt-total-table {
    flex: 0 0 auto;
  }

  .stamp,
  .receipt-stamp-image {
    width: 12.5mm;
    height: 12.5mm;
    font-size: 7.5px;
  }

  .receipt-bank {
    margin-top: 2.6mm;
    padding: 0;
    font-size: 8.4px;
    background: #fff !important;
    line-height: 1.25;
    text-align: center;
  }

  .receipt-bank input[name="bank_name"],
  .receipt-bank input[data-receipt-bind="bank_name"] {
    width: 16mm;
  }

  .receipt-bank input[name="account_no"],
  .receipt-bank input[data-receipt-bind="account_no"] {
    width: 34mm;
  }

  .receipt-bank input[name="account_holder"],
  .receipt-bank input[data-receipt-bind="account_holder"] {
    width: 28mm;
  }

  .receipt-sheet input,
  .receipt-place,
  .receipt-recipient input,
  .receipt-business td:not(.vertical),
  .receipt-business input,
  .receipt-items tbody td:nth-child(-n+3),
  .receipt-business .stamp-cell,
  .receipt-bank,
  .receipt-bank input {
    background: #fff !important;
    color: #000 !important;
  }

  .stamp {
    border-color: #111 !important;
    color: #111 !important;
  }

  .receipt-stamp-image {
    filter: grayscale(1) contrast(1.15);
  }
}
