/* Product navigation + extra document layouts */

.product-nav {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  background: transparent;
}

.product-nav-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel-2);
  min-height: 46px;
  box-sizing: border-box;
}

.product-nav-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 6px;
  opacity: 0.85;
}

.product-nav-group-game {
  border-color: rgba(224, 122, 40, 0.45);
  background: linear-gradient(135deg, rgba(224, 122, 40, 0.14), rgba(30, 36, 48, 0.9));
}

.product-nav-group-game .product-nav-label {
  color: #ffb347;
}

.product-nav-group-docs {
  border-color: rgba(56, 189, 248, 0.55);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(20, 40, 58, 0.95));
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.18), 0 8px 22px rgba(14, 165, 233, 0.12);
}

.product-nav-group-docs .product-nav-label {
  color: #7dd3fc;
}

.product-nav-group-about {
  border-color: rgba(167, 139, 250, 0.45);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(30, 36, 48, 0.9));
}

.product-nav-group-about .product-nav-label {
  color: #c4b5fd;
}

.product-tab-about:hover {
  background: rgba(167, 139, 250, 0.18);
  color: #ede9fe;
}

.product-tab-about.active {
  background: linear-gradient(145deg, #c4b5fd, #8b5cf6);
  color: #1a1028;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.35);
}

html[data-theme='light'] .product-nav-group-about {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), #faf5ff);
}

html[data-theme='light'] .product-tab-about.active {
  color: #1a1028;
}

/* —— About page —— */
.about-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 32px;
  animation: about-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  box-sizing: border-box;
}

@keyframes about-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.about-hero {
  position: relative;
  padding: 28px 28px 26px;
  margin-bottom: 18px;
  border-radius: 16px;
  border: 1px solid rgba(232, 163, 23, 0.28);
  background:
    radial-gradient(700px 280px at 8% 0%, rgba(232, 163, 23, 0.16), transparent 55%),
    radial-gradient(500px 240px at 95% 20%, rgba(56, 189, 248, 0.12), transparent 50%),
    linear-gradient(160deg, #151a24 0%, #10141c 100%);
  overflow: hidden;
}

.about-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -18deg,
    transparent,
    transparent 11px,
    rgba(255, 255, 255, 0.015) 11px,
    rgba(255, 255, 255, 0.015) 12px
  );
  pointer-events: none;
}

.about-kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffb347;
}

.about-hero h2 {
  margin: 0 0 10px;
  font-family: 'Black Ops One', var(--font-ui);
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: #f4f1ea;
}

.about-lead {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  position: relative;
  z-index: 1;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

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

.about-card {
  padding: 20px 18px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(30, 36, 48, 0.95), rgba(18, 22, 30, 0.98));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.about-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.about-card > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.about-card-game {
  border-color: rgba(224, 122, 40, 0.4);
}

.about-card-game h3 {
  color: #ffb347;
}

.about-card-config {
  border-color: rgba(125, 206, 130, 0.35);
}

.about-card-config h3 {
  color: #7dce82;
}

.about-card-docs {
  border-color: rgba(56, 189, 248, 0.4);
}

.about-card-docs h3 {
  color: #7dd3fc;
}

.about-card-credits {
  margin-top: 14px;
  border-color: rgba(251, 191, 36, 0.35);
}

.about-card-credits h3 {
  color: #fbbf24;
}

.about-credits-list a {
  color: #93c5fd;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-credits-list a:hover {
  color: #bfdbfe;
}

.about-steps,
.about-list {
  margin: 0 0 14px;
  padding-left: 1.15rem;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.55;
}

.about-steps li + li,
.about-list li + li {
  margin-top: 6px;
}

.about-steps kbd,
.about-card kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.about-note {
  margin: 0 0 14px !important;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 179, 71, 0.28);
  background: rgba(255, 179, 71, 0.08);
  font-size: 0.82rem !important;
}

.about-note a {
  color: #ffb347;
  font-weight: 600;
}

