/* Invoice Generator */
.tool-widget:has(.invoice-gen-app) {
    padding: 0;
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
}

.invoice-gen-app {
    --inv-accent: #0f766e;
    --inv-border: rgba(148, 163, 184, 0.22);
    --inv-card: rgba(15, 23, 42, 0.92);
    --inv-muted: #94a3b8;
    --inv-text: #e2e8f0;
    --inv-touch: 2.75rem;
    width: 100%;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.inv-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.inv-shell {
    border: 1px solid var(--inv-border);
    border-radius: 20px;
    background:
        radial-gradient(ellipse 70% 45% at 100% 0%, rgba(20, 184, 166, 0.14), transparent 55%),
        radial-gradient(ellipse 50% 35% at 0% 100%, rgba(59, 130, 246, 0.08), transparent 50%),
        linear-gradient(180deg, #111827 0%, #0b1220 100%);
    padding: clamp(0.85rem, 3vw, 1.35rem) clamp(0.85rem, 3vw, 1.35rem) clamp(1rem, 3vw, 1.5rem);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.28);
}

.inv-head {
    margin-bottom: 0.85rem;
}

.inv-head-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--inv-text);
}

.inv-head-desc {
    margin: 0;
    font-size: clamp(0.82rem, 2vw, 0.9rem);
    line-height: 1.5;
    color: var(--inv-muted);
    max-width: 52ch;
}

.inv-trust {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
}

.inv-trust::-webkit-scrollbar {
    display: none;
}

.inv-trust span {
    flex: 0 0 auto;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--inv-border);
    background: rgba(2, 8, 20, 0.5);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--inv-text);
}

.inv-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
    gap: clamp(0.85rem, 2.5vw, 1.35rem);
    align-items: start;
}

.inv-form-col {
    min-width: 0;
}

.inv-card {
    border: 1px solid var(--inv-border);
    border-radius: 14px;
    padding: 0;
    margin-bottom: 0.75rem;
    background: var(--inv-card);
    overflow: hidden;
}

.inv-details {
    margin: 0;
}

.inv-details-body {
    padding: 0 1rem 1rem;
}

.inv-card-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--inv-text);
}

.inv-details > summary {
    list-style: none;
    cursor: pointer;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    user-select: none;
}

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

.inv-details > summary::after {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid var(--inv-muted);
    border-bottom: 2px solid var(--inv-muted);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.inv-details[open] > summary::after {
    transform: rotate(-135deg);
    margin-top: 0.2rem;
}

.inv-card-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.inv-card-head-row--summary {
    width: 100%;
}

.inv-card-head-row--summary .inv-card-title {
    flex: 1;
    text-align: left;
}

.inv-field {
    margin-bottom: 0.65rem;
}

.inv-field:last-child {
    margin-bottom: 0;
}

.inv-field label,
.inv-field-label {
    display: block;
    margin-bottom: 0.28rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--inv-muted);
}

.inv-input,
.inv-textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    min-height: var(--inv-touch);
    border-radius: 10px;
    border: 1px solid var(--inv-border);
    background: rgba(2, 8, 20, 0.55);
    color: var(--inv-text);
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

@media (min-width: 768px) {
    .inv-input,
    .inv-textarea {
        font-size: 0.9rem;
        min-height: auto;
        padding: 0.5rem 0.65rem;
    }
}

.inv-input:focus,
.inv-textarea:focus,
.inv-btn:focus-visible,
.inv-template-opt:focus-visible {
    outline: none;
    border-color: rgba(45, 212, 191, 0.55);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.inv-input--short {
    max-width: 5.5rem;
}

.inv-input--signature {
    font-family: "Segoe Script", "Brush Script MT", cursive;
    font-size: 1.1rem;
}

.inv-textarea {
    resize: vertical;
    min-height: 4.5rem;
}

.inv-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.inv-template-pick {
    display: grid;
    gap: 0.45rem;
}

.inv-template-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: min(320px, 50vh);
    overflow-y: auto;
    padding-right: 0.25rem;
    -webkit-overflow-scrolling: touch;
}

