/* ═══════════════════════════════════════════════════
   FUEL BILL GENERATOR — self-contained stylesheet
   /tools/fuel/fuel.css
═══════════════════════════════════════════════════ */

:root {
  --bg:      #f5f5f7;
  --surface: #ffffff;
  --card:    #f9f9fb;
  --border:  #e2e2e8;
  --accent:  #4f46e5;
  --text:    #111118;
  --muted:   #888899;
  --mono:    'Courier Prime', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Instrument Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
input, select, textarea, button { font-family: inherit; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ═══════════════════════════════════════════════════
   TOOL PAGE LAYOUT
═══════════════════════════════════════════════════ */
.tool-page { display: flex; flex-direction: column; height: 100vh; }

/* ── Top bar ── */
.tool-bar {
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
  flex-shrink: 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.tool-bar-back {
  display: flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px;
  text-decoration: none;
  padding: 5px 10px; border-radius: 6px;
  transition: all 0.2s;
}
.tool-bar-back:hover { background: var(--bg); color: var(--text); }
.tool-bar-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: 14px;
  color: var(--text); flex: 1;
}
.tool-bar-sub { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 6px; }

/* ── Body ── */
.tool-body { display: flex; flex: 1; overflow: hidden; }

/* ── Form panel ── */
.form-panel {
  width: 360px; min-width: 360px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto; height: 100%;
  padding: 16px 16px 60px;
}

/* ── Preview outer + zoom ── */
.preview-outer {
  flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg);
}
.zoom-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}
.zoom-btn {
  width: 26px; height: 26px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer;
  font-size: 14px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, color 0.2s;
  font-family: inherit;
}
.zoom-btn:hover { border-color: var(--accent); color: var(--accent); }
.zoom-reset { font-size: 12px; }
.zoom-label { font-size: 11px; color: var(--muted); min-width: 36px; text-align: center; }

/* ── Preview panel ── */
.preview-panel {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 40px;
  min-height: 0;
}
.preview-panel > * {
  transform-origin: top center;
  transition: transform 0.15s ease;
}

/* ═══════════════════════════════════════════════════
   FORM ELEMENTS
═══════════════════════════════════════════════════ */
.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 9px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--accent);
  margin: 18px 0 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}
.field { margin-bottom: 9px; }
.field label {
  display: block;
  font-size: 10px; color: var(--muted);
  margin-bottom: 3px; font-weight: 500;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  color: var(--text); font-size: 12.5px;
  outline: none; transition: border-color 0.2s;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,0.08); }
.field select option { background: #fff; color: var(--text); }
.field textarea { resize: vertical; min-height: 48px; }
.field input[readonly] { background: #f0f0f4; color: var(--muted); cursor: default; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; }

/* Action buttons */
.print-btn {
  background: var(--card); color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px; width: 100%;
  font-size: 11px; letter-spacing: 1px;
  cursor: pointer; margin-top: 6px;
  text-transform: uppercase; transition: all 0.2s;
}
.print-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(79,70,229,0.04); }
.rand-btn { background: rgba(79,70,229,.06); color: var(--accent); border: 1px solid rgba(79,70,229,.2); border-radius: 8px; padding: 9px; width: 100%; font-size: 11px; letter-spacing: 0.8px; cursor: pointer; text-transform: uppercase; transition: all 0.2s; margin-top: 8px; margin-bottom: 14px; font-family: inherit; font-weight: 600; display: block; }
.rand-btn:hover { background: rgba(79,70,229,.12); }

/* ── Logo picker ── */
.logo-picker { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin-bottom: 8px; }
.logo-opt {
  background: var(--card); border: 2px solid var(--border);
  border-radius: 8px; padding: 7px 3px;
  cursor: pointer; text-align: center; transition: all 0.2s;
}
.logo-opt:hover { border-color: #c0bff0; }
.logo-opt.active { border-color: var(--accent); background: rgba(79,70,229,0.06); }
.lo-svg { height: 30px; display: flex; align-items: center; justify-content: center; margin-bottom: 2px; }
.lo-name { font-size: 8px; color: var(--muted); font-family: var(--mono); }

/* ═══════════════════════════════════════════════════
   AD SLOTS
═══════════════════════════════════════════════════ */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  background: var(--card);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); font-size: 11px;
  letter-spacing: 1px; text-transform: uppercase;
  overflow: hidden;
}
.ad-slot-leaderboard { width: 100%; max-width: 728px; height: 90px; margin: 0 auto; border-radius: 8px; }

/* ═══════════════════════════════════════════════════
   THERMAL RECEIPT
═══════════════════════════════════════════════════ */
/* Pocket-photo wrapper — tilt/skew/shadow set dynamically via inline style */
.receipt-photo {
  position: relative;
}