.about-go {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 9px;
  color: #1a1208;
  background: linear-gradient(145deg, #ffb347, #e07a28);
  box-shadow: 0 2px 10px rgba(224, 122, 40, 0.3);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.about-go:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.about-go-docs {
  color: #041018;
  background: linear-gradient(145deg, #38bdf8, #0284c7);
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.3);
}

.about-go-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.about-footer {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.about-footer p {
  margin: 0;
  color: var(--faint);
  font-size: 0.85rem;
  line-height: 1.5;
}

html[data-theme='light'] .about-hero {
  background:
    radial-gradient(700px 280px at 8% 0%, rgba(232, 163, 23, 0.14), transparent 55%),
    linear-gradient(160deg, #fffaf0 0%, #f4f1ea 100%);
  border-color: rgba(224, 122, 40, 0.3);
}

html[data-theme='light'] .about-hero h2 {
  color: #1a1408;
}

html[data-theme='light'] .about-card {
  background: #fff;
  box-shadow: 0 8px 20px rgba(20, 16, 8, 0.06);
}

html[data-theme='light'] .about-credits-list a {
  color: #1d4ed8;
}

html[data-theme='light'] .about-credits-list a:hover {
  color: #1e40af;
}

.product-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.product-tab:hover {
  color: var(--text);
}

.product-tab-game:hover {
  background: rgba(224, 122, 40, 0.16);
  color: #ffe0b5;
}

.product-tab-game.active {
  background: linear-gradient(145deg, #ffb347, #e07a28);
  color: #1a1208;
  box-shadow: 0 2px 10px rgba(224, 122, 40, 0.35);
}

.product-tab-docs {
  color: #ccebff;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.35);
}

.product-tab-docs:hover {
  background: rgba(56, 189, 248, 0.22);
  color: #f0f9ff;
  border-color: rgba(125, 211, 252, 0.65);
}

.product-tab-docs.active {
  background: linear-gradient(145deg, #38bdf8, #0284c7);
  color: #041018;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(14, 165, 233, 0.4);
}

html[data-theme='light'] .product-nav-group-game {
  background: linear-gradient(135deg, rgba(224, 122, 40, 0.16), #fff8ef);
}

html[data-theme='light'] .product-nav-group-docs {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.16), #f0f9ff);
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.2);
}

html[data-theme='light'] .product-tab-docs {
  color: #075985;
  background: rgba(14, 165, 233, 0.1);
}

html[data-theme='light'] .product-tab-docs.active {
  color: #041018;
}

#product-fuel,
#extra-docs-root,
[data-product-panel] {
  grid-column: 1 / -1;
  min-width: 0;
}

#extra-docs-root:not(:has([data-product-panel]:not([hidden]))) {
  display: none;
}

[data-product-panel][hidden] {
  display: none !important;
}

/* Extra products: match fuel panel height so left form scrolls */
[data-product-panel] .workspace {
  --panel-h: calc(100vh - 168px);
}

#product-rent .workspace {
  --panel-h: calc(100vh - 210px);
}

[data-product-panel] .controls,
[data-product-panel] .preview-pane {
  height: var(--panel-h);
  max-height: var(--panel-h);
  min-height: 0;
  box-sizing: border-box;
}

#product-ecommerce .workspace {
  grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.25fr);
}

[data-product-panel] .extra-preview-shell {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

#product-rent {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

#product-rent .mode-tabs,
#product-driver .mode-tabs {
  flex-shrink: 0;
}

.panel-actions.rr-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  position: static;
  background: transparent;
}

.panel-actions.rr-download-actions .btn {
  flex: 1 1 140px;
}

.extra-doc-form {
  padding-bottom: 8px;
}

.rr-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.rr-upload-row input[type='file'] {
  max-width: 100%;
  font-size: 0.8rem;
}

.rr-sig-seg {
  margin: 8px 0 12px;
}

.rr-sig-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.rr-sig-panel[hidden] {
  display: none !important;
}

.rr-font-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.rr-font-opt {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--ink);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.rr-font-opt.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.rr-font-opt .rr-font-name {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-ui);
}

.rr-font-opt .rr-font-sample {
  font-size: 1.25rem;
  line-height: 1;
}

