:root{
  color-scheme:light;
  font-family:"Patrick Hand","Comic Sans MS",cursive;
  color:#2d2d2d;
  background:#fdfbf7;
  font-synthesis:none;
  text-rendering:optimizeLegibility;
  --paper:#fdfbf7;
  --white:#fff;
  --ink:#2d2d2d;
  --muted:#77736d;
  --old-paper:#e5e0d8;
  --red:#ff4d4d;
  --blue:#2d5da1;
  --yellow:#fff9c4;
  --line:rgba(45,45,45,.72);
  --line-soft:rgba(45,45,45,.2);
  --wobbly:255px 15px 225px 15px / 15px 225px 15px 255px;
  --wobbly-md:24px 8px 28px 10px / 9px 28px 10px 25px;
  --sketch-shadow:4px 4px 0 #2d2d2d;
  --small-shadow:3px 3px 0 rgba(45,45,45,.18);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth;scrollbar-width:none}
html::-webkit-scrollbar{display:none}
.splash-loader{
  display:none;
  position:fixed;
  inset:0;
  z-index:2147483647;
  place-items:center;
  background:#fdfbf7;
  color:#2d2d2d;
  opacity:1;
  transition:opacity .4s ease;
}
html.show-splash .splash-loader{display:grid}
.splash-loader.is-leaving{opacity:0;pointer-events:none}
.splash-content{width:min(82vw,300px);text-align:center}
.splash-logo{
  width:64px;
  height:64px;
  display:grid;
  place-items:center;
  margin:0 auto 16px;
  border:2px solid currentColor;
  border-radius:45% 55% 48% 52% / 55% 45% 55% 45%;
  background:#fff9c4;
  box-shadow:3px 3px 0 currentColor;
  font:700 36px "Kalam","Comic Sans MS",cursive;
  transform:rotate(-5deg);
}
.splash-content h1{font-size:clamp(27px,7vw,36px);margin:0 0 22px}
.splash-progress{height:6px;overflow:hidden;border:1px solid rgba(45,45,45,.25);border-radius:99px;background:rgba(45,45,45,.08)}
.splash-progress span{display:block;width:42%;height:100%;border-radius:inherit;background:#176b5b;animation:splash-progress 1.2s ease-in-out infinite}
.splash-content p{margin:12px 0 0;color:#77736d;font-size:16px}
.noscript-notice{position:relative;z-index:1;padding:12px 18px;background:#fff9c4;color:#2d2d2d;text-align:center}
@keyframes splash-progress{0%{transform:translateX(-110%)}100%{transform:translateX(340%)}}
@media(prefers-color-scheme:dark){
  .splash-loader{background:#151915;color:#fdfbf7}
  .splash-logo{background:#292b21}
  .splash-progress{border-color:rgba(253,251,247,.25);background:rgba(253,251,247,.12)}
  .splash-content p{color:#c1c7bf}
}
@media(prefers-reduced-motion:reduce){
  .splash-loader{transition:none}
  .splash-progress span{animation:none;width:100%}
}
@view-transition{navigation:auto}
::view-transition-old(root){animation:page-exit .18s ease-in both}
::view-transition-new(root){animation:page-enter .32s cubic-bezier(.16,1,.3,1) both}
@keyframes page-exit{to{opacity:0;transform:translateY(-6px)}}
@keyframes page-enter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
body{
  margin:0;
  min-width:320px;
  min-height:100vh;
  background-color:var(--paper);
  background-image:radial-gradient(rgba(45,45,45,.11) .8px,transparent .9px);
  background-size:24px 24px;
}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
[hidden]{display:none!important}

.topbar{
  min-height:76px;
  padding:12px max(22px,calc((100vw - 1180px)/2));
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  background:rgba(253,251,247,.96);
  border-bottom:2px dashed var(--line-soft);
}
.brand{
  display:flex;
  align-items:center;
  gap:11px;
  color:var(--ink);
  text-decoration:none;
  font-family:"Kalam","Comic Sans MS",cursive;
  font-weight:700;
  font-size:21px;
  letter-spacing:-.5px;
}
.brand-mark{
  width:39px;
  height:39px;
  display:grid;
  place-items:center;
  background:var(--yellow);
  border:2px solid var(--ink);
  border-radius:45% 55% 48% 52% / 55% 45% 55% 45%;
  box-shadow:2px 2px 0 var(--ink);
  transform:rotate(-5deg);
  font-family:"Kalam",cursive;
  font-size:22px;
}
.brand small{
  display:block;
  color:var(--muted);
  font:400 13px "Patrick Hand","Comic Sans MS",cursive;
  letter-spacing:.2px;
  margin-top:-3px;
}
.install-area{display:flex;align-items:center;gap:12px}
.ios-hint{font-size:14px;color:var(--muted);margin:0}
.app-shell{max-width:1180px;margin:0 auto;padding:39px 22px 30px}
.intro{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:20px;
  margin-bottom:32px;
}
.eyebrow{
  display:inline-block;
  color:var(--blue);
  font-size:13px;
  font-weight:400;
  letter-spacing:.55px;
  margin:0 0 8px;
  padding:2px 9px;
  background:var(--yellow);
  border:1px dashed rgba(45,45,45,.45);
  border-radius:7px 3px 9px 4px;
  transform:rotate(-1deg);
}
h1,h2,h3,p{margin-top:0}
h1,h2,h3{
  font-family:"Kalam","Comic Sans MS",cursive;
  font-weight:700;
  letter-spacing:-.5px;
  line-height:1.12;
}
h1{font-size:clamp(38px,5vw,54px);margin-bottom:7px}
.intro-copy{color:#5f5a54;font-size:18px;margin:0}
.offline-badge{
  display:flex;
  align-items:center;
  gap:8px;
  padding:7px 13px;
  border:2px dashed var(--ink);
  border-radius:55% 45% 52% 48% / 43% 57% 44% 56%;
  color:var(--ink);
  font-size:15px;
  background:#fff;
  white-space:nowrap;
  transform:rotate(2deg);
}
.offline-badge span{width:8px;height:8px;border-radius:50%;background:#4c9a68}
.panel{
  position:relative;
  background:var(--white);
  border:2px solid var(--ink);
  border-radius:var(--wobbly-md);
  box-shadow:var(--small-shadow);
}
.preset-panel{padding:24px 25px 18px}
.preset-panel:before{
  content:"";
  position:absolute;
  top:-9px;
  left:50%;
  width:92px;
  height:19px;
  transform:translateX(-50%) rotate(-2deg);
  background:rgba(229,224,216,.83);
  border:1px solid rgba(45,45,45,.12);
}
.section-heading{display:flex;justify-content:space-between;align-items:center;gap:16px}
.section-heading h2,.preview-toolbar h2,.history-panel h2{font-size:23px;margin:0}
.preset-chips{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding:19px 2px 15px;
  scrollbar-width:thin;
  scrollbar-color:#aaa197 transparent;
}
.preset-chip{
  flex:0 0 auto;
  min-height:40px;
  border:2px solid var(--ink);
  background:#fff;
  border-radius:49% 51% 46% 54% / 48% 44% 56% 52%;
  padding:7px 14px;
  color:var(--ink);
  font-size:15px;
  box-shadow:2px 2px 0 var(--ink);
  transition:transform .12s ease,box-shadow .12s ease,background .12s ease,color .12s ease;
}
.preset-chip:nth-child(3n+1){transform:rotate(-1deg)}
.preset-chip:nth-child(3n+2){transform:rotate(1deg)}
.preset-chip:hover{background:var(--yellow);transform:rotate(-1deg) translateY(-2px)}
.preset-chip.active{
  border-color:var(--ink);
  background:var(--red);
  color:#fff;
  box-shadow:3px 3px 0 var(--ink);
}
.saved-presets{
  border-top:2px dashed var(--line-soft);
  padding-top:14px;
  display:flex;
  align-items:center;
  gap:12px;
  color:var(--muted);
  font-size:14px;
}
.saved-presets>div{display:flex;gap:8px;flex-wrap:wrap}
.saved-preset-chip{
  border:2px dashed var(--ink);
  background:var(--yellow);
  border-radius:var(--wobbly);
  padding:5px 10px;
  color:var(--ink);
  font-size:14px;
  box-shadow:2px 2px 0 rgba(45,45,45,.55);
}
.saved-preset-chip.active{background:#dce8f7;border-style:solid}
.delete-preset{border:0;background:none;color:var(--red);margin-left:5px;padding:0 2px;font-size:20px}
.custom-fields-wrap{
  border-top:2px dashed var(--line-soft);
  padding:14px 12px 10px;
  margin-top:5px;
  background:var(--yellow);
  border-radius:4px 12px 5px 10px;
  transform:rotate(-.25deg);
}
.field-title{font-size:16px;font-weight:700;margin:0 0 10px}
.custom-field-choices{display:flex;gap:8px 16px;flex-wrap:wrap}
.custom-field-choices label{display:flex;align-items:center;gap:6px;font-size:15px;color:#4c4944}
.custom-field-choices input{width:auto;accent-color:var(--blue)}
.text-button{border:0;background:none;color:var(--blue);font-size:15px;font-weight:700;padding:10px 0 0}
.tabs{
  display:flex;
  gap:20px;
  border-bottom:2px dashed var(--line-soft);
  margin:27px 0 21px;
}
.tab{
  border:0;
  border-bottom:3px solid transparent;
  background:none;
  padding:1px 3px 11px;
  color:#77716b;
  font-size:17px;
  transition:color .12s ease,transform .12s ease;
}
.tab:hover{color:var(--red);transform:rotate(-1deg)}
.tab.active{border-color:var(--red);color:var(--ink);font-weight:700}
.count-badge{
  display:inline-grid;
  place-items:center;
  min-width:21px;
  height:21px;
  padding:0 5px;
  border:1px solid var(--ink);
  border-radius:48% 52% 44% 56%;
  background:var(--yellow);
  color:var(--ink);
  font-size:13px;
  margin-left:4px;
}
.workspace{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,.75fr);gap:23px;align-items:start}
.workspace>.editor,.workspace>.preview-column{min-width:0}
.editor{padding:23px}
.compact{margin-bottom:20px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px 15px}
.form-grid label,.extra-fields label,.totals-editor label{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:15px;
  font-weight:700;
  color:#514d47;
}
.form-grid .span-2{grid-column:span 2}
.logo-field{display:flex;flex-direction:column;gap:6px;color:#514d47;font-size:15px;font-weight:700}
.logo-controls{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.logo-status{color:#79736b;font-size:14px;font-weight:400}
input,select,textarea{
  width:100%;
  min-width:0;
  border:2px solid var(--ink);
  border-radius:var(--wobbly);
  background:#fff;
  padding:10px 12px;
  color:var(--ink);
  font-size:16px;
  outline:none;
}
input::placeholder,textarea::placeholder{color:rgba(45,45,45,.42)}
input:focus,select:focus,textarea:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(45,93,161,.16)}
textarea{resize:vertical}
.extra-fields{display:grid;grid-template-columns:1fr 1fr;gap:14px 15px;margin-top:15px}
.extra-fields .span-2{grid-column:span 2}
.items-heading{display:flex;justify-content:space-between;align-items:center;margin:27px 0 12px}
.items-heading h3{font-size:22px;margin:0}
.table-scroll{overflow-x:auto}
.items-table{width:100%;border-collapse:separate;border-spacing:0;min-width:440px}
.items-table th{text-align:left;color:#5c5750;font-size:14px;font-weight:700;padding:0 5px 10px}
.items-table td{border-top:1px dashed var(--line-soft);padding:8px 4px}
.items-table th:nth-child(n+2),.items-table td:nth-child(n+2){text-align:right}
.items-table td:first-child{width:42%}
.items-table input{padding:8px 9px}
.items-table input[type=number]{text-align:right}
.line-total{font-size:16px;font-weight:700;white-space:nowrap}
.remove-item{border:0;background:none;color:#bd3d3d;font-size:21px;line-height:1;padding:4px 5px}
.totals-editor{display:grid;grid-template-columns:1.1fr .8fr .8fr;gap:10px;margin-top:17px;padding-top:16px;border-top:2px dashed var(--line-soft)}
.editor-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:21px;padding-top:15px;border-top:2px dashed var(--line-soft)}
.autosave-note{color:#79736b;font-size:14px}
.preview-column{position:sticky;top:18px}
.preview-toolbar{display:flex;align-items:center;justify-content:space-between;margin:2px 0 13px}
.preview-toolbar h2{font-size:22px}
.icon-button{
  width:42px;
  height:42px;
  border:2px solid var(--ink);
  border-radius:47% 53% 48% 52% / 52% 46% 54% 48%;
  background:#fff;
  color:var(--ink);
  font-size:20px;
  box-shadow:3px 3px 0 var(--ink);
  transition:transform .12s ease,box-shadow .12s ease,background .12s ease;
}
.icon-button:hover{background:var(--yellow);transform:translate(2px,2px) rotate(4deg);box-shadow:1px 1px 0 var(--ink)}
.receipt-preview{
  --receipt-accent:var(--green);
  background-color:#fffefa;
  background-image:radial-gradient(rgba(45,45,45,.11) .65px,transparent .8px);
  background-size:16px 16px;
  border:2px solid var(--ink);
  border-radius:255px 15px 225px 15px / 15px 225px 15px 255px;
  padding:26px 23px 22px;
  box-shadow:5px 5px 0 var(--ink);
  font-family:"Patrick Hand","Comic Sans MS",cursive;
  font-size:16px;
  line-height:1.35;
  color:var(--ink);
  position:relative;
  overflow:hidden;
}
.receipt-head{text-align:center;border-bottom:2px dashed rgba(45,45,45,.55);padding:5px 0 15px;margin-bottom:10px}
.receipt-logo{display:block;width:auto;height:auto;max-width:100%;max-height:96px;object-fit:contain;margin:0 auto 8px}
.receipt-business{font-family:"Kalam","Patrick Hand",cursive;font-size:25px;font-weight:700;color:var(--receipt-accent);overflow-wrap:anywhere;margin:0 0 3px}
.receipt-title{display:inline-block;font-family:"Kalam","Patrick Hand",cursive;font-size:16px;font-weight:700;letter-spacing:.4px;margin:0 0 6px;padding:2px 10px;border:1px dashed var(--receipt-accent);border-radius:15px 5px 13px 6px;transform:rotate(-1deg)}
.receipt-contact{white-space:pre-line;color:#5e5952;font-size:14px;line-height:1.45}
.receipt-extra-line{display:flex;justify-content:space-between;gap:8px;padding:4px 1px;color:#45413c}
.receipt-extra-line strong{text-align:right;overflow-wrap:anywhere}
.receipt-section{border-bottom:2px dashed rgba(45,45,45,.42);padding:9px 0}
.receipt-items{width:100%;border-collapse:collapse;margin-top:5px}
.receipt-items th{font-family:"Kalam","Patrick Hand",cursive;font-size:15px;color:#514c46;text-align:left;padding:5px 0;border-bottom:1px dashed rgba(45,45,45,.5)}
.receipt-items th:nth-child(n+2),.receipt-items td:nth-child(n+2){text-align:right}
.receipt-items td{padding:6px 0;vertical-align:top;font-size:15px}
.receipt-item-name{overflow-wrap:anywhere;max-width:105px}
.receipt-total-line{display:flex;justify-content:space-between;gap:8px;padding:3px 1px}
.receipt-total-line.grand{font-family:"Kalam","Patrick Hand",cursive;font-size:20px;font-weight:700;border-top:2px dashed rgba(45,45,45,.55);margin-top:7px;padding:8px 9px 5px;background:var(--yellow);border-radius:10px 4px 12px 5px;transform:rotate(-.5deg)}
.receipt-payment{text-align:center;border-bottom:2px dashed rgba(45,45,45,.42);padding:11px 0;font-size:15px}
.receipt-footer{text-align:center;color:#514c46;line-height:1.45;padding:13px 3px 4px;white-space:pre-line;font-size:15px}
.receipt-signature{margin-top:24px;border-top:2px dashed #777;width:66%;padding-top:5px;text-align:center;margin-left:auto;font-size:14px}
.receipt-preview[data-layout="food"] .receipt-head{border-bottom:2px double var(--receipt-accent);padding-bottom:17px}
.receipt-preview[data-layout="studio"] .receipt-head{background:#f8e8f0;border-radius:47% 53% 8px 11px;margin:0 -10px 10px;padding:14px 10px}
.receipt-preview[data-layout="invoice"]{border-top:5px solid var(--receipt-accent)}
.receipt-preview[data-layout="formal"] .receipt-head{border-top:2px dashed var(--receipt-accent);padding-top:12px}
.receipt-preview[data-layout="medical"] .receipt-total-line.grand{color:var(--receipt-accent)}
.receipt-preview[data-layout="beauty"] .receipt-head{border-bottom-style:double}
.receipt-preview[data-layout="education"] .receipt-title{background:#e7eef8;color:var(--receipt-accent);display:inline-block;padding:4px 8px;border-radius:10px 3px 12px 5px}
.receipt-preview[data-layout="service"] .receipt-items td{padding-top:8px;padding-bottom:8px}
.preview-actions{display:grid;grid-template-columns:1fr 1fr;gap:11px;margin-top:15px}
.pdf-note{font-size:14px;color:#79736b;text-align:center;margin:12px 0}
.button{
  min-height:44px;
  border:2px solid var(--ink);
  border-radius:49% 51% 45% 55% / 52% 46% 54% 48%;
  padding:9px 17px;
  background:#fff;
  color:var(--ink);
  font-size:16px;
  font-weight:700;
  box-shadow:4px 4px 0 var(--ink);
  transition:transform .1s ease,box-shadow .1s ease,background .1s ease,color .1s ease;
}
.button:hover{background:var(--red);color:#fff;transform:translate(2px,2px);box-shadow:2px 2px 0 var(--ink)}
.button:active{transform:translate(4px,4px);box-shadow:none}
.button-primary,.button-install{background:var(--red);color:#fff}
.button-install{padding:8px 15px}
.button-outline{background:#fff}
.button-quiet{background:var(--old-paper)}
.button-quiet:hover{background:var(--blue);color:#fff}
.button-small{min-height:38px;padding:6px 13px;font-size:15px}
.history-panel{padding:25px}
.filter-label{display:flex;align-items:center;gap:10px;color:#5e5952;font-size:15px}
.filter-label select{width:auto;min-width:150px;padding:8px}
.history-list{display:grid;gap:13px;margin-top:22px}
.history-card{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  border:2px solid var(--ink);
  border-radius:var(--wobbly-md);
  padding:14px 17px;
  background:#fff;
  box-shadow:3px 3px 0 rgba(45,45,45,.2);
}
.history-card:nth-child(even){transform:rotate(.25deg)}
.history-card:nth-child(odd){transform:rotate(-.2deg)}
.history-main{min-width:0}.history-main h3{font-size:19px;margin:0 0 5px}.history-meta{font-size:14px;color:#77716b;margin:0}
.history-amount{font-size:19px;font-weight:700;white-space:nowrap}
.history-actions{display:flex;align-items:center;gap:8px}
.history-actions button{
  min-height:36px;
  border:2px solid var(--ink);
  border-radius:var(--wobbly);
  padding:6px 12px;
  background:var(--old-paper);
  color:var(--ink);
  font-size:14px;
  box-shadow:2px 2px 0 var(--ink);
}
.history-actions button:hover{background:var(--blue);color:#fff}
.history-actions .delete-history{background:#fff;color:#a43636}
.history-actions .delete-history:hover{background:var(--red);color:#fff}
.empty-state{text-align:center;padding:50px 15px;color:#77716b;font-size:18px}
.status-message{
  position:fixed;
  left:50%;
  bottom:20px;
  transform:translate(-50%,15px) rotate(-1deg);
  opacity:0;
  pointer-events:none;
  background:var(--yellow);
  color:var(--ink);
  border:2px solid var(--ink);
  border-radius:var(--wobbly);
  padding:11px 17px;
  font-size:16px;
  transition:.2s;
  z-index:10;
  box-shadow:4px 4px 0 var(--ink);
}
.status-message.visible{opacity:1;transform:translate(-50%,0) rotate(-1deg)}
.site-footer{
  width:100vw;
  margin-left:calc(50% - 50vw);
  margin-top:52px;
  padding:28px max(22px,calc((100vw - 1180px)/2)) 16px;
  background:#fff;
  border-top:2px solid var(--ink);
  border-bottom:2px solid var(--ink);
}
.footer-brand{display:flex;align-items:center;justify-content:space-between;gap:18px;padding-bottom:23px;border-bottom:2px dashed var(--line-soft)}
.footer-brand p{margin:0;color:#79736b;font-size:16px}
.footer-links{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:22px;padding:25px 0}
.footer-links h2{font-size:20px;margin:0 0 10px}
.footer-links ul{list-style:none;padding:0;margin:0;display:grid;gap:7px}
.footer-links a,.footer-bottom a{color:#5f5a54;text-decoration:none;font-size:15px}
.footer-links a:hover,.footer-bottom a:hover{color:var(--blue);text-decoration:underline;text-underline-offset:3px}
.footer-credit{
  margin:0;
  padding:20px 8px 18px;
  border-top:2px dashed var(--line-soft);
  color:var(--ink);
  text-align:center;
  font-family:"Kalam","Patrick Hand",cursive;
  font-size:clamp(24px,4.2vw,42px);
  font-weight:700;
  line-height:1.2;
  letter-spacing:.2px;
  transform:rotate(-.5deg);
}
.footer-credit strong{color:#c93434;text-decoration:underline;text-decoration-style:wavy;text-decoration-thickness:2px;text-underline-offset:5px}
.footer-heart{display:inline-block;margin-left:7px;font-family:system-ui,sans-serif;font-size:.78em;vertical-align:.05em}
.footer-bottom{display:flex;align-items:center;justify-content:space-between;gap:14px;padding-top:14px;border-top:2px dashed var(--line-soft);color:#79736b;font-size:14px}
.footer-bottom-actions{display:flex;align-items:center;flex-wrap:wrap;gap:18px}
.footer-bottom-actions .ios-hint{margin:0}
.footer-bottom .developer-link{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:7px 12px;
  border:2px solid var(--ink);
  border-radius:var(--wobbly);
  background:var(--yellow);
  color:var(--ink);
  font-family:"Kalam","Patrick Hand",cursive;
  font-size:16px;
  font-weight:700;
  box-shadow:2px 2px 0 var(--ink);
}
.footer-bottom .developer-link:hover{background:var(--red);color:#fff;text-decoration:none}
.info-page-shell{max-width:880px}
.info-page-main{min-height:42vh}
.intro#receipt-maker{scroll-margin-top:20px}
.info-page-breadcrumb{display:flex;align-items:center;flex-wrap:wrap;gap:9px;margin:0 0 26px;color:#79736b;font-size:15px}
.info-page-breadcrumb a{color:var(--blue);text-decoration:none}
.info-page-breadcrumb a:hover{text-decoration:underline;text-underline-offset:3px}
.info-page-breadcrumb strong{color:var(--ink)}
.info-page-panel{padding:clamp(24px,5vw,48px);margin-top:22px}
.info-page-panel h2{font-size:24px}
.info-page-panel p{font-size:18px;line-height:1.6;color:#514d47}
.info-page-links{display:flex;flex-wrap:wrap;gap:10px;list-style:none;padding:0;margin:0}
.info-page-links a{display:block;padding:8px 12px;border:1px dashed var(--ink);border-radius:var(--wobbly);color:var(--blue);font-size:16px;text-decoration:none}
.info-page-links a:hover,.info-page-links a[aria-current="page"]{background:var(--yellow)}
.info-page-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:26px}
.info-page-footer{margin-top:36px}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  ::view-transition-old(root),::view-transition-new(root){animation:none}
}

@media(max-width:850px){
  .workspace{grid-template-columns:minmax(0,1fr) minmax(280px,.82fr);gap:16px}
  .editor{padding:18px}
  .receipt-preview{padding:23px 18px}
  .footer-links{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  .app-shell{padding:29px 15px 22px}
  .topbar{min-height:66px;padding:9px 15px}
  .intro{align-items:flex-start;gap:12px}
  .offline-badge{margin-top:5px;font-size:13px;padding:7px 10px}
  .workspace{grid-template-columns:minmax(0,1fr)}
  .preview-column{position:static;grid-row:1}
  .receipt-preview{width:100%;max-width:420px;margin:0 auto}
  .preview-toolbar{max-width:420px;margin:0 auto 12px}
  .preview-actions,.pdf-note{max-width:420px;margin-left:auto;margin-right:auto}
  .editor{grid-row:2}
  .preset-panel{padding:19px 16px 15px}
  .section-heading{align-items:flex-start}
  .button-quiet{white-space:nowrap}
  .saved-presets{align-items:flex-start;flex-direction:column;gap:8px}
  .history-panel{padding:18px}
  .history-card{align-items:flex-start;flex-wrap:wrap}
  .history-actions{width:100%}
  .footer-brand{align-items:flex-start;flex-direction:column}
  .site-footer{padding:22px 17px 14px}
  .footer-bottom{align-items:flex-start;flex-direction:column}
  .footer-bottom-actions{align-items:flex-start;flex-direction:column;gap:12px}
}
@media(max-width:460px){
  .intro{display:block}
  .offline-badge{display:inline-flex;margin-top:15px}
  .form-grid{gap:11px 9px}
  .form-grid label,.extra-fields label,.totals-editor label{font-size:14px}
  .form-grid input,.form-grid select,.form-grid textarea,.extra-fields input,.extra-fields select,.extra-fields textarea{font-size:15px;padding:9px}
  .editor{padding:15px}
  .section-heading h2{font-size:20px}
  .autosave-note{font-size:12px}
  .filter-label{align-items:flex-start;flex-direction:column;gap:5px}
}

@media print{
  @page{size:auto;margin:0}
  html,body{
    background:#fff!important;
    width:80mm;
    min-width:0;
    min-height:0;
    margin:0!important;
    padding:0!important;
  }
  body>.topbar{display:none!important}
  body>.app-shell{
    display:block!important;
    width:80mm;
    max-width:none;
    margin:0!important;
    padding:0!important;
  }
  .app-shell>:not(#createTab){display:none!important}
  #createTab{display:block!important}
  #createTab .workspace{display:block!important}
  #createTab .editor{display:none!important}
  #createTab .preview-column{display:block!important;position:static!important;width:80mm;margin:0!important;padding:0!important}
  #createTab .preview-column>:not(#receiptPreview){display:none!important}
  #receiptPreview{
    position:static;
    box-sizing:border-box;
    width:80mm;
    min-width:0;
    max-width:80mm;
    margin:0;
    padding:4mm;
    border:0;
    border-radius:0;
    box-shadow:none;
    color:#000!important;
    background:#fff!important;
    font-size:12px;
    line-height:1.3;
    overflow:visible;
  }
  #receiptPreview .receipt-head,#receiptPreview .receipt-section,#receiptPreview .receipt-payment,#receiptPreview .receipt-footer,#receiptPreview .receipt-signature{break-inside:avoid}
  #receiptPreview .receipt-extra-line{align-items:flex-start;gap:3mm}
  #receiptPreview .receipt-extra-line>*,#receiptPreview .receipt-total-line>*{min-width:0;overflow-wrap:anywhere}
  #receiptPreview .receipt-items{table-layout:fixed}
  #receiptPreview .receipt-items th:first-child,#receiptPreview .receipt-items td:first-child{width:48%;overflow-wrap:anywhere}
  #receiptPreview .receipt-items th:nth-child(2),#receiptPreview .receipt-items td:nth-child(2){width:14%}
  #receiptPreview .receipt-items th:nth-child(3),#receiptPreview .receipt-items td:nth-child(3){width:38%;overflow-wrap:anywhere}
  #receiptPreview .receipt-items tr{break-inside:avoid}
  #receiptPreview .receipt-logo{max-width:45mm;max-height:22mm}
  #receiptPreview .receipt-business{font-size:19px}
  #receiptPreview .receipt-title{font-size:13px}
  #receiptPreview .receipt-items th,#receiptPreview .receipt-items td{font-size:11px}
  #receiptPreview .receipt-total-line.grand{font-size:16px}
  #receiptPreview .receipt-footer{font-size:12px}
  #receiptPreview .receipt-business{color:#000!important}
  #receiptPreview .receipt-title{border-color:#555}
  #receiptPreview .receipt-total-line.grand{background:#f4f0df}
  #receiptPreview .receipt-items th,#receiptPreview .receipt-contact,#receiptPreview .receipt-extra-line,#receiptPreview .receipt-footer{color:#222}
}