.thermal-wrap {
  display: flex; flex-direction: column;
}
.thermal-tear-top, .thermal-tear-bottom {
  height: 22px; background: #f0ece4;
}
/* Irregular tear — uneven tooth heights to look hand-torn */
.thermal-tear-top {
  clip-path: polygon(0 100%,1% 20%,2.5% 90%,4% 5%,5.5% 80%,7% 15%,8.5% 95%,10% 10%,11.5% 85%,13% 0%,14.5% 90%,16% 20%,17.5% 100%,19% 15%,20.5% 80%,22% 5%,23.5% 95%,25% 25%,26.5% 75%,28% 0%,29.5% 88%,31% 12%,32.5% 92%,34% 8%,35.5% 82%,37% 18%,38.5% 96%,40% 4%,41.5% 78%,43% 22%,44.5% 100%,46% 10%,47.5% 85%,49% 0%,50.5% 90%,52% 18%,53.5% 75%,55% 5%,56.5% 92%,58% 14%,59.5% 88%,61% 2%,62.5% 80%,64% 20%,65.5% 98%,67% 8%,68.5% 84%,70% 16%,71.5% 96%,73% 6%,74.5% 78%,76% 24%,77.5% 100%,79% 12%,80.5% 86%,82% 0%,83.5% 92%,85% 18%,86.5% 82%,88% 4%,89.5% 90%,91% 22%,92.5% 76%,94% 10%,95.5% 94%,97% 8%,98.5% 88%,100% 100%);
}
.thermal-tear-bottom {
  clip-path: polygon(0 0,1% 80%,2.5% 10%,4% 95%,5.5% 20%,7% 85%,8.5% 5%,10% 90%,11.5% 15%,13% 100%,14.5% 10%,16% 80%,17.5% 0%,19% 85%,20.5% 20%,22% 95%,23.5% 5%,25% 75%,26.5% 25%,28% 100%,29.5% 12%,31% 88%,32.5% 8%,34% 92%,35.5% 18%,37% 82%,38.5% 4%,40% 96%,41.5% 22%,43% 78%,44.5% 0%,46% 90%,47.5% 15%,49% 100%,50.5% 10%,52% 82%,53.5% 25%,55% 95%,56.5% 8%,58% 86%,59.5% 12%,61% 98%,62.5% 20%,64% 80%,65.5% 2%,67% 92%,68.5% 16%,70% 84%,71.5% 4%,73% 94%,74.5% 22%,76% 76%,77.5% 0%,79% 88%,80.5% 14%,82% 100%,83.5% 8%,85% 82%,86.5% 18%,88% 96%,89.5% 10%,91% 78%,92.5% 24%,94% 90%,95.5% 6%,97% 92%,98.5% 12%,100% 0);
}
.thermal {
  background: #faf8f3; width: 340px;
  font-family: var(--mono); position: relative;
}
/* Fold creases — positions set via inline style */
.t-crease {
  position: absolute; left: 0; right: 0;
  height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.07) 20%, rgba(0,0,0,0.13) 50%, rgba(0,0,0,0.07) 80%, transparent 100%);
}
/* Subtle vignette worn edges */
.thermal::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(160,140,100,0.10) 100%);
  pointer-events: none; z-index: 1;
}
.thermal-body { padding: 6px 36px 20px 20px; }