.rr-pen-colors {
  display: flex;
  gap: 8px;
}

.rr-pen-swatch {
  appearance: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.rr-pen-swatch.is-selected {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 2px;
}

.rr-pen-swatch[data-pen='black'],
.rr-pen-swatch[data-ds-pen='black'] {
  background: #111;
}

.rr-pen-swatch[data-pen='blue'],
.rr-pen-swatch[data-ds-pen='blue'] {
  background: #1a4db3;
}

.rr-drag-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.rr-sig-size-field {
  margin-bottom: 10px;
}

.rr-sig-size-field input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}

.rr-sig-input {
  width: 100%;
  font-size: 1.35rem;
  font-weight: 600;
}

.rr-bulk-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.rr-bulk-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  font-size: 0.85rem;
}

.extra-doc-form textarea {
  appearance: none;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  resize: vertical;
  min-height: 64px;
}

.muted {
  color: #6b7280;
  font-size: 0.85em;
}

.pre {
  white-space: pre-wrap;
}

.num {
  text-align: right;
  white-space: nowrap;
}

/* ---- Ecommerce invoice ---- */

.ec-page {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin: 0 auto;
  background: #fff;
  color: #111;
  font-family: 'Sora', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  padding: 28px 32px 24px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.ec-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid #111;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.ec-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: #2874f0;
}

.ec-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

.ec-grid-2 h4 {
  margin: 0 0 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.ec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 14px;
}

.ec-table th,
.ec-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 8px 6px;
  vertical-align: top;
}

.ec-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #6b7280;
}

.ec-totals {
  margin-left: auto;
  width: min(280px, 100%);
  display: grid;
  gap: 6px;
}

.ec-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ec-totals .grand {
  border-top: 1px solid #111;
  padding-top: 8px;
  font-size: 1.05em;
}

.ec-foot {
  margin-top: 18px;
}

/* ---- Flipkart template ---- */

.ec-fk,
.ec-amz {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  /* A4-like page length (~297mm at 96dpi) to match template screenshots */
  min-height: 1123px;
  padding: 28px 36px 22px;
  display: flex;
  flex-direction: column;
}

.ec-page-spacer {
  flex: 1 1 auto;
  min-height: 140px;
}

.ec-fk {
  font-family: Arial, Helvetica, sans-serif;
  color: #000;
  font-size: 11px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

.ec-fk .muted {
  color: #333;
}

.fk-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.fk-logo {
  display: flex;
  align-items: center;
  margin-top: 2px;
}

.fk-logo img {
  display: block;
  height: 56px;
  width: auto;
  max-width: 210px;
  object-fit: contain;
}

.fk-header-mid {
  text-align: center;
  color: #000;
}

.fk-contact {
  font-size: 9px;
  color: #000;
  font-weight: 400;
}

.fk-seller {
  font-size: 13px;
  font-weight: 700;
  color: #000;
  margin-top: 3px;
}

.fk-wh {
  font-size: 8px;
  font-style: italic;
  font-weight: 400;
  color: #000;
  margin-top: 2px;
}

.fk-inv-box {
  border: 1px dashed #000;
  padding: 8px 10px;
  font-size: 11px;
  color: #000;
  white-space: nowrap;
}

.fk-inv-label {
  font-weight: 700;
}

.fk-info {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr auto;
  gap: 12px;
  margin: 10px 0 14px;
  align-items: start;
  font-size: 11px;
  color: #000;
}

.fk-label,
.fk-addr-h {
  font-weight: 700;
  color: #000;
}

.fk-addr-h {
  margin-bottom: 2px;
  font-size: 11px;
}

.fk-name {
  font-weight: 400;
  color: #000;
}

.fk-addr {
  font-weight: 400;
  color: #000;
  font-size: 11px;
}

.fk-keep {
  font-size: 8px;
  font-style: italic;
  font-weight: 400;
  color: #000;
  max-width: 110px;
  line-height: 1.3;
}

.fk-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
  color: #000;
  font-size: 11px;
}

