:root {
  color-scheme: light;
  --bg: #eef5ff;
  --bg-2: #ffffff;
  --text: #0c1726;
  --muted: #5d6b7c;
  --line: rgba(22, 44, 72, .12);
  --glass: rgba(255, 255, 255, .68);
  --glass-strong: rgba(255, 255, 255, .86);
  --primary: #0b74de;
  --primary-2: #043b79;
  --danger: #d92828;
  --success: #18a957;
  --brown: #8a5a2b;
  --purple: #7d3fd1;
  --dark: #161b22;
  --shadow: 0 24px 70px rgba(15, 47, 94, .18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111f;
  --bg-2: #0f1b2b;
  --text: #f5f8ff;
  --muted: #a8b6c8;
  --line: rgba(222, 236, 255, .14);
  --glass: rgba(13, 25, 41, .72);
  --glass-strong: rgba(17, 31, 51, .9);
  --shadow: 0 24px 70px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(11, 116, 222, .25), transparent 36rem),
    linear-gradient(135deg, var(--bg), var(--bg-2));
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.page { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0 44px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; letter-spacing: .2px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 8px; color: white; background: linear-gradient(135deg, #0b74de, #031d3d); box-shadow: var(--shadow); }
.brand-mark i { font-size: 1.1rem; }
.session-user {
  min-width: 0;
  max-width: 280px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  color: var(--muted);
  font-size: .9rem;
  font-weight: 800;
}
.session-user span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.nav a, .nav button, .btn {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--glass);
  border-radius: 8px;
  padding: 10px 13px;
  cursor: pointer;
  backdrop-filter: blur(18px);
}
.nav a, .nav button { display: inline-flex; align-items: center; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; }
.btn.primary { color: white; background: var(--primary); border-color: transparent; }
.btn.danger { color: white; background: var(--danger); border-color: transparent; }
.btn.success { color: white; background: var(--success); border-color: transparent; }
.btn.full { width: 100%; }
.card, .panel {
  border: 1px solid var(--line);
  background: var(--glass);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}
.panel { padding: 22px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.actions { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; align-items: stretch; margin-bottom: 18px; }
.weight-display { container-type: inline-size; display: grid; place-items: center; min-height: 216px; text-align: center; }
.weight-display > div { width: 100%; min-width: 0; display: grid; justify-items: center; gap: 8px; }
.weight-display strong { color: var(--primary); }
.weight-display > div > span { color: var(--muted); font-weight: 800; text-transform: uppercase; font-size: .82rem; display: inline-flex; gap: 8px; align-items: center; }
.live-weight-line {
  max-width: 100%;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: nowrap;
  gap: .18em;
  white-space: nowrap;
  line-height: .95;
  font-size: clamp(2.5rem, 24cqi, 5.2rem);
}
.live-weight-line .weight-unit {
  color: var(--primary);
  font-size: .84em;
  text-transform: none;
  flex: 0 0 auto;
  white-space: nowrap;
}
.live-weight-line [data-live-weight-value] {
  color: var(--primary);
  font-size: 1em;
  text-transform: none;
  flex: 0 1 auto;
  min-width: 0;
}
.weight-meta { display: block; color: var(--muted); font-size: .94rem; font-weight: 700; }
.weight-alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  border: 1px solid rgba(245, 158, 11, .38);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(245, 158, 11, .16);
  color: #8a4b00;
  font-weight: 900;
}
.weight-stale { border-color: rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .08); }
.big-action {
  min-height: 132px;
  padding: 18px;
  color: white;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: clamp(1.15rem, 3vw, 1.7rem);
  font-weight: 900;
  border: 0;
}
.big-action span { display: inline-flex; gap: 10px; align-items: center; }
.big-action small { font-size: .86rem; opacity: .88; font-weight: 700; }
.blue { background: linear-gradient(135deg, #0b74de, #064682); }
.red { background: linear-gradient(135deg, #dc2626, #861515); }
.green { background: linear-gradient(135deg, #16a34a, #0f6530); }
.brown { background: linear-gradient(135deg, #8a5a2b, #4f3016); }
.purple { background: linear-gradient(135deg, #7d3fd1, #3c1974); }
.gray { background: linear-gradient(135deg, #2d3748, #111827); }
h1, h2, h3 { margin: 0 0 14px; line-height: 1.12; }
p { color: var(--muted); line-height: 1.55; }
.muted { color: var(--muted); }
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-title h2 { margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 7px; }
.field label { font-size: .86rem; font-weight: 800; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--text);
  background: var(--glass-strong);
  outline: none;
}
.field textarea { min-height: 92px; resize: vertical; }
.field small.field-help { color: var(--muted); line-height: 1.45; }
.field-error .captcha-error { color: var(--danger); font-weight: 800; }
.field-error .cf-turnstile, .field-error .h-captcha {
  outline: 2px solid rgba(217, 40, 40, .35);
  outline-offset: 6px;
  border-radius: 8px;
}
.discount-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--glass);
}
.discount-panel summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
  list-style: none;
}
.discount-panel summary::-webkit-details-marker { display: none; }
.discount-panel summary::after {
  content: '+';
  float: right;
  color: var(--primary);
}
.discount-panel[open] summary::after { content: '-'; }
.discount-panel > p { margin: 12px 0 14px; }
.api-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.api-key-row input[readonly] {
  background: rgba(148, 163, 184, .14);
  color: var(--text);
}
.account-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.account-summary > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: var(--glass-strong);
}
.account-summary small {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}
.account-summary strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}
.download-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--glass-strong);
}
.download-strip div {
  min-width: 0;
  display: grid;
  gap: 5px;
}
.download-strip small { color: var(--muted); }
.span-2 { grid-column: span 2; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--glass); }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; border-radius: 999px; padding: 5px 9px; font-size: .78rem; font-weight: 900; background: rgba(11, 116, 222, .12); color: var(--primary); }
.badge.warn { color: #ad6200; background: rgba(245, 158, 11, .14); }
.badge.ok { color: var(--success); background: rgba(24, 169, 87, .14); }
.badge.err { color: var(--danger); background: rgba(217, 40, 40, .14); }
.alert { padding: 13px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--glass-strong); }
.alert.error { border-color: rgba(217, 40, 40, .35); }
.alert.success { border-color: rgba(24, 169, 87, .35); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(460px, 100%); padding: 28px; }
.auth-home { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--muted); font-size: .9rem; font-weight: 800; }
.auth-home:hover { color: var(--primary); }
.logo-preview { max-width: 220px; max-height: 90px; object-fit: contain; }
.hp-field { display: none !important; position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.weight-submit-bar {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 16px;
  align-items: stretch;
  margin-top: 8px;
}
.weight-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(11, 116, 222, .12), rgba(255, 255, 255, .45));
  display: grid;
  gap: 8px;
}
.weight-box small {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 900;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.weight-box .weight-meta {
  font-size: .88rem;
  line-height: 1.4;
}
.weight-box .weight-alert {
  color: #8a4b00;
  font-size: .9rem;
  text-transform: none;
}
.weight-box strong:not(.live-weight-line) {
  font-size: clamp(2.7rem, 6vw, 4.8rem);
  line-height: 1;
  color: var(--primary);
}
.weight-box-inline {
  margin-bottom: 2px;
}
.weight-box-inline strong:not(.live-weight-line) {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
}
.submit-box {
  display: grid;
  align-content: center;
  gap: 12px;
  min-width: 240px;
}
.checkbox-inline {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}
.ticket { width: min(820px, 100%); margin: 20px auto; background: white; color: #111827; padding: 28px; border: 1px solid #d1d5db; }
.ticket.narrow {
  page: ticket-80mm;
  width: 80mm;
  max-width: 100%;
  padding: 2mm;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.25;
}
.ticket table { min-width: 0; }
.ticket th, .ticket td { color: #111827; padding: 7px 0; }
.ticket-header { text-align: center; margin-bottom: 14px; }
.ticket.narrow .ticket-header {
  margin-bottom: 8px;
  font-size: 15px;
}
.ticket.narrow .ticket-header h2 {
  margin: 6px 0 0;
  font-size: 20px;
  line-height: 1.15;
}
.ticket.narrow .logo-preview {
  display: block;
  width: var(--ticket-logo-width-narrow, 100%);
  max-width: 100%;
  max-height: var(--ticket-logo-height, 180px);
  height: auto;
  margin: 0 auto 10px;
}
.ticket:not(.narrow):not(.ticket-layout-a4) .logo-preview {
  display: block;
  width: min(100%, var(--ticket-logo-width-a4, 440px));
  max-width: 100%;
  max-height: var(--ticket-logo-height, 180px);
  height: auto;
  margin: 0 auto 14px;
}
.ticket.narrow th,
.ticket.narrow td {
  padding: 8px 0;
  line-height: 1.2;
}
.ticket.narrow th {
  width: 44%;
  padding-right: 2mm;
  font-size: 14px;
  letter-spacing: .02em;
}
.ticket.narrow td {
  width: 56%;
  font-size: 15px;
}
.ticket-measurement {
  display: grid;
  gap: 2px;
}
.ticket-measurement span,
.ticket-measurement strong {
  display: block;
}
.ticket-signatures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px;
  margin-top: 64px;
  align-items: end;
}
.ticket-signature {
  display: grid;
  gap: 8px;
  text-align: center;
}
.ticket-signature-line {
  border-top: 1px solid #111827;
  min-height: 1px;
  width: 100%;
}
.ticket-signature-name {
  color: #111827;
  font-weight: 800;
}
.ticket-layout-launch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass-strong);
}
.ticket-layout-launch > div { display: grid; gap: 5px; }
.ticket-layout-launch small { color: var(--muted); }
.ticket-editor-page { display: grid; gap: 16px; }
.ticket-editor-intro { display: flex; justify-content: space-between; align-items: start; gap: 18px; }
.ticket-editor-intro h1 { margin: 0 0 7px; }
.ticket-editor-intro p { margin: 0; color: var(--muted); max-width: 700px; }
.ticket-editor-workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 270px;
  align-items: start;
  gap: 16px;
}
.ticket-editor-tools, .ticket-editor-inspector {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass-strong);
}
.ticket-editor-tools h2, .ticket-editor-inspector h2 { margin: 0; font-size: 1.1rem; }
.ticket-editor-tools .btn { width: 100%; justify-content: flex-start; }
.ticket-layer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ticket-layer-actions .btn { min-width: 0; font-size: .78rem; padding: 9px 8px; }
.editor-tool-group { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.editor-tool-group strong { font-size: .85rem; color: var(--muted); text-transform: uppercase; }
.ticket-editor-stage-wrap { min-width: 0; overflow-x: scroll; overflow-y: auto; scrollbar-gutter: stable; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(11, 116, 222, .08); }
.ticket-editor-horizontal-scroll { width: 100%; height: 17px; overflow-x: scroll; overflow-y: hidden; margin-bottom: 7px; }
.ticket-editor-horizontal-scroll > div { height: 1px; min-width: 794px; }
.ticket-editor-ruler { width: 794px; padding: 0 0 9px; color: var(--muted); font-size: .8rem; font-weight: 800; text-align: center; }
.ticket-editor-stage {
  position: relative;
  width: 794px;
  height: 1123px;
  overflow: hidden;
  background-color: #fff;
  background-image: linear-gradient(#edf1f5 1px, transparent 1px), linear-gradient(90deg, #edf1f5 1px, transparent 1px);
  background-size: 20px 20px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .22);
}
.ticket-editor-element {
  position: absolute;
  display: flex;
  align-items: center;
  overflow: visible;
  cursor: move;
  border-style: solid;
  line-height: 1.22;
  user-select: none;
}
.ticket-editor-element > span:first-child { display: block; width: 100%; overflow: hidden; padding: 2px; }
.ticket-editor-field { border-style: dashed; border-width: 1px !important; border-color: #8ba4bd !important; background: rgba(255, 255, 255, .9) !important; }
.ticket-editor-field > span:first-child::before { content: '{{ '; color: #0b74de; font-weight: 800; }
.ticket-editor-field > span:first-child::after { content: ' }}'; color: #0b74de; font-weight: 800; }
.ticket-editor-image { justify-content: center; border: 1px dashed #8ba4bd !important; color: #536579 !important; background: rgba(255,255,255,.92) !important; }
.ticket-editor-image-placeholder { text-align: center; }
.ticket-editor-shape-line { min-height: 2px; }
.ticket-editor-element.selected { outline: 2px solid #0b74de; outline-offset: 2px; }
.ticket-editor-resize { position: absolute; width: 13px; height: 13px; right: -7px; bottom: -7px; border: 2px solid #fff; border-radius: 3px; background: #0b74de; cursor: nwse-resize; z-index: 999; }
.editor-prop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.ticket-editor-inspector label { display: grid; gap: 5px; color: var(--muted); font-size: .82rem; font-weight: 800; }
.ticket-editor-inspector .checkbox-inline { display: flex; font-size: .9rem; }
.ticket-editor-actions { grid-column: 2 / 3; display: flex; justify-content: flex-end; gap: 10px; }
.ticket-editor-top-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.ticket-editor-top-actions small { color: var(--success); font-weight: 800; }
.ticket-editor-top-actions small.error { color: var(--danger); }
.ticket-layout-reset { display: flex; justify-content: flex-end; }
.ticket-layout-a4 {
  page: ticket-a4-custom;
  position: relative;
  width: 210mm;
  height: 297mm;
  max-width: 100%;
  margin: 20px auto;
  padding: 0;
  overflow: hidden;
  background: #fff;
  color: #111827;
}
.ticket-layout-copy { position: absolute; inset: 0; }
.ticket-layout-copy-bottom { transform: translateY(148.5mm); }
.ticket-a4-default-double {
  page: ticket-a4-custom;
  position: relative;
  width: 210mm;
  height: 297mm;
  max-width: 100%;
  margin: 20px auto;
  padding: 0;
  overflow: hidden;
}
.ticket-a4-default-double .ticket-default-copy {
  position: absolute;
  inset: 0 0 auto;
  height: 148.5mm;
  padding: 7mm 10mm;
  overflow: hidden;
}
.ticket-a4-default-double .ticket-default-copy-bottom { transform: translateY(148.5mm); }
.ticket-layout-element { position: absolute; box-sizing: border-box; overflow: hidden; border-style: solid; line-height: 1.22; }
.ticket-layout-text { white-space: pre-wrap; }
.ticket-layout-image { display: grid; place-items: center; color: #6b7280; font-size: 12px; }
.ticket-layout-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ticket-layout-shape-circle { border-radius: 50% !important; }
.ticket-layout-shape-line { min-height: 1px; }
.ticket.narrow .ticket-signatures {
  gap: 14px;
  margin-top: 46px;
  font-size: 14px;
}
.print-actions { width: min(820px, 100%); margin: 18px auto; display: flex; gap: 8px; justify-content: flex-end; }

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 1fr);
  align-items: stretch;
  gap: 14px;
  padding: 2px 0 14px;
}
.landing-copy { display: flex; flex-direction: column; justify-content: center; max-width: none; padding: clamp(26px, 4vw, 54px); border: 1px solid var(--line); border-radius: 7px; background: var(--glass-strong); }
.landing-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 11px;
  border: 1px solid rgba(11, 116, 222, .2);
  width: fit-content;
  border-radius: 5px;
  color: var(--primary);
  background: rgba(11, 116, 222, .08);
  font-size: .82rem;
  font-weight: 900;
}
.landing-copy h1 { max-width: 650px; margin-bottom: 18px; font-size: clamp(2.2rem, 4.2vw, 4rem); line-height: 1.02; letter-spacing: -.055em; }
.landing-copy p { max-width: 570px; margin: 0; font-size: clamp(1rem, 1.3vw, 1.12rem); line-height: 1.55; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.landing-login, .landing-contact {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 6px;
  padding: 14px 22px;
  font-weight: 900;
  transition: transform .2s ease, box-shadow .2s ease;
}
.landing-login { min-width: 190px; color: #fff; background: #075db8; box-shadow: none; font-size: 1.05rem; }
.landing-contact { border: 1px solid var(--line); background: var(--glass); color: var(--text); }
.landing-login:hover, .landing-contact:hover { transform: translateY(-2px); }
.landing-support { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; color: var(--muted); font-weight: 700; }
.landing-preview {
  position: relative;
  padding: 16px;
  border: 1px solid #163b64;
  border-radius: 7px;
  color: #edf6ff;
  background: #0c213a;
  box-shadow: none;
}
.landing-preview-top { display: flex; align-items: center; justify-content: space-between; padding: 3px 2px 14px; color: rgba(237, 246, 255, .83); font-size: .84rem; }
.landing-preview-top strong { color: #fff; }
.landing-weight-card { display: grid; gap: 9px; padding: 26px 22px; border: 1px solid #285176; border-radius: 5px; background: #081a2e; }
.landing-weight-card > span, .landing-weight-card em { color: #b9cee3; font-size: .85rem; font-style: normal; font-weight: 800; }
.landing-weight-card strong { color: #fff; font-size: clamp(2.5rem, 6vw, 4.2rem); letter-spacing: -.07em; line-height: 1; }
.landing-weight-card strong small { color: #82c6ff; font-size: .38em; letter-spacing: 0; }
.landing-weight-card em { color: #89e3b5; }
.landing-preview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.landing-preview-grid > div { display: grid; gap: 6px; min-width: 0; padding: 13px; border: 1px solid #285176; border-radius: 5px; background: #102a46; }
.landing-preview-grid span { color: #82c6ff; }
.landing-preview-grid strong { font-size: .9rem; }
.landing-preview-grid small { color: #b9cee3; font-size: .72rem; }
.landing-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0 0 14px; }
.landing-features article { padding: 20px; min-height: 190px; border: 1px solid var(--line); border-radius: 6px; background: var(--glass-strong); }
.landing-features article > span { display: grid; width: 41px; height: 41px; place-items: center; margin-bottom: 16px; border-radius: 5px; color: #fff; background: #075db8; }
.landing-features h2 { margin-bottom: 8px; font-size: 1.08rem; }
.landing-features p { margin: 0; font-size: .92rem; }
.landing-tools { margin: 0 0 14px; padding: clamp(22px, 4vw, 34px); border: 1px solid var(--line); border-radius: 7px; background: var(--glass-strong); box-shadow: none; }
.landing-tools-heading { margin-bottom: 20px; }
.landing-tools-heading .landing-eyebrow { margin-bottom: 10px; }
.landing-tools-heading h2 { margin-bottom: 8px; font-size: clamp(1.45rem, 3vw, 2rem); }
.landing-tools-heading p { max-width: 640px; margin: 0; }
.landing-tools-list { display: grid; gap: 10px; }
.landing-tool { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 5px; background: #fff; transition: border-color .2s ease, background .2s ease; }
.landing-tool:hover { border-color: #075db8; background: #f4f9ff; }
.landing-tool-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 5px; color: #fff; background: #075db8; }
.landing-tool > span:nth-child(2) { display: grid; min-width: 0; gap: 4px; }
.landing-tool strong, .landing-tool small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.landing-tool small { color: var(--muted); font-size: .82rem; }
.landing-tool > i { color: var(--primary); }
.landing-tools-empty { padding: 19px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.landing-contact-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 22px 24px; border-radius: 7px; color: #fff; background: #093d70; box-shadow: none; }
.landing-contact-strip div { display: grid; gap: 4px; }
.landing-contact-strip span { color: rgba(255, 255, 255, .8); }
.landing-contact-strip .btn { border-color: rgba(255, 255, 255, .3); background: #fff; color: #084987; white-space: nowrap; }
:root[data-theme="dark"] .landing-tool { background: #10233a; }
:root[data-theme="dark"] .landing-tool:hover { background: #16314f; }

@media (max-width: 1080px) and (min-width: 821px) {
  .landing-hero { grid-template-columns: minmax(0, .9fr) minmax(350px, 1.1fr); }
  .landing-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing-features article { min-height: 0; }
}

.manual-chat-page { display: grid; gap: 16px; }
.manual-chat-page h1 { margin-bottom: 5px; }
.manual-chat-page .section-title { align-items: flex-start; }
.manual-ai-usage { margin: 8px 0 0; color: var(--muted); font-size: .88rem; font-weight: 800; }
.manual-chat-log {
  display: grid;
  gap: 12px;
  min-height: 260px;
  max-height: 62vh;
  overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(11, 116, 222, .035);
}
.manual-chat-message { display: grid; gap: 6px; max-width: min(820px, 88%); padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--glass-strong); line-height: 1.5; }
.manual-chat-message strong { font-size: .82rem; color: var(--muted); }
.manual-chat-message.from-user { justify-self: end; border-color: rgba(11, 116, 222, .25); background: rgba(11, 116, 222, .11); }
.manual-chat-message.from-ai { justify-self: start; }
.manual-chat-empty { display: grid; place-content: center; min-height: 230px; gap: 10px; text-align: center; color: var(--muted); }
.manual-chat-empty i { color: var(--primary); font-size: 2rem; }
.manual-chat-empty strong { color: var(--text); }
.manual-chat-status { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid rgba(11, 116, 222, .25); border-radius: 9px; color: var(--primary); background: rgba(11, 116, 222, .08); font-weight: 800; }
.manual-chat-status.error { border-color: rgba(220, 38, 38, .28); color: var(--danger); background: rgba(220, 38, 38, .08); }
.manual-chat-form [data-manual-ai-submit-loading] { display: inline-flex; align-items: center; gap: 8px; }
.manual-chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.manual-chat-form textarea { min-height: 82px; resize: vertical; }
.manual-chat-form .btn { min-height: 48px; }

@page ticket-80mm {
  size: 80mm auto;
  margin: 0;
}

@page ticket-a4-custom {
  size: A4 portrait;
  margin: 0;
}

@media (max-width: 820px) {
  .page { width: min(100% - 18px, 1180px); padding-top: 12px; }
  .topbar, .hero { grid-template-columns: 1fr; display: grid; }
  .grid.two, .grid.three, .grid.actions, .form-grid { grid-template-columns: 1fr; }
  .api-key-row { grid-template-columns: 1fr; }
  .account-summary { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .big-action { min-height: 110px; }
  .weight-submit-bar { grid-template-columns: 1fr; }
  .submit-box { min-width: 0; }
  .nav { width: 100%; }
  .nav a, .nav button { flex: 1; text-align: center; }
  .session-user { width: 100%; max-width: none; }
  .section-title { align-items: stretch; flex-direction: column; }
  .download-strip { align-items: stretch; flex-direction: column; }
  .ticket-editor-workspace { grid-template-columns: 1fr; }
  .ticket-editor-tools, .ticket-editor-inspector { position: static; }
  .ticket-editor-actions { grid-column: auto; }
  .ticket-editor-top-actions { grid-column: auto; }
  .ticket-editor-intro, .ticket-layout-launch { align-items: stretch; flex-direction: column; }
  .landing-hero { grid-template-columns: 1fr; min-height: 0; padding: 24px 0 34px; }
  .landing-copy h1 { font-size: clamp(2.25rem, 11vw, 3.7rem); }
  .landing-preview { max-width: 560px; width: 100%; }
  .landing-features { grid-template-columns: 1fr; padding-bottom: 24px; }
  .landing-tool { padding: 13px; }
  .landing-contact-strip { align-items: stretch; flex-direction: column; }
  .landing-contact-strip .btn { width: 100%; }
  .manual-chat-form { grid-template-columns: 1fr; }
  .manual-chat-form .btn { width: 100%; }
  .manual-chat-message { max-width: 96%; }
}

.report-actions, .report-result-summary, .report-pagination { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.report-actions { margin: 12px 0; }
.report-date-help { flex-basis: 100%; color: var(--muted); font-size: .84rem; }
.report-result-summary { justify-content: space-between; margin-top: 12px; color: var(--muted); }
.report-result-summary strong { color: var(--text); }
.report-pagination { margin-top: 14px; }
.report-pagination a { min-width: 34px; padding: 7px 10px; text-align: center; border: 1px solid var(--line); border-radius: 8px; color: var(--text); text-decoration: none; }
.report-pagination a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.report-table { min-width: 1500px; }
.report-table th, .report-table td { white-space: nowrap; }
.report-table tfoot th, .report-table tfoot td { background: rgba(99, 102, 241, .10); font-weight: 700; }
.report-column-filters th { padding: 7px 5px; vertical-align: top; }
.report-column-filters input, .report-column-filters select { box-sizing: border-box; width: 100%; min-width: 82px; padding: 7px; font: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--glass); color: var(--text); }
.report-column-filters input + input { margin-top: 5px; }
.report-column-filters select + input { margin-top: 5px; }

@media (max-width: 820px) {
  .report-result-summary { align-items: flex-start; flex-direction: column; }
}

@media print {
  body { background: white; }
  .topbar, .print-actions, .no-print { display: none !important; }
  .page { width: 100%; padding: 0; }
  .ticket { border: 0; box-shadow: none; margin: 0 auto; }
  .ticket-layout-a4 { width: 210mm; max-width: none; height: 297mm; }
  .report-table { min-width: 0; font-size: 8px; }
  .report-table th, .report-table td { padding: 3px; white-space: normal; }
}