.t-center { text-align: center; }
.t-logo { margin: 12px auto 4px; display: flex; justify-content: center; width: 120px; height: 120px; }
.t-logo svg, .t-logo img { width: 120px; height: 120px; object-fit: contain; }
.t-welcome { font-size: 11px; font-weight: 700; letter-spacing: 2px; margin: 10px 0 4px; }
.t-addr { font-size: 10.5px; line-height: 1.55; color: #222; }
.t-div { border: none; border-top: 1px dashed #999; margin: 9px 0; }
.t-div-solid { border: none; border-top: 2px solid #000; margin: 9px 0; }
.t-row { display: flex; justify-content: space-between; font-size: 11px; line-height: 1.8; color: #111; }
.t-row .lbl { font-weight: 700; }
.t-total-row {
  display: flex; justify-content: space-between;
  font-size: 13.5px; font-weight: 700;
  padding: 5px 0;
  border-top: 2px solid #000; border-bottom: 2px solid #000;
  margin: 5px 0; color: #000;
}
.t-stars { text-align: center; letter-spacing: 3px; font-size: 11px; margin: 8px 0 5px; color: #333; }
.t-footer { text-align: center; font-size: 10.5px; line-height: 1.7; margin-top: 10px; color: #333; }
.t-side-strip {
  position: absolute; right: 0;
  width: 18px; background: #888; color: #fff;
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  padding: 10px 3px;
  writing-mode: vertical-rl; transform: rotate(180deg);
  border-radius: 2px 0 0 2px;
  display: flex; align-items: center; justify-content: center;
}
.t-side-strip--top { top: 20px; }
.t-side-strip--bot { bottom: 20px; }
.t-draft {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%) rotate(-28deg);
  font-size: 56px; font-weight: 900;
  color: rgba(0,0,0,0.04); letter-spacing: 5px;
  pointer-events: none; white-space: nowrap;
  font-family: 'Syne', sans-serif;
}

/* ── Feedback widget (inline in zoom-bar) ── */
.fb-inline { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.fb-inline .fb-label { white-space: nowrap; }
.fb-btn {
  padding: 3px 8px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--card); cursor: pointer;
  font-size: 14px; line-height: 1.4; transition: all 0.2s;
}
.fb-btn:hover { border-color: var(--accent); background: rgba(79,70,229,0.04); }
.fb-btn.selected { border-color: var(--accent); background: rgba(79,70,229,0.08); }
.fb-thanks-inline { font-size: 12px; color: #16a34a; font-weight: 500; white-space: nowrap; display: none; }
.fb-popup {
  position: absolute; top: calc(100% + 4px); left: 14px; z-index: 200;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; width: 260px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  display: none;
}
.fb-popup p { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.fb-popup textarea {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 12px; color: var(--text);
  background: var(--card); resize: vertical; min-height: 64px;
  font-family: inherit; outline: none; transition: border-color 0.2s;
}
.fb-popup textarea:focus { border-color: var(--accent); }
.fb-send {
  margin-top: 7px; width: 100%; padding: 7px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 8px; font-size: 12px;
  font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
.fb-send:hover { opacity: 0.88; }

/* ═══════════════════════════════════════════════════
   PRINT
═══════════════════════════════════════════════════ */
@page { margin: 1cm; }
@media print {
  body { background: #fff !important; }
  .tool-bar, .form-panel, .ad-slot,
  .print-btn, .zoom-bar { display: none !important; }
  .tool-page { height: auto; display: block; }
  .tool-body { display: block; overflow: visible; }
  .preview-outer { display: block; overflow: visible; }
  .preview-panel > * { transform: none !important; }
  .preview-panel {
    padding: 0; background: none;
    display: flex; justify-content: center; align-items: center;
    min-height: calc(100vh - 2cm); overflow: visible;
  }
  .thermal { box-shadow: none !important; background: #fff !important; }
  .thermal::before { display: none !important; }
  .t-crease { display: none !important; }
  .t-draft { display: none !important; }
  .thermal-wrap { filter: none; }
  .thermal-tear-top, .thermal-tear-bottom { display: none; }
  .t-side-strip { display: none; }
  .receipt-photo { transform: none !important; filter: none !important; }
  #print-footer { display: block !important; }
}

/* ── TOOL SAMPLES SECTION ── */
.tool-samples{max-width:600px;margin:0 auto;padding:48px 24px 56px;}
.tool-samples-heading{font-family:'Syne',sans-serif;font-size:20px;font-weight:700;color:var(--text);margin-bottom:6px;letter-spacing:-0.3px;}
.tool-samples-sub{font-size:13px;color:var(--muted);margin-bottom:22px;line-height:1.6;}
.tool-samples-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.tool-samples-grid.landscape{grid-template-columns:1fr;}
.tool-sample-card{background:var(--surface);border:1px solid var(--border);border-radius:12px;overflow:hidden;transition:box-shadow 0.2s;}
.tool-sample-card:hover{box-shadow:0 4px 16px rgba(0,0,0,0.09);}
.tool-sample-card .img-wrap{height:260px;background:#f0f0f4;display:flex;align-items:center;justify-content:center;overflow:hidden;}
.tool-samples-grid.landscape .img-wrap{height:200px;}
.tool-sample-card .img-wrap img{max-width:100%;max-height:100%;object-fit:contain;display:block;}
.tool-sample-card figcaption{padding:10px 12px;font-size:12px;color:var(--muted);line-height:1.5;}
.tool-sample-card figcaption strong{display:block;color:var(--text);font-size:13px;font-weight:600;margin-bottom:2px;}
@media print{.tool-samples{display:none!important;}}
@media(max-width:600px){.tool-samples-grid{grid-template-columns:1fr 1fr;}.tool-samples-grid.landscape{grid-template-columns:1fr;}}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .tool-page { height: auto; }
  .tool-body { flex-direction: column; overflow: visible; height: auto; }
  .form-panel { width: 100%; min-width: unset; height: auto; max-height: none; border-right: none; border-bottom: 1px solid var(--border); }
  .preview-outer { overflow: visible; height: auto; flex: none; }
  .preview-panel { padding: 16px 12px; overflow: visible; height: auto; min-height: 300px; }
  .thermal { width: 100%; max-width: 340px; }
}
@media (max-width: 600px) {
  .logo-picker { grid-template-columns: repeat(4,1fr); }
  .ad-slot-leaderboard { height: 60px; }
}