.fk-table th,
.fk-table td {
  padding: 7px 5px;
  vertical-align: top;
  border: none;
  color: #000;
}

.fk-table thead th {
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  background: #f2f2f2;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  color: #000;
}

.fk-table .num {
  text-align: right;
}

.fk-prod {
  font-weight: 400;
}

.fk-title {
  font-weight: 700;
  font-size: 12px;
  color: #000;
}

.fk-fsn,
.fk-note {
  font-size: 8px;
  font-style: italic;
  font-weight: 400;
  color: #000;
  margin-top: 2px;
}

.fk-sum td {
  border-top: 1px solid #000;
  padding-top: 8px;
  font-weight: 700;
}

.fk-grand {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 2px solid #000;
  border-bottom: 2px solid #000;
  margin-top: 10px;
  padding: 8px 2px;
  color: #000;
}

.fk-grand-label {
  font-size: 16px;
  font-weight: 400;
}

.fk-grand-amt {
  font-size: 18px;
  font-weight: 700;
}

.fk-comp {
  text-align: center;
  font-style: italic;
  font-size: 10px;
  font-weight: 400;
  color: #000;
  margin: 8px 0 12px;
}

.fk-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.fk-returns {
  flex: 1;
  font-size: 9px;
  line-height: 1.4;
  font-weight: 400;
  color: #000;
}

.fk-thanks {
  text-align: center;
  color: #000;
  font-weight: 700;
  min-width: 120px;
  font-size: 12px;
}

.fk-thanks-mark {
  font-size: 14px;
  font-weight: 700;
}

.fk-legal {
  margin-top: 10px;
  font-size: 7px;
  font-weight: 400;
  color: #444;
  line-height: 1.35;
}

.fk-footer {
  flex-shrink: 0;
  margin-top: 8px;
}

.fk-pagebar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid #bbb;
  font-size: 8px;
  font-weight: 400;
  color: #666;
}

/* ---- Amazon template ---- */

.ec-amz {
  font-family: Arial, Helvetica, sans-serif;
  color: #000;
  font-size: 10px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

.ec-amz .muted {
  color: #000;
}

.amz-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 20px;
}

.amz-logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.amz-logo img {
  display: block;
  height: 102px;
  width: auto;
  max-width: 320px;
  object-fit: contain;
}

.amz-title-block {
  text-align: right;
  color: #000;
}

.amz-title {
  font-weight: 700;
  font-size: 13px;
  color: #000;
}

.amz-sub {
  font-size: 10px;
  font-weight: 400;
  color: #000;
  margin-top: 2px;
}

.amz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 14px;
  font-size: 10px;
  color: #000;
}

.amz-addr {
  text-align: right;
}

.amz-h {
  font-weight: 700;
  font-size: 10px;
  color: #000;
  margin-bottom: 2px;
}

.amz-h-gap {
  margin-top: 10px;
}

.amz-strong {
  font-weight: 700;
  color: #000;
}

.amz-body {
  font-weight: 400;
  color: #000;
  font-size: 10px;
}

.amz-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 14px;
  font-size: 10px;
  color: #000;
}

.amz-meta-right {
  text-align: right;
}

.amz-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 12px;
  font-size: 9px;
  color: #000;
}

.amz-table th,
.amz-table td {
  border: 1px solid #000;
  padding: 5px 4px;
  vertical-align: top;
  color: #000;
}

.amz-table thead th {
  background: #4a4a4a;
  color: #fff;
  font-weight: 700;
  text-align: left;
  font-size: 9px;
}

.amz-table .num {
  text-align: right;
  white-space: nowrap;
}

/* Tax Rate / Tax Type / Tax Amount: one block, no internal cell borders */
.amz-table th.amz-tax,
.amz-table td.amz-tax {
  border-left: none;
  border-right: none;
}

.amz-table th.amz-tax-first,
.amz-table td.amz-tax-first {
  border-left: 1px solid #000;
}

.amz-table th.amz-tax-last,
.amz-table td.amz-tax-last {
  border-right: 1px solid #000;
}