.inv-template-opt {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.65rem;
    padding: 0.5rem 0.65rem;
    border-radius: 10px;
    border: 1px solid var(--inv-border);
    background: rgba(2, 8, 20, 0.45);
    color: var(--inv-text);
    cursor: pointer;
    font-family: inherit;
    min-height: 3.25rem;
    width: 100%;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
}

.inv-template-label {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.inv-template-mini {
    width: 2.5rem;
    height: 2.85rem;
    flex-shrink: 0;
    border-radius: 5px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.inv-template-mini--band::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 38%;
    background: var(--t-accent);
}

.inv-template-mini--strip {
    border-left: 5px solid var(--t-accent);
}

.inv-template-mini--double::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 22%;
    background: var(--t-accent);
    box-shadow: 0 7px 0 color-mix(in srgb, var(--t-accent) 45%, #fff);
}

.inv-template-mini--minimal::after {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 6px;
    height: 2px;
    background: var(--t-accent);
}

.inv-template-mini--panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 42%;
    background: var(--t-accent);
}

.inv-template-swatch {
    width: 1.75rem;
    height: 0.5rem;
    border-radius: 999px;
}

.inv-template-name {
    font-size: 0.82rem;
    font-weight: 700;
}

.inv-template-opt.is-active {
    border-color: rgba(45, 212, 191, 0.65);
    background: rgba(20, 184, 166, 0.12);
    box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.25);
}

.inv-template-hint {
    font-size: 0.62rem;
    color: var(--inv-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.inv-logo-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.65rem;
}

.inv-logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    min-width: 6rem;
    max-width: 11.5rem;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid rgba(0, 174, 239, 0.15);
    background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.inv-logo-preview .inv-logo-img,
.inv-logo-preview img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 96px;
    object-fit: contain;
    object-position: center;
}

.inv-logo-preview span {
    font-size: 0.75rem;
    color: #64748b;
}

.inv-logo-actions {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.4rem;
    min-width: min(100%, 12rem);
}

.inv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.9rem;
    min-height: var(--inv-touch);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-family: inherit;
    text-align: center;
}

.inv-btn--sm {
    padding: 0.4rem 0.7rem;
    min-height: 2.25rem;
    font-size: 0.78rem;
}

.inv-btn--block {
    width: 100%;
}

.inv-btn--primary {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
}

.inv-btn--excel {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
}

.inv-btn--export {
    gap: 0.45rem;
    padding: 0.55rem 1rem;
}

.inv-btn--export svg {
    display: block;
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
}

.inv-btn--outline {
    background: transparent;
    border: 1px solid var(--inv-border);
    color: #5eead4;
}

.inv-btn--ghost {
    background: rgba(2, 8, 20, 0.35);
    border: 1px solid var(--inv-border);
    color: var(--inv-muted);
}

.inv-field--actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.inv-lines-wrap {
    margin-bottom: 0.65rem;
    border-radius: 10px;
    border: 1px solid var(--inv-border);
    overflow: hidden;
}

.inv-lines-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.inv-lines-table th {
    text-align: left;
    padding: 0.45rem 0.5rem;
    background: rgba(2, 8, 20, 0.5);
    color: var(--inv-muted);
    font-size: 0.68rem;
    text-transform: uppercase;
}

.inv-lines-table td {
    padding: 0.35rem 0.4rem;
    border-top: 1px solid var(--inv-border);
    vertical-align: middle;
}

.inv-lines-table input {
    width: 100%;
    min-width: 3rem;
    padding: 0.45rem 0.5rem;
    min-height: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--inv-border);
    background: rgba(2, 8, 20, 0.45);
    color: var(--inv-text);
    font-size: 16px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .inv-lines-table input {
        font-size: 0.82rem;
        min-height: auto;
        padding: 0.35rem 0.4rem;
    }
}

.inv-lines-table .inv-line-qty,
.inv-lines-table .inv-line-rate {
    max-width: 5.5rem;
}

.inv-line-del {
    border: none;
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.35rem 0.55rem;
    min-width: var(--inv-touch);
    min-height: var(--inv-touch);
    border-radius: 8px;
}

.inv-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--inv-muted);
    cursor: pointer;
    margin-top: 0.35rem;
}