.amz-table tr.amz-item-main td.amz-tax {
  border-bottom: none;
}

.amz-table tr.amz-tax-cont td.amz-tax {
  border-top: none;
}

.amz-item-name {
  font-weight: 700;
  color: #000;
}

.amz-item-desc {
  font-weight: 400;
  color: #000;
  margin-top: 2px;
}

.amz-total-row td {
  background: #d9d9d9;
  font-weight: 700;
}

.amz-words {
  margin: 10px 0 18px;
  font-size: 11px;
  font-weight: 700;
  color: #000;
}

.amz-sign-wrap {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.amz-sign {
  width: 220px;
  text-align: center;
  color: #000;
  font-size: 10px;
}

.amz-sign-box {
  height: 72px;
  border: 1px solid #000;
  margin: 8px 0;
}

.amz-sign-label {
  font-weight: 700;
  font-size: 10px;
  color: #000;
}

.amz-foot {
  font-size: 10px;
  font-weight: 400;
  color: #000;
  margin-bottom: 8px;
}

.amz-footer {
  flex-shrink: 0;
}

.amz-legal {
  font-size: 7px;
  font-weight: 400;
  line-height: 1.35;
  margin: 0 0 10px;
  color: #888;
}

.amz-pagebar {
  display: flex;
  justify-content: space-between;
  font-size: 7px;
  font-weight: 400;
  color: #888;
}

.ec-item-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}

.ec-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 16px;
}

.ec-modal[hidden] {
  display: none !important;
}

.ec-modal-card {
  width: min(480px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  max-height: 90vh;
  overflow: auto;
}

.ec-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* ---- Postpaid / WiFi bill (Airtel-style page 1) ---- */

#product-postpaid .workspace {
  grid-template-columns: minmax(280px, 0.8fr) minmax(480px, 1.35fr);
}

.bb-page {
  /* ISO 216 A4 — 210mm × 297mm (≈ 794 × 1123 CSS px at 96dpi) */
  --bb-red: #e40000;
  --bb-ink: #111;
  --bb-muted: #666;
  --bb-line: #cfcfcf;
  --bb-bar: #111;
  --bb-pad-x: 10mm;
  --bb-pad-y: 8mm;
  width: 210mm;
  min-width: 210mm;
  max-width: 210mm;
  height: 297mm;
  min-height: 297mm;
  max-height: 297mm;
  margin: 0 auto;
  background: #fff;
  color: var(--bb-ink);
  font-family: Arial, Helvetica, 'Segoe UI', sans-serif;
  font-size: 11.5px;
  line-height: 1.35;
  padding: var(--bb-pad-y) var(--bb-pad-x);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bb-page * {
  box-sizing: border-box;
}

.bb-page-spacer {
  flex: 1 1 auto;
  min-height: 4mm;
}

.bb-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.bb-title-red {
  color: var(--bb-red);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
  text-transform: uppercase;
}

.bb-logo-img {
  display: block;
  height: 36px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.bb-logo-white {
  height: 34px;
}

.bb-wifi-head .bb-logo-img {
  height: 32px;
}

.bb-wifi-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #000;
  color: #fff;
  padding: 3.5mm 4mm;
  margin: calc(var(--bb-pad-y) * -1) calc(var(--bb-pad-x) * -1) 4mm;
}

.bb-wifi-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.bb-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 16px;
  margin-bottom: 12px;
  align-items: start;
}

.bb-hero-wifi {
  gap: 18px;
}

.bb-name {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.bb-address {
  margin: 0 0 8px;
  color: #222;
  white-space: pre-line;
}

.bb-line {
  margin: 2px 0;
}

.bb-k {
  color: #333;
}

.bb-kv {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 3px 0;
  color: var(--bb-muted);
}

.bb-kv strong {
  color: var(--bb-ink);
  font-weight: 700;
}

.bb-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin-top: 10px;
}

.bb-meta-grid span {
  display: block;
  color: var(--bb-muted);
  font-size: 0.92em;
}

.bb-meta-grid strong {
  display: block;
  font-size: 1.02em;
  margin-top: 1px;
}

.bb-paybox {
  border: 1px solid #222;
  padding: 10px 12px 8px;
  background: #fff;
}

.bb-paybox-wifi {
  border-color: #bdbdbd;
  border-radius: 4px;
}

.bb-pay-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 8px;
}

.bb-pay-label {
  font-size: 0.92em;
  color: #333;
  margin-bottom: 2px;
}

.bb-pay-amt,
.bb-pay-due {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}

.bb-paybox-bottom {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.bb-pay-app {
  font-size: 0.95em;
  line-height: 1.3;
  padding-top: 4px;
}

.bb-pay-link {
  display: inline-block;
  margin-top: 6px;
  color: #1565c0;
  text-decoration: underline;
  font-size: 0.95em;
}

.bb-qr-wrap {
  text-align: center;
  max-width: 128px;
}

.bb-qr {
  display: block;
  width: 112px;
  height: 112px;
  margin: 0 auto;
  image-rendering: pixelated;
  border: 1px solid #eee;
}

.bb-pay-scan {
  margin-top: 4px;
  font-size: 0.72rem;
  line-height: 1.25;
  color: #222;
}

.bb-pay-bank {
  font-size: 0.68rem;
  color: #555;
  margin-top: 2px;
}

.bb-formula {
  border: 1px solid #111;
  margin: 0 0 14px;
  overflow: hidden;
}

.bb-formula-labels {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) 1.15fr;
  gap: 0;
  background: #111;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 7px 8px;
}

.bb-formula-labels span {
  padding-right: 4px;
}

.bb-formula-values {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr auto 1fr 1.15fr;
  align-items: center;
  gap: 2px 0;
  padding: 8px;
  font-size: 0.86rem;
  font-weight: 600;
}

.bb-formula-values i {
  font-style: normal;
  text-align: center;
  padding: 0 2px;
  color: #333;
  font-weight: 700;
}

.bb-formula-after {
  text-align: right;
}

.bb-formula-wifi {
  border: 0;
  background: #2f2f2f;
  color: #fff;
}

.bb-formula-wifi .bb-formula-labels {
  background: transparent;
  padding-bottom: 2px;
  font-weight: 500;
}

.bb-formula-wifi .bb-formula-values {
  color: #fff;
  padding-top: 2px;
}

.bb-formula-wifi .bb-formula-values i {
  color: #ddd;
}

.bb-section {
  margin-bottom: 12px;
}

.bb-section-card {
  border: 1px solid #d8d8d8;
  border-radius: 2px;
  overflow: hidden;
}

.bb-bar {
  background: var(--bb-bar);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 7px 10px;
}

.bb-bar-wifi {
  background: #3a3a3a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.bb-bar-right {
  font-weight: 500;
  font-size: 0.85em;
}

.bb-grid-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.92em;
}

.bb-grid-table th,
.bb-grid-table td {
  border-bottom: 1px solid #dcdcdc;
  padding: 7px 8px;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.bb-grid-table thead th {
  background: #f3f3f3;
  font-weight: 700;
  font-size: 0.88em;
}

.bb-grid-table .num,
.bb-grid-table th.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.bb-summary-mobile .bb-col-svc {
  width: 40%;
}

.bb-summary-mobile .bb-col-amt {
  width: 20%;
}

.bb-summary-wifi .bb-col-svc {
  width: 34%;
}

.bb-summary-wifi .bb-col-conn {
  width: 14%;
}

.bb-summary-wifi .bb-col-amt {
  width: 17.333%;
}

.bb-total-row td {
  font-weight: 800;
  font-size: 1.05em;
  border-top: 2px solid #111;
  border-bottom: 0;
  padding-top: 10px;
}

.bb-total-wifi td {
  border-top: 3px solid var(--bb-red);
}

.bb-subhead td {
  background: #fafafa;
  font-weight: 700;
  border-bottom-color: #eee;
}

.bb-subhead-lite td {
  font-weight: 600;
  padding-top: 2px;
}

.bb-hist th {
  font-size: 0.78em;
  line-height: 1.25;
}

.bb-words {
  padding: 8px 2px 2px;
  font-size: 0.92em;
}

.bb-note {
  padding: 6px 2px 0;
  font-size: 0.8em;
  color: #666;
}

.bb-pagefoot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #eee;
  font-size: 0.75rem;
  color: #777;
  flex-shrink: 0;
}