.inv-check input {
    margin-top: 0.2rem;
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

.inv-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.inv-actions--mobile {
    display: none;
}

.inv-status {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    color: var(--inv-muted);
}

.inv-status.is-err { color: #fca5a5; }
.inv-status.is-ok { color: #6ee7b7; }

.inv-preview-col {
    position: sticky;
    top: 0.75rem;
    min-width: 0;
}

.inv-preview-frame {
    border: 1px solid var(--inv-border);
    border-radius: 14px;
    padding: 0.75rem;
    background: rgba(2, 8, 20, 0.35);
}

.inv-preview-label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--inv-muted);
}

.inv-preview-hint {
    margin: 0.2rem 0 0.55rem;
    font-size: 0.72rem;
    color: #64748b;
}

.inv-preview-scroll {
    overflow: visible;
    border-radius: 10px;
}

.inv-preview-paper {
    background: #fff;
    color: #0f172a;
    border-radius: 10px;
    padding: clamp(0.85rem, 2.5vw, 1.25rem);
    min-height: 280px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
    font-size: 0.78rem;
    line-height: 1.45;
    position: relative;
    overflow: hidden;
}

.inv-pv-layout-band,
.inv-pv-layout-double {
    padding-top: 1.1rem;
}

.inv-pv-layout-band .inv-pv-header {
    padding: 0.65rem;
    border: 0;
    border-radius: 8px;
    background: var(--pv-accent);
}

.inv-pv-layout-band .inv-pv-brand h3,
.inv-pv-layout-band .inv-pv-brand p,
.inv-pv-layout-band .inv-pv-doc-title {
    color: #fff;
}

.inv-pv-layout-strip {
    padding-left: 0.55rem;
}

.inv-pv-layout-panel {
    padding-top: 0.35rem;
}

.inv-pv-topbar {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 6px;
    background: var(--pv-accent);
    pointer-events: none;
}

.inv-pv-topbar--light {
    top: 6px;
    height: 4px;
    background: color-mix(in srgb, var(--pv-accent) 40%, #fff);
}

.inv-pv-sideaccent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--pv-accent);
    pointer-events: none;
}

.inv-pv-framed {
    border: 2px solid #64748b;
    box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 5px #cbd5e1;
}

.inv-pv-meta--cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}

.inv-pv-meta--cards > div {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.35rem 0.45rem;
    background: #f8fafc;
}

.inv-pv-meta--cards span {
    display: block;
    font-size: 0.58rem;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.04em;
}

.inv-pv-meta--cards strong {
    font-size: 0.72rem;
    color: var(--pv-accent);
}

.inv-pv-meta--right {
    text-align: right;
    margin-left: auto;
    max-width: 12rem;
    margin-bottom: 0.85rem;
}

.inv-pv-table--zebra tbody tr:nth-child(even) {
    background: #f8fafc;
}

.inv-pv-table--bordered th,
.inv-pv-table--bordered td {
    border: 1px solid #e2e8f0;
}