.bb-muted-cell {
  color: #888;
  font-style: italic;
}

.bb-customer-actions {
  margin-bottom: 2px;
}

.bb-other-list {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.bb-other-row {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 0.7fr auto;
  gap: 8px;
  align-items: end;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line, #e5e7eb);
}

.bb-other-row .field {
  margin: 0;
}

.bb-other-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.bb-other-empty {
  margin: 0;
}

.bb-page .pre {
  white-space: pre-line;
}

/* ---- Rent form style ---- */

.rr-page {
  position: relative;
  width: min(560px, 100%);
  margin: 0 auto;
  background: #fffef8;
  color: #1a1a1a;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.45;
  padding: 28px 26px 22px;
  border: 1px solid #d6d0c2;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
}

/* ---- Driver salary receipt (reference template) ---- */

.ds-page {
  position: relative;
  width: min(560px, 100%);
  margin: 0 auto;
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.55;
  padding: 28px 26px 22px;
  border: 1px solid #ddd;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
}

.ds-page.ds-page-compact {
  padding: 36px 28px 28px;
}

.ds-page * {
  box-sizing: border-box;
}

.legal-template-title {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 24px;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
}

.form-body {
  margin-bottom: 4px;
}

.form-line {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-bottom: 10px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  line-height: 1.35;
  color: #111;
}

.form-text {
  flex-shrink: 0;
  display: inline-flex;
  align-items: flex-end;
  height: 20px;
  padding: 0;
  line-height: 20px;
  box-sizing: border-box;
}

.form-fill {
  font-family: 'Caveat', 'Segoe Script', 'Bradley Hand', cursive;
  font-size: var(--ds-fill-size, 15px);
  font-weight: 600;
  color: #1a1a6e;
  letter-spacing: 0.01em;
  line-height: 1;
  word-break: break-word;
  display: inline-block;
  padding-bottom: 1px;
}

.form-line-field {
  border-bottom: 1px solid #333;
  height: 20px;
  min-height: 20px;
  padding: 0 4px;
  display: inline-flex;
  align-items: flex-end;
  vertical-align: bottom;
  box-sizing: border-box;
  min-width: 72px;
}

.form-line-field.form-line-grow {
  flex: 1 1 120px;
  min-width: min(140px, 100%);
}

.form-line-field.form-line-half {
  flex: 1 1 80px;
  min-width: min(90px, 45%);
}

.form-line-field.form-line-amount {
  flex: 0 0 auto;
  width: 108px;
  min-width: 88px;
  max-width: 120px;
}

.form-line-first {
  flex-wrap: nowrap;
}

.form-line-inr-group {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px 6px;
  flex: 0 0 auto;
  white-space: nowrap;
  height: 20px;
}

.form-line-field.form-line-name {
  flex: 1 1 auto;
  min-width: 72px;
  max-width: none;
}

.form-line-car-row {
  flex-wrap: wrap;
}

.form-line-field.form-line-car {
  flex: 0 1 140px;
  min-width: 110px;
  max-width: 180px;
}

.form-line-field.form-line-month {
  flex: 0 1 120px;
  min-width: 90px;
  max-width: 150px;
}

.form-line-field.form-line-words {
  flex: 1 1 100%;
  width: 100%;
  min-width: 100%;
  display: flex;
}

.form-line-words-row {
  flex-wrap: wrap;
}

.form-line-words-row .form-line-words {
  flex: 1 1 calc(100% - 48px);
  min-width: min(280px, 100%);
}

.form-line-field.form-line-xl {
  flex: 1 1 180px;
  min-width: min(200px, 100%);
}

.form-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

.form-row .form-label {
  flex-shrink: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  color: #111;
  display: inline-flex;
  align-items: flex-end;
  height: 20px;
  line-height: 20px;
  padding: 0;
  min-width: 52px;
  box-sizing: border-box;
}

.form-row .form-line-field {
  flex: 1;
  min-width: 0;
}

.ds-stamp-block {
  margin: 28px 0 32px;
  min-height: 72px;
}

.ds-stamp-label {
  font-size: 12px;
  color: #111;
  margin-bottom: 10px;
}

.ds-stamp-box {
  position: relative;
  min-height: 96px;
  border: 1px dashed #999;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  background: #fff;
  overflow: visible;
}

.ds-sig-drag {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: grab;
  z-index: 3;
  touch-action: none;
  user-select: none;
}

.ds-sig-drag.is-dragging,
.ds-sig-drag:active {
  cursor: grabbing;
}

.ds-sig-drag-text {
  white-space: nowrap;
  pointer-events: auto;
}

.ds-sig-text {
  display: inline-block;
  line-height: 1.1;
}

.ds-stamp-visual {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 78px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.ds-stamp-visual img {
  max-width: 78px;
  max-height: 78px;
  object-fit: contain;
}

.ds-stamp-empty {
  border: 1px dotted #111;
  background: transparent;
}

.rr-title,
.ds-title {
  text-align: center;
  margin: 0 0 8px;
  letter-spacing: 0.12em;
  font-size: 1.15rem;
}

.rr-date,
.ds-date {
  text-align: right;
  margin: 0 0 16px;
}

.rr-body,
.ds-body {
  margin: 0 0 14px;
  text-align: justify;
}

.rr-sign-row,
.ds-sign-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-top: 28px;
}

.rr-fill {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  font-weight: 700;
}

.rr-affix-meta {
  margin-top: 10px;
  text-align: right;
  font-size: 12px;
  color: #1a1a1a;
}

.rr-sig-text {
  display: inline-block;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  word-break: keep-all;
}

/* Untitled stamp placeholder (fallback) */
.rr-stamp {
  width: 72px;
  height: 72px;
  border: 1px dotted #111;
  background: transparent;
}

.rr-sign {
  text-align: right;
  min-width: 160px;
}

.rr-sign-line {
  border-bottom: 1px solid #333;
  min-height: 28px;
  margin-bottom: 4px;
  font-family: 'Caveat', 'Segoe Script', 'Brush Script MT', cursive;
  font-size: 1.35rem;
  font-weight: 600;
}

.rr-sign-row,
.ds-sign-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-top: 28px;
}

.rr-sig-img {
  display: block;
  max-height: 52px;
  max-width: 150px;
  object-fit: contain;
  pointer-events: none;
}

.rr-sig-drag {
  position: absolute;
  z-index: 5;
  cursor: grab;
  touch-action: none;
  user-select: none;
  padding: 4px 10px 10px 4px;
  border: 1px dashed transparent;
  border-radius: 4px;
  transform: translate(-50%, -50%);
}

.rr-sig-drag:hover,
.rr-sig-drag.is-dragging {
  border-color: #1a4db3;
  background: rgba(26, 77, 179, 0.06);
}

.rr-sig-drag.is-dragging {
  cursor: grabbing;
}

.rr-sig-drag img {
  display: block;
  width: 160px;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}

.rr-sig-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: #1a4db3;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: nwse-resize;
  touch-action: none;
  opacity: 0;
}

.rr-sig-drag:hover .rr-sig-resize,
.rr-sig-drag.is-dragging .rr-sig-resize {
  opacity: 1;
}

.rr-foot {
  margin-top: 22px;
  font-size: 0.75rem;
}

@media (max-width: 720px) {
  .fk-header,
  .fk-info,
  .ec-grid-2,
  .bb-hero,
  .bb-meta-grid,
  .bb-pay-row,
  .bb-paybox-bottom,
  .bb-other-row,
  .amz-grid,
  .amz-meta {
    grid-template-columns: 1fr;
  }

  .bb-formula-labels,
  .bb-formula-values {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .fk-keep {
    max-width: none;
  }
}