.inv-pv-table--minimal th {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

.inv-pv-table--rounded th:first-child {
    border-radius: 6px 0 0 6px;
}

.inv-pv-table--rounded th:last-child {
    border-radius: 0 6px 6px 0;
}

.inv-pv-table--accent tbody td:first-child {
    border-left: 3px solid var(--pv-accent);
}

/* Preview inner (generated in JS) */
.inv-pv-header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--pv-accent, #0f766e);
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.inv-pv-layout-strip .inv-pv-header {
    padding-left: 0.55rem;
}

.inv-pv-layout-double .inv-pv-header {
    border-bottom: none;
    padding-top: 0.4rem;
}

.inv-pv-layout-minimal .inv-pv-header {
    border-bottom: 2px solid var(--pv-accent);
}

.inv-pv-layout-panel .inv-pv-header {
    border-bottom: none;
    background: linear-gradient(90deg, color-mix(in srgb, var(--pv-accent) 18%, #fff) 42%, transparent 42%);
    border-radius: 8px;
    padding: 0.45rem 0.5rem 0.65rem;
}

.inv-pv-tpl-modern .inv-pv-header {
    background: linear-gradient(135deg, var(--pv-accent), #0d9488);
}

.inv-pv-tpl-crimson .inv-pv-header {
    background: linear-gradient(120deg, #991b1b, var(--pv-accent));
    border-radius: 2px;
}

.inv-pv-tpl-ocean .inv-pv-header {
    background: linear-gradient(135deg, #075985, #0284c7);
}

.inv-pv-tpl-royal .inv-pv-meta--cards > div,
.inv-pv-tpl-rose .inv-pv-meta--cards > div {
    border-radius: 12px;
}

.inv-pv-tpl-midnight .inv-pv-header {
    background: linear-gradient(90deg, #e2e8f0 42%, #f8fafc 42%);
}

.inv-pv-tpl-gold .inv-pv-header {
    background: linear-gradient(90deg, #fef3c7 42%, #fffbeb 42%);
    border: 1px solid #d4a017;
}

.inv-pv-tpl-coral .inv-pv-topbar--light {
    background: #fda4af;
}

.inv-pv-tpl-charcoal {
    border-radius: 2px;
}

.inv-pv-tpl-emerald .inv-pv-totals {
    border-width: 2px;
}

.inv-preview-paper:not(.inv-pv-layout-minimal) .inv-pv-table th {
    background: var(--pv-accent);
    color: #fff;
    border: none;
}

.inv-pv-sno {
    color: #64748b;
    font-weight: 600;
    width: 2rem;
}

.inv-pv-brand {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    min-width: 0;
    flex: 1;
    flex-wrap: wrap;
}

.inv-pv-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    padding: 3px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.inv-pv-logo-img,
.inv-pv-logo-wrap img {
    display: block;
    width: auto;
    height: auto;
    max-width: 46px;
    max-height: 46px;
    object-fit: contain;
    object-position: center;
}

.inv-pv-brand h3 {
    margin: 0;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    color: #0f172a;
    word-break: break-word;
}

.inv-pv-brand p {
    margin: 0.15rem 0 0;
    font-size: 0.7rem;
    color: #64748b;
}

.inv-pv-doc-title {
    text-align: right;
    font-size: clamp(1.1rem, 3vw, 1.35rem);
    font-weight: 800;
    color: var(--pv-accent, #0f766e);
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.inv-pv-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 0.85rem;
    font-size: 0.72rem;
}

.inv-pv-meta strong {
    color: #64748b;
    font-weight: 600;
}

.inv-pv-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.inv-pv-cols h4 {
    margin: 0 0 0.35rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--pv-accent);
    letter-spacing: 0.05em;
}

.inv-pv-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
    font-size: 0.72rem;
    display: table;
    table-layout: fixed;
    overflow: visible;
}

.inv-pv-table thead { display: table-header-group; }
.inv-pv-table tbody { display: table-row-group; }
.inv-pv-table tr { display: table-row; }

.inv-pv-table th:nth-child(1),
.inv-pv-table td:nth-child(1) { width: 46%; }
.inv-pv-table th:nth-child(2),
.inv-pv-table td:nth-child(2) { width: 12%; }
.inv-pv-table th:nth-child(3),
.inv-pv-table td:nth-child(3) { width: 20%; }
.inv-pv-table th:nth-child(4),
.inv-pv-table td:nth-child(4) { width: 22%; }

.inv-pv-table th {
    background: #f1f5f9;
    text-align: left;
    padding: 0.35rem 0.4rem;
    font-size: 0.65rem;
    text-transform: uppercase;
}

.inv-pv-table td {
    padding: 0.35rem 0.4rem;
    border-bottom: 1px solid #e2e8f0;
    word-break: break-word;
}

.inv-pv-table .num {
    text-align: right;
}

.inv-pv-totals {
    margin-left: auto;
    max-width: 220px;
    font-size: 0.75rem;
    border: 1px solid color-mix(in srgb, var(--pv-accent) 35%, #e2e8f0);
    border-radius: 8px;
    padding: 0.35rem 0.45rem;
    background: color-mix(in srgb, var(--pv-accent) 8%, #fff);
}

.inv-pv-totals div {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.2rem 0;
}

.inv-pv-totals .grand {
    font-weight: 800;
    font-size: 0.95rem;
    border-top: 2px solid #0f172a;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    color: var(--pv-accent, #0f766e);
}

.inv-pv-notes {
    margin-top: 0.75rem;
    font-size: 0.7rem;
    color: #475569;
    word-break: break-word;
}

.inv-pv-sign {
    margin-top: 1rem;
    padding-top: 0.5rem;
}

.inv-pv-sign img {
    max-height: 36px;
    display: block;
    margin-bottom: 0.25rem;
}

.inv-pv-sign .sig-text {
    font-family: "Segoe Script", cursive;
    font-size: 1.1rem;
    color: #1e293b;
}

.inv-pv-footer {
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.62rem;
    color: #94a3b8;
    text-align: center;
    word-break: break-word;
}

/* —— Responsive —— */
@media (max-width: 960px) {
    .inv-layout {
        grid-template-columns: 1fr;
    }

    .inv-preview-col {
        order: -1;
        position: relative;
        top: auto;
    }

    .inv-form-col {
        padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0));
    }

    .inv-actions--desktop .inv-btn--export {
        display: none;
    }

    .inv-actions--mobile {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        margin: 0;
        padding: 0.65rem clamp(0.75rem, 4vw, 1rem);
        padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0));
        gap: 0.5rem;
        background: linear-gradient(180deg, rgba(11, 18, 32, 0.92), rgba(11, 18, 32, 0.98));
        border-top: 1px solid var(--inv-border);
        backdrop-filter: blur(10px);
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
    }

    .inv-actions--mobile .inv-btn--export {
        flex: 1;
    }
}

@media (min-width: 961px) {
    .inv-details > summary {
        cursor: default;
        pointer-events: none;
    }

    .inv-details > summary .inv-btn,
    .inv-details > summary button {
        pointer-events: auto;
        cursor: pointer;
    }

    .inv-details > summary::after {
        display: none;
    }

    .inv-details-body {
        padding-top: 0;
    }

    .inv-details > summary {
        padding-bottom: 0.5rem;
    }
}

@media (max-width: 640px) {
    .inv-grid-2 {
        grid-template-columns: 1fr;
    }

    .inv-template-pick {
        grid-template-columns: 1fr;
    }

    .inv-template-opt {
        flex-direction: row;
        justify-content: flex-start;
        padding: 0.65rem 0.75rem;
        gap: 0.65rem;
    }

    .inv-template-hint {
        margin-left: auto;
    }

    .inv-logo-row {
        flex-direction: column;
        align-items: stretch;
    }

    .inv-logo-actions .inv-btn {
        width: 100%;
    }

    .inv-pv-header {
        flex-direction: column;
    }

    .inv-pv-doc-title {
        text-align: left;
    }

    .inv-pv-cols {
        grid-template-columns: 1fr;
    }

    .inv-lines-table thead {
        display: none;
    }

    .inv-lines-table tbody tr {
        display: block;
        padding: 0.65rem 0.5rem;
        border-top: 1px solid var(--inv-border);
    }

    .inv-lines-table tbody tr:first-child {
        border-top: none;
    }

    .inv-lines-table td {
        display: grid;
        grid-template-columns: 5.5rem minmax(0, 1fr);
        align-items: center;
        gap: 0.35rem 0.5rem;
        padding: 0.35rem 0.25rem;
        border: none;
    }

    .inv-lines-table td::before {
        content: attr(data-label);
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--inv-muted);
    }

    .inv-lines-table td.inv-line-actions {
        grid-template-columns: 1fr;
        justify-items: end;
    }

    .inv-lines-table td.inv-line-actions::before {
        display: none;
    }

    .inv-lines-table .inv-line-qty,
    .inv-lines-table .inv-line-rate {
        max-width: none;
    }

    .inv-card-head-row--summary .inv-btn--sm {
        min-height: 2.25rem;
    }
}

@media (max-width: 400px) {
    .inv-trust span {
        font-size: 0.6rem;
        padding: 0.3rem 0.55rem;
    }

    .inv-shell {
        border-radius: 14px;
    }
}
